version 1.32 | | version 1.33 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_effect_c = | | * static char *rcsid_spell_effect_c = |
* "$Id: spell_effect.c,v 1.32 2000/12/04 00:40:05 cvs Exp $"; | | * "$Id: spell_effect.c,v 1.33 2000/12/09 23:56:02 peterm Exp $"; |
*/ | | */ |
| | |
| | |
| | |
int | | int |
cast_change_attr(object *op,object *caster,int dir,int spell_type) { | | cast_change_attr(object *op,object *caster,int dir,int spell_type) { |
object *tmp = op; | | object *tmp = op; |
object *force; | | object *tmp2; |
| | object *force=NULL; |
int i; | | int i; |
| | |
/* if dir = 99 op defaults to tmp, eat_special_food() requires this. */ | | /* if dir = 99 op defaults to tmp, eat_special_food() requires this. */ |
| | |
| | |
if(tmp==NULL) return 0; | | if(tmp==NULL) return 0; |
| | |
/* if((force=present_in_ob(FORCE,tmp))!=NULL) | | /* If we've already got a force of this type, leave. */ |
remove_force(force); | | for(tmp2=op->inv;tmp2!=NULL;tmp2=tmp2->below) |
We should be able to have more than one thing in force! */ | | if(tmp2->type==FORCE && tmp2->value == spell_type) { |
| | force=tmp2; |
| | } |
| | if(force==NULL) |
force=get_archetype("force"); | | force=get_archetype("force"); |
| | force->value = spell_type; /* mark this force with the originating spell */ |
switch(spell_type) { | | switch(spell_type) { |
case SP_RAGE: | | case SP_RAGE: |
{ | | { |
| | |
break; | | break; |
case SP_IRONWOOD_SKIN: | | case SP_IRONWOOD_SKIN: |
case SP_ARMOUR: { | | case SP_ARMOUR: { |
| | /* armour MAY be used multiple times. */ |
| | force->value = 0; |
/* With PR code, I wonder if this could get merged in with the other protection spells */ | | /* With PR code, I wonder if this could get merged in with the other protection spells */ |
/* peterm, modified so that it uses level-depend functions */ | | /* peterm, modified so that it uses level-depend functions */ |
force->stats.ac=2+SP_level_dam_adjust(op,caster,spell_type); | | force->stats.ac=2+SP_level_dam_adjust(op,caster,spell_type); |