The Amulet of Yendor gives a wish when initially picked up

Part 4 of implementing wish spreading. (This is now a complete
implementation, although the details are likely to change - but it
makes sense to commit something with the right balance properties,
and then tweak it based on feedback from playtesting.)

This helps to make the Amulet of Yendor feel special, and restores
approximately the same average number of wishes per game as existed
prior to the nerf to wands of wishing.

Placing the wish in allmain helps to avoid the wish happening at an
awkward place in the game's control flow, and is simpler than
testing every possible mechanism for gaining items for bugs (message
order is a common issue when trying to place it in addinv-related
functions, and this also avoids issues with the wished-for item
immediately invalidating an assumption that was made by the calling
code).

It is possible that this would be better as an invoke effect,
although I like the impact of picking up the Amulet and immediately
being given a wish.
This commit is contained in:
Alex Smith
2025-05-30 02:10:58 +01:00
parent a8800a9acd
commit 308c5ab237
4 changed files with 12 additions and 1 deletions

View File

@@ -17,7 +17,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 126
#define EDITLEVEL 127
/*
* Development status possibilities.

View File

@@ -52,6 +52,9 @@ struct u_event {
Bitfield(udemigod, 1); /* killed the wiz */
Bitfield(uvibrated, 1); /* stepped on "vibrating square" */
Bitfield(ascended, 1); /* has offered the Amulet */
Bitfield(amulet_wish, 1); /* has gained a wish from the Amulet */
/* 7 free bits */
};
/*

View File

@@ -428,6 +428,13 @@ moveloop_core(void)
/****************************************/
clear_splitobjs();
/* the Amulet of Yendor gives a wish when initially picked up */
if (u.uhave.amulet && !u.uevent.amulet_wish) {
u.uevent.amulet_wish = 1;
makewish();
}
find_ac();
if (!svc.context.mv || Blind) {
/* redo monsters if hallu or wearing a helm of telepathy */

View File

@@ -963,6 +963,7 @@ u_init(void)
u.uevent.uheard_tune = 0;
u.uevent.uopened_dbridge = 0;
u.uevent.udemigod = 0; /* not a demi-god yet... */
u.uevent.amulet_wish = 0;
u.udg_cnt = 0;
u.mh = u.mhmax = u.mtimedone = 0;
u.uz.dnum = u.uz0.dnum = 0;