version 1.27 | | version 1.28 |
---|
| | |
/* | | /* |
* static char *rcsid_gods_c = | | * static char *rcsid_gods_c = |
* "$Id: gods.c,v 1.27 2001/10/30 00:49:02 michtoen Exp $"; | | * "$Id: gods.c,v 1.28 2001/10/30 02:30:20 michtoen Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
if(name&&strcmp(name,"none")) { | | if(name&&strcmp(name,"none")) { |
godlink *gl; | | godlink *gl; |
for(gl=first_god;gl;gl=gl->next) | | for(gl=first_god;gl;gl=gl->next) |
if(!strncmp(name,gl->name,MIN((signed int)strlen(gl->name),nmlen))) | | if(!strncmp(name,gl->name,MIN(strlen(gl->name),nmlen))) |
break; | | break; |
if(gl) godnr=gl->id; | | if(gl) godnr=gl->id; |
} | | } |
| | |
/* whether we will be successfull in defecting or not - | | /* whether we will be successfull in defecting or not - |
* we lose experience from the clerical experience obj */ | | * we lose experience from the clerical experience obj */ |
| | |
loss = (int)(0.1 * (double) pl->chosen_skill->exp_obj->stats.exp); | | loss = 0.1 * (float) pl->chosen_skill->exp_obj->stats.exp; |
if(loss) | | if(loss) |
lose_priest_exp(pl, random_roll(0, loss*angry-1, pl, PREFER_LOW)); | | lose_priest_exp(pl, random_roll(0, loss*angry-1, pl, PREFER_LOW)); |
| | |
| | |
if (item->type == BOOK && item->invisible | | if (item->type == BOOK && item->invisible |
&& strcmp (item->name, "restore spellpoints") == 0) | | && strcmp (item->name, "restore spellpoints") == 0) |
{ | | { |
int max = (int)((double)op->stats.maxsp * ((double)item->stats.maxsp / 100.0)); | | int max = op->stats.maxsp * (item->stats.maxsp / 100.0); |
/* Restore to 50 .. 100%, if sp < 50% */ | | /* Restore to 50 .. 100%, if sp < 50% */ |
int new_sp = (int)((double)random_roll(1000, 1999, op, PREFER_HIGH) / 2000.0 * (double)max); | | int new_sp = random_roll(1000, 1999, op, PREFER_HIGH) / 2000.0 * max; |
if (op->stats.sp >= max / 2) | | if (op->stats.sp >= max / 2) |
continue; | | continue; |
new_draw_info (NDI_UNIQUE, 0, op, "A blue lightning strikes " | | new_draw_info (NDI_UNIQUE, 0, op, "A blue lightning strikes " |
| | |
int loss = 10000000; | | int loss = 10000000; |
int angry = abs(reaction); | | int angry = abs(reaction); |
if(op->chosen_skill->exp_obj) | | if(op->chosen_skill->exp_obj) |
loss = (int)(0.05 * (double) op->chosen_skill->exp_obj->stats.exp); | | loss = 0.05 * (float) op->chosen_skill->exp_obj->stats.exp; |
lose_priest_exp(op, random_roll(0, loss*angry-1, op, PREFER_LOW)); | | lose_priest_exp(op, random_roll(0, loss*angry-1, op, PREFER_LOW)); |
if(random_roll(0, angry, op, PREFER_LOW)) | | if(random_roll(0, angry, op, PREFER_LOW)) |
cast_mana_storm(op,SK_level(op)+(angry*3)); | | cast_mana_storm(op,SK_level(op)+(angry*3)); |