From d940f2457187edc6b0ce1240f8fcbf830769f935 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 13 Feb 2019 21:36:59 -0500 Subject: [PATCH] v0.7.2: small adjustments/fixes: - improved description for rot lasher - cleaned up unused text in blandfruit and clarified description - fixed bombs rarely affecting tengu twice - guidebook pages default to collected in debug mode --- .../items/bombs/ArcaneBomb.java | 19 ++++++--- .../items/bombs/Bomb.java | 30 +++++++++----- .../items/bombs/HolyBomb.java | 30 +++++++++----- .../items/bombs/ShrapnelBomb.java | 21 +++++++--- .../journal/Document.java | 41 ++++++++++--------- .../messages/actors/actors.properties | 2 +- .../messages/items/items.properties | 6 +-- 7 files changed, 91 insertions(+), 58 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ArcaneBomb.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ArcaneBomb.java index b15ca9816..af57edeb7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ArcaneBomb.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ArcaneBomb.java @@ -34,6 +34,8 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; +import java.util.ArrayList; + public class ArcaneBomb extends Bomb { { @@ -61,6 +63,8 @@ public class ArcaneBomb extends Bomb { public void explode(int cell) { super.explode(cell); + ArrayList affected = new ArrayList<>(); + PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), 2 ); for (int i = 0; i < PathFinder.distance.length; i++) { if (PathFinder.distance[i] < Integer.MAX_VALUE) { @@ -69,14 +73,19 @@ public class ArcaneBomb extends Bomb { } Char ch = Actor.findChar(i); if (ch != null){ - //regular bomb damage, but pierces armor - int damage = Math.round(Random.NormalIntRange( Dungeon.depth+5, 10 + Dungeon.depth * 2 )); - ch.damage(damage, this); - if (ch == Dungeon.hero && !ch.isAlive()) - Dungeon.fail(Bomb.class); + affected.add(ch); } } } + + for (Char ch : affected){ + //regular bomb damage, but pierces armor + int damage = Math.round(Random.NormalIntRange( Dungeon.depth+5, 10 + Dungeon.depth * 2 )); + ch.damage(damage, this); + if (ch == Dungeon.hero && !ch.isAlive()){ + Dungeon.fail(Bomb.class); + } + } } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java index 485db3e7f..a88ae745e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java @@ -138,6 +138,9 @@ public class Bomb extends Item { Sample.INSTANCE.play( Assets.SND_BLAST ); if (explodesDestructively()) { + + ArrayList affected = new ArrayList<>(); + if (Dungeon.level.heroFOV[cell]) { CellEmitter.center(cell).burst(BlastParticle.FACTORY, 30); } @@ -163,21 +166,26 @@ public class Bomb extends Item { Char ch = Actor.findChar(c); if (ch != null) { - //those not at the center of the blast take damage less consistently. - int minDamage = c == cell ? Dungeon.depth + 5 : 1; - int maxDamage = 10 + Dungeon.depth * 2; - - int dmg = Random.NormalIntRange(minDamage, maxDamage) - ch.drRoll(); - if (dmg > 0) { - ch.damage(dmg, this); - } - - if (ch == Dungeon.hero && !ch.isAlive()) - Dungeon.fail(Bomb.class); + affected.add(ch); } } } + for (Char ch : affected){ + //those not at the center of the blast take damage less consistently. + int minDamage = ch.pos == cell ? Dungeon.depth + 5 : 1; + int maxDamage = 10 + Dungeon.depth * 2; + + int dmg = Random.NormalIntRange(minDamage, maxDamage) - ch.drRoll(); + if (dmg > 0) { + ch.damage(dmg, this); + } + + if (ch == Dungeon.hero && !ch.isAlive()) { + Dungeon.fail(Bomb.class); + } + } + if (terrainAffected) { Dungeon.observe(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/HolyBomb.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/HolyBomb.java index 9ebb5d02f..132f80108 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/HolyBomb.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/HolyBomb.java @@ -36,6 +36,8 @@ import com.watabou.noosa.audio.Sample; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; +import java.util.ArrayList; + public class HolyBomb extends Bomb { { @@ -50,22 +52,30 @@ public class HolyBomb extends Bomb { new Flare(10, 64).show(Dungeon.hero.sprite.parent, DungeonTilemap.tileCenterToWorld(cell), 2f); } + ArrayList affected = new ArrayList<>(); + PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), 2 ); for (int i = 0; i < PathFinder.distance.length; i++) { if (PathFinder.distance[i] < Integer.MAX_VALUE) { - Char n = Actor.findChar(i); - if (n != null) { - Buff.prolong(n, Blindness.class, 1f); - if (n.properties().contains(Char.Property.UNDEAD) || n.properties().contains(Char.Property.DEMONIC)){ - n.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10 ); - - //bomb deals an additional 67% damage to unholy enemies in a 5x5 range - int damage = Math.round(Random.NormalIntRange( Dungeon.depth+5, 10 + Dungeon.depth * 2 ) * 0.67f); - n.damage(damage, this); - } + Char ch = Actor.findChar(i); + if (ch != null) { + affected.add(ch); + } } } + + for (Char ch : affected){ + Buff.prolong(ch, Blindness.class, 1f); + if (ch.properties().contains(Char.Property.UNDEAD) || ch.properties().contains(Char.Property.DEMONIC)){ + ch.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10 ); + + //bomb deals an additional 67% damage to unholy enemies in a 5x5 range + int damage = Math.round(Random.NormalIntRange( Dungeon.depth+5, 10 + Dungeon.depth * 2 ) * 0.67f); + ch.damage(damage, this); + } + } + Sample.INSTANCE.play( Assets.SND_READ ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShrapnelBomb.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShrapnelBomb.java index b11514bf9..e0197783d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShrapnelBomb.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShrapnelBomb.java @@ -31,6 +31,8 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.utils.Point; import com.watabou.utils.Random; +import java.util.ArrayList; + public class ShrapnelBomb extends Bomb { { @@ -50,6 +52,8 @@ public class ShrapnelBomb extends Bomb { Point c = Dungeon.level.cellToPoint(cell); ShadowCaster.castShadow(c.x, c.y, FOV, Dungeon.level.losBlocking, 8); + ArrayList affected = new ArrayList<>(); + for (int i = 0; i < FOV.length; i++) { if (FOV[i]) { if (Dungeon.level.heroFOV[i] && !Dungeon.level.solid[i]) { @@ -58,15 +62,20 @@ public class ShrapnelBomb extends Bomb { } Char ch = Actor.findChar(i); if (ch != null){ - //regular bomb damage - int damage = Math.round(Random.NormalIntRange( Dungeon.depth+5, 10 + Dungeon.depth * 2 )); - damage -= ch.drRoll(); - ch.damage(damage, this); - if (ch == Dungeon.hero && !ch.isAlive()) - Dungeon.fail(Bomb.class); + affected.add(ch); } } } + + for (Char ch : affected){ + //regular bomb damage + int damage = Math.round(Random.NormalIntRange( Dungeon.depth+5, 10 + Dungeon.depth * 2 )); + damage -= ch.drRoll(); + ch.damage(damage, this); + if (ch == Dungeon.hero && !ch.isAlive()) { + Dungeon.fail(Bomb.class); + } + } } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Document.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Document.java index 3e553e9e5..cc77b3d85 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Document.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Document.java @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.journal; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.utils.Bundle; +import com.watabou.utils.DeviceCompat; import java.util.ArrayList; import java.util.Arrays; @@ -101,32 +102,32 @@ public enum Document { public static final String GUIDE_SEARCH_PAGE = "Examining_and_Searching"; static { - ADVENTURERS_GUIDE.pages.put(GUIDE_INTRO_PAGE, false); - ADVENTURERS_GUIDE.pages.put("Identifying", false); - ADVENTURERS_GUIDE.pages.put(GUIDE_SEARCH_PAGE, false); - ADVENTURERS_GUIDE.pages.put("Strength", false); - ADVENTURERS_GUIDE.pages.put("Food", false); - ADVENTURERS_GUIDE.pages.put("Levelling", false); - ADVENTURERS_GUIDE.pages.put("Surprise_Attacks", false); - ADVENTURERS_GUIDE.pages.put("Dieing", false); - ADVENTURERS_GUIDE.pages.put("Looting", false); - ADVENTURERS_GUIDE.pages.put("Magic", false); + ADVENTURERS_GUIDE.pages.put(GUIDE_INTRO_PAGE, DeviceCompat.isDebug()); + ADVENTURERS_GUIDE.pages.put("Identifying", DeviceCompat.isDebug()); + ADVENTURERS_GUIDE.pages.put(GUIDE_SEARCH_PAGE, DeviceCompat.isDebug()); + ADVENTURERS_GUIDE.pages.put("Strength", DeviceCompat.isDebug()); + ADVENTURERS_GUIDE.pages.put("Food", DeviceCompat.isDebug()); + ADVENTURERS_GUIDE.pages.put("Levelling", DeviceCompat.isDebug()); + ADVENTURERS_GUIDE.pages.put("Surprise_Attacks", DeviceCompat.isDebug()); + ADVENTURERS_GUIDE.pages.put("Dieing", DeviceCompat.isDebug()); + ADVENTURERS_GUIDE.pages.put("Looting", DeviceCompat.isDebug()); + ADVENTURERS_GUIDE.pages.put("Magic", DeviceCompat.isDebug()); //sewers - ALCHEMY_GUIDE.pages.put("Potions", false); - ALCHEMY_GUIDE.pages.put("Stones", false); - ALCHEMY_GUIDE.pages.put("Darts", false); + ALCHEMY_GUIDE.pages.put("Potions", DeviceCompat.isDebug()); + ALCHEMY_GUIDE.pages.put("Stones", DeviceCompat.isDebug()); + ALCHEMY_GUIDE.pages.put("Darts", DeviceCompat.isDebug()); //prison - ALCHEMY_GUIDE.pages.put("Exotic_Potions", false); - ALCHEMY_GUIDE.pages.put("Exotic_Scrolls", false); - ALCHEMY_GUIDE.pages.put("Energy_Food", false); - ALCHEMY_GUIDE.pages.put("Bombs", false); + ALCHEMY_GUIDE.pages.put("Exotic_Potions", DeviceCompat.isDebug()); + ALCHEMY_GUIDE.pages.put("Exotic_Scrolls", DeviceCompat.isDebug()); + ALCHEMY_GUIDE.pages.put("Energy_Food", DeviceCompat.isDebug()); + ALCHEMY_GUIDE.pages.put("Bombs", DeviceCompat.isDebug()); //caves - ALCHEMY_GUIDE.pages.put("Catalysts", false); - ALCHEMY_GUIDE.pages.put("Brews_Elixirs", false); - ALCHEMY_GUIDE.pages.put("Spells", false); + ALCHEMY_GUIDE.pages.put("Catalysts", DeviceCompat.isDebug()); + ALCHEMY_GUIDE.pages.put("Brews_Elixirs", DeviceCompat.isDebug()); + ALCHEMY_GUIDE.pages.put("Spells", DeviceCompat.isDebug()); } private static final String DOCUMENTS = "documents"; 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 9436987c6..7b13684b5 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 @@ -533,7 +533,7 @@ actors.mobs.rotheart.name=rot heart actors.mobs.rotheart.desc=A Rotberry's fruit is very unique. Instead of rotting away and providing nutrients, the fruit grows, hardens, and encompasses the seed. It provides protection for the internal organs which grow inside the fruit. This giant orb is referred to as the heart of an adult rotberry plant. actors.mobs.rotlasher.name=rot lasher -actors.mobs.rotlasher.desc=The rot lasher is a part of a mature rotberry plant's root structure, and also their primary means of defense. Lashers are stuck into the ground, but will violently assault anything that gets near to them. When there is no nearby prey, they stand motionless, attempting to blend in with surrounding vegetation. +actors.mobs.rotlasher.desc=The rot lasher is a part of a mature rotberry plant's root structure, and also their primary means of defense. Lashers are stuck into the ground, but will violently assault any threat that gets near to them. When there is no nearby enemies, they stand motionless, attempting to blend in with surrounding vegetation. actors.mobs.rotlasher$waiting.status=This %s is idle. actors.mobs.scorpio.name=scorpio 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 10200f273..7570f0982 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 @@ -411,12 +411,8 @@ items.food.blandfruit.dreamfruit=dreamfruit items.food.blandfruit.starfruit=starfruit items.food.blandfruit.swiftfruit=swiftfruit items.food.blandfruit.raw=You can't bear to eat it raw. -items.food.blandfruit.ice_msg=The icefruit tastes a bit like Frozen Carpaccio. -items.food.blandfruit.fire_msg=You feel a great fire burning within you! -items.food.blandfruit.toxic_msg=You are imbued with vile toxic power! -items.food.blandfruit.para_msg=You feel the power of the earth coursing through you! items.food.blandfruit.desc=So dry and insubstantial, perhaps stewing it with another ingredient would improve it. -items.food.blandfruit.desc_cooked=The fruit has plumped up from its time soaking in the pot and has even absorbed the properties of the seed it was cooked with. +items.food.blandfruit.desc_cooked=The fruit has plumped up from its time soaking in the pot and has even absorbed the properties of the seed it was cooked with. It will have the effect of whatever potion the seed corresponded to. items.food.blandfruit.desc_eat=It looks ready to be eaten! items.food.blandfruit.desc_throw=It seems pretty volatile, it might be best to throw it. items.food.blandfruit$chunks.name=blandfruit chunks