From 15b711e099355ff405fe001108701ab00eea2222 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 24 Mar 2024 19:29:44 +0100 Subject: [PATCH] if you are in water (and have no Fish), you can now see Orbs of Fish and Aether in adjacent water tiles, and also you can move there and pick them up --- items.cpp | 7 ++++++- passable.cpp | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/items.cpp b/items.cpp index bb0eb82d..a2fa649f 100644 --- a/items.cpp +++ b/items.cpp @@ -16,7 +16,12 @@ EX array items; EX map > hiitems; +EX bool pickable_from_water(eItem it) { + return among(it, itOrbFish, itOrbAether); + } + EX bool cannotPickupItem(cell *c, bool telekinesis) { + if(pickable_from_water(c->item) && isWatery(c)) return false; return itemHidden(c) && !telekinesis && !(isWatery(c) && markOrb(itOrbFish)); } @@ -737,7 +742,7 @@ EX void collectMessage(cell *c2, eItem which) { EX bool itemHiddenFromSight(cell *c) { return isWatery(c) && !items[itOrbInvis] && !(items[itOrbFish] && playerInWater()) - && !(shmup::on && shmup::boatAt(c)); + && !(shmup::on && shmup::boatAt(c)) && !(c->cpdist <= 1 && playerInWater()); } } diff --git a/passable.cpp b/passable.cpp index 94fbb4d6..a633dfea 100644 --- a/passable.cpp +++ b/passable.cpp @@ -258,7 +258,8 @@ EX bool passable(cell *w, cell *from, flagtype flags) { } if(isWatery(w)) { - if(in_gravity_zone(w)) ; + if((flags & P_ISPLAYER) && from && isWatery(from) && pickable_from_water(w->item)) ; + else if(in_gravity_zone(w)) ; else if(from && from->wall == waBoat && F(P_USEBOAT) && (!againstCurrent(w, from) || F(P_MARKWATER)) && !(from->item == itOrbYendor)) ; else if(from && isWatery(from) && F(P_CHAIN) && F(P_USEBOAT) && !againstCurrent(w, from)) ;