v0.3.4: externalized all plant strings

This commit is contained in:
Evan Debenham 2015-12-30 18:42:04 -05:00 committed by Evan Debenham
parent 7860a77789
commit 2776614cd1
15 changed files with 93 additions and 274 deletions

View File

@ -260,7 +260,6 @@ public class WandOfRegrowth extends Wand {
{
image = 12;
plantName = "Dewcatcher";
}
@Override
@ -283,16 +282,10 @@ public class WandOfRegrowth extends Wand {
}
@Override
public String desc() {
return "Dewcatchers camouflage as grass to avoid attention, " +
"but their bulges of collected dew give them away.";
}
//seed is never dropped, only care about plant class
public static class Seed extends Plant.Seed {
{
plantClass = Dewcatcher.class;
setPlant(Dewcatcher.class);
}
}
}
@ -301,7 +294,6 @@ public class WandOfRegrowth extends Wand {
{
image = 13;
plantName = "Seed Pod";
}
@Override
@ -324,16 +316,10 @@ public class WandOfRegrowth extends Wand {
}
@Override
public String desc() {
return "Seed Pods look pretty, but the seeds they carry are actually " +
"stolen from other plants they kill with their roots.";
}
//seed is never dropped, only care about plant class
public static class Seed extends Plant.Seed {
{
plantClass = Seedpod.class;
setPlant(Seedpod.class);
}
}

View File

@ -55,7 +55,7 @@ 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.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.
actors.buffs.hunger.hungry=Hungry
@ -395,7 +395,43 @@ actors.char.def_verb=dodged
items.bags.bag.name=backpack
items.wands.wandofregrowth$dewcatcher.name=Dewcatcher
items.wands.wandofregrowth$dewcatcher.desc=Dewcatchers camouflage as grass to avoid attention, but their bulges of collected dew give them away.
items.wands.wandofregrowth$seedpod.name=Seed Pod
items.wands.wandofregrowth$seedpod.desc=Seed Pods look pretty, but the seeds they carry are actually stolen from other plants they kill with their roots.
plants.blandfruitbush.name=Blandfruit
plants.blandfruitbush.desc=Distant cousin of the Rotberry, the pear-shaped produce of the Blandfruit bush tastes like caked dust. The fruit is gross and unsubstantial but isn't poisonous. perhaps it could be cooked.
plants.blindweed.name=Blindweed
plants.blindweed.desc=Upon being touched a Blindweed perishes in a bright flash of light. The flash is strong enough to disorient for several seconds.
plants.dreamfoil.name=Dreamfoil
plants.dreamfoil.refreshed=You feel refreshed.
plants.dreamfoil.desc=The Dreamfoil's prickly flowers contain a chemical which is known for its properties as a strong neutralizing agent. Most weaker creatures are overwhelmed and knocked unconscious, which gives the plant its namesake.
plants.earthroot.name=Earthroot
plants.earthroot.desc=When a creature touches an Earthroot, its roots create a kind of immobile natural armor around it.
plants.earthroot$armor.name=Herbal armor
plants.earthroot$armor.desc=A kind of natural, immobile armor is protecting you. The armor forms plates of bark and twine, wrapping around your body.\n\nThis herbal armor will absorb 50%% of all physical damage you take, until it eventually runs out of durability and collapses. The armor is also immobile, if you attempt to move it will break apart and be lost.\n\nThe herbal armor can absorb %d more damage before breaking.
plants.fadeleaf.name=Fadeleaf
plants.fadeleaf.desc=Touching a Fadeleaf will teleport any creature to a random place on the current level.
plants.firebloom.name=Firebloom
plants.firebloom.desc=When something touches a Firebloom, it bursts into flames.
plants.icecap.name=Icecap
plants.icecap.desc=Upon being touched, an Icecap lets out a puff of freezing pollen. The freezing effect is much stronger if the environment is wet.
plants.plant$seed.seed_of=seed of %s
plants.plant$seed.ac_plant=PLANT
plants.plant$seed.info=Throw this seed to the place where you want to grow %s.\n\n%s
plants.rotberry.name=Rotberry
plants.rotberry.desc=The berries of a young rotberry shrub taste like sweet, sweet death.\n\nGiven several days, this rotberry shrub will grow into another rot heart.
plants.sorrowmoss.name=Sorrowmoss
plants.sorrowmoss.desc=A Sorrowmoss is a flower (not a moss) with razor-sharp petals, coated with a deadly venom.
plants.starflower.name=Starflower
plants.starflower.desc=An extremely rare plant, Starflower is said to grant holy power to whomever touches it.
plants.stormvine.name=Stormvine
plants.stormvine.desc=Gravity affects the Stormvine plant strangely, allowing its whispy blue tendrils to 'hang' on the air. Anything caught in the vine is affected by this, and becomes disoriented.
plants.sungrass.name=Sungrass
plants.sungrass.desc=Sungrass is renowned for its sap's slow but effective healing properties.
plants.sungrass$health.name=Herbal Healing
plants.sungrass$health.desc=Sungrass possesses excellent healing properties, though its not as fast as a potion of healing.\n\nYou are current slowly regenerating health from the sungrass plant. Taking damage while healing will reduce the healing effectiveness, and moving off the plant will break the healing effect.\n\nYou can heal for %d more health, or until your health is full.
levels.features.alchemypot.select_seed=Select a seed to throw

View File

@ -28,41 +28,23 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class BlandfruitBush extends Plant {
private static final String TXT_DESC =
"Distant cousin of the Rotberry, the pear-shaped produce of the Blandfruit bush tastes like caked dust. " +
"The fruit is gross and unsubstantial but isn't poisonous. perhaps it could be cooked.";
{
image = 8;
plantName = "Blandfruit";
}
@Override
public void activate() {
Char ch = Actor.findChar(pos);
Dungeon.level.drop( new Blandfruit(), pos ).sprite.drop();
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed {
{
plantName = "Blandfruit";
setPlant( BlandfruitBush.class );
name = "seed of " + plantName;
image = ItemSpriteSheet.SEED_BLANDFRUIT;
plantClass = BlandfruitBush.class;
alchemyClass = null;
}
@Override
public String desc() {
return TXT_DESC;
}
}
}

View File

@ -34,14 +34,9 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.utils.Random;
public class Blindweed extends Plant {
private static final String TXT_DESC =
"Upon being touched a Blindweed perishes in a bright flash of light. " +
"The flash is strong enough to disorient for several seconds.";
{
image = 3;
plantName = "Blindweed";
}
@Override
@ -63,25 +58,13 @@ public class Blindweed extends Plant {
}
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed {
{
plantName = "Blindweed";
name = "seed of " + plantName;
setPlant(Blindweed.class);
image = ItemSpriteSheet.SEED_BLINDWEED;
plantClass = Blindweed.class;
alchemyClass = PotionOfInvisibility.class;
}
@Override
public String desc() {
return TXT_DESC;
}
}
}

View File

@ -34,19 +34,14 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfPurity;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
public class Dreamfoil extends Plant {
private static final String TXT_DESC =
"The Dreamfoil's prickly flowers contain a chemical which is known for its " +
"properties as a strong neutralizing agent. Most weaker creatures are overwhelmed " +
"and knocked unconscious, which gives the plant its namesake.";
{
image = 10;
plantName = "Dreamfoil";
}
@Override
@ -57,7 +52,7 @@ public class Dreamfoil extends Plant {
if (ch instanceof Mob)
Buff.affect(ch, MagicalSleep.class);
else if (ch instanceof Hero){
GLog.i( "You feel refreshed." );
GLog.i( Messages.get(this, "refreshed") );
Buff.detach( ch, Poison.class );
Buff.detach( ch, Cripple.class );
Buff.detach( ch, Weakness.class );
@ -65,29 +60,17 @@ public class Dreamfoil extends Plant {
Buff.detach( ch, Drowsy.class );
Buff.detach( ch, Slow.class );
Buff.detach( ch, Vertigo.class);
}
}
}
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed {
{
plantName = "Dreamfoil";
setPlant(Dreamfoil.class);
name = "seed of " + plantName;
image = ItemSpriteSheet.SEED_DREAMFOIL;
plantClass = Dreamfoil.class;
alchemyClass = PotionOfPurity.class;
}
@Override
public String desc() {
return TXT_DESC;
}
}
}

View File

@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.plants;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.Camera;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
@ -34,14 +35,9 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
import com.watabou.utils.Bundle;
public class Earthroot extends Plant {
private static final String TXT_DESC =
"When a creature touches an Earthroot, its roots " +
"create a kind of immobile natural armor around it.";
{
image = 5;
plantName = "Earthroot";
}
@Override
@ -58,28 +54,16 @@ public class Earthroot extends Plant {
}
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed {
{
plantName = "Earthroot";
name = "seed of " + plantName;
setPlant( Earthroot.class );
image = ItemSpriteSheet.SEED_EARTHROOT;
plantClass = Earthroot.class;
alchemyClass = PotionOfParalyticGas.class;
bones = true;
}
@Override
public String desc() {
return TXT_DESC;
}
}
public static class Armor extends Buff {
@ -131,19 +115,12 @@ public class Earthroot extends Plant {
@Override
public String toString() {
return Utils.format("Herbal armor", level);
return Messages.get(this, "name");
}
@Override
public String desc() {
return "A kind of natural, immobile armor is protecting you. " +
"The armor forms plates of bark and twine, wrapping around your body.\n" +
"\n" +
"This herbal armor will absorb 50% of all physical damage you take, " +
"until it eventually runs out of durability and collapses. The armor is also immobile, " +
"if you attempt to move it will break apart and be lost.\n" +
"\n" +
"The herbal armor can absorb " + level + " more damage before breaking.";
return Messages.get(this, "desc", level);
}
private static final String POS = "pos";

View File

@ -32,14 +32,9 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportat
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Fadeleaf extends Plant {
private static final String TXT_DESC =
"Touching a Fadeleaf will teleport any creature " +
"to a random place on the current level.";
{
image = 6;
plantName = "Fadeleaf";
}
@Override
@ -69,7 +64,7 @@ public class Fadeleaf extends Plant {
ch.sprite.visible = Dungeon.visible[pos];
}
}
if (Dungeon.visible[pos]) {
@ -77,25 +72,13 @@ public class Fadeleaf extends Plant {
}
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed {
{
plantName = "Fadeleaf";
name = "seed of " + plantName;
setPlant( Fadeleaf.class );
image = ItemSpriteSheet.SEED_FADELEAF;
plantClass = Fadeleaf.class;
alchemyClass = PotionOfMindVision.class;
}
@Override
public String desc() {
return TXT_DESC;
}
}
}

View File

@ -30,12 +30,9 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Firebloom extends Plant {
private static final String TXT_DESC = "When something touches a Firebloom, it bursts into flames.";
{
image = 0;
plantName = "Firebloom";
}
@Override
@ -48,25 +45,13 @@ public class Firebloom extends Plant {
}
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed {
{
plantName = "Firebloom";
name = "seed of " + plantName;
setPlant( Firebloom.class );
image = ItemSpriteSheet.SEED_FIREBLOOM;
plantClass = Firebloom.class;
alchemyClass = PotionOfLiquidFlame.class;
}
@Override
public String desc() {
return TXT_DESC;
}
}
}

View File

@ -30,14 +30,9 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
import com.watabou.utils.PathFinder;
public class Icecap extends Plant {
private static final String TXT_DESC =
"Upon being touched, an Icecap lets out a puff of freezing pollen. " +
"The freezing effect is much stronger if the environment is wet.";
{
image = 1;
plantName = "Icecap";
}
@Override
@ -54,25 +49,13 @@ public class Icecap extends Plant {
}
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed {
{
plantName = "Icecap";
name = "seed of " + plantName;
setPlant( Icecap.class );
image = ItemSpriteSheet.SEED_ICECAP;
plantClass = Icecap.class;
alchemyClass = PotionOfFrost.class;
}
@Override
public String desc() {
return TXT_DESC;
}
}
}

View File

@ -24,6 +24,7 @@ import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
@ -47,7 +48,7 @@ import com.watabou.utils.Random;
public abstract class Plant implements Bundlable {
public String plantName;
public String plantName = Messages.get(this, "name");
public int image;
public int pos;
@ -114,15 +115,11 @@ public abstract class Plant implements Bundlable {
}
public String desc() {
return null;
return Messages.get(this, "desc");
}
public static class Seed extends Item {
public static final String AC_PLANT = "PLANT";
private static final String TXT_INFO = "Throw this seed to the place where you want to grow %s.\n\n%s";
private static final float TIME_TO_PLANT = 1f;
{
@ -134,11 +131,17 @@ public abstract class Plant implements Bundlable {
protected String plantName;
public Class<? extends Item> alchemyClass;
protected void setPlant(Class<? extends Plant> plantClass){
this.plantClass = plantClass;
plantName = Messages.get(plantClass, "name");
name = Messages.get(Seed.class, "seed_of", plantName);
}
@Override
public ArrayList<String> actions( Hero hero ) {
ArrayList<String> actions = super.actions( hero );
actions.add( AC_PLANT );
actions.add( Messages.get( Seed.class, "ac_plant" ) );
return actions;
}
@ -153,7 +156,7 @@ public abstract class Plant implements Bundlable {
@Override
public void execute( Hero hero, String action ) {
if (action.equals( AC_PLANT )) {
if (action.equals( Messages.get( Seed.class, "ac_plant" ))) {
hero.spend( TIME_TO_PLANT );
hero.busy();
@ -195,10 +198,15 @@ public abstract class Plant implements Bundlable {
public int price() {
return 10 * quantity;
}
@Override
public String desc() {
return Messages.get(plantClass, "desc");
}
@Override
public String info() {
return String.format( TXT_INFO, Utils.indefinite( plantName ), desc() );
return Messages.get( Seed.class, "info", Utils.indefinite( plantName ), desc() );
}
}
}

View File

@ -26,14 +26,8 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Rotberry extends Plant {
private static final String TXT_DESC =
"The berries of a young rotberry shrub taste like sweet, sweet death.\n" +
"\n" +
"Given several days, this rotberry shrub will grow into another rot heart.";
{
image = 7;
plantName = "Rotberry";
}
@Override
@ -41,25 +35,13 @@ public class Rotberry extends Plant {
Dungeon.level.drop( new Seed(), pos ).sprite.drop();
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed {
{
plantName = "Rotberry";
setPlant( Rotberry.class );
name = "seed of " + plantName;
image = ItemSpriteSheet.SEED_ROTBERRY;
plantClass = Rotberry.class;
alchemyClass = PotionOfStrength.class;
}
@Override
public String desc() {
return TXT_DESC;
}
}
}

View File

@ -32,12 +32,8 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Sorrowmoss extends Plant {
private static final String TXT_DESC =
"A Sorrowmoss is a flower (not a moss) with razor-sharp petals, coated with a deadly venom.";
{
image = 2;
plantName = "Sorrowmoss";
}
@Override
@ -53,25 +49,13 @@ public class Sorrowmoss extends Plant {
}
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed {
{
plantName = "Sorrowmoss";
name = "seed of " + plantName;
setPlant( Sorrowmoss.class );
image = ItemSpriteSheet.SEED_SORROWMOSS;
plantClass = Sorrowmoss.class;
alchemyClass = PotionOfToxicGas.class;
}
@Override
public String desc() {
return TXT_DESC;
}
}
}

View File

@ -31,13 +31,8 @@ import com.watabou.utils.Random;
public class Starflower extends Plant {
private static final String TXT_DESC =
"An extremely rare plant, " +
"Starflower is said to grant holy power to whomever touches it.";
{
image = 11;
plantName = "Starflower";
}
@Override
@ -51,26 +46,14 @@ public class Starflower extends Plant {
}
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed{
{
plantName = "Starflower";
setPlant( Starflower.class );
name = "Seed of " + plantName;
image = ItemSpriteSheet.SEED_STARFLOWER;
plantClass = Starflower.class;
alchemyClass = PotionOfExperience.class;
}
@Override
public String desc() {
return TXT_DESC;
}
}
}

View File

@ -29,13 +29,8 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class Stormvine extends Plant {
private static final String TXT_DESC =
"Gravity affects the Stormvine plant strangely, allowing its whispy blue tendrils " +
"to 'hang' on the air. Anything caught in the vine is affected by this, and becomes disoriented.";
{
image = 9;
plantName = "Stormvine";
}
@Override
@ -47,25 +42,13 @@ public class Stormvine extends Plant {
}
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed {
{
plantName = "Stormvine";
setPlant( Stormvine.class );
name = "seed of " + plantName;
image = ItemSpriteSheet.SEED_STORMVINE;
plantClass = Stormvine.class;
alchemyClass = PotionOfLevitation.class;
}
@Override
public String desc() {
return TXT_DESC;
}
}
}

View File

@ -29,17 +29,15 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShaftParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
public class Sungrass extends Plant {
private static final String TXT_DESC = "Sungrass is renowned for its sap's slow but effective healing properties.";
{
image = 4;
plantName = "Sungrass";
}
@Override
@ -55,28 +53,16 @@ public class Sungrass extends Plant {
}
}
@Override
public String desc() {
return TXT_DESC;
}
public static class Seed extends Plant.Seed {
{
plantName = "Sungrass";
name = "seed of " + plantName;
setPlant( Sungrass.class );
image = ItemSpriteSheet.SEED_SUNGRASS;
plantClass = Sungrass.class;
alchemyClass = PotionOfHealing.class;
bones = true;
}
@Override
public String desc() {
return TXT_DESC;
}
}
public static class Health extends Buff {
@ -147,17 +133,12 @@ public class Sungrass extends Plant {
@Override
public String toString() {
return "Herbal Healing";
return Messages.get(this, "name");
}
@Override
public String desc() {
return "Sungrass possesses excellent healing properties, though its not as fast as a potion of healing.\n" +
"\n" +
"You are current slowly regenerating health from the sungrass plant. " +
"Taking damage while healing will reduce the healing effectiveness, and moving off the plant will break the healing effect.\n" +
"\n" +
"You can heal for " + level + " more health, or until your health is full.";
return Messages.get(this, "desc", level);
}
private static final String POS = "pos";