1 | /* |
1 | /* |
2 | * static char *rcsid_gods_c = |
2 | * static char *rcsid_gods_c = |
3 | * "$Id: gods.c,v 1.1.1.1 2006/02/03 07:14:31 root Exp $"; |
3 | * "$Id: gods.c,v 1.3 2006/08/13 17:16:04 elmex dead $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
398 | */ |
398 | */ |
399 | void become_follower (object *op, object *new_god) { |
399 | void become_follower (object *op, object *new_god) { |
400 | object *old_god = NULL; /* old god */ |
400 | object *old_god = NULL; /* old god */ |
401 | treasure *tr; |
401 | treasure *tr; |
402 | object *item, *skop, *next; |
402 | object *item, *skop, *next; |
403 | int i,sk_applied; |
403 | int i, sk_applied, |
404 | |
404 | undeadified = 0; /* Turns to true if changing god can changes the undead status of the player.*/ |
|
|
405 | |
405 | old_god = find_god(determine_god(op)); |
406 | old_god = find_god(determine_god(op)); |
406 | |
407 | |
407 | /* take away any special god-characteristic items. */ |
408 | /* take away any special god-characteristic items. */ |
408 | for(item=op->inv;item!=NULL;item=next) { |
409 | for(item=op->inv;item!=NULL;item=next) { |
409 | next = item->below; |
410 | next = item->below; |
… | |
… | |
466 | link_player_skills(op); |
467 | link_player_skills(op); |
467 | } |
468 | } |
468 | |
469 | |
469 | sk_applied=QUERY_FLAG(skop,FLAG_APPLIED); /* save skill status */ |
470 | sk_applied=QUERY_FLAG(skop,FLAG_APPLIED); /* save skill status */ |
470 | |
471 | |
|
|
472 | /* Clear the "undead" status. We also need to force a call to change_abil, |
|
|
473 | * so I set undeadified for that. |
|
|
474 | * - gros, 21th July 2006. |
|
|
475 | */ |
|
|
476 | if ((old_god)&&(QUERY_FLAG(old_god,FLAG_UNDEAD))) |
|
|
477 | { |
|
|
478 | CLEAR_FLAG(skop,FLAG_UNDEAD); |
|
|
479 | undeadified=1; |
|
|
480 | } |
|
|
481 | |
471 | if(skop->title) { /* get rid of old god */ |
482 | if(skop->title) { /* get rid of old god */ |
472 | new_draw_info_format(NDI_UNIQUE,0,op, |
483 | new_draw_info_format(NDI_UNIQUE,0,op, |
473 | "%s's blessing is withdrawn from you.",skop->title); |
484 | "%s's blessing is withdrawn from you.",skop->title); |
474 | /* The point of this is to really show what abilities the player just lost */ |
485 | /* The point of this is to really show what abilities the player just lost */ |
475 | if (sk_applied) { |
486 | if (sk_applied || undeadified) { |
476 | CLEAR_FLAG(skop,FLAG_APPLIED); |
487 | CLEAR_FLAG(skop,FLAG_APPLIED); |
477 | (void) change_abil(op,skop); |
488 | (void) change_abil(op,skop); |
478 | } |
489 | } |
479 | free_string(skop->title); |
490 | free_string(skop->title); |
480 | } |
491 | } |