Atrinik Server  4.0
Macros
Item types

Macros

#define IS_WEAPON(op)   (op->type == ARROW || op->type == BOW || op->type == WEAPON)
 
#define IS_ARMOR(op)   (op->type == ARMOUR || op->type == SHIELD || op->type == HELMET || op->type == CLOAK || op->type == BOOTS || op->type == GLOVES || op->type == BRACERS || op->type == GIRDLE || op->type == PANTS)
 
#define IS_LIVE(op)   ((op)->type == PLAYER || QUERY_FLAG((op), FLAG_MONSTER))
 
#define IS_ARROW(op)   (op->type == ARROW || op->type == BULLET)
 
#define IS_ATTACK_SPELL(op)   ((op)->type == BULLET || (op)->type == CONE || (op)->type == LIGHTNING)
 

Detailed Description

Convenience macros to determine what kind of things we are dealing with.

Macro Definition Documentation

#define IS_ARMOR (   op)    (op->type == ARMOUR || op->type == SHIELD || op->type == HELMET || op->type == CLOAK || op->type == BOOTS || op->type == GLOVES || op->type == BRACERS || op->type == GIRDLE || op->type == PANTS)

Is this some kind of armor (shield, helmet, cloak, etc)?

Definition at line 839 of file define.h.

#define IS_ARROW (   op)    (op->type == ARROW || op->type == BULLET)

Is it an arrow?

Definition at line 843 of file define.h.

#define IS_ATTACK_SPELL (   op)    ((op)->type == BULLET || (op)->type == CONE || (op)->type == LIGHTNING)

Determine whether the object is an attack spell.

Definition at line 845 of file define.h.

#define IS_LIVE (   op)    ((op)->type == PLAYER || QUERY_FLAG((op), FLAG_MONSTER))

Is this object alive?

Definition at line 841 of file define.h.

#define IS_WEAPON (   op)    (op->type == ARROW || op->type == BOW || op->type == WEAPON)

Is this a weapon?

Definition at line 837 of file define.h.