From 82a428233b7bd0057e756ca21046442d31e4ce3c Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 7 May 2015 20:48:59 -0400 Subject: [PATCH] v0.3.0: first round of buff descriptions --- .../actors/buffs/Amok.java | 9 ++++ .../actors/buffs/Barkskin.java | 10 +++++ .../actors/buffs/Bleeding.java | 10 +++++ .../actors/buffs/Blindness.java | 11 +++++ .../actors/buffs/Buff.java | 6 +++ .../actors/buffs/Charm.java | 10 +++++ .../actors/buffs/Combo.java | 13 +++++- .../actors/buffs/Cripple.java | 9 ++++ .../actors/buffs/Fury.java | 9 ++++ .../actors/buffs/GasesImmunity.java | 10 +++++ .../actors/buffs/Light.java | 9 ++++ .../actors/buffs/LockedFloor.java | 45 ++++++++++++------- .../actors/buffs/MindVision.java | 11 +++++ .../items/armor/glyphs/Viscosity.java | 12 ++++- .../plants/Earthroot.java | 20 ++++++++- 15 files changed, 173 insertions(+), 21 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Amok.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Amok.java index 23c6c46b8..28d745e51 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Amok.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Amok.java @@ -42,4 +42,13 @@ public class Amok extends FlavourBuff { public String toString() { return "Amok"; } + + @Override + public String desc() { + return "Amok causes a state of great rage and confusion in its target.\n" + + "\n" + + "When a creature is amoked, they will attack whatever is near them, whether they be friend or foe.\n" + + "\n" + + "The amok will last for " + dispTurns() + "."; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Barkskin.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Barkskin.java index 63cab58bc..1bafa8d05 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Barkskin.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Barkskin.java @@ -60,4 +60,14 @@ public class Barkskin extends Buff { public String toString() { return "Barkskin"; } + + @Override + public String desc() { + return "Your skin is hardened, it feels rough and solid like bark.\n" + + "\n" + + "The hardened skin increases your effective armor, allowing you to better defend against physical attack. " + + "The armor bonus will decrease by one point each turn until it expires.\n" + + "\n" + + "Your armor is currently increased by " + level +"."; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Bleeding.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Bleeding.java index d35353569..a3e28403d 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Bleeding.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Bleeding.java @@ -94,4 +94,14 @@ public class Bleeding extends Buff { return true; } + + @Override + public String desc() { + return "That wound is leaking a worrisome amount of blood.\n" + + "\n" + + "Bleeding causes damage every turn. Each turn the damage decreases by a random amount, " + + "until the bleeding eventually stops.\n" + + "\n" + + "The bleeding can currently deal " + level + " max damage."; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Blindness.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Blindness.java index 5e12430c5..97d819012 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Blindness.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Blindness.java @@ -41,4 +41,15 @@ public class Blindness extends FlavourBuff { public String toString() { return "Blinded"; } + + @Override + public String desc() { + return "Blinding turns the surrounding world into a dark haze.\n" + + "\n" + + "While blinded, a character can't see more than one tile infront of themselves, rendering ranged " + + "attacks useless and making it very easy to lose track of distant enemies. Additionally, a blinded " + + "hero is unable to read scrolls or books.\n" + + "\n" + + "The blindness will last for " + dispTurns() + "."; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Buff.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Buff.java index b5ae93bd9..d0000b0a1 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Buff.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Buff.java @@ -21,6 +21,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; +import java.text.DecimalFormat; import java.util.HashSet; public class Buff extends Actor { @@ -75,6 +76,11 @@ public class Buff extends Actor { return ""; } + //to handle the common case of showing how many turns are remaining in a buff description. + protected String dispTurns() { + return cooldown() == 1 ? "1 more turn" : new DecimalFormat("#.##").format(cooldown()) + " more turns"; + } + public static T append( Char target, Class buffClass ) { try { T buff = buffClass.newInstance(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Charm.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Charm.java index e75934fc5..205fcdf2a 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Charm.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Charm.java @@ -58,4 +58,14 @@ public class Charm extends FlavourBuff { Resistance r = ch.buff( Resistance.class ); return r != null ? r.durationFactor() : 1; } + + @Override + public String desc() { + return "A charm is manipulative magic that can make enemies temporarily adore eachother.\n" + + "\n" + + "Characters affected by charm are unable to directly attack the enemy they are charmed by. " + + "Attacking other targets is still possible however.\n" + + "\n" + + "The charm will last for " + dispTurns() + "."; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java index 6f00f5f07..0fa9f3d6e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java @@ -63,5 +63,16 @@ public class Combo extends Buff { detach(); return true; } - + + @Override + public String desc() { + return "Through building momentum, the gladiator deals bonus damage.\n" + + "\n" + + "Your combo will keep building with quick attacks that do not miss. " + + "The higher your combo gets, the faster your attacks will need to be. " + + "failing to land a hit quickly enough will reset the combo.\n" + + "\n" + + (count <= 2 ? "Your combo has not built up enough to give you bonus damage yet." : + "Your combo is currently giving you " + ((count - 2) / 5f) + " % bonus damage."); + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Cripple.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Cripple.java index 419bba762..cef107865 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Cripple.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Cripple.java @@ -36,4 +36,13 @@ public class Cripple extends FlavourBuff { public String toString() { return "Crippled"; } + + @Override + public String desc() { + return "You're pretty sure legs aren't meant to bend that way.\n" + + "\n" + + "Crippled halves movement speed, making moving a tile usually take two turns instead of one.\n" + + "\n" + + "This cripple will last for " + dispTurns() + "."; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Fury.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Fury.java index 622b86207..f8a81e9b9 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Fury.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Fury.java @@ -47,4 +47,13 @@ public class Fury extends Buff { public String toString() { return "Furious"; } + + @Override + public String desc() { + return "You are angry, enemies won't like you when you're angry.\n" + + "\n" + + "A great rage burns within you, increasing the damage you deal with physical attacks by 50%. \n" + + "\n" + + "This rage will last as long as you are injured below 40% health.\n"; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/GasesImmunity.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/GasesImmunity.java index 5c8c6c937..b1dca3873 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/GasesImmunity.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/GasesImmunity.java @@ -45,4 +45,14 @@ public class GasesImmunity extends FlavourBuff { immunities.add( StenchGas.class ); immunities.add( VenomGas.class ); } + + @Override + public String desc() { + return "some strange force is filtering out the air around you, it's not causing you any harm, but it blocks " + + "out everything but air so effectively you can't even smell anything!\n" + + "\n" + + "You are immune to the effects of all gasses while this buff lasts.\n" + + "\n" + + "You will be immune for " + dispTurns() + "."; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Light.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Light.java index cfeac9938..1863c43e4 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Light.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Light.java @@ -62,4 +62,13 @@ public class Light extends FlavourBuff { public String toString() { return "Illuminated"; } + + @Override + public String desc() { + return "Even in the Darkest Dungeon, a steady light at your side is always comforting.\n" + + "\n" + + "Light helps keep darkness at bay, allowing you to see a reasonable distance despite the environment.\n" + + "\n" + + "The light will last for " + dispTurns() + "."; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/LockedFloor.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/LockedFloor.java index fd62a7e5d..c674315ac 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/LockedFloor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/LockedFloor.java @@ -7,27 +7,38 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; * Created by Evan on 04/04/2015. */ public class LockedFloor extends Buff { - //this buff is purely meant as a visual indicator that the gameplay implications of a level seal are in effect. + //this buff is purely meant as a visual indicator that the gameplay implications of a level seal are in effect. + @Override + public boolean act() { + spend(TICK); - @Override - public boolean act() { - spend(TICK); + if (!Dungeon.level.locked) + detach(); - if (!Dungeon.level.locked) - detach(); + return true; + } - return true; - } + @Override + public int icon() { + return BuffIndicator.LOCKED_FLOOR; + } - @Override - public int icon() { - return BuffIndicator.LOCKED_FLOOR; - } - - @Override - public String toString() { - return "Floor is Locked"; - } + @Override + public String toString() { + return "Floor is Locked"; + } + @Override + public String desc() { + return "The current floor is locked, and you are unable to leave it!\n" + + "\n" + + "While a floor is locked, you will not gain hunger, or take damage from starving, " + + "but your current hunger state is still in effect. For example, if you are starving you won't take " + + "damage, but will still not regenerate health.\n" + + "\n" + + "Additionally, if you are revived by an unblessed ankh while the floor is locked, then it will reset.\n" + + "\n" + + "Kill this floor's boss to break the lock.\n"; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/MindVision.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/MindVision.java index 0a2342ac8..5b19a2099 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/MindVision.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/MindVision.java @@ -45,4 +45,15 @@ public class MindVision extends FlavourBuff { super.detach(); Dungeon.observe(); } + + @Override + public String desc() { + return "Somehow you are able to see all creatures on this floor through your mind. It's a weird feeling.\n" + + "\n" + + "All characters on this floor are visible to you as long as you have mind vision. " + + "Seeing a creature through mind vision counts as it being seen or nearby for " + + "the purposes of many magical effects.\n" + + "\n" + + "The mind vision will last for " + dispTurns() + "."; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java index a00448f87..739c58080 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java @@ -116,7 +116,7 @@ public class Viscosity extends Glyph { @Override public String toString() { - return Utils.format( "Defered damage (%d)", damage ); + return Utils.format( "Defered damage", damage ); } @Override @@ -146,5 +146,15 @@ public class Viscosity extends Glyph { return true; } + + @Override + public String desc() { + return "While your armor's glyph has protected you from damage, it seems to be slowly paying you back for it.\n" + + "\n" + + "Damage is being dealt to you over time instead of immediately. " + + "You will take one damage per turn until there is no damage left.\n" + + "\n" + + "There is " + damage + " deffered damage left."; + } } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java b/src/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java index 253cd7d60..86d73bd39 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java @@ -84,6 +84,10 @@ public class Earthroot extends Plant { private int pos; private int level; + + { + type = buffType.POSITIVE; + } @Override public boolean attachTo( Char target ) { @@ -123,9 +127,21 @@ public class Earthroot extends Plant { @Override public String toString() { - return Utils.format("Herbal armor (%d)", level); + return Utils.format("Herbal armor", level); } - + + @Override + public String desc() { + return "A kind of natural, immobile armor is protecting you. " + + "The armor forms plates of bark and twine, wrapping around your body.\n" + + "\n" + + "This herbal armor will absorb 50% of all physical damage you take, " + + "until it eventually runs out of durability and collapses. The armor is also immobile, " + + "if you attempt to move it will break apart and be lost.\n" + + "\n" + + "The herbal armor can absorb " + level + " more damage before breaking."; + } + private static final String POS = "pos"; private static final String LEVEL = "level";