fix github issue #109 - healing spells
Fixes #109 Spells of healing and extra healing cast at monsters were handling monster blindness differently from other forms of healing. (Potions also work differently when drunk by monsters but I haven't changed that since it seems to be intentional.) Hero: potion of healing cures blindness if blessed; spell of healing cast at skilled or better now behaves likewise; potion of extra healing cures blindness if not cursed; spell of extra healing is inherently not cursed and already behaved likewise; potion of full healing always cures blindness even if cursed. Monsters quaffing potions: plain healing cures blindness if not cursed; extra healing and full healing always cure blindess. Hero casting healing spell at monster: plain healing behaves like the hero plain healing case: cures blindness as if blessed when cast at skilled or expert level; this is a change in hehavior--it used to cure timed blindness even if unskilled and not cure 'permanent' blindness at all; extra healing cast by hero is inherently not cursed so always cures blindness.
This commit is contained in:
18
src/zap.c
18
src/zap.c
@@ -138,7 +138,7 @@ struct obj *otmp;
|
||||
boolean wake = TRUE; /* Most 'zaps' should wake monster */
|
||||
boolean reveal_invis = FALSE, learn_it = FALSE;
|
||||
boolean dbldam = Role_if(PM_KNIGHT) && u.uhave.questart;
|
||||
boolean helpful_gesture = FALSE;
|
||||
boolean skilled_spell, helpful_gesture = FALSE;
|
||||
int dmg, otyp = otmp->otyp;
|
||||
const char *zap_type_text = "spell";
|
||||
struct obj *obj;
|
||||
@@ -149,10 +149,12 @@ struct obj *otmp;
|
||||
reveal_invis = FALSE;
|
||||
|
||||
notonhead = (mtmp->mx != bhitpos.x || mtmp->my != bhitpos.y);
|
||||
skilled_spell = (otmp && otmp->oclass == SPBOOK_CLASS && otmp->blessed);
|
||||
|
||||
switch (otyp) {
|
||||
case WAN_STRIKING:
|
||||
zap_type_text = "wand";
|
||||
/* fall through */
|
||||
/*FALLTHRU*/
|
||||
case SPE_FORCE_BOLT:
|
||||
reveal_invis = TRUE;
|
||||
if (disguised_mimic)
|
||||
@@ -343,10 +345,12 @@ struct obj *otmp;
|
||||
mtmp->mhp += d(6, otyp == SPE_EXTRA_HEALING ? 8 : 4);
|
||||
if (mtmp->mhp > mtmp->mhpmax)
|
||||
mtmp->mhp = mtmp->mhpmax;
|
||||
if (mtmp->mblinded) {
|
||||
mtmp->mblinded = 0;
|
||||
mtmp->mcansee = 1;
|
||||
}
|
||||
/* plain healing must be blessed to cure blindness; extra
|
||||
healing only needs to not be cursed, so spell always cures
|
||||
[potions quaffed by monsters behave slightly differently;
|
||||
we use the rules for the hero here...] */
|
||||
if (skilled_spell || otyp == SPE_EXTRA_HEALING)
|
||||
mcureblindness(mtmp, canseemon(mtmp));
|
||||
if (canseemon(mtmp)) {
|
||||
if (disguised_mimic) {
|
||||
if (is_obj_mappear(mtmp,STRANGE_OBJECT)) {
|
||||
@@ -2407,7 +2411,7 @@ boolean ordinary;
|
||||
case SPE_EXTRA_HEALING:
|
||||
learn_it = TRUE; /* (no effect for spells...) */
|
||||
healup(d(6, obj->otyp == SPE_EXTRA_HEALING ? 8 : 4), 0, FALSE,
|
||||
(obj->otyp == SPE_EXTRA_HEALING));
|
||||
(obj->blessed || obj->otyp == SPE_EXTRA_HEALING));
|
||||
You_feel("%sbetter.", obj->otyp == SPE_EXTRA_HEALING ? "much " : "");
|
||||
break;
|
||||
case WAN_LIGHT: /* (broken wand) */
|
||||
|
||||
Reference in New Issue
Block a user