From 5c8d4c8701153ccb6e8c5e306ecbfbe12185df28 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 24 Mar 2025 13:07:24 -0400 Subject: [PATCH] v3.1.0: added landmark entries for lost pack and beacon location --- .../items/LostBackpack.java | 3 +++ .../items/spells/BeaconOfReturning.java | 10 ++++++++++ .../shatteredpixeldungeon/journal/Notes.java | 16 ++++++++++++++++ .../scenes/InterlevelScene.java | 3 +++ 4 files changed, 32 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/LostBackpack.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/LostBackpack.java index e5ed4af1d..ff73a94e1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/LostBackpack.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/LostBackpack.java @@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; +import com.shatteredpixel.shatteredpixeldungeon.journal.Notes; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -79,6 +80,8 @@ public class LostBackpack extends Item { hero.spendAndNext(TIME_TO_PICK_UP); GameScene.pickUp( this, pos ); ((HeroSprite)hero.sprite).updateArmor(); + + Notes.remove(Notes.Landmark.LOST_PACK); return true; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/BeaconOfReturning.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/BeaconOfReturning.java index 0f119ef86..315f22ae9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/BeaconOfReturning.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/BeaconOfReturning.java @@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfPassage; import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog; +import com.shatteredpixel.shatteredpixeldungeon.journal.Notes; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -90,12 +91,16 @@ public class BeaconOfReturning extends Spell { @Override protected void onThrow(int cell) { returnDepth = -1; + if (Dungeon.hero.belongings.getItem(getClass()) == null){ + Notes.remove(Notes.Landmark.BEACON_LOCATION); + } super.onThrow(cell); } @Override public void doDrop(Hero hero) { returnDepth = -1; + Notes.remove(Notes.Landmark.BEACON_LOCATION); super.doDrop(hero); } @@ -103,6 +108,8 @@ public class BeaconOfReturning extends Spell { returnDepth = Dungeon.depth; returnBranch = Dungeon.branch; returnPos = hero.pos; + + Notes.add(Notes.Landmark.BEACON_LOCATION); hero.spend( 1f ); hero.busy(); @@ -173,6 +180,9 @@ public class BeaconOfReturning extends Spell { InterlevelScene.returnPos = returnPos; Game.switchScene( InterlevelScene.class ); } + if (quantity == 1){ + Notes.remove(Notes.Landmark.BEACON_LOCATION); + } detach(hero.belongings.backpack); Catalog.countUse(getClass()); if (Random.Float() < talentChance){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java index 42491e3a0..4f75cbf5f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java @@ -38,7 +38,9 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Shopkeeper; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.LostBackpack; import com.shatteredpixel.shatteredpixeldungeon.items.keys.Key; +import com.shatteredpixel.shatteredpixeldungeon.items.spells.BeaconOfReturning; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.WeakFloorRoom; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -126,6 +128,9 @@ public class Notes { WELL_OF_AWARENESS, SACRIFICIAL_FIRE, STATUE, + + LOST_PACK, + BEACON_LOCATION, GHOST, RAT_KING, @@ -185,6 +190,11 @@ public class Notes { case STATUE: return new Image(new StatueSprite()); + case LOST_PACK: + return Icons.get(Icons.BACKPACK_LRG); + case BEACON_LOCATION: + return new ItemSprite(ItemSpriteSheet.RETURN_BEACON); + case GHOST: return new Image(new GhostSprite()); case RAT_KING: @@ -212,6 +222,9 @@ public class Notes { case LARGE_FLOOR: return Messages.get(Level.Feeling.class, "large_title"); case TRAPS_FLOOR: return Messages.get(Level.Feeling.class, "traps_title"); case SECRETS_FLOOR: return Messages.get(Level.Feeling.class, "secrets_title"); + + case LOST_PACK: return Messages.get(LostBackpack.class, "name"); + case BEACON_LOCATION:return Messages.get(BeaconOfReturning.class, "name"); } } @@ -239,6 +252,9 @@ public class Notes { case SACRIFICIAL_FIRE: return Messages.get(SacrificialFire.class, "desc"); case STATUE: return Messages.get(Statue.class, "desc"); + case LOST_PACK: return Messages.get(LostBackpack.class, "desc"); + case BEACON_LOCATION: return Messages.get(BeaconOfReturning.class, "desc"); + case GHOST: return Messages.get(Ghost.class, "desc"); case RAT_KING: return new RatKing().description(); //variable description based on holiday/run state case WANDMAKER: return Messages.get(Wandmaker.class, "desc"); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java index 179d7a8cd..8a485beea 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java @@ -34,6 +34,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.ShadowBox; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.LostBackpack; import com.shatteredpixel.shatteredpixeldungeon.journal.Document; +import com.shatteredpixel.shatteredpixeldungeon.journal.Notes; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; @@ -764,6 +765,8 @@ public class InterlevelScene extends PixelScene { level.drop(new LostBackpack(), invPos); } + Notes.add(Notes.Landmark.LOST_PACK); + Dungeon.switchLevel( level, Dungeon.hero.pos ); }