diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 3ce8c65f9..1cbe7578b 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -726,7 +726,7 @@ items.potions.exotic.exoticpotion.no=No, I changed my mind items.potions.exotic.potionofcleansing.name=potion of cleansing items.potions.exotic.potionofcleansing.desc=This powerful reagent will render the drinker immune to all harmful effects for a few turns when quaffed. It can be thrown at a target to cleanse them as well. items.potions.exotic.potionofcleansing$cleanse.name=Cleansed -items.potions.exotic.potionofcleansing$cleanse.desc=A potion of cleansing is granting this character temporary immunity from all harmful effects!\n\nTurns remaining: %s. +items.potions.exotic.potionofcleansing$cleanse.desc=This character is temporarily immune to all harmful effects!\n\nTurns remaining: %s. items.potions.exotic.potionofcorrosivegas.name=potion of corrosive gas items.potions.exotic.potionofcorrosivegas.desc=Uncorking or shattering this pressurized glass will cause its contents to explode into a deadly cloud of corrosive rust-colored gas. The gas spreads more quickly than toxic gas and is more deadly, but also won't last as long. @@ -1547,6 +1547,9 @@ items.weapon.missiles.darts.blindingdart.desc=These darts are tipped with a blin items.weapon.missiles.darts.chillingdart.name=chilling dart items.weapon.missiles.darts.chillingdart.desc=These darts are tipped with an icecap-based compound which will significantly chill their target. +items.weapon.missiles.darts.cleansingdart.name=cleansing dart +items.weapon.missiles.darts.cleansingdart.desc=These darts are tipped with a dreamfoil-based compound which will temporarily make their target immune to all negative effects. The dart itself is still harmful to enemies, but will not harm allies. + items.weapon.missiles.darts.dart.name=dart items.weapon.missiles.darts.dart.ac_tip=TIP items.weapon.missiles.darts.dart.prompt=Select a seed @@ -1578,14 +1581,11 @@ items.weapon.missiles.darts.poisondart.name=poison dart items.weapon.missiles.darts.poisondart.desc=These darts are tipped with a sorrowmoss-based compound which will poison their target. items.weapon.missiles.darts.rotdart.name=rot dart -items.weapon.missiles.darts.rotdart.desc=These wicked darts are tipped with an acidic rotberry-based compound, which will aggressively eat through anything the dart comes into contact with. Powerful foes will resist most of the effect, but the corrosion is strong enough to easily kill most standard enemies. Unfortunately, the compound is unstable, and will always expire after a single use. +items.weapon.missiles.darts.rotdart.desc=These wicked darts are tipped with an acidic rotberry-based compound, which will aggressively eat through anything the dart comes into contact with. Powerful foes will resist most of the effect, but the corrosion is strong enough to easily kill most standard enemies. These last longer than other tipped darts, but their durability cannot be boosted. items.weapon.missiles.darts.shockingdart.name=shocking dart items.weapon.missiles.darts.shockingdart.desc=These darts are tipped with a stormvine-based compound which will deliver a nasty shock to their target. -items.weapon.missiles.darts.sleepdart.name=sleep dart -items.weapon.missiles.darts.sleepdart.desc=These darts are tipped with a dreamfoil-based compound which will instantly put their target into a light sleep. - items.weapon.missiles.darts.tippeddart.ac_clean=CLEAN items.weapon.missiles.darts.tippeddart.clean_title=Clean Darts items.weapon.missiles.darts.tippeddart.clean_desc=This action will remove the seed tipping on your darts, reverting them back to regular darts. diff --git a/core/src/main/assets/messages/plants/plants.properties b/core/src/main/assets/messages/plants/plants.properties index 62d3ef31a..15a7774a4 100644 --- a/core/src/main/assets/messages/plants/plants.properties +++ b/core/src/main/assets/messages/plants/plants.properties @@ -9,7 +9,7 @@ plants.blindweed$seed.name=seed of blindweed plants.dreamfoil.name=dreamfoil plants.dreamfoil.refreshed=You feel refreshed. -plants.dreamfoil.desc=The dreamfoil's prickly flowers contain a chemical which is known for its properties as a strong neutralizing agent. Most weaker creatures are overwhelmed and knocked unconscious, which gives the plant its namesake. +plants.dreamfoil.desc=The dreamfoil's prickly flowers contain a chemical which is known for its properties as a strong neutralizing agent. Anything that steps in this plant will be cleansed of many negative effects. plants.dreamfoil.warden_desc=In addition to the neutralizing effect, _the Warden_ will become temporarily immune to all area-bound effects when stepping on dreamfoil. plants.dreamfoil$seed.name=seed of dreamfoil diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java index 0ea3acd18..bdc6ef42a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -47,6 +47,11 @@ public class ShatteredPixelDungeon extends Game { public ShatteredPixelDungeon( PlatformSupport platform ) { super( sceneClass == null ? WelcomeScene.class : sceneClass, platform ); + //v1.2.0 + com.watabou.utils.Bundle.addAlias( + com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.CleansingDart.class, + "com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.SleepDart" ); + //v1.1.0 com.watabou.utils.Bundle.addAlias( com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfDread.class, diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCleansing.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCleansing.java index 7bed4f88a..419288404 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCleansing.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCleansing.java @@ -66,8 +66,12 @@ public class PotionOfCleansing extends ExoticPotion { } } } - + public static void cleanse(Char ch){ + cleanse(ch, Cleanse.DURATION); + } + + public static void cleanse(Char ch, float duration){ for (Buff b : ch.buffs()){ if (b.type == Buff.buffType.NEGATIVE && !(b instanceof AllyBuff) @@ -78,7 +82,7 @@ public class PotionOfCleansing extends ExoticPotion { ((Hunger) b).satisfy(Hunger.STARVING); } } - Buff.affect(ch, Cleanse.class, Cleanse.DURATION); + Buff.affect(ch, Cleanse.class, duration); } public static class Cleanse extends FlavourBuff { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/AdrenalineDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/AdrenalineDart.java index 8f09e54a8..109684c52 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/AdrenalineDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/AdrenalineDart.java @@ -35,7 +35,7 @@ public class AdrenalineDart extends TippedDart { @Override public int proc(Char attacker, Char defender, int damage) { - Buff.prolong( defender, Adrenaline.class, Adrenaline.DURATION); + Buff.prolong( defender, Adrenaline.class, 3*Adrenaline.DURATION); if (attacker.alignment == defender.alignment){ return 0; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/SleepDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/CleansingDart.java similarity index 67% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/SleepDart.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/CleansingDart.java index 9dcbd63fd..ca64b2f41 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/SleepDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/CleansingDart.java @@ -22,29 +22,24 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfCleansing; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; -public class SleepDart extends TippedDart { +public class CleansingDart extends TippedDart { { - image = ItemSpriteSheet.SLEEP_DART; + image = ItemSpriteSheet.CLEANSING_DART; } @Override public int proc(Char attacker, final Char defender, int damage) { - - //need to delay this so damage from the dart doesn't break the sleep - new FlavourBuff(){ - {actPriority = VFX_PRIO;} - public boolean act() { - Buff.affect( defender, Sleep.class ); - return super.act(); - } - }.attachTo(defender); - + + PotionOfCleansing.cleanse(defender, PotionOfCleansing.Cleanse.DURATION*2f); + + if (attacker.alignment == defender.alignment){ + return 0; + } + return super.proc(attacker, defender, damage); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/DisplacingDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/DisplacingDart.java index d48fd0e6a..04247c393 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/DisplacingDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/DisplacingDart.java @@ -24,6 +24,8 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TalismanOfForesight; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; import com.shatteredpixel.shatteredpixeldungeon.mechanics.ShadowCaster; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -40,50 +42,58 @@ public class DisplacingDart extends TippedDart { image = ItemSpriteSheet.DISPLACING_DART; } - int distance = 8; - @Override public int proc(Char attacker, Char defender, int damage) { - + + //attempts to teleport the enemy to a position 8-10 cells away from the hero + //prioritizes the closest visible cell to the defender, or closest non-visible if no visible are present + //grants vision on the defender if teleport goes to non-visible if (!defender.properties().contains(Char.Property.IMMOVABLE)){ - int startDist = Dungeon.level.distance(attacker.pos, defender.pos); - - HashMap> positions = new HashMap<>(); + ArrayList visiblePositions = new ArrayList<>(); + ArrayList nonVisiblePositions = new ArrayList<>(); - PathFinder.buildDistanceMap(defender.pos, BArray.or(Dungeon.level.passable, Dungeon.level.avoid, null)); + PathFinder.buildDistanceMap(attacker.pos, BArray.or(Dungeon.level.passable, Dungeon.level.avoid, null)); for (int pos = 0; pos < Dungeon.level.length(); pos++){ - if (Dungeon.level.heroFOV[pos] - && Dungeon.level.passable[pos] - && PathFinder.distance[pos] != Integer.MAX_VALUE + if (Dungeon.level.passable[pos] + && PathFinder.distance[pos] >= 8 + && PathFinder.distance[pos] <= 10 && (!Char.hasProp(defender, Char.Property.LARGE) || Dungeon.level.openSpace[pos]) && Actor.findChar(pos) == null){ - - int dist = Dungeon.level.distance(attacker.pos, pos); - if (dist > startDist){ - if (positions.get(dist) == null){ - positions.put(dist, new ArrayList()); - } - positions.get(dist).add(pos); + + if (Dungeon.level.heroFOV[pos]){ + visiblePositions.add(pos); + } else { + nonVisiblePositions.add(pos); + } + + } + } + + int chosenPos = -1; + + if (!visiblePositions.isEmpty()) { + for (int pos : visiblePositions) { + if (chosenPos == -1 || Dungeon.level.trueDistance(defender.pos, chosenPos) + > Dungeon.level.trueDistance(defender.pos, pos)){ + chosenPos = pos; + } + } + } else { + for (int pos : nonVisiblePositions) { + if (chosenPos == -1 || Dungeon.level.trueDistance(defender.pos, chosenPos) + > Dungeon.level.trueDistance(defender.pos, pos)){ + chosenPos = pos; } - } } - float[] probs = new float[distance+1]; - - for (int i = 0; i <= distance; i++){ - if (positions.get(i) != null){ - probs[i] = i - startDist; + if (chosenPos != -1){ + ScrollOfTeleportation.appear( defender, chosenPos ); + if (!Dungeon.level.heroFOV[chosenPos]){ + Buff.affect(attacker, TalismanOfForesight.CharAwareness.class, 5f).charID = defender.id(); } - } - - int chosenDist = Random.chances(probs); - - if (chosenDist != -1){ - int pos = positions.get(chosenDist).get(Random.index(positions.get(chosenDist))); - ScrollOfTeleportation.appear( defender, pos ); Dungeon.level.occupyCell(defender ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/HolyDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/HolyDart.java index 5f8b5548a..487e8ae81 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/HolyDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/HolyDart.java @@ -35,7 +35,7 @@ public class HolyDart extends TippedDart { @Override public int proc(Char attacker, Char defender, int damage) { - Buff.affect(defender, Bless.class, Bless.DURATION); + Buff.affect(defender, Bless.class, Math.round(3.33f*Bless.DURATION)); if (attacker.alignment == defender.alignment){ return 0; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/PoisonDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/PoisonDart.java index 5b5ebd1bc..f8f738d6f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/PoisonDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/PoisonDart.java @@ -36,7 +36,7 @@ public class PoisonDart extends TippedDart { @Override public int proc(Char attacker, Char defender, int damage) { - Buff.affect( defender, Poison.class ).set( 3 + Dungeon.depth / 3 ); + Buff.affect( defender, Poison.class ).set( 3 + Dungeon.depth / 2 ); return super.proc(attacker, defender, damage); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/RotDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/RotDart.java index 9d47a8b43..d807a9c99 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/RotDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/RotDart.java @@ -49,6 +49,6 @@ public class RotDart extends TippedDart { @Override public float durabilityPerUse() { - return 100f; + return 20f; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/ShockingDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/ShockingDart.java index a8b9489c6..72ddcbbf7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/ShockingDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/ShockingDart.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.effects.Lightning; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; @@ -41,7 +42,7 @@ public class ShockingDart extends TippedDart { @Override public int proc(Char attacker, Char defender, int damage) { - defender.damage(Random.NormalIntRange(8, 12), this); + defender.damage(Random.NormalIntRange(5 + Dungeon.depth/4, 10 + Dungeon.depth/4), this); CharSprite s = defender.sprite; if (s != null && s.parent != null) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java index dda1554f7..9b9efc673 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java @@ -173,7 +173,7 @@ public abstract class TippedDart extends Dart { private static HashMap, Class> types = new HashMap<>(); static { types.put(Blindweed.Seed.class, BlindingDart.class); - types.put(Dreamfoil.Seed.class, SleepDart.class); + types.put(Dreamfoil.Seed.class, CleansingDart.class); types.put(Earthroot.Seed.class, ParalyticDart.class); types.put(Fadeleaf.Seed.class, DisplacingDart.class); types.put(Firebloom.Seed.class, IncendiaryDart.class); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Dreamfoil.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Dreamfoil.java index 093aad3f6..4955d6e87 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Dreamfoil.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Dreamfoil.java @@ -44,16 +44,14 @@ public class Dreamfoil extends Plant { public void activate( Char ch ) { if (ch != null) { - if (ch instanceof Mob) { - Buff.affect(ch, MagicalSleep.class); - } else if (ch instanceof Hero){ + PotionOfHealing.cure(ch); + + if (ch instanceof Hero) { GLog.i( Messages.get(this, "refreshed") ); - PotionOfHealing.cure(ch); - + if (((Hero) ch).subClass == HeroSubClass.WARDEN){ Buff.affect(ch, BlobImmunity.class, BlobImmunity.DURATION/2f); } - } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java index 66bee7578..1e19bf6a0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java @@ -332,7 +332,7 @@ public class ItemSpriteSheet { public static final int CHILLING_DART = TIPPED_DARTS+4; public static final int SHOCKING_DART = TIPPED_DARTS+5; public static final int POISON_DART = TIPPED_DARTS+6; - public static final int SLEEP_DART = TIPPED_DARTS+7; + public static final int CLEANSING_DART = TIPPED_DARTS+7; public static final int PARALYTIC_DART = TIPPED_DARTS+8; public static final int HOLY_DART = TIPPED_DARTS+9; public static final int DISPLACING_DART = TIPPED_DARTS+10;