1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-24 09:24:49 +00:00

Orb of Winter collects encased items in shmup mode

This commit is contained in:
Zeno Rogue
2025-10-09 22:36:03 +02:00
parent 14ae093901
commit 61d397e7c4
2 changed files with 17 additions and 11 deletions

View File

@@ -1272,6 +1272,20 @@ bool alchMayDuplicate(eWall w) {
return !isDie(w) && w != waBoat && w != waArrowTrap;
}
EX bool winter_collect(cell *c2) {
int qty = 0;
if(items[itOrbWinter])
forCellEx(c3, c2) if(c3->wall == waIcewall && c3->item) {
changes.ccell(c3);
markOrb(itOrbWinter);
eItem it = c3->item;
if(collectItem(c3, cwt.at)) qty++;
if(!c3->item)
animate_item_throw(c3, c2, it);
}
return qty;
}
bool pcmove::perform_actual_move() {
cell*& c2 = mi.t;
changes.at_commit([&] {
@@ -1328,16 +1342,7 @@ bool pcmove::perform_actual_move() {
cwt.at->wall = waIcewall;
}
if(items[itOrbWinter])
forCellEx(c3, c2) if(c3->wall == waIcewall && c3->item) {
changes.ccell(c3);
markOrb(itOrbWinter);
eItem it = c3->item;
if(collectItem(c3, cwt.at))
return true;
if(!c3->item)
animate_item_throw(c3, c2, it);
}
if(winter_collect(c2)) return true;
movecost(cwt.at, c2, 2);

View File

@@ -1294,6 +1294,7 @@ void movePlayer(monster *m, int delta) {
firetraplist.emplace(ticks + 800, c2);
}
winter_collect(c2);
if(c2->item == itOrbYendor && !peace::on) yendor::check(c2);
collectItem(c2, m->base);
movecost(m->base, c2, 2);