diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Bleeding.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Bleeding.java index e315203d6..be53e4d77 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Bleeding.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Bleeding.java @@ -98,6 +98,11 @@ public class Bleeding extends Buff { return true; } + @Override + public String heroMessage() { + return Messages.get(this, "heromsg"); + } + @Override public String desc() { return Messages.get(this, "desc", level); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Blindness.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Blindness.java index e0c976247..96e0898f9 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Blindness.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Blindness.java @@ -46,6 +46,11 @@ public class Blindness extends FlavourBuff { return Messages.get(this, "name"); } + @Override + public String heroMessage() { + return Messages.get(this, "heromsg"); + } + @Override public String desc() { return Messages.get(this, "desc", dispTurns()); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Buff.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Buff.java index dd8721d1a..e77926ba9 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Buff.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Buff.java @@ -80,6 +80,10 @@ public class Buff extends Actor { //do nothing by default }; + public String heroMessage(){ + return null; + } + public String desc(){ return ""; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java index 0975fbd32..f2f4c7c88 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java @@ -145,6 +145,11 @@ public class Burning extends Buff implements Hero.Doom { else target.sprite.remove(CharSprite.State.BURNING); } + @Override + public String heroMessage() { + return Messages.get(this, "heromsg"); + } + @Override public String toString() { return Messages.get(this, "name"); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Charm.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Charm.java index b2d515e40..c4ba05887 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Charm.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Charm.java @@ -63,6 +63,11 @@ public class Charm extends FlavourBuff { return r != null ? r.durationFactor() : 1; } + @Override + public String heroMessage() { + return Messages.get(this, "heromsg"); + } + @Override public String desc() { return Messages.get(this, "desc", dispTurns()); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Cripple.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Cripple.java index 816bfedc6..dcb1f6c28 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Cripple.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Cripple.java @@ -41,6 +41,11 @@ public class Cripple extends FlavourBuff { return Messages.get(this, "name"); } + @Override + public String heroMessage() { + return Messages.get(this, "heromsg"); + } + @Override public String desc() { return Messages.get(this, "desc", dispTurns()); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Fury.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Fury.java index 334dea552..f23165f66 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Fury.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Fury.java @@ -52,6 +52,11 @@ public class Fury extends Buff { return Messages.get(this, "name"); } + @Override + public String heroMessage() { + return Messages.get(this, "heromsg"); + } + @Override public String desc() { return Messages.get(this, "desc"); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java index 4c52a457b..57f5d5fca 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java @@ -44,6 +44,11 @@ public class Ooze extends Buff { return Messages.get(this, "name"); } + @Override + public String heroMessage() { + return Messages.get(this, "heromsg"); + } + @Override public String desc() { return Messages.get(this, "desc"); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Paralysis.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Paralysis.java index e66d83682..cf19bd13b 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Paralysis.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Paralysis.java @@ -62,6 +62,11 @@ public class Paralysis extends FlavourBuff { else target.sprite.remove(CharSprite.State.PARALYSED); } + @Override + public String heroMessage() { + return Messages.get(this, "heromsg"); + } + @Override public String toString() { return Messages.get(this, "name"); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Poison.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Poison.java index 4492eaf1f..19943e361 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Poison.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Poison.java @@ -70,6 +70,11 @@ public class Poison extends Buff implements Hero.Doom { return Messages.get(this, "name"); } + @Override + public String heroMessage() { + return Messages.get(this, "heromsg"); + } + @Override public String desc() { return Messages.get(this, "desc", dispTurns(left)); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Roots.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Roots.java index 6ea5f2bfb..e587c1de6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Roots.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Roots.java @@ -56,6 +56,11 @@ public class Roots extends FlavourBuff { return Messages.get(this, "name"); } + @Override + public String heroMessage() { + return Messages.get(this, "heromsg"); + } + @Override public String desc() { return Messages.get(this, "desc", dispTurns()); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Weakness.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Weakness.java index 28954f294..42078c855 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Weakness.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Weakness.java @@ -68,6 +68,11 @@ public class Weakness extends FlavourBuff { return r != null ? r.durationFactor() * DURATION : DURATION; } + @Override + public String heroMessage() { + return Messages.get(this, "heromsg"); + } + @Override public String desc() { return Messages.get(this, "desc", dispTurns()); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 54f731452..a79bc3757 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -1150,39 +1150,17 @@ public class Hero extends Char { super.add( buff ); - //TODO: need to do something with these so they can be i18n-ified if (sprite != null) { - if (buff instanceof Burning) { - GLog.w( "You catch fire!" ); - interrupt(); - } else if (buff instanceof Paralysis) { - GLog.w( "You are paralysed!" ); - interrupt(); - } else if (buff instanceof Poison) { - GLog.w( "You are poisoned!" ); - interrupt(); - } else if (buff instanceof Ooze) { - GLog.w( "Caustic ooze eats your flesh. Wash it away!" ); - } else if (buff instanceof Roots) { - GLog.w( "You can't move!" ); - } else if (buff instanceof Weakness) { - GLog.w( "You feel weakened!" ); - } else if (buff instanceof Blindness) { - GLog.w( "You are blinded!" ); - } else if (buff instanceof Fury) { - GLog.w( "You become furious!" ); - } else if (buff instanceof Charm) { - GLog.w( "You are charmed!" ); - } else if (buff instanceof Cripple) { - GLog.w( "You are crippled!" ); - } else if (buff instanceof Bleeding) { - GLog.w( "You are bleeding!" ); - } else if (buff instanceof RingOfMight.Might){ - if (((RingOfMight.Might)buff).level > 0) { + String msg = buff.heroMessage(); + if (msg != null){ + GLog.w(msg); + } + + if (buff instanceof RingOfMight.Might) { + if (((RingOfMight.Might) buff).level > 0) { HT += ((RingOfMight.Might) buff).level * 5; } - } else if (buff instanceof Vertigo) { - GLog.w("Everything is spinning around you!"); + } else if (buff instanceof Paralysis || buff instanceof Vertigo) { interrupt(); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java index dd660ebe6..a96be1eb8 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java @@ -54,40 +54,6 @@ public enum HeroClass { this.title = title; } - //TODO: need to make all these Messages references non-static - public static final String[] WAR_PERKS = { - Messages.get(HeroClass.class, "warrior_perk1"), - Messages.get(HeroClass.class, "warrior_perk2"), - Messages.get(HeroClass.class, "warrior_perk3"), - Messages.get(HeroClass.class, "warrior_perk4"), - Messages.get(HeroClass.class, "warrior_perk5"), - }; - - public static final String[] MAG_PERKS = { - Messages.get(HeroClass.class, "mage_perk1"), - Messages.get(HeroClass.class, "mage_perk2"), - Messages.get(HeroClass.class, "mage_perk3"), - Messages.get(HeroClass.class, "mage_perk4"), - Messages.get(HeroClass.class, "mage_perk5"), - }; - - public static final String[] ROG_PERKS = { - Messages.get(HeroClass.class, "rogue_perk1"), - Messages.get(HeroClass.class, "rogue_perk2"), - Messages.get(HeroClass.class, "rogue_perk3"), - Messages.get(HeroClass.class, "rogue_perk4"), - Messages.get(HeroClass.class, "rogue_perk5"), - Messages.get(HeroClass.class, "rogue_perk6"), - }; - - public static final String[] HUN_PERKS = { - Messages.get(HeroClass.class, "huntress_perk1"), - Messages.get(HeroClass.class, "huntress_perk2"), - Messages.get(HeroClass.class, "huntress_perk3"), - Messages.get(HeroClass.class, "huntress_perk4"), - Messages.get(HeroClass.class, "huntress_perk5"), - }; - public void initHero( Hero hero ) { hero.heroClass = this; @@ -211,13 +177,38 @@ public enum HeroClass { switch (this) { case WARRIOR: - return WAR_PERKS; + return new String[]{ + Messages.get(HeroClass.class, "warrior_perk1"), + Messages.get(HeroClass.class, "warrior_perk2"), + Messages.get(HeroClass.class, "warrior_perk3"), + Messages.get(HeroClass.class, "warrior_perk4"), + Messages.get(HeroClass.class, "warrior_perk5"), + }; case MAGE: - return MAG_PERKS; + return new String[]{ + Messages.get(HeroClass.class, "mage_perk1"), + Messages.get(HeroClass.class, "mage_perk2"), + Messages.get(HeroClass.class, "mage_perk3"), + Messages.get(HeroClass.class, "mage_perk4"), + Messages.get(HeroClass.class, "mage_perk5"), + }; case ROGUE: - return ROG_PERKS; + return new String[]{ + Messages.get(HeroClass.class, "rogue_perk1"), + Messages.get(HeroClass.class, "rogue_perk2"), + Messages.get(HeroClass.class, "rogue_perk3"), + Messages.get(HeroClass.class, "rogue_perk4"), + Messages.get(HeroClass.class, "rogue_perk5"), + Messages.get(HeroClass.class, "rogue_perk6"), + }; case HUNTRESS: - return HUN_PERKS; + return new String[]{ + Messages.get(HeroClass.class, "huntress_perk1"), + Messages.get(HeroClass.class, "huntress_perk2"), + Messages.get(HeroClass.class, "huntress_perk3"), + Messages.get(HeroClass.class, "huntress_perk4"), + Messages.get(HeroClass.class, "huntress_perk5"), + }; } return null; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/messages/messages.properties b/src/com/shatteredpixel/shatteredpixeldungeon/messages/messages.properties index b9d2c450c..f52cbff99 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/messages/messages.properties +++ b/src/com/shatteredpixel/shatteredpixeldungeon/messages/messages.properties @@ -18,16 +18,20 @@ actors.buffs.barkskin.name=Barkskin actors.buffs.barkskin.desc=Your skin is hardened, it feels rough and solid like bark.\n\nThe 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\nYour armor is currently increased by %d. actors.buffs.bleeding.name=Bleeding actors.buffs.bleeding.ondeath=You bled to death... +actors.buffs.bleeding.heromsg=You are bleeding! actors.buffs.bleeding.desc=That wound is leaking a worrisome amount of blood.\n\nBleeding causes damage every turn. Each turn the damage decreases by a random amount, until the bleeding eventually stops.\n\nThe bleeding can currently deal %d max damage. actors.buffs.bless.name=Blessed actors.buffs.bless.desc=A great burst of focus, some say it is inspired by the gods.\n\nBlessing significantly increases accuracy and evasion, making the blessed much more effective in combat.\n\nThis blessing will last for %s. actors.buffs.blindness.name=Blinded +actors.buffs.blindness.heromsg=You are blinded! actors.buffs.blindness.desc=Blinding turns the surrounding world into a dark haze.\n\nWhile 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\nThe blindness will last for %s. actors.buffs.buff.1moreturn=1 more turn actors.buffs.buff.#moreturns=%s more turns actors.buffs.burning.name=Burning +actors.buffs.burning.heromsg=You catch fire! actors.buffs.burning.desc=Few things are more distressing than being engulfed in flames.\n\nFire 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\nAdditionally, the fire may ignite flammable terrain or items that it comes into contact with.\n\nThe burning will last for %s, or until it is resisted or extinquished. actors.buffs.charm.name=Charmed +actors.buffs.charm.heromsg=You are charmed! actors.buffs.charm.desc=A charm is manipulative magic that can make enemies temporarily adore eachother.\n\nCharacters affected by charm are unable to directly attack the enemy they are charmed by. Attacking other targets is still possible however.\n\nThe charm will last for %s. actors.buffs.chill.name=Chilled actors.buffs.chill.desc=Not quite frozen, but still much too cold.\n\nChilled 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\nThis chill will last for %s, and is currently reducing speed by %s%% @@ -39,6 +43,7 @@ actors.buffs.combo.bonusdmg=Your combo is currently giving you %f%% bonus damage actors.buffs.corruption.name=Corrupted actors.buffs.corruption.desc=Corruption seeps into the essence of a being, twisting them against their former nature.\n\nCorrupted 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\nCorruption is permanent, its effects only end in death. actors.buffs.cripple.name=Crippled +actors.buffs.cripple.heromsg=You are crippled! actors.buffs.cripple.desc=You're pretty sure legs aren't meant to bend that way.\n\nCrippled halves movement speed, making moving a tile usually take two turns instead of one.\n\nThis cripple will last for %s. actors.buffs.drowsy.name=Drowsy actors.buffs.drowsy.desc=A magical force is making it difficult to stay awake.\n\nThe hero can resist drowsiness by taking damage or by being at full health.\n\nAfter %s, the target will fall into a deep magical sleep. @@ -49,6 +54,7 @@ actors.buffs.fireimbue.desc=You are imbued with the power of fire!\n\nAll physic actors.buffs.frost.name=Frozen actors.buffs.frost.desc=Not to be confused with freezing solid, this more benign freezing simply encases the target in ice.\n\nFreezing 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\nThe freeze will last for %s, or until the target takes damage. actors.buffs.fury.name=Furious +actors.buffs.fury.heromsg=You become furious! actors.buffs.fury.desc=You are angry, enemies won't like you when you're angry.\n\nA great rage burns within you, increasing the damage you deal with physical attacks by 50%.\n\nThis rage will last as long as you are injured below 50% health. actors.buffs.gasesimmunity.name=Immune to gases actors.buffs.gasesimmunity.desc=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\nYou will be immune for %s. @@ -77,16 +83,20 @@ actors.buffs.magicalsleep.desc=This character has fallen into a deep magical sle actors.buffs.mindvision.name=Mind vision actors.buffs.mindvision.desc=Somehow you are able to see all creatures on this floor through your mind. It's a weird feeling.\n\nAll 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\nThe mind vision will last for %s. actors.buffs.ooze.name=Caustic ooze +actors.buffs.ooze.heromsg=Caustic ooze eats your flesh. Wash it away! actors.buffs.ooze.ondeath=You melt away... actors.buffs.ooze.desc=This sticky acid clings to flesh, slowly melting it away.\n\nOoze will deal consistent damage until it is washed off in water.\n\nOoze does not expire on its own and must be removed with water. actors.buffs.paralysis.name=Paralysed +actors.buffs.paralysis.heromsg=You are paralysed! actors.buffs.paralysis.desc=Oftentimes the worst thing to do is nothing at all.\n\nParalysis 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\nThis paralysis will last for %s, or until it is resisted through pain. actors.buffs.poison.name=Poisoned +actors.buffs.poison.heromsg=You are poisoned! actors.buffs.poison.ondeath=You died from poison... actors.buffs.poison.desc=Poison works its way through the body, slowly impairing its internal functioning.\n\nPoison deals damage each turn proportional to how long until it expires.\n\nThis poison will last for %s. actors.buffs.recharging.name=Recharging actors.buffs.recharging.desc=Energy is coursing through you, improving the rate that your wands and staffs charge.\n\nEach turn this buff will increase current charge by one quarter, in addition to regular recharge.\n\nThe recharging will last for %s. actors.buffs.roots.name=Rooted +actors.buffs.roots.heromsg=You can't move! actors.buffs.roots.desc=Roots(magical or natural) grab at the feet, forcing them down to the ground.\n\nRoots lock a target in place, making it impossible for them to move, but other actions are not affected.\n\nThe roots will last for %s. actors.buffs.shadows.name=Shadowmelded actors.buffs.shadows.desc=You are blended into the shadows around you, granting you invisibility and slowing your metabolism.\n\nWhile 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\nYou will remain shadowmelded until you leave the shadows or an enemy comes into contact with you. @@ -105,6 +115,7 @@ actors.buffs.venom.desc=Venom is a extremely caustic and dangerous poison.\n\nUn actors.buffs.vertigo.name=Vertigo actors.buffs.vertigo.desc=Walking in a straight line can be difficult when the whole world is spinning.\n\nWhile 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\nThis Vertigo effect with last for %s. actors.buffs.weakness.name=Weakened +actors.buffs.weakness.heromsg=You feel weakened! actors.buffs.weakness.desc=Your gear suddenly feels a lot heavier.\n\nWeakening magic is affecting you, reducing your effective strength by 2 points.\n\nThis weakness will last for %s. actors.hero.hero.leave=One does not simply leave Pixel Dungeon.