From ea628b7212970555cd26fd83cdcb8dcfbcc4382b Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 14 May 2015 19:57:15 -0400 Subject: [PATCH] v0.3.0: buff descriptions round 3 plus some tweaks to displaying remaining turns. --- .../actors/buffs/Buff.java | 4 ++-- .../actors/buffs/Burning.java | 2 +- .../actors/buffs/Chill.java | 12 ++++++++++++ .../actors/buffs/FireImbue.java | 2 +- .../actors/buffs/FlavourBuff.java | 9 +++++++++ .../actors/buffs/Hunger.java | 18 ++++++++++++++++++ .../actors/buffs/Levitation.java | 11 +++++++++++ .../actors/buffs/Ooze.java | 11 ++++++++++- .../actors/buffs/Paralysis.java | 10 ++++++++++ .../actors/buffs/Poison.java | 9 +++++++++ .../actors/buffs/Slow.java | 9 +++++++++ .../actors/buffs/ToxicImbue.java | 2 +- 12 files changed, 93 insertions(+), 6 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Buff.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Buff.java index 967015246..574d5ef98 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Buff.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Buff.java @@ -81,8 +81,8 @@ public class Buff extends Actor { } //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"; + protected String dispTurns(float input){ + return input == 1 ? "1 more turn" : new DecimalFormat("#.##").format(input) + " more turns"; } public static T append( Char target, Class buffClass ) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java index b0b857830..2b0faadcf 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java @@ -160,7 +160,7 @@ public class Burning extends Buff implements Hero.Doom { "\n" + "Additionally, the fire may ignite flammable terrain or items that it comes into contact with.\n" + "\n" + - "The burning will last for " + dispTurns() + ", or until it is resisted or extinquished."; + "The burning will last for " + dispTurns(left) + ", or until it is resisted or extinquished."; } @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java index c56526bfb..439c571f9 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java @@ -13,6 +13,8 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.utils.Random; +import java.text.DecimalFormat; + /** * Created by debenhame on 23/04/2015. */ @@ -86,4 +88,14 @@ public class Chill extends FlavourBuff { return "Chilled"; } + @Override + public String desc() { + return "Not quite frozen, but still much too cold.\n" + + "\n" + + "Chilled targets perform all actions more slowly, depending on how many turns are left in the effect. " + + "At it's worst, this is equivalent to being slowed.\n" + + "\n" + + "This chilled will last for " + dispTurns() + ", " + + "and is currently reducing speed by " + new DecimalFormat("#.##").format(speedFactor()*100f) + "%"; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FireImbue.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FireImbue.java index 000190e3e..c2488dbf3 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FireImbue.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FireImbue.java @@ -78,7 +78,7 @@ public class FireImbue extends Buff { "All physical attacks will have a chance to light enemies ablaze. " + "Additionally, you are completely immune to the effects of fire.\n" + "\n" + - "You are imbued for " + dispTurns() + "."; + "You are imbued for " + dispTurns(left) + "."; } { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FlavourBuff.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FlavourBuff.java index d788cfcf8..1a8d9f31a 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FlavourBuff.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FlavourBuff.java @@ -17,6 +17,8 @@ */ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; +import java.text.DecimalFormat; + //buff whose only logic is to wait and detach after a time. public class FlavourBuff extends Buff { @@ -25,4 +27,11 @@ public class FlavourBuff extends Buff { detach(); return true; } + + //flavour buffs can all just rely on cooldown() + protected String dispTurns() { + //add one turn as buffs act last, we want them to end at 1 visually, even if they end at 0 internally. + float visualTurnsLeft = cooldown()+1f; + return visualTurnsLeft == 1 ? "1 more turn" : new DecimalFormat("#.##").format(visualTurnsLeft) + " more turns"; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java index 7537e0c1c..eb682fb0f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java @@ -177,6 +177,24 @@ public class Hunger extends Buff implements Hero.Doom { } } + @Override + public String desc() { + String result; + if (level < STARVING) { + result = "You can feel your stomach calling out for food, but it's not too urgent yet.\n\n"; + } else { + result = "You're so hungry it hurts.\n\n"; + } + + result += "Hunger slowly increases as you spend time in the dungeon, eventually you will begin to starve. " + + "While starving you will slowly lose health instead of regenerating it.\n" + + "\n" + + "Rationing is important! If you have health to spare starving isn't a bad idea if it means there will " + + "be more food later. Effective rationing can make food last a lot longer!\n\n"; + + return result; + } + @Override public void onDeath() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Levitation.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Levitation.java index c94806f08..16ee789c7 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Levitation.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Levitation.java @@ -59,4 +59,15 @@ public class Levitation extends FlavourBuff { public String toString() { return "Levitating"; } + + @Override + public String desc() { + return "A magical force is levitating you over the ground, making you feel weightless.\n" + + "\n " + + "While levitating you ignore all ground-based effects. Traps won't trigger, water won't put out fire, " + + "plants won't be trampled, roots will miss you, and you will hover right over pits. " + + "Be careful, as all these things can come into effect the second the levitation ends!\n" + + "\n" + + "You are levitating for " + dispTurns() + "."; + } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java index fdef21572..2c7ef8661 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java @@ -42,7 +42,16 @@ public class Ooze extends Buff { public String toString() { return "Caustic ooze"; } - + + @Override + public String desc() { + return "This sticky acid clings to flesh, slowly melting it away.\n" + + "\n" + + "Ooze will deal consistent damage until it is washed off in water.\n" + + "\n" + + "Ooze does not expire on its own and must be removed with water."; + } + @Override public boolean act() { if (target.isAlive()) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Paralysis.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Paralysis.java index 3bcda0c13..f2c62130a 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Paralysis.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Paralysis.java @@ -62,6 +62,16 @@ public class Paralysis extends FlavourBuff { return "Paralysed"; } + @Override + public String desc() { + return "Oftentimes the worst thing to do is nothing at all.\n" + + "\n" + + "Paralysis 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" + + "\n" + + "This paralysis will last for " + dispTurns() + ", or until it is resisted through pain.\n"; + } + public static float duration( Char ch ) { Resistance r = ch.buff( Resistance.class ); return r != null ? r.durationFactor() * DURATION : DURATION; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Poison.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Poison.java index f095ebc84..5ef607ffd 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Poison.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Poison.java @@ -66,6 +66,15 @@ public class Poison extends Buff implements Hero.Doom { return "Poisoned"; } + @Override + public String desc() { + return "Poison works its way through the body, slowly impairing its internal functioning.\n" + + "\n" + + "Poison deals damage each turn proportional to how long until it expires.\n" + + "\n" + + "This poison will last for " + dispTurns(left) + "."; + } + @Override public boolean attachTo(Char target) { if (super.attachTo(target)){ diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Slow.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Slow.java index 5658228d3..102ae3f26 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Slow.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Slow.java @@ -39,6 +39,15 @@ public class Slow extends FlavourBuff { return "Slowed"; } + @Override + public String desc() { + return "Slowing magic affects the target's rate of time, to them everything is moving super-fast.\n" + + "\n" + + "A slowed character performs all actions in twice the amount of time they would normally take.\n" + + "\n" + + "This slow will last for " + dispTurns() + "."; + } + public static float duration( Char ch ) { Resistance r = ch.buff( Resistance.class ); return r != null ? r.durationFactor() * DURATION : DURATION; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ToxicImbue.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ToxicImbue.java index 9abe510d2..3e348fb37 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ToxicImbue.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ToxicImbue.java @@ -66,7 +66,7 @@ public class ToxicImbue extends Buff { "As you move around toxic gas will constantly billow forth from you, damaging your enemies. " + "You are immune to toxic gas and poison for the duration of the effect.\n" + "\n" + - "You are imbued for " + dispTurns() + "."; + "You are imbued for " + dispTurns(left) + "."; } {