version 1.15 | | version 1.16 |
---|
| | |
/* | | /* |
* static char *rcsid_gods_c = | | * static char *rcsid_gods_c = |
* "$Id: gods.c,v 1.15 2001/01/09 23:50:37 avogl Exp $"; | | * "$Id: gods.c,v 1.16 2001/01/11 06:37:59 peterm Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
* and limitations to priests */ | | * and limitations to priests */ |
#define MORE_PRIEST_GIFTS | | #define MORE_PRIEST_GIFTS |
| | |
| | static int god_gives_present (object *op, object *god, treasure *tr); |
| | |
int lookup_god_by_name(char *name) { | | int lookup_god_by_name(char *name) { |
int godnr=-1,nmlen = strlen(name); | | int godnr=-1,nmlen = strlen(name); |
| | |
| | |
/* May switch Gods, but its random chance based on our current level | | /* May switch Gods, but its random chance based on our current level |
* note it gets harder to swap gods the higher we get */ | | * note it gets harder to swap gods the higher we get */ |
if((angry==1)&&!(RANDOM()%(pl->chosen_skill->exp_obj->level+1))) { | | if((angry==1)&&!(RANDOM()%(pl->chosen_skill->exp_obj->level+1))) { |
int i; /* index over known_spells */ | | |
int sp; /* spell index */ | | |
| | |
become_follower(pl,&altar->other_arch->clone); | | become_follower(pl,&altar->other_arch->clone); |
} /* If angry... switching gods */ | | } /* If angry... switching gods */ |
| | |
| | |
void become_follower (object *op, object *new_god) { | | void become_follower (object *op, object *new_god) { |
object *exp_obj = op->chosen_skill->exp_obj; | | object *exp_obj = op->chosen_skill->exp_obj; |
| | treasure *tr; |
| | object *item; |
int i; | | int i; |
| | |
| | /* take away any special god-characteristic items. */ |
| | for(item=op->inv;item!=NULL;item=item->below) |
| | if(QUERY_FLAG(item,FLAG_STARTEQUIP) && item->invisible) { |
| | if(item->type==SKILL) continue; |
| | if(item->type==FORCE) continue; |
| | remove_ob(item); |
| | free_object(item); |
| | item=op->inv; |
| | } |
| | |
| | |
| | /* give the player any special god-characteristic-items. */ |
| | for(tr=new_god->randomitems->items; tr!=NULL; tr = tr->next) { |
| | if(tr->item && tr->item->clone.invisible && tr->item->clone.type != SPELLBOOK && |
| | tr->item->clone.type != BOOK) |
| | god_gives_present(op,new_god,tr); } |
| | |
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)) { |
| | |
} | | } |
| | |
/* Other gifts */ | | /* Other gifts */ |
if ( ! item->invisible) | | if ( ! item->invisible) { |
if (god_gives_present (op, god, tr)) | | if (god_gives_present (op, god, tr)) |
return; | | return; |
else | | else |
continue; | | continue; |
| | } |
/* else ignore it */ | | /* else ignore it */ |
} | | } |
| | |