Skip to content

Commit 20a7202

Browse files
committed
Add message for creatures hit by cancellation and zero out hero's Pw
This was inspired initially by an EvilHack feature that added messages, but I wasn't happy with the messages ("Magical energies are absorbed from [monster]" implies the hero has magic-sight which isn't really the case) so I changed them to an ambiguous visual effect. The other change, removing all magic energy from the player when they get canceled, is to provide a counterpart to monsters no longer being able to use their spells or special attacks once cancelled. This shouldn't actually happen very often, as the only causes right now are the hero zapping cancellation at themselves (which also cancels their entire inventory) or getting hit by Magicbane. At some point I might consider implementing a player-side cancellation status like FIQHack has, but not right now.
1 parent 5fbdd32 commit 20a7202

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

doc/xnh-changelog-10.0.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ changes:
3636
- The spell of restore ability has the same effects, except for curing illness.
3737
- Monsters hit by a potion of restore ability get cured of any blindness,
3838
confusion, or stunning, instead of being healed to full HP.
39+
- If the hero is hit with cancellation, they lose all their magic energy.
3940

4041
### Interface changes
4142

43+
- There is a visual effect associated with the monster (or the hero) being
44+
hit with cancellation.
4245

4346
### Architectural changes
4447

src/zap.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3242,6 +3242,12 @@ cancel_monst(struct monst *mdef, struct obj *obj, boolean youattack,
32423242

32433243
/* now handle special cases */
32443244
if (youdefend) {
3245+
if (!Blind)
3246+
pline("Dull sparkles flicker around you.");
3247+
/* since there is not (yet) a Cancelled status for heroes, at least
3248+
* temporarily limit their ability to use magical attacks... */
3249+
u.uen = 0;
3250+
32453251
if (Upolyd) { /* includes lycanthrope in creature form */
32463252
/*
32473253
* Return to normal form unless Unchanging.
@@ -3267,6 +3273,8 @@ cancel_monst(struct monst *mdef, struct obj *obj, boolean youattack,
32673273
}
32683274
}
32693275
} else {
3276+
if (canseemon(mdef))
3277+
pline("Dull sparkles flicker around %s.", mon_nam(mdef));
32703278
mdef->mcan = 1;
32713279
/* force shapeshifter into its base form or mimic to unhide */
32723280
normal_shape(mdef);

0 commit comments

Comments
 (0)