v0.3.0: first round of buff descriptions

This commit is contained in:
Evan Debenham
2015-05-07 20:48:59 -04:00
parent 42af14f98a
commit 82a428233b
15 changed files with 173 additions and 21 deletions
@@ -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 extends Buff> T append( Char target, Class<T> buffClass ) {
try {
T buff = buffClass.newInstance();