From 1b97a95892a0651c8926b437f1e1b789b0c15939 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 3 Jan 2015 22:31:22 -0500 Subject: [PATCH] v0.2.3: more NPCs now use hero's given name. --- .../shatteredpixeldungeon/actors/mobs/King.java | 2 +- .../shatteredpixeldungeon/actors/mobs/Tengu.java | 2 +- .../actors/mobs/npcs/Ghost.java | 13 +++++++------ .../actors/mobs/npcs/ImpShopkeeper.java | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java index ee91c2d60..0191fd8bd 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java @@ -143,7 +143,7 @@ public class King extends Mob { Badges.validateBossSlain(); - yell( "You cannot kill me, " + Dungeon.hero.heroClass.title() + "... I am... immortal..." ); + yell( "You cannot kill me, " + Dungeon.hero.givenName() + "... I am... immortal..." ); } private int maxArmySize() { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java index 280248360..cb4a34f44 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java @@ -168,7 +168,7 @@ public class Tengu extends Mob { @Override public void notice() { super.notice(); - yell( "Gotcha, " + Dungeon.hero.heroClass.title() + "!" ); + yell( "Gotcha, " + Dungeon.hero.givenName() + "!" ); } @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java index c6c4042dd..92f437e72 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java @@ -56,6 +56,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.GhostSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.GnollTricksterSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.GreatCrabSprite; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; +import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.shatteredpixel.shatteredpixeldungeon.windows.WndQuest; import com.shatteredpixel.shatteredpixeldungeon.windows.WndSadGhost; import com.watabou.noosa.audio.Sample; @@ -76,7 +77,7 @@ public class Ghost extends NPC { } private static final String TXT_RAT1 = - "Hello adventurer... Once I was like you - strong and confident... " + + "Hello %s... Once I was like you - strong and confident... " + "But I was slain by a foul beast... I can't leave this place... Not until I have my revenge... " + "Slay the _fetid rat_, that has taken my life...\n\n" + "It stalks this floor... Spreading filth everywhere... " + @@ -87,7 +88,7 @@ public class Ghost extends NPC { "_Fight it near water... Avoid the stench..._"; private static final String TXT_GNOLL1 = - "Hello adventurer... Once I was like you - strong and confident... " + + "Hello %s... Once I was like you - strong and confident... " + "But I was slain by a devious foe... I can't leave this place... Not until I have my revenge... " + "Slay the _gnoll trickster_, that has taken my life...\n\n" + "It is not like the other gnolls... It hides and uses thrown weapons... " + @@ -98,7 +99,7 @@ public class Ghost extends NPC { "_Don't let it hit you... Get near to it..._"; private static final String TXT_CRAB1 = - "Hello adventurer... Once I was like you - strong and confident... " + + "Hello %s... Once I was like you - strong and confident... " + "But I was slain by an ancient creature... I can't leave this place... Not until I have my revenge... " + "Slay the _great crab_, that has taken my life...\n\n" + "It is unnaturally old... With a massive single claw and a thick shell... " + @@ -196,13 +197,13 @@ public class Ghost extends NPC { switch (Quest.type){ case 1: default: questBoss = new FetidRat(); - txt_quest = TXT_RAT1; break; + txt_quest = Utils.format(TXT_RAT1, Dungeon.hero.givenName()); break; case 2: questBoss = new GnollTrickster(); - txt_quest = TXT_GNOLL1; break; + txt_quest = Utils.format(TXT_GNOLL1, Dungeon.hero.givenName()); break; case 3: questBoss = new GreatCrab(); - txt_quest = TXT_CRAB1; break; + txt_quest = Utils.format(TXT_CRAB1, Dungeon.hero.givenName()); break; } questBoss.pos = Dungeon.level.randomRespawnCell(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/ImpShopkeeper.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/ImpShopkeeper.java index 3bf0ca574..54d9800b7 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/ImpShopkeeper.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/ImpShopkeeper.java @@ -27,7 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; public class ImpShopkeeper extends Shopkeeper { - private static final String TXT_GREETINGS = "Hello, friend!"; + private static final String TXT_GREETINGS = "Hello, %s!"; public static final String TXT_THIEF = "I thought I could trust you!"; @@ -42,7 +42,7 @@ public class ImpShopkeeper extends Shopkeeper { protected boolean act() { if (!seenBefore && Dungeon.visible[pos]) { - yell( Utils.format( TXT_GREETINGS ) ); + yell( Utils.format( TXT_GREETINGS, Dungeon.hero.givenName() ) ); seenBefore = true; }