version 1.10 | | version 1.11 |
---|
| | |
/* | | /* |
* static char *rcsid_time_c = | | * static char *rcsid_time_c = |
* "$Id: time.c,v 1.10 2000/07/28 07:10:21 cvs Exp $"; | | * "$Id: time.c,v 1.11 2000/10/16 19:19:31 peterm Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
while(op!=NULL&&op->type!=PLAYER) | | while(op!=NULL&&op->type!=PLAYER) |
op=op->env; | | op=op->env; |
if(op!=NULL) { | | if(op!=NULL) { |
if(blocks_magic(op->map,op->x,op->y)) | | if(blocks_magic(op->map,op->x,op->y) && wor->stats.hp != 1) |
new_draw_info(NDI_UNIQUE, 0,op,"You feel something fizzle inside you."); | | new_draw_info(NDI_UNIQUE, 0,op,"You feel something fizzle inside you."); |
else | | else |
enter_exit(op,wor); | | enter_exit(op,wor); |
| | |
} | | } |
| | |
void move_teleporter(object *op) { | | void move_teleporter(object *op) { |
| | |
if(op->above!=NULL) { | | if(op->above!=NULL) { |
if(EXIT_PATH(op)) { | | if(EXIT_PATH(op)) { |
if(op->above->type==PLAYER) | | if(op->above->type==PLAYER) |
| | |
} | | } |
} | | } |
| | |
| | /* This object will teleport someone to a different map |
| | and will also apply changes to the player from its inventory. |
| | This was invented for giving classes, but there's no reason it |
| | can't be generalized. |
| | */ |
| | |
| | void move_player_changer(object *op) { |
| | object *player; |
| | object *walk; |
| | if(op->above!=NULL) { |
| | if(EXIT_PATH(op)) { |
| | if(op->above->type==PLAYER) { |
| | player=op->above; |
| | for(walk=op->inv;walk!=NULL;walk=walk->below) |
| | apply_changes_to_player(player,walk); |
| | link_player_skills(op->above); |
| | esrv_send_inventory(op->above,op->above); |
| | enter_exit(op->above,op); |
| | } |
| | else |
| | return; |
| | } |
| | } |
| | } |
| | |
/* peterm: firewalls generalized to be able to shoot any type | | /* peterm: firewalls generalized to be able to shoot any type |
of spell at all. the stats.dam field of a firewall object | | of spell at all. the stats.dam field of a firewall object |
contains it's spelltype. The direction of the wall is stored | | contains it's spelltype. The direction of the wall is stored |
| | |
it, and insert an invisible, weightless force into him | | it, and insert an invisible, weightless force into him |
with a specific code as the slaying field. | | with a specific code as the slaying field. |
At that time, it writes the contents of its own message | | At that time, it writes the contents of its own message |
field to the player. */ | | field to the player. The marker will decrement hp to |
| | 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; |
| | |
| | |
/* if we didn't find our own MARK */ | | /* if we didn't find our own MARK */ |
if(tmp2==NULL) { | | if(tmp2==NULL) { |
| | |
object *force = get_archetype("force"); | | object *force = get_archetype("force"); |
force->speed = 0; | | force->speed = 0; |
if(op->stats.food) { | | if(op->stats.food) { |
| | |
/* put in the lock code */ | | /* put in the lock code */ |
force->slaying = add_string(op->slaying); | | force->slaying = add_string(op->slaying); |
insert_ob_in_ob(force,tmp); | | insert_ob_in_ob(force,tmp); |
| | if(op->msg) |
| | new_draw_info(NDI_UNIQUE|NDI_NAVY,0,tmp,op->msg); |
| | if(op->stats.hp > 0) { |
| | op->stats.hp--; |
| | if(op->stats.hp==0) { |
| | /* marker expires--granted mark number limit */ |
| | remove_ob(op); |
| | free_object(op); |
| | return; |
| | } |
| | } |
} | | } |
| | |
} | | } |
| | |
case MARKER: | | case MARKER: |
move_marker(op); | | move_marker(op); |
return 0; | | return 0; |
| | case PLAYER_CHANGER: |
| | move_player_changer(op); |
| | return 0; |
} | | } |
| | |
return 0; | | return 0; |