Primitive 0x0003 - Find Best Interaction


Use

There is no SimPe wizard for this instruction, so the following table details the meaning of each of the operands.

OperandDescriptionOperand Values
0 & 1 For Motive(s) bit 1: Shopping
bit 2: Scratch/Chew
bit 3: Unused
bit 4: Mood
bit 5: Mood+Mem
bit 6: Energy
bit 7: Comfort
bit 8: Hunger
bit 9: Water/Hygiene
bit 10: Bladder
bit 11: Unused
bit 12: Sleep State
bit 13: Unused
bit 14: Environment
bit 15: Social
bit 16: Fun
2 Other Motives 0: for the N current worst motives
1: with remaining motives from the worst
3 - bit 1 Unused
3 - bit 2 Only In Room In Temp 0 Off: False
On: True
3 - bit 3 Include OOW objects Off: False
On: True
3 - bit 4 Only nested Off: False
On: True
3 - bit 5 Only on current interaction (ci) object Off: False
On: True
3 - bit 6 Use location (room?) of object in Temp 1 Off: False
On: True
3 - bit 7 Unused
3 - bit 8 Unused
4 thru 15 Unused

See Also


SimPe Code

// Decompiled with JetBrains decompiler
// Type: pjse.BhavNameWizards.WizPrim0x0003
// Assembly: pjse.coder.plugin, Version=4.0.3349.37576, Culture=neutral, PublicKeyToken=null

using SimPe.PackedFiles.Wrapper;
using System;

namespace pjse.BhavNameWizards
{
  public class WizPrim0x0003 : BhavWizPrim
  {
    public WizPrim0x0003(Instruction i)
      : base(i)
    {
    }

    protected override string Operands(bool lng)
    {
      byte[] numArray = new byte[16];
      ((byte[]) this.instruction.Operands).CopyTo((Array) numArray, 0);
      ((byte[]) this.instruction.Reserved1).CopyTo((Array) numArray, 8);
      string str1 = "";
      string str2;
      if (numArray[2] == (byte) 0)
      {
        str2 = str1 + Localization.GetString("bwp03_nworst");
      }
      else
      {
        int num = (int) BhavWiz.ToShort(numArray[0], numArray[1]);
        str2 = str1 + Localization.GetString("bwp03_formotive") + ": ";
        bool flag = false;
        for (ushort sid = 0; sid < (ushort) 16; ++sid)
        {
          if ((num & 1 << (int) sid) != 0)
          {
            str2 = str2 + (flag ? "; " : "") + BhavWiz.readStr(GS.BhavStr.Motives, sid);
            flag = true;
          }
        }
        if (!flag)
          str2 = str2 + "(" + Localization.GetString("none") + ")";
        if (lng)
          str2 = str2 + ", " + Localization.GetString("bwp03_remworst") + ": " + (((int) numArray[2] & 1) != 0).ToString();
      }
      if (lng)
        str2 = str2 + ", " + Localization.GetString("bwp03_inroom") + " " + this.dataOwner((byte) 8, (ushort) 0) + ": " + (((int) numArray[3] & 2) != 0).ToString() + ", " + Localization.GetString("bwp03_oow") + ": " + (((int) numArray[3] & 4) != 0).ToString() + ", " + Localization.GetString("bwp03_nested") + ": " + (((int) numArray[3] & 8) != 0).ToString() + ", " + Localization.GetString("bwp03_oninteraction") + ": " + (((int) numArray[3] & 16) != 0).ToString() + ", " + Localization.GetString("bwp03_locntemp1") + ": " + (((int) numArray[3] & 32) != 0).ToString();
      return str2;
    }
  }
}