Party Move Filter

The party move filter is entered with the following structure as the parameters. In general, you can inhibit the movement by setting a bit in the flags parameter.


enum PARTYMOVE_CONSTANTS
{
  PM_BEGINTURN   = 1,
  PM_STAIRWAY    = 2,
  PM_ATTEMPTMOVE = 3,

  PM_INHIBITMOVE = 0x0001,
  PM_SETDELAY    = 0x0002,
  PM_ADDDELAY    = 0x0004,
};


struct PARTYMOVEDATA
{
  ui32 moveType;     // PM_BEGINTURN
                     //   The party is about to turn.
                     //   'fromLocationType' is valid.
                     //      if locationType = 3 = stairwell then if you do not
                     //      inhibit the movement the filter will be called
                     //      again when the party is about to traverse the
                     //      stairwell.
                     //   'toLocationType' is valid.
                     //   'fromLocaation' is valid.
                     //   'toLocation' is valid unless locationType is stairwell.
                     //   'direction' is 0, 1, 2, 3 for right, left, up, down.
                     //   flags is 0.
                     //   Set flag PM_INHIBITMOVE to cancel the turning movement
                     // PM_STAIRWAY
                     //   The party is about to traverse a stairway.
                     //   'relDirection' = 'absDirection' = 0 for down, 1 for up
                     //   'flags' = 0
                     //   'fromLocation' is valid
                     //   'toLocation' is valid
                     //   'fromLocationType' is valid
                     //   'toLocationType' is valid and is equal to 3.
                     //   Set flag PM_INHIBITMOVE to cancel the movement
                     // PM_ATTEMPTMOVE
                     //   The party is about to attempt a move forward, backward, slide left, slide right
                     //   'relDirection' 0, 1, 2, or 3 for forward, right, backward, left
                     //   'absDirection is 0, 1, 2, or 3 for north, east, south, west
                     //   'flags' is zero
                     //   'fromLocation' is valid
                     //   'toLocation' is valid
                     //   'fromLocationType' is valid
                     //   'toLocationType is valid
                     //   'staminaAdjustments are valid and you can change them.  They will
                     //         not be applied if the move is inhibited by PM_INHIBITMOVE.
                     //   You can set delay to be the delay before the party can move again.
                     //      If you set PM_SETDELAY then this value will be used whether or not
                     //          the party moves.  They may be inhibited by a monster, for example.
                     //          If you set PM_INHIBITMOVE then the delay will be ignored.
                     //      If you set PM_ADDDELAY then this value will be added to the computed
                     //          delay only if the party actuall moves.
                     //   Set flag PM_INHIBITMOVE to cancel the movement.
  ui32 flags;
  ui32 delay;
  ui32 staminaAdjustment[4]; // decrement to stamina; -1 if character non-existent
  ui32 relDirection;    //
  ui32 absDirection;
  ui32 fromLocation; // location with pos = facing.
  ui32 toLocation;   // location with pos = facing.
  ui32 fromLocationType; // cellType (or roomType) 0=stone, etc.
  ui32 toLocationType;
};