v0.3.4: externalized wand strings

This commit is contained in:
Evan Debenham
2016-01-02 03:24:31 -05:00
committed by Evan Debenham
parent 1885fdc17a
commit 186c6cea91
15 changed files with 83 additions and 139 deletions
@@ -62,6 +62,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.LightningTrap;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.SummoningTrap;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene;
@@ -250,7 +251,7 @@ public class CursedWand {
Sample.INSTANCE.play(Assets.SND_CURSED);
if (!user.isAlive()) {
Dungeon.fail(Utils.format(ResultDescriptions.ITEM, wand.name()));
GLog.n("You were killed by your own " + wand.name());
GLog.n(Messages.get(CursedWand.class, "ondeath", wand.name()));
}
break;
}
@@ -258,7 +259,7 @@ public class CursedWand {
}
});
} else {
GLog.i("nothing happens");
GLog.i(Messages.get(CursedWand.class, "nothing"));
wand.wandUsed();
}
break;
@@ -307,7 +308,7 @@ public class CursedWand {
GameScene.add(sheep);
CellEmitter.get(sheep.pos).burst(Speck.factory(Speck.WOOL), 4);
} else {
GLog.i("nothing happens");
GLog.i(Messages.get(CursedWand.class, "nothing"));
}
wand.wandUsed();
}
@@ -325,7 +326,7 @@ public class CursedWand {
if (misc1 != null) misc1.cursed = misc1.cursedKnown = true;
if (misc2 != null) misc2.cursed = misc2.cursedKnown = true;
EquipableItem.equipCursed(user);
GLog.n("Your worn equipment becomes cursed!");
GLog.n( Messages.get(CursedWand.class, "cursed") );
wand.wandUsed();
break;
@@ -383,8 +384,8 @@ public class CursedWand {
} while (Random.Int(5) != 0);
new Flare(8, 32).color(0xFFFF66, true).show(user.sprite, 2f);
Sample.INSTANCE.play(Assets.SND_TELEPORT);
GLog.p("grass explodes around you!");
GLog.w("you smell burning...");
GLog.p(Messages.get(CursedWand.class, "grass"));
GLog.w(Messages.get(CursedWand.class, "fire"));
wand.wandUsed();
break;
@@ -413,17 +414,23 @@ public class CursedWand {
case 2:
try {
Dungeon.saveAll();
GameScene.show(
new WndOptions("CURSED WAND ERROR", "this application will now self-destruct", "abort", "retry", "fail") {
@Override
public void hide() {
throw new RuntimeException("critical wand exception");
if(!Messages.get(CursedWand.class, "nothing").equals("nothing happens")){
//Don't bother doing this joke to none-english speakers, I doubt it would translate.
GLog.i(Messages.get(CursedWand.class, "nothing"));
wand.wandUsed();
} else {
GameScene.show(
new WndOptions("CURSED WAND ERROR", "this application will now self-destruct", "abort", "retry", "fail") {
@Override
public void hide() {
throw new RuntimeException("critical wand exception");
}
}
}
);
);
}
} catch(IOException e){
//oookay maybe don't kill the game if the save failed.
GLog.i("nothing happens");
GLog.i(Messages.get(CursedWand.class, "nothing"));
wand.wandUsed();
}
break;
@@ -439,7 +446,7 @@ public class CursedWand {
} while (result.level() < 0 && !(result instanceof MissileWeapon));
if (result.isUpgradable()) result.upgrade();
result.cursed = result.cursedKnown = true;
GLog.w("your wand transmogrifies into a different item!");
GLog.w( Messages.get(CursedWand.class, "transmogrify") );
Dungeon.level.drop(result, user.pos).sprite.drop();
wand.wandUsed();
break;
@@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SoulMark;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
@@ -56,11 +57,6 @@ public abstract class Wand extends Item {
public static final String AC_ZAP = "ZAP";
private static final String TXT_FIZZLES = "your wand fizzles; it must not have enough charge.";
private static final String TXT_SELF_TARGET = "You can't target yourself";
private static final String TXT_IDENTIFY = "You are now familiar with your %s.";
private static final float TIME_TO_ZAP = 1f;
public int maxCharges = initialCharges();
@@ -183,7 +179,7 @@ public abstract class Wand extends Item {
@Override
public String info() {
return (cursed && cursedKnown) ?
desc() + "\n\nThis wand is cursed, making its magic chaotic and random." :
desc() + Messages.get(Wand.class, "cursed") :
desc();
}
@@ -254,7 +250,7 @@ public abstract class Wand extends Item {
curCharges -= cursed ? 1 : chargesPerCast();
if (!isIdentified() && usagesToKnow <= 0) {
identify();
GLog.w( TXT_IDENTIFY, name() );
GLog.w( Messages.get(Wand.class, "identify", name()) );
} else {
if (curUser.heroClass == HeroClass.MAGE) levelKnown = true;
updateQuickslot();
@@ -302,7 +298,7 @@ public abstract class Wand extends Item {
return price;
}
private static final String UNFAMILIRIARITY = "unfamiliarity";
private static final String UNFAMILIRIARITY = "unfamiliarity";
private static final String CUR_CHARGES = "curCharges";
private static final String CUR_CHARGE_KNOWN = "curChargeKnown";
private static final String PARTIALCHARGE = "partialCharge";
@@ -340,7 +336,7 @@ public abstract class Wand extends Item {
int cell = shot.collisionPos;
if (target == curUser.pos || cell == curUser.pos) {
GLog.i( TXT_SELF_TARGET );
GLog.i( Messages.get(Wand.class, "self_target") );
return;
}
@@ -360,7 +356,7 @@ public abstract class Wand extends Item {
CursedWand.cursedZap(curWand, curUser, new Ballistica( curUser.pos, target, Ballistica.MAGIC_BOLT));
if (!curWand.cursedKnown){
curWand.cursedKnown = true;
GLog.n("This " + curItem.name() + " is cursed!");
GLog.n(Messages.get(Wand.class, "curse_discover", curWand.name()));
}
} else {
curWand.fx(shot, new Callback() {
@@ -375,7 +371,7 @@ public abstract class Wand extends Item {
} else {
GLog.w( TXT_FIZZLES );
GLog.w( Messages.get(Wand.class, "fizzles") );
}
@@ -384,7 +380,7 @@ public abstract class Wand extends Item {
@Override
public String prompt() {
return "Choose a location to zap";
return Messages.get(Wand.class, "prompt");
}
};
@@ -38,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
@@ -100,7 +101,7 @@ public class WandOfBlastWave extends Wand {
if (!curUser.isAlive()) {
Dungeon.fail( Utils.format(ResultDescriptions.ITEM, name) );
GLog.n("You killed yourself with your own Wand of Blast Wave...");
GLog.n( Messages.get( this, "ondeath") );
}
}
@@ -212,13 +213,4 @@ public class WandOfBlastWave extends Wand {
}
}
@Override
public String desc() {
return "This wand is made of a sort of marbled stone, with gold trim and a round black gem at the tip. " +
"It feels very weighty in your hand.\n" +
"\n" +
"This wand shoots a bolt which violently detonates at a target location. There is no smoke and fire, " +
"but the force of this blast is enough to knock even the biggest of foes around.";
}
}
@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.*;
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample;
@@ -54,12 +55,12 @@ public class WandOfCorruption extends Wand {
if (ch != null){
if(ch.buff(Corruption.class) != null){
GLog.w("that character is already corrupted");
GLog.w( Messages.get(this, "already_corrupted") );
return;
}
if (ch.properties().contains(Char.Property.BOSS) || ch.properties().contains(Char.Property.MINIBOSS)){
GLog.w("Bosses are immune to corruption");
GLog.w( Messages.get(this, "boss") );
return;
}
@@ -82,7 +83,7 @@ public class WandOfCorruption extends Wand {
//if we fail, lose all charges, remember we have 1 left to lose from using the wand.
if (extraCharges >= curCharges){
curCharges = 1;
GLog.w("The corrupting power was not strong enough, nothing happens.");
GLog.w( Messages.get(this, "fail") );
return;
}
@@ -122,14 +123,4 @@ public class WandOfCorruption extends Wand {
particle.shuffleXY(2f);
}
@Override
public String desc() {
return "This wand radiates dark energy, if that weren't already obvious from the small decorative skull shaped onto its tip.\n" +
"\n" +
"This wand will release a blast of corrupting energy, attempting to bend enemies to your will. " +
"Full health enemies are dramatically harder to corrupt than weakened and debuffed ones. " +
"Successfully corrupting an enemy restores them to full health.\n" +
"\n" +
"This wand uses at least one charge per cast, but will often use more in an attempt to overpower more healthy enemies.";
}
}
@@ -56,7 +56,7 @@ public class WandOfDisintegration extends Wand {
int maxDistance = Math.min(distance(), beam.dist);
ArrayList<Char> chars = new ArrayList<Char>();
ArrayList<Char> chars = new ArrayList<>();
int terrainPassed = 2, terrainBonus = 0;
for (int c : beam.subPath(1, maxDistance)) {
@@ -130,12 +130,4 @@ public class WandOfDisintegration extends Wand {
particle.shuffleXY(2f);
}
@Override
public String desc() {
return
"This wand is made from a solid smooth chunk of obsidian, with a deep purple light running up its side, " +
"ending at the tip. It glows with destructive energy, waiting to shoot forward.\n\n" +
"This wand shoots a beam that pierces any obstacle, and will go farther the more it is upgraded.\n\n" +
"This wand deals bonus damage the more enemies and terrain it penetrates.";
}
}
@@ -170,13 +170,4 @@ public class WandOfFireblast extends Wand {
particle.shuffleXY(2f);
}
@Override
public String desc() {
return
"This wand is made from red-lacquered wood with golden leaf used liberally to make it look quite regal. " +
"It crackles and hisses at the tip, eager to unleash its powerful magic.\n" +
"\n" +
"This wand produces a blast of fire when used, extending out into a cone shape. As this wand is upgraded " +
"it will consume more charges, the effect becomes significantly more powerful the more charges are consumed.";
}
}
@@ -118,12 +118,4 @@ public class WandOfFrost extends Wand {
particle.radiateXY(Random.Float(2f));
}
@Override
public String desc() {
return "This wand seems to be made out of some kind of magical ice. It grows brighter towards its " +
"rounded tip. It feels very cold when held, but somehow your hand stays warm.\n\n" +
"This wand shoots blasts of icy energy toward your foes, dealing significant damage and chilling, " +
"which reduces speed. The effect seems stronger in water. Chilled and frozen enemies " +
"take less damage from this wand, as they are already cold.";
}
}
@@ -26,6 +26,7 @@ import java.util.HashSet;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shock;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.noosa.Camera;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
@@ -73,7 +74,7 @@ public class WandOfLightning extends Wand {
if (!curUser.isAlive()) {
Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name ) );
GLog.n( "You killed yourself with your own Wand of Lightning..." );
GLog.n(Messages.get(this, "ondeath"));
}
}
@@ -147,14 +148,5 @@ public class WandOfLightning extends Wand {
particle.x -= dst;
particle.y += dst;
}
@Override
public String desc() {
return
"This wand is made out of solid metal, making it surprisingly heavy. " +
"Two prongs curve together at the top, and electricity arcs between them.\n\n" +
"This wand sends powerful lightning arcing through whatever it is shot at. " +
"This electricity can bounce between many adjacent foes, and is more powerful in water. " +
"If you're too close, you may get shocked as well.";
}
}
@@ -62,10 +62,5 @@ public class WandOfMagicMissile extends Wand {
protected int initialCharges() {
return 3;
}
@Override
public String desc() {
return
"This wand launches missiles of pure magical energy, dealing moderate damage to a target creature.";
}
}
@@ -147,13 +147,4 @@ public class WandOfPrismaticLight extends Wand {
particle.radiateXY(1f);
}
@Override
public String desc() {
return
"This wand is made of a solid piece of translucent crystal, like a long chunk of smooth glass. " +
"It becomes clear towards the tip, where you can see colorful lights dancing around inside it.\n\n" +
"This wand shoots rays of light which damage and blind enemies and cut through the darkness of the dungeon, " +
"revealing hidden areas and traps. Demonic and undead foes will burn in the bright light " +
"of the wand, taking significant bonus damage.";
}
}
@@ -81,7 +81,7 @@ public class WandOfRegrowth extends Wand {
float numPlants, numDews, numPods, numStars;
int chrgUsed = chargesPerCast();
//numbers greater than n*100% means n garunteed plants, e.g. 210% = 2 plants w/10% chance for 3 plants.
//numbers greater than n*100% means n guaranteed plants, e.g. 210% = 2 plants w/10% chance for 3 plants.
numPlants = 0.2f + chrgUsed*chrgUsed*0.020f; //scales from 22% to 220%
numDews = 0.05f + chrgUsed*chrgUsed*0.016f; //scales from 6.6% to 165%
numPods = 0.02f + chrgUsed*chrgUsed*0.013f; //scales from 3.3% to 135%
@@ -242,19 +242,6 @@ public class WandOfRegrowth extends Wand {
particle.y += dst;
}
@Override
public String desc() {
return
"This wand is made from a thin shaft of expertly carved wood. " +
"Somehow it is still alive and vibrant, bright green like a young tree's core.\n" +
"\n" +
"When used, this wand will consume all its charges to blast magical regrowth energy outward " +
"in a cone. This magic will cause grass, roots, and rare plants to spring to life.\n" +
"\n" +
"\"When life ceases new life always begins to grow... The eternal cycle always remains!\"";
}
public static class Dewcatcher extends Plant{
{
@@ -43,6 +43,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
@@ -181,7 +182,7 @@ public class WandOfTransfusion extends Wand {
if (!curUser.isAlive()){
Dungeon.fail( Utils.format(ResultDescriptions.ITEM, name) );
GLog.n("You killed yourself with your own Wand of Transfusion...");
GLog.n( Messages.get(this, "ondeath") );
}
}
@@ -198,7 +199,7 @@ public class WandOfTransfusion extends Wand {
if (Random.Int( level() + 10 ) >= 9){
//grants a free use of the staff
freeCharge = true;
GLog.p("Your staff is charged with the life energy of your enemy!");
GLog.p( Messages.get(this, "charged") );
attacker.sprite.emitter().burst(BloodParticle.BURST, 20);
}
}
@@ -236,11 +237,6 @@ public class WandOfTransfusion extends Wand {
@Override
public String desc() {
return "A fairly plainly shaped wand, it stands out due to its magenta hue and pitch black gem at the tip.\n" +
"\n" +
"This wand will take some of your life energy and blast it at a target. This effect is very versatile: " +
"allies will be healed, enemies will be temporarily charmed, and hostile undead will take considerable damage. " +
"The life force effect can also be potent at dispelling curses as well. " +
"The life energy drain is significant though, using this wand will deal damage to you in addition to consuming charges.";
return "";
}
}
@@ -74,12 +74,4 @@ public class WandOfVenom extends Wand {
particle.shuffleXY(2f);
}
@Override
public String desc() {
return
"This wand has a purple body which opens to a brilliant green gem. " +
"A small amount of foul smelling gas leaks from the gem.\n\n" +
"This wand shoots a bolt which explodes into a cloud of vile venomous gas at a targeted location. " +
"Anything caught inside this cloud will take continual damage, increasing with time.";
}
}