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:
PatR
2018-06-20 14:53:20 -07:00
parent 3c979cb0a5
commit 800a898b51
3 changed files with 31 additions and 17 deletions

View File

@@ -886,7 +886,7 @@ int spell;
boolean atme;
{
int energy, damage, chance, n, intell;
int skill, role_skill, res = 0;
int otyp, skill, role_skill, res = 0;
boolean confused = (Confusion != 0);
boolean physical_damage = FALSE;
struct obj *pseudo;
@@ -1029,10 +1029,11 @@ boolean atme;
* Find the skill the hero has in a spell type category.
* See spell_skilltype for categories.
*/
skill = spell_skilltype(pseudo->otyp);
otyp = pseudo->otyp;
skill = spell_skilltype(otyp);
role_skill = P_SKILL(skill);
switch (pseudo->otyp) {
switch (otyp) {
/*
* At first spells act as expected. As the hero increases in skill
* with the appropriate spell type, some spells increase in their
@@ -1056,9 +1057,9 @@ boolean atme;
}
} else {
explode(u.dx, u.dy,
pseudo->otyp - SPE_MAGIC_MISSILE + 10,
otyp - SPE_MAGIC_MISSILE + 10,
spell_damage_bonus(u.ulevel / 2 + 1), 0,
(pseudo->otyp == SPE_CONE_OF_COLD)
(otyp == SPE_CONE_OF_COLD)
? EXPL_FROSTY
: EXPL_FIERY);
}
@@ -1073,12 +1074,13 @@ boolean atme;
}
}
break;
} /* else fall through... */
} /* else */
/*FALLTHRU*/
/* these spells are all duplicates of wand effects */
case SPE_FORCE_BOLT:
physical_damage = TRUE;
/* fall through */
/*FALLTHRU*/
case SPE_SLEEP:
case SPE_MAGIC_MISSILE:
case SPE_KNOCK:
@@ -1096,7 +1098,13 @@ boolean atme;
case SPE_EXTRA_HEALING:
case SPE_DRAIN_LIFE:
case SPE_STONE_TO_FLESH:
if (!(objects[pseudo->otyp].oc_dir == NODIR)) {
if (objects[otyp].oc_dir != NODIR) {
if (otyp == SPE_HEALING || otyp == SPE_EXTRA_HEALING) {
/* healing and extra healing are actually potion effects,
but they've been extended to take a direction like wands */
if (role_skill >= P_SKILLED)
pseudo->blessed = 1;
}
if (atme) {
u.dx = u.dy = u.dz = 0;
} else if (!getdir((char *) 0)) {
@@ -1136,7 +1144,7 @@ boolean atme;
/* high skill yields effect equivalent to blessed scroll */
if (role_skill >= P_SKILLED)
pseudo->blessed = 1;
/* fall through */
/*FALLTHRU*/
case SPE_CHARM_MONSTER:
case SPE_MAGIC_MAPPING:
case SPE_CREATE_MONSTER:
@@ -1152,7 +1160,7 @@ boolean atme;
/* high skill yields effect equivalent to blessed potion */
if (role_skill >= P_SKILLED)
pseudo->blessed = 1;
/* fall through */
/*FALLTHRU*/
case SPE_INVISIBILITY:
(void) peffects(pseudo);
break;