v0.3.0: buff descriptions round 4 (almost done)

This commit is contained in:
Evan Debenham 2015-05-21 01:02:23 -04:00
parent 624277ef97
commit a2c4e2474b
8 changed files with 71 additions and 3 deletions

View File

@ -8,6 +8,10 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
*/ */
public class Bless extends FlavourBuff { public class Bless extends FlavourBuff {
{
type = buffType.POSITIVE;
}
@Override @Override
public int icon() { public int icon() {
//TODO: add icon //TODO: add icon
@ -19,4 +23,12 @@ public class Bless extends FlavourBuff {
return "Blessed"; return "Blessed";
} }
@Override
public String desc() {
return "A great burst of focus, some say it is inspired by the gods.\n" +
"\n" +
"Blessing significantly increases accuracy and evasion, making the blessed much more effective in combat.\n" +
"\n" +
"This blessing will last for " + dispTurns() + ".";
}
} }

View File

@ -85,6 +85,7 @@ public class Buff extends Actor {
return input == 1 ? "1 more turn" : new DecimalFormat("#.##").format(input) + " more turns"; return input == 1 ? "1 more turn" : new DecimalFormat("#.##").format(input) + " more turns";
} }
//creates a fresh instance of the buff and attaches that, this allows duplication.
public static<T extends Buff> T append( Char target, Class<T> buffClass ) { public static<T extends Buff> T append( Char target, Class<T> buffClass ) {
try { try {
T buff = buffClass.newInstance(); T buff = buffClass.newInstance();
@ -101,6 +102,7 @@ public class Buff extends Actor {
return buff; return buff;
} }
//same as append, but prevents duplication.
public static<T extends Buff> T affect( Char target, Class<T> buffClass ) { public static<T extends Buff> T affect( Char target, Class<T> buffClass ) {
T buff = target.buff( buffClass ); T buff = target.buff( buffClass );
if (buff != null) { if (buff != null) {
@ -115,7 +117,8 @@ public class Buff extends Actor {
buff.spend( duration ); buff.spend( duration );
return buff; return buff;
} }
//postpones an already active buff, or creates & attaches a new buff and delays that.
public static<T extends FlavourBuff> T prolong( Char target, Class<T> buffClass, float duration ) { public static<T extends FlavourBuff> T prolong( Char target, Class<T> buffClass, float duration ) {
T buff = affect( target, buffClass ); T buff = affect( target, buffClass );
buff.postpone( duration ); buff.postpone( duration );

View File

@ -53,4 +53,13 @@ public class Drowsy extends Buff {
public String toString() { public String toString() {
return "Drowsy"; return "Drowsy";
} }
@Override
public String desc() {
return "A magical force is making it difficult to stay awake.\n" +
"\n" +
"The hero can resist drowsiness by taking damage or by being at full health.\n" +
"\n" +
"After " + dispTurns(cooldown()+1) + ", the target will fall into a deep magical sleep.";
}
} }

View File

@ -107,7 +107,17 @@ public class Frost extends FlavourBuff {
public String toString() { public String toString() {
return "Frozen"; return "Frozen";
} }
@Override
public String desc() {
return "Not to be confused with freezing solid, this more benign freezing simply encases the target in ice.\n" +
"\n" +
"Freezing acts similarly to paralysis, making it impossible for the target to act. " +
"Unlike paralysis, freezing is immediately cancelled if the target takes damage, as the ice will shatter.\n" +
"\n" +
"The freeze will last for " + dispTurns() + ", or until the target takes damage.\n";
}
public static float duration( Char ch ) { public static float duration( Char ch ) {
Resistance r = ch.buff( Resistance.class ); Resistance r = ch.buff( Resistance.class );
return r != null ? r.durationFactor() * DURATION : DURATION; return r != null ? r.durationFactor() * DURATION : DURATION;

View File

@ -51,4 +51,13 @@ public class Roots extends FlavourBuff {
public String toString() { public String toString() {
return "Rooted"; return "Rooted";
} }
@Override
public String desc() {
return "Roots(magical or natural) grab at the feet, forcing them down to the ground.\n" +
"\n" +
"Roots lock a target in place, making it impossible for them to move, but other actions are not affected.\n" +
"\n" +
"The roots will last for " + dispTurns() + ".";
}
} }

View File

@ -54,7 +54,17 @@ public class Terror extends FlavourBuff {
public String toString() { public String toString() {
return "Terrified"; return "Terrified";
} }
@Override
public String desc() {
return "Terror is manipulative magic which forces its target into an uncontrollable panic.\n" +
"\n" +
"Terrified characters are forced to run away from their opponent, trying to put as many doors and " +
"walls between them as possible. The shock of pain is enough to break this effect, however.\n" +
"\n" +
"This terror will last for " + dispTurns() + ", or until the target takes damage.";
}
public static void recover( Char target ) { public static void recover( Char target ) {
Terror terror = target.buff( Terror.class ); Terror terror = target.buff( Terror.class );
if (terror != null && terror.cooldown() < DURATION) { if (terror != null && terror.cooldown() < DURATION) {

View File

@ -103,6 +103,16 @@ public class CapeOfThorns extends Artifact {
return "Thorns"; return "Thorns";
} }
@Override
public String desc() {
return "Your cape is radiating energy, surrounding you in a field of deflective force!\n" +
"\n" +
"All damage you receive is reduced while the thorns effect is active. Additionally, " +
"if the attacker is next to you, the reduced amount is deflected back at the attacker.\n" +
"\n" +
"Your cape will continue radiating energy for " + dispTurns(cooldown) + ".";
}
@Override @Override
public int icon() { public int icon() {
if (cooldown == 0) if (cooldown == 0)

View File

@ -185,6 +185,11 @@ public class TalismanOfForesight extends Artifact {
return "Foresight"; return "Foresight";
} }
@Override
public String desc() {
return "You feel very nervous, as if there is nearby unseen danger.";
}
@Override @Override
public int icon() { public int icon() {
if (warn == 0) if (warn == 0)