v0.3.4: externalized all buff strings
This commit is contained in:
committed by
Evan Debenham
parent
801fd58e7c
commit
77d16d5a93
@@ -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") );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user