version 1.71 | | version 1.72 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_effect_c = | | * static char *rcsid_spell_effect_c = |
* "$Id: spell_effect.c,v 1.71 2002/07/05 22:22:29 uid39786 Exp $"; | | * "$Id: spell_effect.c,v 1.72 2002/07/15 04:57:13 mwedel Exp $"; |
*/ | | */ |
| | |
| | |
| | |
} | | } |
| | |
int perceive_self(object *op) { | | int perceive_self(object *op) { |
char *cp=describe_item(op), buf[MAX_BUF]; | | char *cp=describe_item(op, op), buf[MAX_BUF]; |
archetype *at=find_archetype("depletion"); | | archetype *at=find_archetype("depletion"); |
object *tmp; | | object *tmp; |
int i; | | int i; |
| | |
| | |
if((dir==-1) || arch_blocked(at,op->map, op->x + freearr_x[dir], op->y+freearr_y[dir])) { | | if((dir==-1) || arch_blocked(at,op->map, op->x + freearr_x[dir], op->y+freearr_y[dir])) { |
new_draw_info(NDI_UNIQUE, 0,op, "There is something in the way."); | | new_draw_info(NDI_UNIQUE, 0,op, "There is something in the way."); |
if(op->type == PLAYER) | | |
op->contr->count_left = 0; | | |
return 0; | | return 0; |
} | | } |
for (i = 1; i < number + 1; i++) { | | for (i = 1; i < number + 1; i++) { |
| | |
} | | } |
| | |
| | |
/* Alchemy code by Mark Wedel (master@rahul.net) | | /* Alchemy code by Mark Wedel |
* | | * |
* This code adds a new spell, called alchemy. Alchemy will turn | | * This code adds a new spell, called alchemy. Alchemy will turn |
* objects to gold nuggets, the value of the gold nuggets being | | * objects to gold nuggets, the value of the gold nuggets being |
| | |
if (op->type==PLAYER) { | | if (op->type==PLAYER) { |
| | |
new_draw_info_format(NDI_UNIQUE, 0, op, | | new_draw_info_format(NDI_UNIQUE, 0, op, |
"You have %s.", long_desc(tmp)); | | "You have %s.", long_desc(tmp, op)); |
if (tmp->msg) { | | if (tmp->msg) { |
new_draw_info(NDI_UNIQUE, 0,op, "The item has a story:"); | | new_draw_info(NDI_UNIQUE, 0,op, "The item has a story:"); |
new_draw_info(NDI_UNIQUE, 0,op, tmp->msg); | | new_draw_info(NDI_UNIQUE, 0,op, tmp->msg); |
| | |
identify(tmp); | | identify(tmp); |
if (op->type==PLAYER) { | | if (op->type==PLAYER) { |
new_draw_info_format(NDI_UNIQUE, 0,op, | | new_draw_info_format(NDI_UNIQUE, 0,op, |
"On the ground is %s.", long_desc(tmp)); | | "On the ground is %s.", long_desc(tmp, op)); |
if (tmp->msg) { | | if (tmp->msg) { |
new_draw_info(NDI_UNIQUE, 0,op, "The item has a story:"); | | new_draw_info(NDI_UNIQUE, 0,op, "The item has a story:"); |
new_draw_info(NDI_UNIQUE, 0,op, tmp->msg); | | new_draw_info(NDI_UNIQUE, 0,op, tmp->msg); |
| | |
| | |
if((dir==-1) || arch_blocked(at,op->map, op->x + freearr_x[dir], op->y+freearr_y[dir])) { | | if((dir==-1) || arch_blocked(at,op->map, op->x + freearr_x[dir], op->y+freearr_y[dir])) { |
new_draw_info(NDI_UNIQUE, 0,op,"There is something in the way."); | | new_draw_info(NDI_UNIQUE, 0,op,"There is something in the way."); |
if(op->type==PLAYER) | | |
op->contr->count_left=0; | | |
return 0; | | return 0; |
} | | } |
| | |
| | |
if(op->type==PLAYER) { | | if(op->type==PLAYER) { |
op->contr->golem=tmp; | | op->contr->golem=tmp; |
/* give the player control of the golem */ | | /* give the player control of the golem */ |
op->contr->shoottype=range_scroll; | | op->contr->shoottype=range_golem; |
} | | } |
| | |
/* This sets the level dependencies on dam, wc and hp */ | | /* This sets the level dependencies on dam, wc and hp */ |
| | |
/* if there's no place to put the golem, abort */ | | /* if there's no place to put the golem, abort */ |
if((dir==-1) || blocked(op->map,op->x+freearr_x[dir],op->y+freearr_y[dir])) { | | if((dir==-1) || blocked(op->map,op->x+freearr_x[dir],op->y+freearr_y[dir])) { |
new_draw_info(NDI_UNIQUE, 0,op,"There is something in the way."); | | new_draw_info(NDI_UNIQUE, 0,op,"There is something in the way."); |
if(op->type==PLAYER) | | |
op->contr->count_left=0; | | |
return 0; | | return 0; |
} | | } |
| | |
| | |
if(!weapon) { | | if(!weapon) { |
if(op->type==PLAYER) { | | if(op->type==PLAYER) { |
new_draw_info(NDI_UNIQUE, 0,op,"You need to wield a weapon to animate it."); | | new_draw_info(NDI_UNIQUE, 0,op,"You need to wield a weapon to animate it."); |
op->contr->count_left=0; | | |
} | | } |
return 0; | | return 0; |
} else if (spellnum == SP_STAFF_TO_SNAKE && strcmp(weapon->name,"quarterstaff")) { | | } else if (spellnum == SP_STAFF_TO_SNAKE && strcmp(weapon->name,"quarterstaff")) { |
if(op->type==PLAYER) { | | if(op->type==PLAYER) { |
new_draw_info(NDI_UNIQUE, 0,op,"The spell fails to transform your weapon."); | | new_draw_info(NDI_UNIQUE, 0,op,"The spell fails to transform your weapon."); |
op->contr->count_left=0; | | |
} | | } |
return 0; | | return 0; |
} else if(op->type==PLAYER && | | } else if(op->type==PLAYER && |
(QUERY_FLAG(weapon,FLAG_CURSED) || QUERY_FLAG(weapon,FLAG_DAMNED))) { | | (QUERY_FLAG(weapon,FLAG_CURSED) || QUERY_FLAG(weapon,FLAG_DAMNED))) { |
new_draw_info(NDI_UNIQUE, 0,op,"You can't animate it. It won't let go of your hand."); | | new_draw_info(NDI_UNIQUE, 0,op,"You can't animate it. It won't let go of your hand."); |
op->contr->count_left=0; | | |
return 0; | | return 0; |
} | | } |
} | | } |
| | |
tmp->type=GOLEM; | | tmp->type=GOLEM; |
set_owner(tmp,op); | | set_owner(tmp,op); |
op->contr->golem=tmp; | | op->contr->golem=tmp; |
op->contr->shoottype=range_scroll; | | op->contr->shoottype=range_golem; |
} else { | | } else { |
/* If spell is cast by a pet, and the weapon is not cursed, make the animated | | /* If spell is cast by a pet, and the weapon is not cursed, make the animated |
* weapon a pet. */ | | * weapon a pet. */ |