Movement types and related macros.


Defines

#define MOVE_WALK   0x1
#define MOVE_FLY_LOW   0x2
#define MOVE_FLY_HIGH   0x4
#define MOVE_FLYING   0x6
#define MOVE_SWIM   0x8
#define MOVE_BOAT   0x10
#define MOVE_ALL   0x1f
#define MOVE_BLOCK_DEFAULT   MOVE_SWIM
#define OB_MOVE_BLOCK(ob1, ob2)   ((ob1->move_type&ob2->move_block) == ob1->move_type)
#define OB_TYPE_MOVE_BLOCK(ob1, type)   ((type != 0) && (ob1->move_type&type) == ob1->move_type)

Typedefs

typedef unsigned char MoveType

Detailed Description

Those flags are all possible movement types.

If you add new movement types, you may need to update describe_item() so properly describe those types. change_abil() probably should be updated also.


Define Documentation

#define MOVE_ALL   0x1f

Mask of all movement types.

Definition at line 656 of file define.h.

#define MOVE_BLOCK_DEFAULT   MOVE_SWIM

The normal assumption is that objects are walking/flying. So often we don't want to block movement, but still don't want to allow all types (swimming is rather specialized) - I also expect as more movement types show up, this is likely to get updated. Basically, this is the default for spaces that allow movement - anything but swimming right now. If you really want nothing at all, then can always set move_block to 0

Definition at line 667 of file define.h.

#define MOVE_BOAT   0x10

Boats/sailing.

Definition at line 655 of file define.h.

#define MOVE_FLY_HIGH   0x4

High flying object.

Definition at line 652 of file define.h.

#define MOVE_FLY_LOW   0x2

Low flying object.

Definition at line 651 of file define.h.

#define MOVE_FLYING   0x6

Combo of fly_low and fly_high.

Definition at line 653 of file define.h.

#define MOVE_SWIM   0x8

Swimming object.

Definition at line 654 of file define.h.

#define MOVE_WALK   0x1

Object walks.

Definition at line 650 of file define.h.

#define OB_MOVE_BLOCK ( ob1,
ob2   )     ((ob1->move_type&ob2->move_block) == ob1->move_type)

Basic macro to see if ob2 blocks ob1 from moving onto this space. Basically, ob2 has to block all of ob1 movement types.

Definition at line 681 of file define.h.

#define OB_TYPE_MOVE_BLOCK ( ob1,
type   )     ((type != 0) && (ob1->move_type&type) == ob1->move_type)

Basic macro to see if if ob1 can not move onto a space based on the 'type' move_block parameter Add check - if type is 0, don't stop anything from moving onto it.

Definition at line 690 of file define.h.


Typedef Documentation

typedef unsigned char MoveType

Typdef here to define type large enough to hold bitmask of all movement types. Make one declaration so easy to update. uint8 is defined yet, so just use what that would define it at anyways.

Definition at line 675 of file define.h.


Generated on Thu Mar 25 23:27:51 2010 for Crossfire Server, Branch 1.12 by  doxygen 1.5.8