From 4152d9dc7a4de7b47d08e29fc974f38eab979e38 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 3 Apr 2020 20:01:35 -0400 Subject: [PATCH] v0.8.0: bugfixes and tweaks: - Fixed webs not always clearing properly - Fixed doors being hidden on floor 2 in some cases when they shouldn't - Fixed Yog and its minions ignoring bees - Added back the name of an item when it can't be grabbed. --- .../shatteredpixeldungeon/actors/blobs/Web.java | 2 +- .../shatteredpixeldungeon/actors/hero/Hero.java | 15 +++++++++++++++ .../actors/mobs/YogDzewa.java | 12 +++++++++++- .../levels/painters/RegularPainter.java | 10 ++++++---- .../messages/actors/actors.properties | 3 ++- 5 files changed, 35 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Web.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Web.java index 31c2b4353..6a20bdeb2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Web.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Web.java @@ -78,7 +78,7 @@ public class Web extends Blob { @Override public void clear(int cell) { super.clear(cell); - if (volume == 0) return; + if (cur == null) return; Level l = Dungeon.level; l.solid[cell] = cur[cell] > 0 || (Terrain.flags[l.map[cell]] & Terrain.SOLID) != 0; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index efb9b4fd5..ae02d727c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -106,6 +106,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap; +import com.shatteredpixel.shatteredpixeldungeon.messages.Languages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.plants.Earthroot; import com.shatteredpixel.shatteredpixeldungeon.plants.Swiftthistle; @@ -737,6 +738,20 @@ public class Hero extends Char { curAction = null; } else { + + if (item instanceof Dewdrop + || item instanceof TimekeepersHourglass.sandBag + || item instanceof DriedRose.Petal + || item instanceof Key) { + //Do Nothing + } else { + //TODO temporary until 0.8.0a, when all languages will get this phrase + if (Messages.lang() == Languages.ENGLISH) { + GLog.newLine(); + GLog.n(Messages.get(this, "you_cant_have", item.name())); + } + } + heap.sprite.drop(); ready(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java index 2a92a70db..541657cad 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java @@ -142,7 +142,7 @@ public class YogDzewa extends Mob { sprite.parent.add(new Beam.DeathRay(sprite.center(), DungeonTilemap.raisedTileCenterToWorld(b.collisionPos))); for (int p : b.path) { Char ch = Actor.findChar(p); - if (ch != null && ch.alignment != alignment) { + if (ch != null && (ch.alignment != alignment || ch instanceof Bee)) { affected.add(ch); } if (Dungeon.level.flamable[p]) { @@ -338,6 +338,16 @@ public class YogDzewa extends Mob { public void beckon( int cell ) { } + @Override + public void aggro(Char ch) { + for (Mob mob : (Iterable)Dungeon.level.mobs.clone()) { + if (Dungeon.level.distance(pos, mob.pos) <= 4 && + (mob instanceof Larva || mob instanceof RipperDemon)) { + mob.aggro(ch); + } + } + } + @SuppressWarnings("unchecked") @Override public void die( Object cause ) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java index 73ad52a8a..998ce2af5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java @@ -188,11 +188,13 @@ public abstract class RegularPainter extends Painter { } else { d.type = Room.Door.Type.UNLOCKED; } - } - //entrance doors on floor 2 are hidden if the player hasn't beaten the first boss - if (Dungeon.depth == 2 && !Badges.isUnlocked(Badges.Badge.BOSS_SLAIN_1) && r instanceof EntranceRoom){ - d.type = Room.Door.Type.HIDDEN; + //entrance doors on floor 2 are hidden if the player hasn't beaten the first boss + if (Dungeon.depth == 2 + && !Badges.isUnlocked(Badges.Badge.BOSS_SLAIN_1) + && r instanceof EntranceRoom){ + d.type = Room.Door.Type.HIDDEN; + } } switch (d.type) { diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties index a5d75e6c4..9441a38d6 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties @@ -302,7 +302,8 @@ actors.hero.hero.leave=You can't leave yet! actors.hero.hero.level_up=Level up! actors.hero.hero.new_level=Level up!\nYou are more accurate, evasive, & healthy! actors.hero.hero.level_cap=You cannot grow stronger, but your experiences do give you a surge of power! -actors.hero.hero.you_now_have=You now have: %s. +actors.hero.hero.you_now_have=You picked up: %s. +actors.hero.hero.you_cant_have=You can't carry: %s. actors.hero.hero.locked_chest=This chest is locked and you don't have a matching key. actors.hero.hero.locked_door=You don't have a matching key. actors.hero.hero.noticed_smth=You noticed something.