From d837b75f5f1ce43700ef196545ba419ac26d62a3 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 25 Aug 2018 23:37:09 -0400 Subject: [PATCH] v0.7.0: various bugfixes and improvements: - adjusted 'snapped out of paralysis' message, should be better for translators - mob names are now capitalized when they yell something - scroll of enchantment window now cannot be tapped out of, and warns that cancel still uses the scroll bugfixes: - fixed transmuting with a full inventory destroying the result item - stone of intuition now works correctly on exotic items - fixed wand of corruption no longer applying debuffs to corrupted/doomed enemies - fixed incorrect alchemical energy when two alchemy pots are in the same floor - fixed issues when using two swiftthistle together - fixed a visual bug with secret doors and chasms --- .../actors/buffs/Paralysis.java | 5 ++- .../actors/mobs/Mob.java | 2 +- .../items/scrolls/ScrollOfTransmutation.java | 6 ++-- .../scrolls/exotic/ScrollOfEnchantment.java | 18 ++++++++-- .../items/stones/StoneOfIntuition.java | 35 +++++++++++++++++-- .../items/wands/WandOfCorruption.java | 2 +- .../rooms/secret/SecretLaboratoryRoom.java | 5 ++- .../levels/rooms/special/LaboratoryRoom.java | 5 ++- .../plants/Swiftthistle.java | 15 +++----- .../tiles/DungeonTileSheet.java | 1 + .../messages/actors/actors.properties | 4 +-- .../messages/items/items.properties | 1 + 12 files changed, 68 insertions(+), 31 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Paralysis.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Paralysis.java index ed818d848..aa9788cab 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Paralysis.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Paralysis.java @@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; -import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.utils.Bundle; import com.watabou.utils.Random; @@ -57,10 +56,10 @@ public class Paralysis extends FlavourBuff { } resist.damage += damage; if (Random.NormalIntRange(0, resist.damage) >= Random.NormalIntRange(0, target.HP)){ - detach(); if (Dungeon.level.heroFOV[target.pos]) { - GLog.i( Messages.get(this, "out", target.name) ); + target.sprite.showStatus(CharSprite.NEUTRAL, Messages.get(this, "out")); } + detach(); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index b3a7c9d1e..6ca989a62 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -674,7 +674,7 @@ public abstract class Mob extends Char { } public void yell( String str ) { - GLog.n( "%s: \"%s\" ", name, str ); + GLog.n( "%s: \"%s\" ", Messages.titleCase(name), str ); } //returns true when a mob sees the hero, and is currently targeting them. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTransmutation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTransmutation.java index 51ba05fb5..60a42c318 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTransmutation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTransmutation.java @@ -29,8 +29,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMight; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.ExoticPotion; import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll; @@ -96,7 +94,9 @@ public class ScrollOfTransmutation extends InventoryScroll { ((EquipableItem)result).doEquip(Dungeon.hero); } else { item.detach(Dungeon.hero.belongings.backpack); - result.collect(); + if (!result.collect()){ + Dungeon.level.drop(result, curUser.pos).sprite.drop(); + } } if (result.isIdentified()){ Catalog.setSeen(result.getClass()); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfEnchantment.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfEnchantment.java index 7789e7fed..93650273b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfEnchantment.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfEnchantment.java @@ -60,7 +60,9 @@ public class ScrollOfEnchantment extends ExoticScroll { enchants[2] = Weapon.Enchantment.random( existing, enchants[0].getClass(), enchants[1].getClass()); GameScene.show(new WndOptions(Messages.titleCase(ScrollOfEnchantment.this.name()), - Messages.get(ScrollOfEnchantment.class, "weapon"), + Messages.get(ScrollOfEnchantment.class, "weapon") + + "\n\n" + + Messages.get(ScrollOfEnchantment.class, "cancel_warn"), enchants[0].name(), enchants[1].name(), enchants[2].name(), @@ -78,6 +80,11 @@ public class ScrollOfEnchantment extends ExoticScroll { Enchanting.show(curUser, item); } } + + @Override + public void onBackPressed() { + //do nothing, reader has to cancel + } }); } else if (item instanceof Armor) { @@ -90,7 +97,9 @@ public class ScrollOfEnchantment extends ExoticScroll { glyphs[2] = Armor.Glyph.random( existing, glyphs[0].getClass(), glyphs[1].getClass()); GameScene.show(new WndOptions(Messages.titleCase(ScrollOfEnchantment.this.name()), - Messages.get(ScrollOfEnchantment.class, "armor"), + Messages.get(ScrollOfEnchantment.class, "armor") + + "\n\n" + + Messages.get(ScrollOfEnchantment.class, "cancel_warn"), glyphs[0].name(), glyphs[1].name(), glyphs[2].name(), @@ -108,6 +117,11 @@ public class ScrollOfEnchantment extends ExoticScroll { Enchanting.show(curUser, item); } } + + @Override + public void onBackPressed() { + //do nothing, reader has to cancel + } }); } else { //TODO if this can ever be found un-IDed, need logic for that diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfIntuition.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfIntuition.java index 5ac9d26b1..0be0ee6d4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfIntuition.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfIntuition.java @@ -38,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfParalyticG import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfPurity; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfToxicGas; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.ExoticPotion; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfLullaby; @@ -52,6 +53,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportat import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTerror; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTransmutation; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; @@ -167,15 +169,42 @@ public class StoneOfIntuition extends InventoryStone { HashSet> unIDed = new HashSet<>(); final Class[] all; + final int row; if (item.isIdentified()){ hide(); return; } else if (item instanceof Potion){ unIDed.addAll(Potion.getUnknown()); - all = potions; + all = potions.clone(); + if (item instanceof ExoticPotion){ + row = 8; + for (int i = 0; i < all.length; i++){ + all[i] = ExoticPotion.regToExo.get(all[i]); + } + HashSet> exoUID = new HashSet<>(); + for (Class i : unIDed){ + exoUID.add(ExoticPotion.regToExo.get(i)); + } + unIDed = exoUID; + } else { + row = 0; + } } else if (item instanceof Scroll){ unIDed.addAll(Scroll.getUnknown()); - all = scrolls; + all = scrolls.clone(); + if (item instanceof ExoticScroll){ + row = 24; + for (int i = 0; i < all.length; i++){ + all[i] = ExoticScroll.regToExo.get(all[i]); + } + HashSet> exoUID = new HashSet<>(); + for (Class i : unIDed){ + exoUID.add(ExoticScroll.regToExo.get(i)); + } + unIDed = exoUID; + } else { + row = 16; + } } else { hide(); return; @@ -206,7 +235,7 @@ public class StoneOfIntuition extends InventoryStone { super.onClick(); } }; - Image im = new Image(Assets.CONS_ICONS, 7*i, all == potions ? 0 : 16, 7, 8); + Image im = new Image(Assets.CONS_ICONS, 7*i, row, 7, 8); im.scale.set(2f); btn.icon(im); btn.setRect(left + placed*BTN_SIZE, top, BTN_SIZE, BTN_SIZE); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java index a8ea8db2f..e88125601 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java @@ -161,7 +161,7 @@ public class WandOfCorruption extends Wand { //cannot re-corrupt or doom an enemy, so give them a major debuff instead if(enemy.buff(Corruption.class) != null || enemy.buff(Doom.class) != null){ - enemyResist = corruptingPower*.99f; + corruptingPower = enemyResist - 0.001f; } if (corruptingPower > enemyResist){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretLaboratoryRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretLaboratoryRoom.java index c2e57e9ca..2605f6ee9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretLaboratoryRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretLaboratoryRoom.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.secret; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Alchemy; +import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfExperience; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfFrost; @@ -70,9 +71,7 @@ public class SecretLaboratoryRoom extends SecretRoom { Point pot = center(); Painter.set( level, pot, Terrain.ALCHEMY ); - Alchemy alchemy = new Alchemy(); - alchemy.seed( level, pot.x + level.width() * pot.y, 1+Random.NormalIntRange(20, 30) ); - level.blobs.put( Alchemy.class, alchemy ); + Blob.seed( pot.x + level.width() * pot.y, 1+Random.NormalIntRange(20, 30), Alchemy.class, level ); int n = Random.IntRange( 2, 3 ); HashMap, Float> chances = new HashMap<>(potionChances); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LaboratoryRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LaboratoryRoom.java index 8f1a9eca9..b0de353a7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LaboratoryRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LaboratoryRoom.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Alchemy; +import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.journal.AlchemyPage; @@ -60,10 +61,8 @@ public class LaboratoryRoom extends SpecialRoom { } Painter.set( level, pot, Terrain.ALCHEMY ); - Alchemy alchemy = new Alchemy(); int chapter = 1 + Dungeon.depth/5; - alchemy.seed( level, pot.x + level.width() * pot.y, 1 + chapter*10 + Random.NormalIntRange(0, 10) ); - level.blobs.put( Alchemy.class, alchemy ); + Blob.seed( pot.x + level.width() * pot.y, 1 + chapter*10 + Random.NormalIntRange(0, 10), Alchemy.class, level ); int n = Random.NormalIntRange( 2, 3 ); for (int i=0; i < n; i++) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java index 8fcd1a85f..fe5657edf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java @@ -42,7 +42,7 @@ public class Swiftthistle extends Plant { public void activate() { Char ch = Actor.findChar(pos); if (ch == Dungeon.hero) { - Buff.affect(ch, TimeBubble.class); + Buff.affect(ch, TimeBubble.class).reset(); } } @@ -56,7 +56,7 @@ public class Swiftthistle extends Plant { public static class TimeBubble extends Buff { - private float left = 6f; + private float left; private int pos; { @@ -74,14 +74,9 @@ public class Swiftthistle extends Plant { if (left < 4) FlavourBuff.greyIcon(icon, 4f, left); } - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)){ - pos = target.pos; - return true; - } else { - return false; - } + public void reset(){ + pos = target.pos; + left = 6f; } public void processTime( float time ){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTileSheet.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTileSheet.java index 6f66d2848..e48a3015c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTileSheet.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTileSheet.java @@ -144,6 +144,7 @@ public class DungeonTileSheet { chasmStitcheable.put( Terrain.DOOR, CHASM_WALL ); chasmStitcheable.put( Terrain.OPEN_DOOR, CHASM_WALL ); chasmStitcheable.put( Terrain.LOCKED_DOOR, CHASM_WALL ); + chasmStitcheable.put( Terrain.SECRET_DOOR, CHASM_WALL ); chasmStitcheable.put( Terrain.WALL_DECO, CHASM_WALL ); //water 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 268ea8e9b..e4f635ae0 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 @@ -202,8 +202,8 @@ actors.buffs.ooze.desc=This sticky acid clings to flesh, slowly melting it away. actors.buffs.paralysis.name=Paralysed actors.buffs.paralysis.heromsg=You are paralysed! -actors.buffs.paralysis.out=The pain snaps %s out of paralysis. -actors.buffs.paralysis.desc=Oftentimes the worst thing to do is nothing at all.\n\nParalysis completely halts all actions, forcing the target to wait until the effect wears off. The pain from taking damage can also cause characters to snap out of paralysis.\n\nTurns of paralysis remaining: %s. +actors.buffs.paralysis.out=resisted paralysis +actors.buffs.paralysis.desc=Oftentimes the worst thing to do is nothing at all.\n\nParalysis completely halts all actions, forcing the target to wait until the effect wears off. The pain from taking damage can cause characters to resist paralysis, breaking them out of the effect.\n\nTurns of paralysis remaining: %s. actors.buffs.poison.name=Poisoned actors.buffs.poison.heromsg=You are poisoned! diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index 27bae2742..8d3d7943f 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -855,6 +855,7 @@ items.scrolls.exotic.scrollofenchantment.name=scroll of enchantment items.scrolls.exotic.scrollofenchantment.inv_title=Enchant an item items.scrolls.exotic.scrollofenchantment.weapon=Select an enchantment to apply to your weapon. items.scrolls.exotic.scrollofenchantment.armor=Select a glyph to apply to your armor. +items.scrolls.exotic.scrollofenchantment.cancel_warn=Cancelling with still consume the scroll. items.scrolls.exotic.scrollofenchantment.cancel=cancel items.scrolls.exotic.scrollofenchantment.desc=This scroll will infuse a weapon or armor with powerful magical energy. The reader even has some degree of control over which magic is imbued.