From 13b9d2f80193b90b3582ba6cc85cfb3ffb53d405 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 22 Jan 2016 22:12:02 -0500 Subject: [PATCH] v0.3.4: externalized item actions --- .../shatteredpixeldungeon/items/Amulet.java | 4 +- .../shatteredpixeldungeon/items/Bomb.java | 2 +- .../items/EquipableItem.java | 9 ++++ .../items/KindOfWeapon.java | 7 ---- .../items/MerchantsBeacon.java | 1 - .../items/armor/Armor.java | 7 ---- .../items/armor/ClassArmor.java | 14 +++---- .../items/armor/HuntressArmor.java | 8 +--- .../items/armor/MageArmor.java | 7 ---- .../items/armor/RogueArmor.java | 7 ---- .../items/armor/WarriorArmor.java | 11 +---- .../items/artifacts/Artifact.java | 8 ---- .../items/rings/Ring.java | 7 ---- .../items/weapon/missiles/MissileWeapon.java | 3 -- .../messages/items/items.properties | 41 +++++++++++++++++++ .../shatteredpixeldungeon/plants/Plant.java | 6 ++- .../windows/WndItem.java | 3 +- 17 files changed, 68 insertions(+), 77 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java index bb2cc5939..f8a4cb8b1 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java @@ -33,7 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; public class Amulet extends Item { - private static final String AC_END = "END THE GAME"; + private static final String AC_END = "END"; { image = ItemSpriteSheet.AMULET; @@ -50,7 +50,7 @@ public class Amulet extends Item { @Override public void execute( Hero hero, String action ) { - if (action == AC_END) { + if (action.equals(AC_END)) { showAmuletScene( false ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java index a0d4a4e3b..c2fe16b72 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java @@ -58,7 +58,7 @@ public class Bomb extends Item { //FIXME using a static variable for this is kinda gross, should be a better way private static boolean lightingFuse = false; - private static final String AC_LIGHTTHROW = "Light & Throw"; + private static final String AC_LIGHTTHROW = "LIGHTTHROW"; @Override public boolean isSimilar(Item item) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/EquipableItem.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/EquipableItem.java index 82c544420..36c897e8c 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/EquipableItem.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/EquipableItem.java @@ -28,6 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; +import java.util.ArrayList; + public abstract class EquipableItem extends Item { public static final String AC_EQUIP = "EQUIP"; @@ -37,6 +39,13 @@ public abstract class EquipableItem extends Item { bones = true; } + @Override + public ArrayList actions(Hero hero ) { + ArrayList actions = super.actions( hero ); + actions.add( isEquipped( hero ) ? AC_UNEQUIP : AC_EQUIP ); + return actions; + } + @Override public void execute( Hero hero, String action ) { if (action.equals( AC_EQUIP )) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/KindOfWeapon.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/KindOfWeapon.java index 9c1a2cf98..26d17bd14 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/KindOfWeapon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/KindOfWeapon.java @@ -33,13 +33,6 @@ abstract public class KindOfWeapon extends EquipableItem { protected static final float TIME_TO_EQUIP = 1f; - @Override - public ArrayList actions( Hero hero ) { - ArrayList actions = super.actions( hero ); - actions.add(isEquipped(hero) ? AC_UNEQUIP : AC_EQUIP); - return actions; - } - @Override public boolean isEquipped( Hero hero ) { return hero.belongings.weapon == this; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/MerchantsBeacon.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/MerchantsBeacon.java index 7e7e9381e..c2aad62a9 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/MerchantsBeacon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/MerchantsBeacon.java @@ -32,7 +32,6 @@ public class MerchantsBeacon extends Item { private static final String AC_USE = "USE"; - { image = ItemSpriteSheet.BEACON; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java index e28c1e61a..1a02f247b 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java @@ -78,13 +78,6 @@ public class Armor extends EquipableItem { inscribe((Glyph) bundle.get(GLYPH)); } - @Override - public ArrayList actions( Hero hero ) { - ArrayList actions = super.actions( hero ); - actions.add(isEquipped(hero) ? AC_UNEQUIP : AC_EQUIP); - return actions; - } - @Override public boolean doEquip( Hero hero ) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java index cf755cd28..f073e071f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java @@ -29,14 +29,13 @@ import com.watabou.utils.Bundle; import java.util.ArrayList; abstract public class ClassArmor extends Armor { - - private static final String TXT_LOW_HEALTH = "Your health is too low!"; - private static final String TXT_NOT_EQUIPPED = "You need to be wearing this armor to use its special power!"; + + private static final String AC_SPECIAL = "SPECIAL"; { levelKnown = true; cursedKnown = true; - defaultAction = special(); + defaultAction = AC_SPECIAL; bones = false; } @@ -95,14 +94,14 @@ abstract public class ClassArmor extends Armor { public ArrayList actions( Hero hero ) { ArrayList actions = super.actions( hero ); if (hero.HP >= 3 && isEquipped( hero )) { - actions.add( special() ); + actions.add( AC_SPECIAL ); } return actions; } @Override public void execute( Hero hero, String action ) { - if (action == special()) { + if (action.equals(AC_SPECIAL)) { if (hero.HP < 3) { GLog.w( Messages.get(this, "low_hp") ); @@ -118,8 +117,7 @@ abstract public class ClassArmor extends Armor { super.execute( hero, action ); } } - - abstract public String special(); + abstract public void doSpecial(); @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/HuntressArmor.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/HuntressArmor.java index 28c97f91a..b04d63fa9 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/HuntressArmor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/HuntressArmor.java @@ -36,8 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.utils.Callback; public class HuntressArmor extends ClassArmor { - - private static final String AC_SPECIAL = "SPECTRAL BLADES"; + { image = ItemSpriteSheet.ARMOR_HUNTRESS; @@ -45,11 +44,6 @@ public class HuntressArmor extends ClassArmor { private HashMap targets = new HashMap(); - @Override - public String special() { - return AC_SPECIAL; - } - @Override public void doSpecial() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/MageArmor.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/MageArmor.java index 9996bb094..5ee1f58c9 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/MageArmor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/MageArmor.java @@ -37,17 +37,10 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class MageArmor extends ClassArmor { - private static final String AC_SPECIAL = "MOLTEN EARTH"; - { image = ItemSpriteSheet.ARMOR_MAGE; } - @Override - public String special() { - return AC_SPECIAL; - } - @Override public void doSpecial() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/RogueArmor.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/RogueArmor.java index 644a40f8c..9fdf3b8f6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/RogueArmor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/RogueArmor.java @@ -41,17 +41,10 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class RogueArmor extends ClassArmor { - private static final String AC_SPECIAL = "SMOKE BOMB"; - { image = ItemSpriteSheet.ARMOR_ROGUE; } - @Override - public String special() { - return AC_SPECIAL; - } - @Override public void doSpecial() { GameScene.selectCell( teleporter ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java index 3af6b8b93..b17ceff65 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java @@ -44,18 +44,11 @@ public class WarriorArmor extends ClassArmor { private static int LEAP_TIME = 1; private static int SHOCK_TIME = 3; - - private static final String AC_SPECIAL = "HEROIC LEAP"; - + { image = ItemSpriteSheet.ARMOR_WARRIOR; } - - @Override - public String special() { - return AC_SPECIAL; - } - + @Override public void doSpecial() { GameScene.selectCell( leaper ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java index 858d63e22..7424d482d 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java @@ -70,14 +70,6 @@ public class Artifact extends KindofMisc { public Artifact(){ super(); } - - @Override - public ArrayList actions( Hero hero ) { - ArrayList actions = super.actions( hero ); - actions.add( isEquipped( hero ) ? AC_UNEQUIP : AC_EQUIP ); - return actions; - } - @Override public boolean doEquip( final Hero hero ) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java index 711caab2a..1ecb4f8a4 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java @@ -108,13 +108,6 @@ public class Ring extends KindofMisc { gem = handler.label( this ); } - @Override - public ArrayList actions( Hero hero ) { - ArrayList actions = super.actions( hero ); - actions.add( isEquipped( hero ) ? AC_UNEQUIP : AC_EQUIP ); - return actions; - } - @Override public boolean doEquip( final Hero hero ) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java index 87c822f7e..7670bfe25 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java @@ -51,9 +51,6 @@ abstract public class MissileWeapon extends Weapon { public ArrayList actions( Hero hero ) { ArrayList actions = super.actions( hero ); actions.remove( AC_EQUIP ); - if (!isEquipped( hero )) { - actions.remove( AC_UNEQUIP ); - } return actions; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index 722cd2419..f4e86ffd4 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -45,6 +45,7 @@ items.armor.clotharmor.name=cloth armor items.armor.clotharmor.desc=This lightweight armor offers basic protection. items.armor.huntressarmor.name=huntress cloak +items.armor.huntressarmor.ac_special=SPECTRAL BLADES items.armor.huntressarmor.no_enemies=No enemies in sight items.armor.huntressarmor.desc=A huntress in such cloak can create a fan of spectral blades. Each of these blades will target a single enemy in the huntress's field of view, inflicting damage depending on her currently equipped melee weapon. @@ -52,6 +53,7 @@ items.armor.leatherarmor.name=leather armor items.armor.leatherarmor.desc=Armor made from tanned monster hide. Not as light as cloth armor but provides better protection. items.armor.magearmor.name=mage robe +items.armor.magearmor.ac_special=MOLTEN EARTH items.armor.magearmor.desc=Wearing this gorgeous robe, a mage can cast a spell of molten earth: all the enemies in his field of view will be set on fire and unable to move at the same time. items.armor.mailarmor.name=mail armor @@ -61,6 +63,7 @@ items.armor.platearmor.name=plate armor items.armor.platearmor.desc=Enormous plates of metal are joined together into a suit that provides unmatched protection to any adventurer strong enough to bear its staggering weight. items.armor.roguearmor.name=rogue garb +items.armor.roguearmor.ac_special=SMOKE BOMB items.armor.roguearmor.fov=You can only jump to an empty location in your field of view items.armor.roguearmor.prompt=Choose a location to jump to items.armor.roguearmor.desc=Wearing this dark garb, a rogue can perform a trick, that is called "smoke bomb": he blinds enemies who could see him and jumps aside. @@ -69,6 +72,7 @@ items.armor.scalearmor.name=scale armor items.armor.scalearmor.desc=The metal scales sewn onto a leather vest create a flexible, yet protective armor. items.armor.warriorarmor.name=warrior suit of armor +items.armor.warriorarmor.ac_special=HEROIC LEAP items.armor.warriorarmor.prompt=Choose direction to leap items.armor.warriorarmor.desc=While this armor looks heavy, it allows a warrior to perform heroic leap towards a targeted location, slamming down to stun all neighbouring enemies. @@ -76,6 +80,7 @@ items.armor.warriorarmor.desc=While this armor looks heavy, it allows a warrior ###artifacts items.artifacts.alchemiststoolkit.name=alchemists toolkit +items.artifacts.alchemiststoolkit.ac_brew=BREW ##this one isn't dropped, so for now no i18n items.artifacts.artifact.unequip_title=Unequip one item @@ -96,6 +101,7 @@ items.artifacts.capeofthorns$thorns.name=Thorns items.artifacts.capeofthorns$thorns.desc=Your cape is radiating energy, surrounding you in a field of deflective force!\n\nAll 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\nTurns of thorns remaining: %s. items.artifacts.chaliceofblood.name=chalice of blood +items.artifacts.chaliceofblood.ac_prick=PRICK items.artifacts.chaliceofblood.yes=Yes, I know what I'm doing items.artifacts.chaliceofblood.no=No, I changed my mind items.artifacts.chaliceofblood.prick_warn=Each time you use the chalice it will drain more life energy, if you are not careful this can easily kill you.\n\nAre you sure you want to offer it more life energy? @@ -108,6 +114,7 @@ items.artifacts.chaliceofblood.desc_2=Some of your blood is pooled into the chal items.artifacts.chaliceofblood.desc_3=The chalice is filled to the brim with your life essence. You can feel the chalice pouring life energy back into you. items.artifacts.cloakofshadows.name=cloak of shadows +items.artifacts.cloakofshadows.ac_stealth=STEALTH items.artifacts.cloakofshadows.cooldown=Your cloak needs %d more rounds to re-energize. items.artifacts.cloakofshadows.no_charge=Your cloak hasn't recharged enough to be usable yet. items.artifacts.cloakofshadows.desc=A priceless magical cloak, stolen from the royal armory many years ago by the Rogue. When worn, it can be used to turn completely invisible for a short time.\n\nThe more the cloak is used, the stronger it will become, allowing the Rogue to become invisible more frequently and for longer durations. @@ -117,6 +124,7 @@ items.artifacts.cloakofshadows$cloakstealth.name=Cloaked items.artifacts.cloakofshadows$cloakstealth.desc=Your cloak of shadows is granting you invisibility while you are shrouded by it.\n\nWhile 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\nYou will remain cloaked until it is cancelled or your cloak runs out of charge. items.artifacts.driedrose.name=dried rose +items.artifacts.driedrose.ac_summon=SUMMON items.artifacts.driedrose.spawned=You have already summed the ghost. items.artifacts.driedrose.no_charge=Your rose isn't fully charged yet. items.artifacts.driedrose.cursed=You cannot use a cursed rose. @@ -138,6 +146,7 @@ items.artifacts.driedrose$ghosthero.introduce=My spirit is bound to this rose, i items.artifacts.driedrose$ghosthero.desc=A frail looking ethereal figure with a humanoid shape. Its power seems tied to the rose I have.\n\nThis ghost may not be much, but it seems to be my only true friend down here. items.artifacts.etherealchains.name=ethereal chains +items.artifacts.etherealchains.ac_cast=CAST items.artifacts.etherealchains.no_charge=Your chains do not have enough charge. items.artifacts.etherealchains.cursed=You can't use cursed chains. items.artifacts.etherealchains.does_nothing=That won't do anything. @@ -150,6 +159,8 @@ items.artifacts.etherealchains.desc_equipped=The chains rest around your side, s items.artifacts.etherealchains$chainsrecharge.levelup=Your chains grow stronger! items.artifacts.hornofplenty.name=horn of plenty +items.artifacts.hornofplenty.ac_eat=EAT +items.artifacts.hornofplenty.ac_store=STORE items.artifacts.hornofplenty.eat=You eat from the horn. items.artifacts.hornofplenty.prompt=Select a piece of food items.artifacts.hornofplenty.no_food=Your horn has no food in it to eat! @@ -162,6 +173,9 @@ items.artifacts.hornofplenty.desc_hint=Perhaps there is a way to increase the ho items.artifacts.hornofplenty.desc_cursed=The cursed horn has bound itself to your side, it seems to be eager to take food rather than produce it. items.artifacts.lloydsbeacon.name=lloyd's beacon +items.artifacts.lloydsbeacon.ac_zap=ZAP +items.artifacts.lloydsbeacon.ac_set=SET +items.artifacts.lloydsbeacon.ac_return=RETURN items.artifacts.lloydsbeacon.no_charge=Your beacon does not have enough energy right now. items.artifacts.lloydsbeacon.tele_fail=The teleportation magic fails. items.artifacts.lloydsbeacon.prompt=Choose a location to zap. @@ -180,6 +194,8 @@ items.artifacts.sandalsofnature.name=sandals of nature items.artifacts.sandalsofnature.name_1=shoes of nature items.artifacts.sandalsofnature.name_2=boots of nature items.artifacts.sandalsofnature.name_3=greaves of nature +items.artifacts.sandalsofnature.ac_feed=FEED +items.artifacts.sandalsofnature.ac_root=ROOT items.artifacts.sandalsofnature.no_charge=They have no energy right now. items.artifacts.sandalsofnature.prompt=Select a seed items.artifacts.sandalsofnature.already_fed=Your footwear have already recently gained nutrients from that seed. @@ -195,6 +211,7 @@ items.artifacts.sandalsofnature.desc_ability=The footwear has gained the ability items.artifacts.sandalsofnature.desc_seeds=You have fed the footwear %d seeds. items.artifacts.talismanofforesight.name=talisman of foresight +items.artifacts.talismanofforesight.ac_scry=SCRY items.artifacts.talismanofforesight.no_charge=Your talisman isn't fully charged yet. items.artifacts.talismanofforesight.scry=The Talisman floods your mind with knowledge about the current floor. items.artifacts.talismanofforesight.desc=A smooth stone with strange engravings on it. You feel like it's watching everything around you, keeping an eye out for anything unusual. @@ -207,6 +224,7 @@ items.artifacts.talismanofforesight$foresight.uneasy=You feel uneasy. items.artifacts.talismanofforesight$foresight.desc=You feel very nervous, as if there is nearby unseen danger. items.artifacts.timekeepershourglass.name=timekeeper's hourglass +items.artifacts.timekeepershourglass.ac_activate=ACTIVATE items.artifacts.timekeepershourglass.in_use=Your hourglass is already in use. items.artifacts.timekeepershourglass.no_charge=Your hourglass hasn't recharged enough to be usable yet. items.artifacts.timekeepershourglass.cursed=You cannot use a cursed hourglass. @@ -225,6 +243,8 @@ items.artifacts.timekeepershourglass$sandbag.no_hourglass=You have no hourglass items.artifacts.timekeepershourglass$sandbag.desc=This small bag of fine sand should work perfectly with your hourglass.\n\nIt seems odd that the shopkeeper would have this specific item right when you need it... items.artifacts.unstablespellbook.name=unstable spellbook +items.artifacts.unstablespellbook.ac_read=READ +items.artifacts.unstablespellbook.ac_add=ADD items.artifacts.unstablespellbook.blinded=You cannot read from the book while blinded. items.artifacts.unstablespellbook.no_charge=Your spellbook is out of energy for now. items.artifacts.unstablespellbook.cursed=You cannot read from a cursed spellbook. @@ -280,6 +300,7 @@ items.food.chargrilledmeat.name=chargrilled meat items.food.chargrilledmeat.desc=It looks like a decent steak. items.food.food.name=ration of food +items.food.foor.ac_eat=EAT items.food.food.eat_msg=That food tasted delicious! items.food.food.desc=Nothing fancy here: dried meat, some biscuits - things like that. @@ -323,6 +344,7 @@ items.keys.skeletonkey.desc=This key looks serious: its head is shaped like a sk ###potions +items.potions.potion.ac_drink=DRINK items.potions.potion.turquoise=turquoise items.potions.potion.crimson=crimson items.potions.potion.azure=azure @@ -411,6 +433,7 @@ items.quest.embers.name=elemental embers items.quest.embers.desc=Special embers which can only be harvested from young fire elementals. They radiate thermal energy. items.quest.pickaxe.name=pickaxe +items.quest.pickaxe.ac_mine=MINE items.quest.pickaxe.no_vein=There is no dark gold vein near you to mine. items.quest.pickaxe.desc=This is a large and sturdy tool for breaking rocks. Probably it can be used as a weapon. @@ -481,6 +504,7 @@ items.rings.ringofwealth.desc=It's not clear what this ring does exactly, good l ###scrolls +items.scrolls.scroll.ac_read=READ items.scrolls.scroll.kaunan=KAUNAN items.scrolls.scroll.sowilo=SOWILO items.scrolls.scroll.laguz=LAGUZ @@ -566,6 +590,7 @@ items.wands.cursedwand.grass=Grass explodes around you! items.wands.cursedwand.fire=You smell burning... items.wands.cursedwand.transmogrify=Your wand transmogrifies into a different item! +items.wands.wand.ac_zap=ZAP items.wands.wand.fizzles=Your wand fizzles; it must not have enough charge. items.wands.wand.self_target=You can't target yourself! items.wands.wand.identify=You are now familiar with your %s. @@ -665,6 +690,8 @@ items.weapon.melee.mace.stats_desc=This is a slightly fast weapon. items.weapon.melee.mace.desc=The iron head of this weapon inflicts substantial damage. items.weapon.melee.magesstaff.name=mage's staff +items.weapon.melee.magesstaff.ac_imbue=IMBUE +items.weapon.melee.magesstaff.ac_zap=ZAP items.weapon.melee.magesstaff.wand=wand items.weapon.melee.magesstaff.staff=staff items.weapon.melee.magesstaff.prompt=Select a wand to consume @@ -688,6 +715,7 @@ items.weapon.melee.quarterstaff.name=quarterstaff items.weapon.melee.quarterstaff.desc=A staff of hardwood, its ends are shod with iron. items.weapon.melee.shortsword.name=short sword +items.weapon.melee.shortsword.ac_reforge=REFORGE items.weapon.melee.shortsword.desc=It is indeed quite short, just a few inches longer, than a dagger. items.weapon.melee.spear.name=spear @@ -738,19 +766,23 @@ items.weapon.weapon.heavier=It was balanced to be heavier. ###misc items items.amulet.name=amulet of yendor +items.amulet.ac_end=END THE GAME items.amulet.desc=The Amulet of Yendor is the most powerful known artifact of unknown origin. It is said that the amulet is able to fulfil any wish if its owner's will-power is strong enough to "persuade" it to do it. items.ankh.name=ankh +items.ankh.ac_bless=BLESS items.ankh.bless=You bless the ankh with clean water. items.ankh.desc=This ancient symbol of immortality grants the ability to return to life after death. Upon resurrection all non-equipped items are lost. Using a full dew vial, the ankh can be blessed with extra strength. items.ankh.desc_blessed=This ancient symbol of immortality grants the ability to return to life after death. The ankh has been blessed and is now much stronger. The Ankh will sacrifice itself to save you in a moment of deadly peril. items.armorkit.name=armor kit +items.armorkit.ac_apply=APPLY items.armorkit.prompt=Select an armor to upgrade items.armorkit.upgraded=You applied the armor kit to upgrade your %s items.armorkit.desc=Using this kit of small tools and materials anybody can transform any armor into an "epic armor", which will keep all properties of the original armor, but will also provide its wearer a special ability depending on his class. No skills in tailoring, leatherworking or blacksmithing are required. items.bomb.name=bomb +items.bomt.ac_lightthrow=LIGHT & THROW items.bomb.snuff_fuse=You quickly snuff the bomb's fuse. items.bomb.ondeath=Killed by an explosion items.bomb.desc=A fairly hefty black powder bomb. An explosion from this would certainly do damage to anything nearby.\n\nIt looks like the fuse will take a couple rounds to burn down once it is lit. @@ -764,6 +796,7 @@ items.dewdrop.already_full=You already have full health. items.dewdrop.desc=A crystal clear dewdrop.\n\nDue to the magic of this place, pure water has minor restorative properties. items.dewvial.name=dew vial +items.dewvial.ac_drink=DRINK items.dewvial.value=%+dHP items.dewvial.collected=You collected a dewdrop into your dew vial. items.dewvial.full=Your dew vial is full! @@ -776,31 +809,39 @@ items.gold.name=gold items.gold.desc=A pile of gold coins. Collect gold coins to spend them later in a shop. items.honeypot.name=honeypot +items.honeypot.ac_shatter=SHATTER items.honeypot.desc=This large honeypot is only really lined with honey, instead it houses a giant bee! These sorts of massive bees usually stay in their hives, perhaps the pot is some sort of specialized trapper's cage? The bee seems pretty content inside the pot with its honey, and buzzes at you warily when you look at it. items.honeypot$shatteredpot.name=shattered honeypot items.honeypot$shatteredpot.desc=The pot has been shattered, only the sticky honey that lines its walls is holding it together, and it is slowly coming apart.\n\nDespite its broken state, the bee still seems to want to protect the pot. items.item.pack_full=Your pack is too full for the %s. items.item.prompt=Choose direction of throw +items.item.ac_drop=DROP +items.item.ac_throw=THROW items.kindofweapon.cursed=you wince as your grip involuntarily tightens around your %s items.merchantsbeacon.name=merchant's beacon +items.merchantsbeacon.ac_use=USE items.merchantsbeacon.desc=This odd piece of dwarven technology allows you to communicate from great distances.\n\nAfter being activated, this beacon will let you sell items to Pixel Mart from anywhere in the dungeon.\n\nHowever, the magic within the beacon will only last for one session, so use it wisely. items.stylus.name=arcane stylus +items.stylus.ac_inscribe=INSCRIBE items.stylus.prompt=Select an armor to inscribe items.stylus.inscribed=You inscribed your armor with the stylus items.stylus.desc=This arcane stylus is made of some dark, very hard stone. Using it you can inscribe a magical glyph on your armor, but you have no power over choosing what glyph it will be, the stylus will decide it for you. items.tomeofmastery.name=Tome of Mastery +items.tomeofmastery.ac_read=READ items.tomeofmastery.way=You have chosen the way of the %s! items.tomeofmastery.desc=This worn leather book is not that thick, but you feel somehow, that you can gather a lot from it. Remember though that reading this tome may require some time. items.torch.name=torch +items.torch.ac_light=LIGHT items.torch.desc=An adventuring staple, when a dungeon goes dark, a torch can help lead the way. items.weightstone.name=weightstone +items.weightstone.ac_apply=APPLY items.weightstone.select=Select a weapon to balance items.weightstone.light=you balanced your weapon to make it lighter items.weightstone.heavy=you balanced your weapon to make it heavier diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java b/src/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java index c615120ab..af7dc4480 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java @@ -119,6 +119,8 @@ public abstract class Plant implements Bundlable { } public static class Seed extends Item { + + public static final String AC_PLANT = "PLANT"; private static final float TIME_TO_PLANT = 1f; @@ -134,7 +136,7 @@ public abstract class Plant implements Bundlable { @Override public ArrayList actions( Hero hero ) { ArrayList actions = super.actions( hero ); - actions.add( Messages.get( Seed.class, "ac_plant" ) ); + actions.add( AC_PLANT ); return actions; } @@ -149,7 +151,7 @@ public abstract class Plant implements Bundlable { @Override public void execute( Hero hero, String action ) { - if (action.equals( Messages.get( Seed.class, "ac_plant" ))) { + if (action.equals( AC_PLANT )) { hero.spend( TIME_TO_PLANT ); hero.busy(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndItem.java b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndItem.java index ecda56224..c9166e8ed 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndItem.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndItem.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.windows; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.ui.ItemSlot; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; @@ -66,7 +67,7 @@ public class WndItem extends Window { if (Dungeon.hero.isAlive() && owner != null) { for (final String action:item.actions( Dungeon.hero )) { - RedButton btn = new RedButton( action ) { + RedButton btn = new RedButton( Messages.get(item, "ac_" + action) ) { @Override protected void onClick() { item.execute( Dungeon.hero, action );