v0.3.0: buff descriptions round 3 plus some tweaks to displaying remaining turns.
This commit is contained in:
parent
e8a2004345
commit
ea628b7212
|
@ -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 extends Buff> T append( Char target, Class<T> buffClass ) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) + "%";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) + ".";
|
||||
}
|
||||
|
||||
{
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
||||
|
|
|
@ -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() + ".";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,6 +43,15 @@ public class Ooze extends Buff {
|
|||
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()) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)){
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) + ".";
|
||||
}
|
||||
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user