dragon armor properties
Special abilities conferred by wearing dragon armor was implemented in a somewhat half-assed fashion; extend it to 3/4-assed. Abilities came from wearing dragon armor but not from being poly'd into a dragon or for monsters that were wearing dragon armor or actually were dragons. This covers much of that. There are umpteen calls of 'resists_foo(mon)' and some are now 'resists_foo(mon) || defended(mon, AD_FOO)' but the second part ought to be incorporated into update_mon_intrinics() so that the extra '|| defended()' doesn't have to be spread all over the place and the ones being put in now could/should be removed. While testing, I noticed that a monster wielding Fire Brand did not resist being hit by a wand of fire. This fixes that and should also fix various comparable situations for other artifacts. But so far it has only been done for zapping (and any other actions which use the zapping code). Folding defended() checks into update_mon_intrinsics() matters more than that probably sounds.
This commit is contained in:
@@ -3757,7 +3757,7 @@ zhitm(
|
||||
*ootmp = (struct obj *) 0;
|
||||
switch (abstype) {
|
||||
case ZT_MAGIC_MISSILE:
|
||||
if (resists_magm(mon)) {
|
||||
if (resists_magm(mon) || defended(mon, AD_MAGM)) {
|
||||
sho_shieldeff = TRUE;
|
||||
break;
|
||||
}
|
||||
@@ -3766,7 +3766,7 @@ zhitm(
|
||||
tmp = spell_damage_bonus(tmp);
|
||||
break;
|
||||
case ZT_FIRE:
|
||||
if (resists_fire(mon)) {
|
||||
if (resists_fire(mon) || defended(mon, AD_FIRE)) {
|
||||
sho_shieldeff = TRUE;
|
||||
break;
|
||||
}
|
||||
@@ -3788,7 +3788,7 @@ zhitm(
|
||||
}
|
||||
break;
|
||||
case ZT_COLD:
|
||||
if (resists_cold(mon)) {
|
||||
if (resists_cold(mon) || defended(mon, AD_COLD)) {
|
||||
sho_shieldeff = TRUE;
|
||||
break;
|
||||
}
|
||||
@@ -3801,6 +3801,7 @@ zhitm(
|
||||
(void) destroy_mitem(mon, POTION_CLASS, AD_COLD);
|
||||
break;
|
||||
case ZT_SLEEP:
|
||||
/* possibly resistance and shield effect handled by sleep_monst() */
|
||||
tmp = 0;
|
||||
(void) sleep_monst(mon, d(nd, 25),
|
||||
type == ZT_WAND(ZT_SLEEP) ? WAND_CLASS : '\0');
|
||||
@@ -3825,18 +3826,18 @@ zhitm(
|
||||
} else {
|
||||
struct obj *otmp2;
|
||||
|
||||
if (resists_disint(mon)) {
|
||||
if (resists_disint(mon) || defended(mon, AD_DISN)) {
|
||||
sho_shieldeff = TRUE;
|
||||
} else if (mon->misc_worn_check & W_ARMS) {
|
||||
/* destroy shield; victim survives */
|
||||
*ootmp = which_armor(mon, W_ARMS);
|
||||
} else if (mon->misc_worn_check & W_ARM) {
|
||||
/* destroy body armor, also cloak if present */
|
||||
/* destroy suit, also cloak if present */
|
||||
*ootmp = which_armor(mon, W_ARM);
|
||||
if ((otmp2 = which_armor(mon, W_ARMC)) != 0)
|
||||
m_useup(mon, otmp2);
|
||||
} else {
|
||||
/* no body armor, victim dies; destroy cloak
|
||||
/* no suit, victim dies; destroy cloak
|
||||
and shirt now in case target gets life-saved */
|
||||
tmp = MAGIC_COOKIE;
|
||||
if ((otmp2 = which_armor(mon, W_ARMC)) != 0)
|
||||
@@ -3850,7 +3851,7 @@ zhitm(
|
||||
tmp = mon->mhp + 1;
|
||||
break;
|
||||
case ZT_LIGHTNING:
|
||||
if (resists_elec(mon)) {
|
||||
if (resists_elec(mon) || defended(mon, AD_ELEC)) {
|
||||
sho_shieldeff = TRUE;
|
||||
tmp = 0;
|
||||
/* can still blind the monster */
|
||||
@@ -3874,14 +3875,14 @@ zhitm(
|
||||
(void) destroy_mitem(mon, RING_CLASS, AD_ELEC);
|
||||
break;
|
||||
case ZT_POISON_GAS:
|
||||
if (resists_poison(mon)) {
|
||||
if (resists_poison(mon) || defended(mon, AD_DRST)) {
|
||||
sho_shieldeff = TRUE;
|
||||
break;
|
||||
}
|
||||
tmp = d(nd, 6);
|
||||
break;
|
||||
case ZT_ACID:
|
||||
if (resists_acid(mon)) {
|
||||
if (resists_acid(mon) || defended(mon, AD_ACID)) {
|
||||
sho_shieldeff = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user