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:
@@ -44,6 +44,8 @@ wishing for small mimic corpse or large mimic corpse failed with 'nothing
|
|||||||
yielded normal size one (size prefix was being stripped off for globs)
|
yielded normal size one (size prefix was being stripped off for globs)
|
||||||
wishing for "glob of grey ooze" failed even though grey ooze is recognized
|
wishing for "glob of grey ooze" failed even though grey ooze is recognized
|
||||||
as a variant spelling for gray ooze
|
as a variant spelling for gray ooze
|
||||||
|
spells of healing and extra healing cast at monsters handled monster blindness
|
||||||
|
inconsistently compared to other healing
|
||||||
|
|
||||||
|
|
||||||
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
||||||
|
|||||||
+18
-10
@@ -886,7 +886,7 @@ int spell;
|
|||||||
boolean atme;
|
boolean atme;
|
||||||
{
|
{
|
||||||
int energy, damage, chance, n, intell;
|
int energy, damage, chance, n, intell;
|
||||||
int skill, role_skill, res = 0;
|
int otyp, skill, role_skill, res = 0;
|
||||||
boolean confused = (Confusion != 0);
|
boolean confused = (Confusion != 0);
|
||||||
boolean physical_damage = FALSE;
|
boolean physical_damage = FALSE;
|
||||||
struct obj *pseudo;
|
struct obj *pseudo;
|
||||||
@@ -1029,10 +1029,11 @@ boolean atme;
|
|||||||
* Find the skill the hero has in a spell type category.
|
* Find the skill the hero has in a spell type category.
|
||||||
* See spell_skilltype for categories.
|
* See spell_skilltype for categories.
|
||||||
*/
|
*/
|
||||||
skill = spell_skilltype(pseudo->otyp);
|
otyp = pseudo->otyp;
|
||||||
|
skill = spell_skilltype(otyp);
|
||||||
role_skill = P_SKILL(skill);
|
role_skill = P_SKILL(skill);
|
||||||
|
|
||||||
switch (pseudo->otyp) {
|
switch (otyp) {
|
||||||
/*
|
/*
|
||||||
* At first spells act as expected. As the hero increases in skill
|
* At first spells act as expected. As the hero increases in skill
|
||||||
* with the appropriate spell type, some spells increase in their
|
* with the appropriate spell type, some spells increase in their
|
||||||
@@ -1056,9 +1057,9 @@ boolean atme;
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
explode(u.dx, u.dy,
|
explode(u.dx, u.dy,
|
||||||
pseudo->otyp - SPE_MAGIC_MISSILE + 10,
|
otyp - SPE_MAGIC_MISSILE + 10,
|
||||||
spell_damage_bonus(u.ulevel / 2 + 1), 0,
|
spell_damage_bonus(u.ulevel / 2 + 1), 0,
|
||||||
(pseudo->otyp == SPE_CONE_OF_COLD)
|
(otyp == SPE_CONE_OF_COLD)
|
||||||
? EXPL_FROSTY
|
? EXPL_FROSTY
|
||||||
: EXPL_FIERY);
|
: EXPL_FIERY);
|
||||||
}
|
}
|
||||||
@@ -1073,12 +1074,13 @@ boolean atme;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} /* else fall through... */
|
} /* else */
|
||||||
|
/*FALLTHRU*/
|
||||||
|
|
||||||
/* these spells are all duplicates of wand effects */
|
/* these spells are all duplicates of wand effects */
|
||||||
case SPE_FORCE_BOLT:
|
case SPE_FORCE_BOLT:
|
||||||
physical_damage = TRUE;
|
physical_damage = TRUE;
|
||||||
/* fall through */
|
/*FALLTHRU*/
|
||||||
case SPE_SLEEP:
|
case SPE_SLEEP:
|
||||||
case SPE_MAGIC_MISSILE:
|
case SPE_MAGIC_MISSILE:
|
||||||
case SPE_KNOCK:
|
case SPE_KNOCK:
|
||||||
@@ -1096,7 +1098,13 @@ boolean atme;
|
|||||||
case SPE_EXTRA_HEALING:
|
case SPE_EXTRA_HEALING:
|
||||||
case SPE_DRAIN_LIFE:
|
case SPE_DRAIN_LIFE:
|
||||||
case SPE_STONE_TO_FLESH:
|
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) {
|
if (atme) {
|
||||||
u.dx = u.dy = u.dz = 0;
|
u.dx = u.dy = u.dz = 0;
|
||||||
} else if (!getdir((char *) 0)) {
|
} else if (!getdir((char *) 0)) {
|
||||||
@@ -1136,7 +1144,7 @@ boolean atme;
|
|||||||
/* high skill yields effect equivalent to blessed scroll */
|
/* high skill yields effect equivalent to blessed scroll */
|
||||||
if (role_skill >= P_SKILLED)
|
if (role_skill >= P_SKILLED)
|
||||||
pseudo->blessed = 1;
|
pseudo->blessed = 1;
|
||||||
/* fall through */
|
/*FALLTHRU*/
|
||||||
case SPE_CHARM_MONSTER:
|
case SPE_CHARM_MONSTER:
|
||||||
case SPE_MAGIC_MAPPING:
|
case SPE_MAGIC_MAPPING:
|
||||||
case SPE_CREATE_MONSTER:
|
case SPE_CREATE_MONSTER:
|
||||||
@@ -1152,7 +1160,7 @@ boolean atme;
|
|||||||
/* high skill yields effect equivalent to blessed potion */
|
/* high skill yields effect equivalent to blessed potion */
|
||||||
if (role_skill >= P_SKILLED)
|
if (role_skill >= P_SKILLED)
|
||||||
pseudo->blessed = 1;
|
pseudo->blessed = 1;
|
||||||
/* fall through */
|
/*FALLTHRU*/
|
||||||
case SPE_INVISIBILITY:
|
case SPE_INVISIBILITY:
|
||||||
(void) peffects(pseudo);
|
(void) peffects(pseudo);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ struct obj *otmp;
|
|||||||
boolean wake = TRUE; /* Most 'zaps' should wake monster */
|
boolean wake = TRUE; /* Most 'zaps' should wake monster */
|
||||||
boolean reveal_invis = FALSE, learn_it = FALSE;
|
boolean reveal_invis = FALSE, learn_it = FALSE;
|
||||||
boolean dbldam = Role_if(PM_KNIGHT) && u.uhave.questart;
|
boolean dbldam = Role_if(PM_KNIGHT) && u.uhave.questart;
|
||||||
boolean helpful_gesture = FALSE;
|
boolean skilled_spell, helpful_gesture = FALSE;
|
||||||
int dmg, otyp = otmp->otyp;
|
int dmg, otyp = otmp->otyp;
|
||||||
const char *zap_type_text = "spell";
|
const char *zap_type_text = "spell";
|
||||||
struct obj *obj;
|
struct obj *obj;
|
||||||
@@ -149,10 +149,12 @@ struct obj *otmp;
|
|||||||
reveal_invis = FALSE;
|
reveal_invis = FALSE;
|
||||||
|
|
||||||
notonhead = (mtmp->mx != bhitpos.x || mtmp->my != bhitpos.y);
|
notonhead = (mtmp->mx != bhitpos.x || mtmp->my != bhitpos.y);
|
||||||
|
skilled_spell = (otmp && otmp->oclass == SPBOOK_CLASS && otmp->blessed);
|
||||||
|
|
||||||
switch (otyp) {
|
switch (otyp) {
|
||||||
case WAN_STRIKING:
|
case WAN_STRIKING:
|
||||||
zap_type_text = "wand";
|
zap_type_text = "wand";
|
||||||
/* fall through */
|
/*FALLTHRU*/
|
||||||
case SPE_FORCE_BOLT:
|
case SPE_FORCE_BOLT:
|
||||||
reveal_invis = TRUE;
|
reveal_invis = TRUE;
|
||||||
if (disguised_mimic)
|
if (disguised_mimic)
|
||||||
@@ -343,10 +345,12 @@ struct obj *otmp;
|
|||||||
mtmp->mhp += d(6, otyp == SPE_EXTRA_HEALING ? 8 : 4);
|
mtmp->mhp += d(6, otyp == SPE_EXTRA_HEALING ? 8 : 4);
|
||||||
if (mtmp->mhp > mtmp->mhpmax)
|
if (mtmp->mhp > mtmp->mhpmax)
|
||||||
mtmp->mhp = mtmp->mhpmax;
|
mtmp->mhp = mtmp->mhpmax;
|
||||||
if (mtmp->mblinded) {
|
/* plain healing must be blessed to cure blindness; extra
|
||||||
mtmp->mblinded = 0;
|
healing only needs to not be cursed, so spell always cures
|
||||||
mtmp->mcansee = 1;
|
[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 (canseemon(mtmp)) {
|
||||||
if (disguised_mimic) {
|
if (disguised_mimic) {
|
||||||
if (is_obj_mappear(mtmp,STRANGE_OBJECT)) {
|
if (is_obj_mappear(mtmp,STRANGE_OBJECT)) {
|
||||||
@@ -2407,7 +2411,7 @@ boolean ordinary;
|
|||||||
case SPE_EXTRA_HEALING:
|
case SPE_EXTRA_HEALING:
|
||||||
learn_it = TRUE; /* (no effect for spells...) */
|
learn_it = TRUE; /* (no effect for spells...) */
|
||||||
healup(d(6, obj->otyp == SPE_EXTRA_HEALING ? 8 : 4), 0, FALSE,
|
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 " : "");
|
You_feel("%sbetter.", obj->otyp == SPE_EXTRA_HEALING ? "much " : "");
|
||||||
break;
|
break;
|
||||||
case WAN_LIGHT: /* (broken wand) */
|
case WAN_LIGHT: /* (broken wand) */
|
||||||
|
|||||||
Reference in New Issue
Block a user