version 1.86 | | version 1.87 |
---|
| | |
/* | | /* |
* static char *rcsid_time_c = | | * static char *rcsid_time_c = |
* "$Id: time.c,v 1.86 2006/02/07 07:54:46 mwedel Exp $"; | | * "$Id: time.c,v 1.87 2006/03/18 15:05:37 ryo_saeba Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
#include <sproto.h> | | #include <sproto.h> |
#endif | | #endif |
| | |
/* The following removes doors. The functions check to see if similar | | /** The following removes doors. The functions check to see if similar |
* doors are next to the one that is being removed, and if so, set it | | * doors are next to the one that is being removed, and if so, set it |
* so those will be removed shortly (in a cascade like fashion.) | | * so those will be removed shortly (in a cascade like fashion.) |
*/ | | */ |
| | |
free_object(op); | | free_object(op); |
} | | } |
| | |
| | /** |
| | * Same as remove_door but for locked doors. |
| | */ |
void remove_door2(object *op) { | | void remove_door2(object *op) { |
int i; | | int i; |
object *tmp; | | object *tmp; |
| | |
free_object(op); | | free_object(op); |
} | | } |
| | |
/* Will generate a monster according to content | | /** Will generate a monster according to content |
* of generator. | | * of generator. |
*/ | | */ |
void generate_monster_inv(object *gen) { | | void generate_monster_inv(object *gen) { |
| | |
} /* gate is going up */ | | } /* gate is going up */ |
} | | } |
| | |
/* hp : how long door is open/closed | | /** hp : how long door is open/closed |
* maxhp : initial value for hp | | * maxhp : initial value for hp |
* sp : 1 = open, 0 = close | | * sp : 1 = open, 0 = close |
*/ | | */ |
| | |
} | | } |
} | | } |
| | |
/* slaying: name of the thing the detector is to look for | | /** slaying: name of the thing the detector is to look for |
* speed: frequency of 'glances' | | * speed: frequency of 'glances' |
* connected: connected value of detector | | * connected: connected value of detector |
* sp: 1 if detection sets buttons | | * sp: 1 if detection sets buttons |
* -1 if detection unsets buttons | | * -1 if detection unsets buttons |
*/ | | */ |
| | |
void move_detector(object *op) | | void move_detector(object *op) |
{ | | { |
object *tmp; | | object *tmp; |
| | |
} | | } |
| | |
| | |
/* stop_item() returns a pointer to the stopped object. The stopped object | | /** stop_item() returns a pointer to the stopped object. The stopped object |
* may or may not have been removed from maps or inventories. It will not | | * may or may not have been removed from maps or inventories. It will not |
* have been merged with other items. | | * have been merged with other items. |
* | | * |
| | |
} | | } |
} | | } |
| | |
/* fix_stopped_item() - put stopped item where stop_item() had found it. | | /** fix_stopped_item() - put stopped item where stop_item() had found it. |
* Inserts item into the old map, or merges it if it already is on the map. | | * Inserts item into the old map, or merges it if it already is on the map. |
* | | * |
* 'map' must be the value of op->map before stop_item() was called. | | * 'map' must be the value of op->map before stop_item() was called. |
| | |
} else | | } else |
op->slaying = NULL; | | op->slaying = NULL; |
| | |
/* Reset these to zero, so that CAN_MERGE will work properly */ | | /* Reset these to zero, so that can_merge will work properly */ |
op->spellarg = NULL; | | op->spellarg = NULL; |
op->stats.sp = 0; | | op->stats.sp = 0; |
op->stats.hp = 0; | | op->stats.hp = 0; |
| | |
return op; | | return op; |
} | | } |
| | |
/* stop_arrow() - what to do when a non-living flying object | | /** stop_arrow() - what to do when a non-living flying object |
* has to stop. Sept 96 - I added in thrown object code in | | * has to stop. Sept 96 - I added in thrown object code in |
* here too. -b.t. | | * here too. -b.t. |
* | | * |
| | |
} | | } |
} | | } |
| | |
/* Move an arrow along its course. op is the arrow or thrown object. | | /** Move an arrow along its course. op is the arrow or thrown object. |
*/ | | */ |
| | |
void move_arrow(object *op) { | | void move_arrow(object *op) { |
| | |
insert_ob_in_map (op, m, op,0); | | insert_ob_in_map (op, m, op,0); |
} | | } |
| | |
/* This routine doesnt seem to work for "inanimate" objects that | | /** This routine doesnt seem to work for "inanimate" objects that |
* are being carried, ie a held torch leaps from your hands!. | | * are being carried, ie a held torch leaps from your hands!. |
* Modified this routine to allow held objects. b.t. */ | | * Modified this routine to allow held objects. b.t. */ |
| | |
void change_object(object *op) { /* Doesn`t handle linked objs yet */ | | static void change_object(object *op) { /* Doesn`t handle linked objs yet */ |
object *tmp,*env,*pl; | | object *tmp,*env,*pl; |
int i,j; | | int i,j; |
| | |
| | |
} | | } |
| | |
| | |
/* This object will teleport someone to a different map | | /** This object will teleport someone to a different map |
and will also apply changes to the player from its inventory. | | * and will also apply changes to the player from its inventory. |
This was invented for giving classes, but there's no reason it | | * This was invented for giving classes, but there's no reason it |
can't be generalized. | | * can't be generalized. |
*/ | | */ |
| | |
void move_player_changer(object *op) { | | void move_player_changer(object *op) { |
object *player; | | object *player; |
object *walk; | | object *walk; |
| | |
} | | } |
} | | } |
| | |
/* firewalls fire other spells. | | /** |
| | * firewalls fire other spells. |
* The direction of the wall is stored in op->stats.sp. | | * The direction of the wall is stored in op->stats.sp. |
* walls can have hp, so they can be torn down. | | * walls can have hp, so they can be torn down. |
*/ | | */ |
| | |
} | | } |
| | |
| | |
/* move_player_mover: this function takes a "player mover" as an | | /** |
| | * move_player_mover: this function takes a "player mover" as an |
* argument, and performs the function of a player mover, which is: | | * argument, and performs the function of a player mover, which is: |
* | | * |
* a player mover finds any players that are sitting on it. It | | * a player mover finds any players that are sitting on it. It |
| | |
} | | } |
} | | } |
| | |
/* | | /** |
* Will duplicate a specified object placed on top of it. | | * Will duplicate a specified object placed on top of it. |
* connected: what will trigger it. | | * connected: what will trigger it. |
* level: multiplier. 0 to destroy. | | * level: multiplier. 0 to destroy. |
| | |
} | | } |
} | | } |
| | |
/* move_creator (by peterm) | | /** |
| | * move_creator (by peterm) |
* it has the creator object create it's other_arch right on top of it. | | * it has the creator object create it's other_arch right on top of it. |
* connected: what will trigger it | | * connected: what will trigger it |
* hp: how many times it may create before stopping | | * hp: how many times it may create before stopping |
| | |
* more concern with large objects, most notably a part being placed | | * more concern with large objects, most notably a part being placed |
* outside of the map which would cause the server to crash | | * outside of the map which would cause the server to crash |
*/ | | */ |
| | |
void move_creator(object *creator) { | | void move_creator(object *creator) { |
object *new_ob; | | object *new_ob; |
| | |
| | |
} | | } |
} | | } |
| | |
/* move_marker --peterm@soda.csua.berkeley.edu | | /** |
when moved, a marker will search for a player sitting above | | * move_marker --peterm@soda.csua.berkeley.edu |
it, and insert an invisible, weightless force into him | | * when moved, a marker will search for a player sitting above |
with a specific code as the slaying field. | | * it, and insert an invisible, weightless force into him |
At that time, it writes the contents of its own message | | * with a specific code as the slaying field. |
field to the player. The marker will decrement hp to | | * At that time, it writes the contents of its own message |
0 and then delete itself every time it grants a mark. | | * field to the player. The marker will decrement hp to |
unless hp was zero to start with, in which case it is infinite.*/ | | * 0 and then delete itself every time it grants a mark. |
| | * unless hp was zero to start with, in which case it is infinite.*/ |
void move_marker(object *op) { | | void move_marker(object *op) { |
object *tmp,*tmp2; | | object *tmp,*tmp2; |
| | |