version 1.10 | | version 1.11 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_effect_c = | | * static char *rcsid_spell_effect_c = |
* "$Id: spell_effect.c,v 1.10 2000/04/19 11:46:42 jec Exp $"; | | * "$Id: spell_effect.c,v 1.11 2000/04/27 07:35:01 cvs Exp $"; |
*/ | | */ |
| | |
| | |
| | |
tmp->type==GATE || tmp->type==LOCKED_DOOR || | | tmp->type==GATE || tmp->type==LOCKED_DOOR || |
tmp->type==WEAPON || tmp->type==ALTAR || tmp->type==SIGN || | | tmp->type==WEAPON || tmp->type==ALTAR || tmp->type==SIGN || |
tmp->type==TRIGGER_PEDESTAL || tmp->type==SPECIAL_KEY || | | tmp->type==TRIGGER_PEDESTAL || tmp->type==SPECIAL_KEY || |
tmp->type==TREASURE || tmp->type==BOOK)) { | | tmp->type==TREASURE || tmp->type==BOOK || |
| | tmp->type==HOLY_ALTAR)) { |
if(RANDOM()%(SK_level(op)) > tmp->level/4) { | | if(RANDOM()%(SK_level(op)) > tmp->level/4) { |
tmp->invisible=0; | | tmp->invisible=0; |
done_one = 1; | | done_one = 1; |
| | |
int cast_consecrate(object *op) { | | int cast_consecrate(object *op) { |
char buf[MAX_BUF]; | | char buf[MAX_BUF]; |
int success=0; | | int success=0; |
| | |
#ifdef MULTIPLE_GODS | | #ifdef MULTIPLE_GODS |
object *tmp, *god=find_god(determine_god(op)); | | object *tmp, *god=find_god(determine_god(op)); |
#endif | | |
sprintf(buf,"Nothing happens."); | | |
#ifdef MULTIPLE_GODS | | |
if(!god) { | | if(!god) { |
new_draw_info(NDI_UNIQUE, 0,op, | | new_draw_info(NDI_UNIQUE, 0,op, |
"You can't consecrate anything if you don't worship a god!"); | | "You can't consecrate anything if you don't worship a god!"); |
return 0; | | return 0; |
} | | } |
| | |
sprintf(buf,"You are'nt standing over an altar!"); | | for(tmp=op->below;tmp;tmp=tmp->below) { |
for(tmp=op->below;tmp;tmp=tmp->below) | | if(tmp->type==HOLY_ALTAR) { |
if(tmp->type==ALTAR) { | | if(QUERY_FLAG(tmp,FLAG_IS_FLOOR)) break; |
if(!tmp->title && strcmp(tmp->name,tmp->arch->clone.name)) { | | |
sprintf(buf,"That altar may not be consecrated."); | | /* We use SK_level here instead of path_level mod because I think |
break; | | * all the gods should give equal chance of re-consecrating altars |
} else if(QUERY_FLAG(tmp,FLAG_IS_FLOOR)) break; | | */ |
if(tmp->title) | | if(tmp->level > SK_level(op)) { |
free_string(tmp->title); | | new_draw_info_format(NDI_UNIQUE, 0,op, |
if(tmp->name) | | "You are not poweful enough to reconsecrate the altar of %s", tmp->title); |
free_string(tmp->name); | | } else { |
| | /* If we got here, we are consecrating an altar */ |
| | if(tmp->name) free_string(tmp->name); |
sprintf(buf,"%s of %s",tmp->arch->clone.name,god->name); | | sprintf(buf,"%s of %s",tmp->arch->clone.name,god->name); |
tmp->name = add_string(buf); | | tmp->name = add_string(buf); |
tmp->title = add_string(god->name); | | tmp->level = SK_level(op); |
sprintf(buf,"You consecrated the altar to %s!",god->name); | | tmp->other_arch = god; |
success = 1; | | |
if(op->type==PLAYER) esrv_update_item(UPD_NAME, op, tmp); | | if(op->type==PLAYER) esrv_update_item(UPD_NAME, op, tmp); |
break; | | new_draw_info_format(NDI_UNIQUE,0, op, |
| | "You consecrated the altar to %s!",god->name); |
| | return 1; |
| | } |
} | | } |
| | } |
| | new_draw_info(NDI_UNIQUE, 0,op,"You are not standing over an altar!"); |
| | return 0; |
| | #else |
| | new_draw_info(NDI_UNIQUE, 0,op,"Nothing happens."); |
| | return 0; |
#endif | | #endif |
| | |
new_draw_info(NDI_UNIQUE, 0,op,buf); | | |
return success; | | |
} | | } |
| | |
| | |