version 1.3 | | version 1.4 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: gods.c,v 1.3 1999/07/30 07:20:16 cvs Exp $"; | | * "$Id: gods.c,v 1.4 1999/09/17 18:44:43 damn Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
object *pl_god=find_god(determine_god(pl)); | | object *pl_god=find_god(determine_god(pl)); |
| | |
#ifdef MULTIPLE_GODS | | #ifdef MULTIPLE_GODS |
/* hmm. what happend depends on pl previous god, level, etc */ | | /* hmm. what happend depends on pl's current god, level, etc */ |
if(!pl_god) { /*new convert */ | | if(!pl_god) { /*new convert */ |
become_follower(pl,altar->title); | | become_follower(pl,altar->title); |
return; | | return; |
| | |
/* we can super-charge grace to 2x max */ | | /* we can super-charge grace to 2x max */ |
if(pl->stats.grace<(2*pl->stats.maxgrace)) { | | if(pl->stats.grace<(2*pl->stats.maxgrace)) { |
pl->stats.grace+=bonus/2; | | pl->stats.grace+=bonus/2; |
| | if(pl->stats.grace>(2*pl->stats.maxgrace)) { |
| | pl->stats.grace=(2*pl->stats.maxgrace); |
| | } |
} | | } |
| | |
/* Every once in a while, the god decides to checkup on their | | /* Every once in a while, the god decides to checkup on their |
* follower, and may intervene to help them out. */ | | * follower, and may intervene to help them out. */ |
| | bonus += pl->stats.luck; /* -- DAMN -- */ |
if((RANDOM()%500-bonus)<0) god_intervention(pl,pl_god); | | if((RANDOM()%500-bonus)<0) god_intervention(pl,pl_god); |
| | |
} else if(altar->title) { /* praying to another god! */ | | } else if(altar->title) { /* praying to another god! */ |
| | |
| | |
if(!op||!new_god) return; | | if(!op||!new_god) return; |
if(op->race&&new_god->slaying&&strstr(op->race,new_god->slaying)) { | | if(op->race&&new_god->slaying&&strstr(op->race,new_god->slaying)) { |
new_draw_info_format(NDI_UNIQUE|NDI_NAVY,0,op,"Fool! %s detest your kind!",godname); | | new_draw_info_format(NDI_UNIQUE|NDI_NAVY,0,op,"Fool! %s detests your kind!",godname); |
if(RANDOM()%(op->level)-5>0) | | if(RANDOM()%(op->level)-5>0) |
cast_mana_storm(op,new_god->level+10); | | cast_mana_storm(op,new_god->level+10); |
return; | | return; |
| | |
} | | } |
| | |
/* Fix drained stats? */ | | /* Fix drained stats? */ |
if(!(RANDOM()%2)&&!(god->attacktype&AT_DRAIN)) { | | if(!(RANDOM()%2)&&!(god->attacktype&(AT_DRAIN||AT_DEPLETE))) { |
object *depl; | | object *depl; |
archetype *at; | | archetype *at; |
| | |
| | |
} | | } |
if(god->race) { | | if(god->race) { |
new_draw_info_format(NDI_UNIQUE,0,op, | | new_draw_info_format(NDI_UNIQUE,0,op, |
"You are feel a bond with all things which are %s.", | | "You feel a bond with all things which are %s.", |
god->race); | | god->race); |
return; | | return; |
} | | } |
| | |
* has PATH_NULL. | | * has PATH_NULL. |
* (already checked in RARE_PRAYER) | | * (already checked in RARE_PRAYER) |
*/ | | */ |
| | /* Only teach spells of paths this god is attuned to. Also check * |
if ((god->path_attuned & spells[spell].path) | | * that the spell has no repelled or denied paths, in case any * |
&& !(god->path_repelled & spells[spell].path) | | * multi-path spells come along. --DAMN */ |
&& spells[spell].level <= level | | if ( (god->path_attuned & spells[spell].path) && |
&& !check_spell_known(op,spell)) { | | !(god->path_repelled & spells[spell].path) && |
| | !(god->path_denied & spells[spell].path) && |
| | (spells[spell].level <= level) && |
| | (!check_spell_known(op,spell)) ) { |
| | |
play_sound_player_only(op->contr, SOUND_LEARN_SPELL,0,0); | | play_sound_player_only(op->contr, SOUND_LEARN_SPELL,0,0); |
new_draw_info_format(NDI_UNIQUE, 0,op, | | new_draw_info_format(NDI_UNIQUE, 0,op, |
| | |
| | |
int god_examines_priest (object *op, object *god) { | | int god_examines_priest (object *op, object *god) { |
int reaction=1; | | int reaction=1; |
object *weapon=NULL; | | object *item=NULL; |
| | |
for(weapon=op->inv;weapon;weapon=weapon->below) | | |
if(weapon->type==WEAPON&&QUERY_FLAG(weapon,FLAG_APPLIED)) break; | | |
| | |
if(weapon) | | for(item=op->inv;item;item=item->below) { |
reaction=god_examines_item(god,weapon)*(weapon->magic?abs(weapon->magic):1); | | if(QUERY_FLAG(item,FLAG_APPLIED)) { |
| | reaction+=god_examines_item(god,item)*(item->magic?abs(item->magic):1); |
| | } |
| | } |
| | |
/* well, well. Looks like we screwed up. Time for god's revenge */ | | /* well, well. Looks like we screwed up. Time for god's revenge */ |
if(reaction<0) { | | if(reaction<0) { |
| | |
if(spellop->title){ | | if(spellop->title){ |
char buf[MAX_BUF]; | | char buf[MAX_BUF]; |
sprintf(buf,"%s of %s",spellop->name,spellop->title); | | sprintf(buf,"%s of %s",spellop->name,spellop->title); |
| | if (spellop->name) free_string(spellop->name); |
spellop->name=add_string(buf); | | spellop->name=add_string(buf); |
} | | } |
} | | } |