v0.3.4: externalized all buff strings

This commit is contained in:
Evan Debenham
2015-12-28 20:23:15 -05:00
committed by Evan Debenham
parent 801fd58e7c
commit 77d16d5a93
42 changed files with 239 additions and 305 deletions
@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Amok extends FlavourBuff {
@@ -43,15 +44,11 @@ public class Amok extends FlavourBuff {
@Override
public String toString() {
return "Amok";
return Messages.get(this, "name");
}
@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() + ".";
return Messages.get(this, "desc", dispTurns());
}
}
@@ -20,6 +20,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Barkskin extends Buff {
@@ -61,16 +62,11 @@ public class Barkskin extends Buff {
@Override
public String toString() {
return "Barkskin";
return Messages.get(this, "name");
}
@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 +".";
return Messages.get(this, "desc", level);
}
}
@@ -23,9 +23,9 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions;
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
import com.watabou.utils.Bundle;
import com.watabou.utils.PointF;
import com.watabou.utils.Random;
@@ -64,7 +64,7 @@ public class Bleeding extends Buff {
@Override
public String toString() {
return "Bleeding";
return Messages.get(this, "name");
}
@Override
@@ -81,7 +81,7 @@ public class Bleeding extends Buff {
if (target == Dungeon.hero && !target.isAlive()) {
Dungeon.fail( ResultDescriptions.BLEEDING );
GLog.n( "You bled to death..." );
GLog.n( Messages.get(this, "ondeath") );
}
spend( TICK );
@@ -100,11 +100,6 @@ public class Bleeding extends Buff {
@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.";
return Messages.get(this, "desc", level);
}
}
@@ -20,7 +20,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Bless extends FlavourBuff {
@@ -36,15 +36,11 @@ public class Bless extends FlavourBuff {
@Override
public String toString() {
return "Blessed";
return Messages.get(this, "name");
}
@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() + ".";
return Messages.get(this, "desc", dispTurns());
}
}
@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Blindness extends FlavourBuff {
@@ -42,17 +43,11 @@ public class Blindness extends FlavourBuff {
@Override
public String toString() {
return "Blinded";
return Messages.get(this, "name");
}
@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() + ".";
return Messages.get(this, "desc", dispTurns());
}
}
@@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import java.text.DecimalFormat;
@@ -85,7 +86,9 @@ public class Buff extends Actor {
//to handle the common case of showing how many turns are remaining in a buff description.
protected String dispTurns(float input){
return input == 1 ? "1 more turn" : new DecimalFormat("#.##").format(input) + " more turns";
return input == 1 ?
Messages.get(Buff.class, "1moreturn") :
Messages.get(Buff.class, "#moreturns", new DecimalFormat("#.##").format(input));
}
//creates a fresh instance of the buff and attaches that, this allows duplication.
@@ -36,6 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
@@ -146,7 +147,7 @@ public class Burning extends Buff implements Hero.Doom {
@Override
public String toString() {
return "Burning";
return Messages.get(this, "name");
}
public static float duration( Char ch ) {
@@ -156,14 +157,7 @@ public class Burning extends Buff implements Hero.Doom {
@Override
public String desc() {
return "Few things are more distressing than being engulfed in flames.\n" +
"\n" +
"Fire will deal damage every turn until it is put out by water, expires, or it is resisted. " +
"Fire can be extinquished by stepping into water, or from the splash of a shattering potion. \n" +
"\n" +
"Additionally, the fire may ignite flammable terrain or items that it comes into contact with.\n" +
"\n" +
"The burning will last for " + dispTurns(left) + ", or until it is resisted or extinquished.";
return Messages.get(this, "desc", dispTurns(left));
}
@Override
@@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
@@ -54,7 +55,7 @@ public class Charm extends FlavourBuff {
@Override
public String toString() {
return "Charmed";
return Messages.get(this, "name");
}
public static float durationFactor( Char ch ) {
@@ -64,11 +65,6 @@ public class Charm extends FlavourBuff {
@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() + ".";
return Messages.get(this, "desc", dispTurns());
}
}
@@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.food.FrozenCarpaccio;
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
@@ -102,17 +103,11 @@ public class Chill extends FlavourBuff {
@Override
public String toString() {
return "Chilled";
return Messages.get(this, "name");
}
@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((1f-speedFactor())*100f) + "%";
return Messages.get(this, "desc", dispTurns(), new DecimalFormat("#.##").format((1f-speedFactor())*100f));
}
}
@@ -22,13 +22,12 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
public class Combo extends Buff {
private static String TXT_COMBO = "%d hit combo!";
public int count = 0;
@Override
@@ -38,7 +37,7 @@ public class Combo extends Buff {
@Override
public String toString() {
return "Combo";
return Messages.get(this, "name");
}
public int hit( Char enemy, int damage ) {
@@ -49,7 +48,7 @@ public class Combo extends Buff {
Badges.validateMasteryCombo( count );
GLog.p( TXT_COMBO, count );
GLog.p( Messages.get(this, "combo", count) );
postpone( 1.41f - count / 10f );
return (int)(damage * (count - 2) / 5f);
@@ -69,13 +68,9 @@ public class Combo extends Buff {
@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) * 20f) + " % bonus damage.");
return Messages.get(this, "desc") +
(count <= 2 ?
Messages.get(this, "notenough") :
Messages.get(this, "bonusdmg", ((count - 2) * 20f)));
}
}
@@ -20,6 +20,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
@@ -59,16 +60,11 @@ public class Corruption extends Buff {
@Override
public String toString() {
return "Corrupted";
return Messages.get(this, "name");
}
@Override
public String desc() {
return "Corruption seeps into the essence of a being, twisting them against their former nature.\n" +
"\n" +
"Corrupted creatures will attack and aggravate their allies, and ignore their former enemies. " +
"Corruption is damaging as well, and will slowly cause its target to succumb.\n" +
"\n" +
"Corruption is permanent, its effects only end in death.";
return Messages.get(this, "desc");
}
}
@@ -20,6 +20,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Cripple extends FlavourBuff {
@@ -37,15 +38,11 @@ public class Cripple extends FlavourBuff {
@Override
public String toString() {
return "Crippled";
return Messages.get(this, "name");
}
@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() + ".";
return Messages.get(this, "desc", dispTurns());
}
}
@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Random;
@@ -54,15 +55,11 @@ public class Drowsy extends Buff {
@Override
public String toString() {
return "Drowsy";
return Messages.get(this, "name");
}
@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.";
return Messages.get(this, "desc", dispTurns(cooldown()+1));
}
}
@@ -23,10 +23,8 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.EarthParticle;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
import java.util.HashSet;
public class EarthImbue extends FlavourBuff {
@@ -44,16 +42,12 @@ public class EarthImbue extends FlavourBuff {
@Override
public String toString() {
return "Imbued with Earth";
return Messages.get(this, "name");
}
@Override
public String desc() {
return "You are inbued with the power of earth!\n" +
"\n" +
"All physical attacks will command roots to lock the enemy in place while the effect lasts.\n" +
"\n" +
"You are imbued for " + dispTurns() + ".";
return Messages.get(this, "desc", dispTurns());
}
{
@@ -24,6 +24,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
@@ -85,17 +86,12 @@ public class FireImbue extends Buff {
@Override
public String toString() {
return "Imbued with Fire";
return Messages.get(this, "name");
}
@Override
public String desc() {
return "You are imbued with the power of fire!\n" +
"\n" +
"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(left) + ".";
return Messages.get(this, "desc", dispTurns(left));
}
{
@@ -20,9 +20,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import java.text.DecimalFormat;
//buff whose only logic is to wait and detach after a time.
//buff whose only internal logic is to wait and detach after a time.
public class FlavourBuff extends Buff {
@Override
@@ -34,7 +32,6 @@ public class FlavourBuff extends Buff {
//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";
return dispTurns(cooldown()+1f);
}
}
@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
@@ -108,17 +109,12 @@ public class Frost extends FlavourBuff {
@Override
public String toString() {
return "Frozen";
return Messages.get(this, "name");
}
@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";
return Messages.get(this, "desc", dispTurns());
}
public static float duration( Char ch ) {
@@ -20,6 +20,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Fury extends Buff {
@@ -48,15 +49,11 @@ public class Fury extends Buff {
@Override
public String toString() {
return "Furious";
return Messages.get(this, "name");
}
@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 50% health.\n";
return Messages.get(this, "desc");
}
}
@@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ParalyticGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.StenchGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.VenomGas;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class GasesImmunity extends FlavourBuff {
@@ -38,7 +39,7 @@ public class GasesImmunity extends FlavourBuff {
@Override
public String toString() {
return "Immune to gases";
return Messages.get(this, "name");
}
{
@@ -51,11 +52,6 @@ public class GasesImmunity extends FlavourBuff {
@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() + ".";
return Messages.get(this, "desc", dispTurns());
}
}
@@ -26,14 +26,12 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
public class Hunger extends Buff implements Hero.Doom {
@@ -42,10 +40,6 @@ public class Hunger extends Buff implements Hero.Doom {
public static final float HUNGRY = 260f;
public static final float STARVING = 360f;
private static final String TXT_HUNGRY = "You are hungry.";
private static final String TXT_STARVING = "You are starving!";
private static final String TXT_DEATH = "You starved to death...";
private float level;
private float partialDamage;
@@ -93,7 +87,7 @@ public class Hunger extends Buff implements Hero.Doom {
boolean statusUpdated = false;
if (newLevel >= STARVING) {
GLog.n( TXT_STARVING );
GLog.n( Messages.get(this, "onstarving") );
hero.resting = false;
hero.damage( 1, this );
statusUpdated = true;
@@ -102,7 +96,7 @@ public class Hunger extends Buff implements Hero.Doom {
} else if (newLevel >= HUNGRY && level < HUNGRY) {
GLog.w( TXT_HUNGRY );
GLog.w( Messages.get(this, "onhungry") );
statusUpdated = true;
}
@@ -131,7 +125,7 @@ public class Hunger extends Buff implements Hero.Doom {
Artifact.ArtifactBuff buff = target.buff( HornOfPlenty.hornRecharge.class );
if (buff != null && buff.isCursed()){
energy *= 0.67f;
GLog.n("The cursed horn steals some of the food energy as you eat.");
GLog.n( Messages.get(this, "cursedhorn") );
}
if (!Dungeon.isChallenged(Challenges.NO_FOOD))
@@ -169,9 +163,9 @@ public class Hunger extends Buff implements Hero.Doom {
@Override
public String toString() {
if (level < STARVING) {
return "Hungry";
return Messages.get(this, "hungry");
} else {
return "Starving";
return Messages.get(this, "starving");
}
}
@@ -179,16 +173,12 @@ public class Hunger extends Buff implements Hero.Doom {
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";
result = Messages.get(this, "desc_intro_hungry");
} else {
result = "You're so hungry it hurts.\n\n";
result = Messages.get(this, "desc_intro_starving");
}
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";
result += Messages.get(this, "desc");
return result;
}
@@ -199,6 +189,6 @@ public class Hunger extends Buff implements Hero.Doom {
Badges.validateDeathFromHunger();
Dungeon.fail( ResultDescriptions.HUNGER );
GLog.n( TXT_DEATH );
GLog.n( Messages.get(this, "ondeath") );
}
}
@@ -24,6 +24,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
@@ -65,17 +66,12 @@ public class Invisibility extends FlavourBuff {
@Override
public String toString() {
return "Invisible";
return Messages.get(this, "name");
}
@Override
public String desc() {
return "You are completely blended into the surrounding terrain, making you impossible to see.\n" +
"\n" +
"While you are invisible enemies are unable to attack or follow you. " +
"Physical attacks and magical effects (such as scrolls and wands) will immediately cancel invisibility.\n" +
"\n" +
"This invisibility will last for " + dispTurns() + ".";
return Messages.get(this, "desc", dispTurns());
}
public static void dispel() {
@@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
@@ -60,17 +61,11 @@ public class Levitation extends FlavourBuff {
@Override
public String toString() {
return "Levitating";
return Messages.get(this, "name");
}
@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() + ".";
return Messages.get(this, "desc", dispTurns());
}
}
@@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
@@ -63,15 +64,11 @@ public class Light extends FlavourBuff {
@Override
public String toString() {
return "Illuminated";
return Messages.get(this, "name");
}
@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() + ".";
return Messages.get(this, "desc", dispTurns());
}
}
@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
@@ -71,18 +72,11 @@ public class LockedFloor extends Buff {
@Override
public String toString() {
return "Floor is Locked";
return Messages.get(this, "name");
}
@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. In addition, " +
"if you do not work towards defeating this floor's boss, passive regeneration effects will also stop.\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";
return Messages.get(this, "desc");
}
}
@@ -23,13 +23,13 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
public class MagicalSleep extends Buff {
private static final float STEP = 1f;
public static final float SWS = 1.5f;
@Override
public boolean attachTo( Char target ) {
@@ -37,11 +37,11 @@ public class MagicalSleep extends Buff {
if (target instanceof Hero)
if (target.HP == target.HT) {
GLog.i("You are too healthy, and resist the urge to sleep.");
GLog.i(Messages.get(this, "toohealthy"));
detach();
return true;
} else {
GLog.i("You fall into a deep magical sleep.");
GLog.i(Messages.get(this, "fallasleep"));
}
else if (target instanceof Mob)
((Mob)target).state = ((Mob)target).SLEEPING;
@@ -60,7 +60,7 @@ public class MagicalSleep extends Buff {
target.HP = Math.min(target.HP+1, target.HT);
((Hero) target).resting = true;
if (target.HP == target.HT) {
GLog.p("You wake up feeling refreshed and healthy.");
GLog.p(Messages.get(this, "wakeup"));
detach();
}
}
@@ -84,15 +84,11 @@ public class MagicalSleep extends Buff {
@Override
public String toString() {
return "Magical Sleep";
return Messages.get(this, "name");
}
@Override
public String desc() {
return "This character has fallen into a deep magical sleep which they will not wake from naturally.\n" +
"\n" +
"Magical sleep is similar to regular sleep, except that only damage will cause the target to wake up. \n" +
"\n" +
"For the hero, magical sleep has some restorative properties, allowing them to rapidly heal while resting.";
return Messages.get(this, "desc");
}
}
@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class MindVision extends FlavourBuff {
@@ -40,7 +41,7 @@ public class MindVision extends FlavourBuff {
@Override
public String toString() {
return "Mind vision";
return Messages.get(this, "name");
}
@Override
@@ -51,12 +52,6 @@ public class MindVision extends FlavourBuff {
@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() + ".";
return Messages.get(this, "desc", dispTurns());
}
}
@@ -23,14 +23,12 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
import com.watabou.utils.Random;
public class Ooze extends Buff {
private static final String TXT_HERO_KILLED = "%s killed you...";
{
type = buffType.NEGATIVE;
@@ -43,16 +41,12 @@ public class Ooze extends Buff {
@Override
public String toString() {
return "Caustic ooze";
return Messages.get(this, "name");
}
@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.";
return Messages.get(this, "desc");
}
@Override
@@ -64,7 +58,7 @@ public class Ooze extends Buff {
target.damage( 1, this );
if (!target.isAlive() && target == Dungeon.hero) {
Dungeon.fail( ResultDescriptions.OOZE );
GLog.n( TXT_HERO_KILLED, toString() );
GLog.n( Messages.get(this, "ondeath") );
}
spend( TICK );
}
@@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
@@ -63,17 +64,12 @@ public class Paralysis extends FlavourBuff {
@Override
public String toString() {
return "Paralysed";
return Messages.get(this, "name");
}
@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";
return Messages.get(this, "desc", dispTurns());
}
public static float duration( Char ch ) {
@@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.PoisonParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.utils.Bundle;
@@ -66,16 +67,12 @@ public class Poison extends Buff implements Hero.Doom {
@Override
public String toString() {
return "Poisoned";
return Messages.get(this, "name");
}
@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) + ".";
return Messages.get(this, "desc", dispTurns(left));
}
@Override
@@ -20,6 +20,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Recharging extends FlavourBuff {
@@ -31,7 +32,7 @@ public class Recharging extends FlavourBuff {
@Override
public String toString() {
return "Recharging";
return Messages.get(this, "name");
}
//want to process partial turns for this buff, and not count it when it's expiring.
@@ -45,10 +46,6 @@ public class Recharging extends FlavourBuff {
@Override
public String desc() {
return "Energy is coursing through you, improving the rate that your wands and staffs charge.\n" +
"\n" +
"Each turn this buff will increase current charge by one quarter, in addition to regular recharge. \n" +
"\n" +
"The recharging will last for " + dispTurns() + ".";
return Messages.get(this, "desc", dispTurns());
}
}
@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Roots extends FlavourBuff {
@@ -52,15 +53,11 @@ public class Roots extends FlavourBuff {
@Override
public String toString() {
return "Rooted";
return Messages.get(this, "name");
}
@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() + ".";
return Messages.get(this, "desc", dispTurns());
}
}
@@ -20,6 +20,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
@@ -97,17 +98,11 @@ public class Shadows extends Invisibility {
@Override
public String toString() {
return "Shadowmelded";
return Messages.get(this, "name");
}
@Override
public String desc() {
return "You are blended into the shadows around you, granting you invisibility and slowing your metabolism.\n" +
"\n" +
"While you are invisible enemies are unable to attack or follow you. " +
"Most physical attacks and magical effects (such as scrolls and wands) will immediately cancel invisibility. " +
"Additionally, while shadowmelded, your rate of hunger is slowed.\n" +
"\n" +
"You will remain shadowmelded until you leave the shadows or an enemy comes into contact with you.";
return Messages.get(this, "desc");
}
}
@@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Slow extends FlavourBuff {
@@ -39,16 +40,12 @@ public class Slow extends FlavourBuff {
@Override
public String toString() {
return "Slowed";
return Messages.get(this, "name");
}
@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() + ".";
return Messages.get(this, "desc", dispTurns());
}
public static float duration( Char ch ) {
@@ -20,8 +20,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
@@ -51,15 +50,11 @@ public class SnipersMark extends FlavourBuff {
@Override
public String toString() {
return "Sniper's mark";
return Messages.get(this, "name");
}
@Override
public String desc() {
Char ch = (Char)Actor.findById(object);
return "The sniper is honed in " + ((ch == null) ? "on a lost target" : "on the nearby " + ch.name ) + ", " +
"gaining increased attack speed and armor penetration while attacking it.\n" +
"\n" +
"The sniper will remain honed in until she switches targets, stops attacking, or the target dies.";
return Messages.get(this, "desc");
}
}
@@ -20,6 +20,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
@@ -44,14 +45,11 @@ public class SoulMark extends FlavourBuff {
@Override
public String toString() {
return "Soul Marked";
return Messages.get(this, "name");
}
@Override
public String desc() {
return "The warlock has tapped into the soul of this creature. " +
"He will heal and satisfy his hunger as it takes physical damage.\n" +
"\n" +
"This mark will last for " + dispTurns() + ".";
return Messages.get(this, "desc", dispTurns());
}
}
@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
@@ -55,17 +56,12 @@ public class Terror extends FlavourBuff {
@Override
public String toString() {
return "Terrified";
return Messages.get(this, "name");
}
@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.";
return Messages.get(this, "desc", dispTurns());
}
public static void recover( Char target ) {
@@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
@@ -73,17 +74,12 @@ public class ToxicImbue extends Buff {
@Override
public String toString() {
return "Imbued with Toxicity";
return Messages.get(this, "name");
}
@Override
public String desc() {
return "You are imbued with poisonous energy!\n" +
"\n" +
"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(left) + ".";
return Messages.get(this, "desc", dispTurns(left));
}
{
@@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
@@ -60,16 +61,12 @@ public class Venom extends Poison implements Hero.Doom {
@Override
public String toString() {
return "Venomed";
return Messages.get(this, "name");
}
@Override
public String desc() {
return "Venom is a extremely caustic and dangerous poison.\n" +
"\n" +
"Unlike poison, whose damage lowers over time, venom does increasing damage the longer it stays on a target.\n" +
"\n" +
"This venom will last for " + dispTurns(left) + ", and is currently dealing " + damage + " damage.";
return Messages.get(this, "desc", dispTurns(left), damage);
}
@Override
@@ -18,6 +18,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Vertigo extends FlavourBuff {
@@ -35,17 +36,12 @@ public class Vertigo extends FlavourBuff {
@Override
public String toString() {
return "Vertigo";
return Messages.get(this, "name");
}
@Override
public String desc() {
return "Walking in a straight line can be difficult when the whole world is spinning.\n" +
"\n" +
"While under the effects of vertigo, characters who attempt to move will go in a random direction, " +
"instead of the one they intended to go in. \n" +
"\n" +
"This Vertigo effect with last for " + dispTurns() + ".";
return Messages.get(this, "desc", dispTurns());
}
public static float duration( Char ch ) {
@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Weakness extends FlavourBuff {
@@ -40,7 +41,7 @@ public class Weakness extends FlavourBuff {
@Override
public String toString() {
return "Weakened";
return Messages.get(this, "name");
}
@Override
@@ -69,10 +70,6 @@ public class Weakness extends FlavourBuff {
@Override
public String desc() {
return "Your gear suddenly feels a lot heavier.\n" +
"\n" +
"Weakening magic is affecting you, reducing your effective strength by 2 points.\n" +
"\n" +
"This weakness will last for " + dispTurns() + ".";
return Messages.get(this, "desc", dispTurns());
}
}