|
Atrinik Server 2.5
|
Go to the source code of this file.
Functions | |
| static int | is_legal_2ways_exit (object *op, object *exit) |
| void | move_apply (object *trap, object *victim, object *originator, int flags) |
| object * | find_special_prayer_mark (object *op, int spell) |
| static void | insert_special_prayer_mark (object *op, int spell) |
| void | do_learn_spell (object *op, int spell, int special_prayer) |
| void | do_forget_spell (object *op, int spell) |
| int | manual_apply (object *op, object *tmp, int aflag) |
| int | player_apply (object *pl, object *op, int aflag, int quiet) |
| void | player_apply_below (object *pl) |
| static int | apply_check_item_power (object *who, const object *op) |
| int | apply_special (object *who, object *op, int aflags) |
| int | monster_apply_special (object *who, object *op, int aflags) |
Handles objects being applied, and their effect.
Definition in file apply.c.
Apply an object.
This function doesn't check for unpaid items, but checks other restrictions.
Usage example: apply_special(who, op, AP_UNAPPLY | AP_IGNORE_CURSE)
| who | Object using op. It can be a monster. |
| op | Object being used. Should be an equipment type item, eg, one which you put on and keep on for a while, and not something like a potion or scroll. |
| aflags | Flags. |
| void do_forget_spell | ( | object * | op, |
| int | spell | ||
| ) |
| void do_learn_spell | ( | object * | op, |
| int | spell, | ||
| int | special_prayer | ||
| ) |
Find a special prayer marker in object's inventory.
Special prayers are granted by gods and lost when the follower decides to pray to different gods. 'Force' objects keep track of which prayers are special.
| op | Object to search in. |
| spell | Spell ID to find. |
| static void insert_special_prayer_mark | ( | object * | op, |
| int | spell | ||
| ) | [static] |
This function return true if the exit is not a two ways one or it is two ways, valid exit.
A valid two way exit means:
| op | Player to check for. |
| exit_ob | Exit object. |
Main apply handler.
Checks for unpaid items before applying.
| op | object causing tmp to be applied. |
| tmp | object being applied. |
| aflag | Special (always apply/unapply) flags. Nothing is done with them in this function - they are passed to apply_special(). |
| 0 | Player or monster can't apply objects of that type. |
| 1 | Has been applied, or there was an error applying the object. |
| 2 | Objects of that type can't be applied if not in inventory. |
Monster applies an item.
| who | The monster. |
| op | The object to apply. |
| aflags | Apply flags. |
'victim' moves onto 'trap' (trap has FLAG_WALK_ON or FLAG_FLY_ON set) or 'victim' leaves 'trap' (trap has FLAG_WALK_OFF or FLAG_FLY_OFF) set.
I added the flags parameter to give the single events more information about whats going on:
Most important is the "MOVE_APPLY_VANISHED" flag. If set, a object has left a tile but "vanished" and not moved (perhaps it exploded or something). This means that some events are not triggered like trapdoors or teleporter traps for example which have a "FLY/MOVE_OFF" set. This will avoid that they touch invalid objects.
| trap | Object victim moved on. |
| victim | The object that moved on trap. |
| originator | Player, monster or other object that caused 'victim' to move onto 'trap'. Will receive messages caused by this action. May be NULL, however, some types of traps require an originator to function. |
| flags | Flags. |
Living thing is applying an object.
| pl | object causing op to be applied. |
| op | object being applied. |
| aflag | Special (always apply/unapply) flags. Nothing is done with them in this function - they are passed to apply_special(). |
| quiet | If 1, suppresses the "don't know how to apply" and "you must get it first" messages as needed by player_apply_below(). There can still be "but you are floating high above the ground" messages. |
| 0 | Player or monster can't apply objects of that type. |
| 1 | Has been applied, or there was an error applying the object. |
| 2 | Objects of that type can't be applied if not in inventory. |
1.7.4