Make anti-magic fields drain more energy

... and make them actually deal damage based on the energy
it would've drained, if you have Antimagic.
Also prevent them appearing too early in the dungeon.

Allow drain energy attacks (and anti-magic traps) drain more
than your level of energy.

Make eating magical monsters such as wizards and shamans give
the same tiny buzz bonus as eating a newt.
This commit is contained in:
Pasi Kallinen
2021-05-20 20:40:56 +03:00
parent a1b765936f
commit 5ad45fc696
4 changed files with 34 additions and 20 deletions

View File

@@ -527,6 +527,9 @@ dying from being level-drained below level 1 killed hero without saying so
and jumped straight to "do you want your possessions identified?"
conflict will now consider your charisma and requires line of sight
boost hit points of some golems
make anti-magic fields drain more energy and prevent them from showing up
too early in the dungeon
eating magical monsters such as wizards or shamans may give a mild buzz
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository

View File

@@ -20,6 +20,7 @@ static void done_eating(boolean);
static void cprefx(int);
static int intrinsic_possible(int, struct permonst *);
static void givit(int, struct permonst *);
static void eye_of_newt_buzz(void);
static void cpostfx(int);
static void consume_tin(const char *);
static void start_tin(struct obj *);
@@ -916,6 +917,26 @@ givit(int type, register struct permonst *ptr)
DISABLE_WARNING_FORMAT_NONLITERAL
static void
eye_of_newt_buzz(void)
{
/* MRKR: "eye of newt" may give small magical energy boost */
if (rn2(3) || 3 * u.uen <= 2 * u.uenmax) {
int old_uen = u.uen;
u.uen += rnd(3);
if (u.uen > u.uenmax) {
if (!rn2(3))
u.uenmax++;
u.uen = u.uenmax;
}
if (old_uen != u.uen) {
You_feel("a mild buzz.");
g.context.botl = 1;
}
}
}
/* called after completely consuming a corpse */
static void
cpostfx(int pm)
@@ -930,23 +951,6 @@ cpostfx(int pm)
(void) eatmdone();
switch (pm) {
case PM_NEWT:
/* MRKR: "eye of newt" may give small magical energy boost */
if (rn2(3) || 3 * u.uen <= 2 * u.uenmax) {
int old_uen = u.uen;
u.uen += rnd(3);
if (u.uen > u.uenmax) {
if (!rn2(3))
u.uenmax++;
u.uen = u.uenmax;
}
if (old_uen != u.uen) {
You_feel("a mild buzz.");
g.context.botl = 1;
}
}
break;
case PM_WRAITH:
pluslvl(FALSE);
break;
@@ -1100,6 +1104,10 @@ cpostfx(int pm)
0L);
}
/* Eating magical monsters can give you some magical energy. */
if (attacktype(ptr, AT_MAGC) || pm == PM_NEWT)
eye_of_newt_buzz();
/* Check the monster for all of the intrinsics. If this
* monster can give more than one, pick one to try to give
* from among all it can give.

View File

@@ -1385,6 +1385,7 @@ mktrap(int num, int mktrapflags, struct mkroom *croom, coord *tm)
if (lvl < 5)
kind = NO_TRAP;
break;
case ANTI_MAGIC:
case LANDMINE:
if (lvl < 6)
kind = NO_TRAP;

View File

@@ -1974,15 +1974,17 @@ trapeffect_anti_magic(
unsigned int trflags UNUSED)
{
if (mtmp == &g.youmonst) {
int drain = (u.uen > 1) ? (rnd(u.uen / 2) + 2) : 4;
seetrap(trap);
/* hero without magic resistance loses spell energy,
hero with magic resistance takes damage instead;
possibly non-intuitive but useful for play balance */
if (!Antimagic) {
drain_en(rnd(u.ulevel) + 1);
drain_en(drain);
} else {
struct obj *otmp;
int dmgval2 = rnd(4), hp = Upolyd ? u.mh : u.uhp;
int dmgval2 = rnd(drain), hp = Upolyd ? u.mh : u.uhp;
/* Half_XXX_damage has opposite its usual effect (approx)
but isn't cumulative if hero has more than one */
@@ -4293,7 +4295,7 @@ drain_en(int n)
You_feel("momentarily lethargic.");
} else {
/* throttle further loss a bit when there's not much left to lose */
if (n > u.uenmax || n > u.ulevel)
if (n > (u.uen + u.uenmax) / 3)
n = rnd(n);
You_feel("your magical energy drain away%c", (n > u.uen) ? '!' : '.');