Rejigger anti-magic traps

My changes were too drastic, so reduce the drain and damage so it
matches all the other traps. Now the anti-magic trap will always
ding your max energy a bit, in addition to the physical damage done
if wearing magic resistance.
This commit is contained in:
Pasi Kallinen
2022-07-12 20:24:30 +03:00
parent 0059ced578
commit 5c7c9d10ae
3 changed files with 11 additions and 12 deletions
+1 -2
View File
@@ -533,8 +533,7 @@ dying from being level-drained below level 1 killed hero without saying so
and jumped straight to "do you want your possessions identified?" and jumped straight to "do you want your possessions identified?"
conflict will now consider your charisma and requires line of sight conflict will now consider your charisma and requires line of sight
boost hit points of some golems boost hit points of some golems
make anti-magic fields drain more energy and prevent them from showing up make anti-magic fields always drain max energy
too early in the dungeon
eating magical monsters such as wizards or shamans may give a mild buzz eating magical monsters such as wizards or shamans may give a mild buzz
make exploding spheres create an actual explosion make exploding spheres create an actual explosion
pets are more careful about attacking monsters at low health pets are more careful about attacking monsters at low health
-1
View File
@@ -1435,7 +1435,6 @@ mktrap(
if (lvl < 5) if (lvl < 5)
kind = NO_TRAP; kind = NO_TRAP;
break; break;
case ANTI_MAGIC:
case LANDMINE: case LANDMINE:
if (lvl < 6) if (lvl < 6)
kind = NO_TRAP; kind = NO_TRAP;
+10 -9
View File
@@ -2037,17 +2037,13 @@ trapeffect_anti_magic(
unsigned int trflags UNUSED) unsigned int trflags UNUSED)
{ {
if (mtmp == &g.youmonst) { if (mtmp == &g.youmonst) {
int drain = (u.uen > 1) ? (rnd(u.uen / 2) + 2) : 4; int drain = d(2, 6);
int halfd = rnd(((drain + 1) / 2));
seetrap(trap); seetrap(trap);
/* hero without magic resistance loses spell energy, if (Antimagic) {
hero with magic resistance takes damage instead;
possibly non-intuitive but useful for play balance */
if (!Antimagic) {
drain_en(drain);
} else {
struct obj *otmp; struct obj *otmp;
int dmgval2 = rnd(drain), hp = Upolyd ? u.mh : u.uhp; int dmgval2 = rnd(4), hp = Upolyd ? u.mh : u.uhp;
/* Half_XXX_damage has opposite its usual effect (approx) /* Half_XXX_damage has opposite its usual effect (approx)
but isn't cumulative if hero has more than one */ but isn't cumulative if hero has more than one */
@@ -2074,6 +2070,11 @@ trapeffect_anti_magic(
/* opposite of magical explosion */ /* opposite of magical explosion */
losehp(dmgval2, "anti-magic implosion", KILLED_BY_AN); losehp(dmgval2, "anti-magic implosion", KILLED_BY_AN);
} }
if (u.uenmax > halfd) {
u.uenmax -= halfd;
drain -= halfd;
}
drain_en(drain);
} else { } else {
boolean trapkilled = FALSE; boolean trapkilled = FALSE;
boolean in_sight = canseemon(mtmp) || (mtmp == u.usteed); boolean in_sight = canseemon(mtmp) || (mtmp == u.usteed);
@@ -2084,7 +2085,7 @@ trapeffect_anti_magic(
if (!resists_magm(mtmp)) { /* lose spell energy */ if (!resists_magm(mtmp)) { /* lose spell energy */
if (!mtmp->mcan && (attacktype(mptr, AT_MAGC) if (!mtmp->mcan && (attacktype(mptr, AT_MAGC)
|| attacktype(mptr, AT_BREA))) { || attacktype(mptr, AT_BREA))) {
mtmp->mspec_used += d(2, 2); mtmp->mspec_used += d(2, 6);
if (in_sight) { if (in_sight) {
seetrap(trap); seetrap(trap);
pline("%s seems lethargic.", Monnam(mtmp)); pline("%s seems lethargic.", Monnam(mtmp));