diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index b4dedf3b2..882649f27 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -1391,6 +1391,13 @@ public class Hero extends Char { Sample.INSTANCE.play( Assets.SND_TELEPORT ); GLog.w( Messages.get(this, "revive") ); Statistics.ankhsUsed++; + + for (Char ch : Actor.chars()){ + if (ch instanceof DriedRose.GhostHero){ + ((DriedRose.GhostHero) ch).sayAnhk(); + return; + } + } return; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java index 55c24695a..5e285786e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java @@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon; import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; import com.shatteredpixel.shatteredpixeldungeon.items.quest.MetalShard; @@ -168,8 +169,16 @@ public class DM300 extends Mob { @Override public void notice() { super.notice(); - BossHealthBar.assignBoss(this); - yell( Messages.get(this, "notice") ); + if (!BossHealthBar.isAssigned()) { + BossHealthBar.assignBoss(this); + yell(Messages.get(this, "notice")); + for (Char ch : Actor.chars()){ + if (ch instanceof DriedRose.GhostHero){ + GLog.n("\n"); + ((DriedRose.GhostHero) ch).sayBoss(); + } + } + } } { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java index c0ac36bd5..106c5b1f3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.GooWarn; @@ -33,6 +34,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Ooze; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; import com.shatteredpixel.shatteredpixeldungeon.items.quest.GooBlob; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -40,6 +42,7 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.GooSprite; import com.shatteredpixel.shatteredpixeldungeon.ui.BossHealthBar; +import com.shatteredpixel.shatteredpixeldungeon.ui.GameLog; import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.Camera; @@ -251,8 +254,16 @@ public class Goo extends Mob { @Override public void notice() { super.notice(); - BossHealthBar.assignBoss(this); - yell( Messages.get(this, "notice") ); + if (!BossHealthBar.isAssigned()) { + BossHealthBar.assignBoss(this); + yell(Messages.get(this, "notice")); + for (Char ch : Actor.chars()){ + if (ch instanceof DriedRose.GhostHero){ + GLog.n("\n"); + ((DriedRose.GhostHero) ch).sayBoss(); + } + } + } } private final String PUMPEDUP = "pumpedup"; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java index 47b55857f..5f6e36502 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java @@ -37,6 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.ArmorKit; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon; import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; @@ -48,6 +49,7 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.KingSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.UndeadSprite; import com.shatteredpixel.shatteredpixeldungeon.ui.BossHealthBar; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; import com.watabou.utils.PathFinder; @@ -225,8 +227,16 @@ public class King extends Mob { @Override public void notice() { super.notice(); - BossHealthBar.assignBoss(this); - yell( Messages.get(this, "notice") ); + if (!BossHealthBar.isAssigned()) { + BossHealthBar.assignBoss(this); + yell(Messages.get(this, "notice")); + for (Char ch : Actor.chars()){ + if (ch instanceof DriedRose.GhostHero){ + GLog.n("\n"); + ((DriedRose.GhostHero) ch).sayBoss(); + } + } + } } { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java index 2162651cc..6430b5cd2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java @@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.TomeOfMastery; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; @@ -42,6 +43,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.TenguSprite; import com.shatteredpixel.shatteredpixeldungeon.ui.BossHealthBar; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; import com.watabou.utils.Random; @@ -241,12 +243,20 @@ public class Tengu extends Mob { @Override public void notice() { super.notice(); - BossHealthBar.assignBoss(this); - if (HP <= HT/2) BossHealthBar.bleed(true); - if (HP == HT) { - yell(Messages.get(this, "notice_mine", Dungeon.hero.givenName())); - } else { - yell(Messages.get(this, "notice_face", Dungeon.hero.givenName())); + if (!BossHealthBar.isAssigned()) { + BossHealthBar.assignBoss(this); + if (HP <= HT/2) BossHealthBar.bleed(true); + if (HP == HT) { + yell(Messages.get(this, "notice_mine", Dungeon.hero.givenName())); + for (Char ch : Actor.chars()){ + if (ch instanceof DriedRose.GhostHero){ + GLog.n("\n"); + ((DriedRose.GhostHero) ch).sayBoss(); + } + } + } else { + yell(Messages.get(this, "notice_face", Dungeon.hero.givenName())); + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java index a5e492b12..2c5ea1075 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java @@ -40,6 +40,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRetribution; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfPsionicBlast; @@ -176,8 +177,16 @@ public class Yog extends Mob { @Override public void notice() { super.notice(); - BossHealthBar.assignBoss(this); - yell( Messages.get(this, "notice") ); + if (!BossHealthBar.isAssigned()) { + BossHealthBar.assignBoss(this); + yell(Messages.get(this, "notice")); + for (Char ch : Actor.chars()){ + if (ch instanceof DriedRose.GhostHero){ + GLog.n("\n"); + ((DriedRose.GhostHero) ch).sayBoss(); + } + } + } } { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java index 0a10e97c7..1f4860357 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.CorrosiveGas; @@ -52,6 +53,7 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.GhostSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.ui.BossHealthBar; import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline; import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -153,8 +155,14 @@ public class DriedRose extends Artifact { ghost.yell( Messages.get(GhostHero.class, "hello", Dungeon.hero.givenName()) ); Sample.INSTANCE.play( Assets.SND_GHOST ); firstSummon = true; - } else - ghost.saySpawned(); + + } else { + if (BossHealthBar.isAssigned()) { + ghost.sayBoss(); + } else { + ghost.sayAppeared(); + } + } charge = 0; updateQuickslot(); @@ -302,6 +310,7 @@ public class DriedRose extends Artifact { defaultAction = AC_SUMMON; } + //TODO consider adjusting recharging and/or ghosts health regen so that suiciding isn't so good as a heal LockedFloor lock = target.buff(LockedFloor.class); if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) { partialCharge += 1/5f; //500 turns to a full charge @@ -337,15 +346,18 @@ public class DriedRose extends Artifact { } } - //FIXME need to translate phrases here public CellSelector.Listener ghostDirector = new CellSelector.Listener(){ @Override public void onSelect(Integer cell) { if (cell == null) return; - if (!Dungeon.level.heroFOV[cell] || Actor.findChar(cell) == null){ - GLog.i("Okay, I'll hold that position"); + Sample.INSTANCE.play( Assets.SND_GHOST ); + + if (!Dungeon.level.heroFOV[cell] + || Actor.findChar(cell) == null + || (Actor.findChar(cell) != Dungeon.hero && Actor.findChar(cell).alignment != Char.Alignment.ENEMY)){ + ghost.yell(Messages.get(ghost, "directed_position_" + Random.IntRange(1, 5))); ghost.aggro(null); ghost.state = ghost.WANDERING; ghost.defendingPos = cell; @@ -359,22 +371,21 @@ public class DriedRose extends Artifact { Dungeon.level.updateFieldOfView( ghost, ghost.fieldOfView ); if (Actor.findChar(cell) == Dungeon.hero){ - GLog.i("Okay, I'll follow you."); + ghost.yell(Messages.get(ghost, "directed_follow_" + Random.IntRange(1, 5))); ghost.aggro(null); ghost.state = ghost.WANDERING; ghost.defendingPos = -1; } else if (Actor.findChar(cell).alignment == Char.Alignment.ENEMY){ - GLog.i("Okay, I'll attack that enemy."); + ghost.yell(Messages.get(ghost, "directed_attack_" + Random.IntRange(1, 5))); ghost.aggro(Actor.findChar(cell)); ghost.setTarget(cell); - } } @Override public String prompt() { - return "\"What should I do?\""; + return "\"" + Messages.get(GhostHero.class, "direct_prompt") + "\""; } }; @@ -453,42 +464,83 @@ public class DriedRose extends Artifact { rose = Dungeon.hero.belongings.getItem(DriedRose.class); } - defenseSkill = (Dungeon.hero.lvl+4)*2; + //same dodge as the hero + defenseSkill = (Dungeon.hero.lvl+4); if (rose == null) return; - HT = 20 + 4*rose.level(); + HT = 20 + 8*rose.level(); } - public void saySpawned(){ - if (Messages.lang() != Languages.ENGLISH) return; //don't say anything if not on english - int i = (Dungeon.depth - 1) / 5; - fieldOfView = new boolean[Dungeon.level.length()]; - Dungeon.level.updateFieldOfView(this, fieldOfView); - if (chooseEnemy() == null) - yell( Random.element( VOICE_AMBIENT[i] ) ); - else - yell( Random.element( VOICE_ENEMIES[i][ Dungeon.bossLevel() ? 1 : 0 ] ) ); - Sample.INSTANCE.play( Assets.SND_GHOST ); + public void sayAppeared(){ + int depth = (Dungeon.depth - 1) / 5; + + //only some lines are said on the first floor of a depth + int variant = Dungeon.depth % 5 == 1 ? Random.IntRange(1, 3) : Random.IntRange(1, 6); + + switch(depth){ + case 0: + yell( Messages.get( this, "dialogue_sewers_" + variant )); + break; + case 1: + yell( Messages.get( this, "dialogue_prison_" + variant )); + break; + case 2: + yell( Messages.get( this, "dialogue_caves_" + variant )); + break; + case 3: + yell( Messages.get( this, "dialogue_city_" + variant )); + break; + case 4: default: + yell( Messages.get( this, "dialogue_halls_" + variant )); + break; + } + if (ShatteredPixelDungeon.scene() instanceof GameScene) { + Sample.INSTANCE.play( Assets.SND_GHOST ); + } } - - public void sayAnhk(){ - yell( Random.element( VOICE_BLESSEDANKH ) ); + + public void sayBoss(){ + int depth = (Dungeon.depth - 1) / 5; + + switch(depth){ + case 0: + yell( Messages.get( this, "seen_goo_" + Random.IntRange(1, 3) )); + break; + case 1: + yell( Messages.get( this, "seen_tengu_" + Random.IntRange(1, 3) )); + break; + case 2: + yell( Messages.get( this, "seen_dm300_" + Random.IntRange(1, 3) )); + break; + case 3: + yell( Messages.get( this, "seen_king_" + Random.IntRange(1, 3) )); + break; + case 4: default: + yell( Messages.get( this, "seen_yog_" + Random.IntRange(1, 3) )); + break; + } Sample.INSTANCE.play( Assets.SND_GHOST ); } public void sayDefeated(){ - if (Messages.lang() != Languages.ENGLISH) return; //don't say anything if not on english - yell( Random.element( VOICE_DEFEATED[ Dungeon.bossLevel() ? 1 : 0 ] ) ); + if (BossHealthBar.isAssigned()){ + yell( Messages.get( this, "defeated_by_boss_" + Random.IntRange(1, 3) )); + } else { + yell( Messages.get( this, "defeated_by_enemy_" + Random.IntRange(1, 3) )); + } Sample.INSTANCE.play( Assets.SND_GHOST ); } public void sayHeroKilled(){ - if (Messages.lang() != Languages.ENGLISH) return; //don't say anything if not on english - yell(Random.element(VOICE_HEROKILLED)); + if (Dungeon.bossLevel()){ + yell( Messages.get( this, "hero_killed_boss_" + Random.IntRange(1, 3) )); + } else { + yell( Messages.get( this, "hero_killed_" + Random.IntRange(1, 3) )); + } Sample.INSTANCE.play( Assets.SND_GHOST ); } - - public void sayBossBeaten(){ - yell( Random.element( VOICE_BOSSBEATEN[ Dungeon.depth==25 ? 1 : 0 ] ) ); + + public void sayAnhk(){ + yell( Messages.get( this, "blessed_ankh_" + Random.IntRange(1, 3) )); Sample.INSTANCE.play( Assets.SND_GHOST ); } @@ -736,139 +788,6 @@ public class DriedRose extends Artifact { } - //************************************************************************************ - //This is a bunch strings & string arrays, used in all of the sad ghost's voice lines. - //************************************************************************************ - //FIXME, need to go over these for final polish (inc. translations!) - - private static final String VOICE_INTRODUCE = "My spirit is bound to this rose, it was very precious to me, a "+ - "gift from my love whom I left on the surface.\n\nI cannot return to him, but thanks to you I have a " + - "second chance to complete my journey. When I am able I will respond to your call and fight with you.\n\n" + - "hopefully you may succeed where I failed..."; - - //1st index - depth type, 2nd index - specific line. - public static final String[][] VOICE_AMBIENT = { - { - "These sewers were once safe, some even lived here in the winter...", - "I wonder what happened to the guard patrols, did they give up?...", - "I had family on the surface, I hope they are safe..." - },{ - "I've heard stories about this place, nothing good...", - "This place was always more of a dungeon than a prison...", - "I can't imagine what went on when this place was abandoned..." - },{ - "No human or dwarf has been here for a very long time...", - "Something must have gone very wrong, for the dwarves to abandon a gold mine...", - "I feel great evil lurking below..." - },{ - "The dwarves were industrious, but greedy...", - "I hope the surface never ends up like this place...", - "So the dwarvern metropolis really has fallen..." - },{ - "What is this place?...", - "So the stories are true, we have to fight a demon god...", - "I feel a great evil in this place..." - },{ - "... I don't like this place... We should leave as soon as possible..." - } - }; - - //1st index - depth type, 2nd index - boss or not, 3rd index - specific line. - public static final String[][][] VOICE_ENEMIES = { - { - { - "Let's make the sewers safe again...", - "If the guards couldn't defeat them, perhaps we can...", - "These crabs are extremely annoying..." - },{ - "Beware Goo!...", - "Many of my friends died to this thing, time for vengeance...", - "Such an abomination cannot be allowed to live..." - } - },{ - { - "What dark magic happened here?...", - "To think the captives of this place are now its guardians...", - "They were criminals before, now they are monsters..." - },{ - "If only he would see reason, he doesn't seem insane...", - "He assumes we are hostile, if only he would stop to talk...", - "The one prisoner left sane is a deadly assassin. Of course..." - } - },{ - { - "The creatures here are twisted, just like the sewers... ", - "more gnolls, I hate gnolls...", - "Even the bats are bloodthirsty here..." - },{ - "Only dwarves would build a mining machine that kills looters...", - "That thing is huge...", - "How has it survived here for so long?..." - } - },{ - { - "Dwarves aren't supposed to look that pale...", - "I don't know what's worse, the dwarves, or their creations...", - "They all obey their master without question, even now..." - },{ - "When people say power corrupts, this is what they mean...", - "He's more a Lich than a King now...", - "Looks like he's more demon than dwarf now..." - } - },{ - { - "What the heck is that thing?...", - "This place is terrifying...", - "What were the dwarves thinking, toying with power like this?..." - },{ - "Oh.... this doesn't look good...", - "So that's what a god looks like?...", - "This is going to hurt..." - } - },{ - { - "I don't like this place... we should leave as soon as we can..." - },{ - "Hello source viewer, I'm writing this here as this line should never trigger. Have a nice day!" - } - } - }; - - //1st index - Yog or not, 2nd index - specific line. - public static final String[][] VOICE_BOSSBEATEN = { - { - "Yes!", - "Victory!" - },{ - "It's over... we won...", - "I can't believe it... We just killed a god..." - } - }; - - //1st index - boss or not, 2nd index - specific line. - public static final String[][] VOICE_DEFEATED = { - { - "Good luck...", - "I will return...", - "Tired... for now..." - },{ - "No... I can't....", - "I'm sorry.. good luck..", - "Finish it off... without me..." - } - }; - - public static final String[] VOICE_HEROKILLED = { - "nooo...", - "no...", - "I couldn't help them..." - }; - - public static final String[] VOICE_BLESSEDANKH = { - "Incredible!...", - "Wish I had one of those...", - "How did you survive that?..." - }; } private static class WndGhostHero extends Window{ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index 836cb159b..a01f55d5c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.SPDSettings; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.BannerSprites; @@ -41,6 +42,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; import com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster; import com.shatteredpixel.shatteredpixeldungeon.items.bags.PotionBandolier; import com.shatteredpixel.shatteredpixeldungeon.items.bags.ScrollHolder; @@ -419,6 +421,13 @@ public class GameScene extends PixelScene { && (InterlevelScene.mode == InterlevelScene.Mode.DESCEND || InterlevelScene.mode == InterlevelScene.Mode.FALL)) { GLog.h(Messages.get(this, "descend"), Dungeon.depth); Sample.INSTANCE.play(Assets.SND_DESCEND); + + for (Char ch : Actor.chars()){ + if (ch instanceof DriedRose.GhostHero){ + ((DriedRose.GhostHero) ch).sayAppeared(); + } + } + } else if (InterlevelScene.mode == InterlevelScene.Mode.RESET) { GLog.h(Messages.get(this, "warp")); } else { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BossHealthBar.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BossHealthBar.java index 4d50e9d43..9878b59fd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BossHealthBar.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BossHealthBar.java @@ -111,6 +111,10 @@ public class BossHealthBar extends Component { instance.visible = instance.active = true; } } + + public static boolean isAssigned(){ + return boss != null && boss.isAlive() && Dungeon.level.mobs.contains(boss); + } public static void bleed(boolean value){ bleeding = value; diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index fc34afffe..e0d2b9bbc 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -204,11 +204,6 @@ items.artifacts.driedrose$petal.no_room=There is no room left for this petal, so items.artifacts.driedrose$petal.maxlevel=The rose is completed! items.artifacts.driedrose$petal.levelup=You add the petal to the rose. items.artifacts.driedrose$petal.desc=A frail dried up petal, which has somehow survived this far into the dungeon. -items.artifacts.driedrose$ghosthero.name=sad ghost -items.artifacts.driedrose$ghosthero.def_verb=evaded -items.artifacts.driedrose$ghosthero.hello=Hello again %s. -items.artifacts.driedrose$ghosthero.introduce=My spirit is bound to this rose, it was very precious to me, a gift from my love whom I left on the surface.\n\nI cannot return to him, but thanks to you I have a second chance to complete my journey. When I am able I will respond to your call and fight with you.\n\nAs long as you have the rose I can hear your voice, so you can use it to direct me from afar.\n\nHopefully you may succeed where I failed... -items.artifacts.driedrose$ghosthero.desc=A frail looking ethereal figure with a humanoid shape. Their power seems tied to the rose you have.\n\nThis ghost may not be much, they seem to be your only true friend down here. items.artifacts.driedrose$wndghosthero.title=Ghost's Equipment items.artifacts.driedrose$wndghosthero.desc=The ghost is weak on their own, but their form is solid enough to be equipped with a weapon and armor. They will be able to use these items just like you do.\n\nThe ghost can currently equip items requiring up to _%d strength._ items.artifacts.driedrose$wndghosthero.weapon_prompt=Select a weapon @@ -218,6 +213,93 @@ items.artifacts.driedrose$wndghosthero.cant_unidentified=You don't know enough a items.artifacts.driedrose$wndghosthero.cant_cursed=You can't give the ghost cursed equipment. items.artifacts.driedrose$wndghosthero.cant_strength=The ghost is not strong enough to use that. +##ghost hero +items.artifacts.driedrose$ghosthero.name=sad ghost +items.artifacts.driedrose$ghosthero.def_verb=evaded + +items.artifacts.driedrose$ghosthero.hello=Hello again %s. +items.artifacts.driedrose$ghosthero.introduce=My spirit is bound to this rose, it was very precious to me, a gift from my love whom I left on the surface.\n\nI cannot return to him, but thanks to you I have a second chance to complete my journey. When I am able I will respond to your call and fight with you.\n\nAs long as you have the rose I can hear your voice, so you can use it to direct me from afar.\n\nHopefully you may succeed where I failed... + +items.artifacts.driedrose$ghosthero.dialogue_sewers_1=These sewers used to be safe, people even lived here in the winter. +items.artifacts.driedrose$ghosthero.dialogue_sewers_2=I wonder what happened to the guard patrols, did they give up? +items.artifacts.driedrose$ghosthero.dialogue_sewers_3=I had family on the surface, I hope they're safe. +items.artifacts.driedrose$ghosthero.dialogue_sewers_4=The guards couldn't defeat these monsters, but maybe we can. +items.artifacts.driedrose$ghosthero.dialogue_sewers_5=If even the sewers are this dangerous, I wonder what's below... +items.artifacts.driedrose$ghosthero.dialogue_sewers_6=What could have caused these rats and crabs to grow so large? +items.artifacts.driedrose$ghosthero.dialogue_prison_1=I've heard stories about this place, nothing good. +items.artifacts.driedrose$ghosthero.dialogue_prison_2=This place was always more of a dungeon than a prison. +items.artifacts.driedrose$ghosthero.dialogue_prison_3=I can't imagine what went on when this place was abandoned. +items.artifacts.driedrose$ghosthero.dialogue_prison_4=It seems both the prisoners and guards have been turned into monsters. +items.artifacts.driedrose$ghosthero.dialogue_prison_5=What could be responsible for all these skeletons? +items.artifacts.driedrose$ghosthero.dialogue_prison_6=These people didn't have to end up like this... +items.artifacts.driedrose$ghosthero.dialogue_caves_1=No human or dwarf has been here for a very long time. +items.artifacts.driedrose$ghosthero.dialogue_caves_2=What would cause the dwarves to abandon a gold mine? +items.artifacts.driedrose$ghosthero.dialogue_caves_3=It's a shame all the gold here is useless on the surface. +items.artifacts.driedrose$ghosthero.dialogue_caves_4=The creatures here are twisted, just like the sewers. +items.artifacts.driedrose$ghosthero.dialogue_caves_5=Even the bats are bloodthirsty here. +items.artifacts.driedrose$ghosthero.dialogue_caves_6=We haven't seen any machinery, did the dwarves reclaim it all? +items.artifacts.driedrose$ghosthero.dialogue_city_1=The dwarves were industrious, but greedy. +items.artifacts.driedrose$ghosthero.dialogue_city_2=So the dwarvern metropolis really has fallen. +items.artifacts.driedrose$ghosthero.dialogue_city_3=I hope the surface never ends up like this place. +items.artifacts.driedrose$ghosthero.dialogue_city_4=Dwarves aren't supposed to look so pale. +items.artifacts.driedrose$ghosthero.dialogue_city_5=I don't know what's worse, the dwarves, or their creations. +items.artifacts.driedrose$ghosthero.dialogue_city_6=It seems the dwarves are mindless monsters now as well. +items.artifacts.driedrose$ghosthero.dialogue_halls_1=What is this place? +items.artifacts.driedrose$ghosthero.dialogue_halls_2=This place is terrifying... +items.artifacts.driedrose$ghosthero.dialogue_halls_3=What were the dwarves thinking, toying with power like this? +items.artifacts.driedrose$ghosthero.dialogue_halls_4=The monsters here are otherworldly, where did they come from? +items.artifacts.driedrose$ghosthero.dialogue_halls_5=Can you feel it? It's like something is watching us. +items.artifacts.driedrose$ghosthero.dialogue_halls_6=Thank goodness there are torches, it's so dark here! + +items.artifacts.driedrose$ghosthero.seen_goo_1=Beware Goo! +items.artifacts.driedrose$ghosthero.seen_goo_2=Many of my friends died to this thing, time for vengeance! +items.artifacts.driedrose$ghosthero.seen_goo_3=Such an abomination cannot be allowed to live! +items.artifacts.driedrose$ghosthero.seen_tengu_1=The one prisoner left is a deadly assassin. Of course... +items.artifacts.driedrose$ghosthero.seen_tengu_2=He's trapped us! +items.artifacts.driedrose$ghosthero.seen_tengu_3=I've heard horror stories about that mask... +items.artifacts.driedrose$ghosthero.seen_dm300_1=Only dwarves would build a mining machine that kills intruders. +items.artifacts.driedrose$ghosthero.seen_dm300_2=That thing is huge... +items.artifacts.driedrose$ghosthero.seen_dm300_3=How has this thing stayed active for so long? +items.artifacts.driedrose$ghosthero.seen_king_1=When people say power corrupts, this is what they mean. +items.artifacts.driedrose$ghosthero.seen_king_2=He's more of a lich than a king now. +items.artifacts.driedrose$ghosthero.seen_king_3=Even in death the dwarves obey their master. +items.artifacts.driedrose$ghosthero.seen_yog_1=Oh, this doesn't look good. +items.artifacts.driedrose$ghosthero.seen_yog_2=So that's what a god looks like? +items.artifacts.driedrose$ghosthero.seen_yog_3=This is going to hurt... + +items.artifacts.driedrose$ghosthero.defeated_by_enemy_1=Good luck... +items.artifacts.driedrose$ghosthero.defeated_by_enemy_2=Tired... for now... +items.artifacts.driedrose$ghosthero.defeated_by_enemy_3=I will return... +items.artifacts.driedrose$ghosthero.defeated_by_boss_1=I'm sorry... good luck... +items.artifacts.driedrose$ghosthero.defeated_by_boss_2=Finish it off... without me... +items.artifacts.driedrose$ghosthero.defeated_by_boss_3=No... I can't... +items.artifacts.driedrose$ghosthero.blessed_ankh_1=How did you survive that? +items.artifacts.driedrose$ghosthero.blessed_ankh_2=I wish I had one of those... +items.artifacts.driedrose$ghosthero.blessed_ankh_3=Oh my! You're still alive! +items.artifacts.driedrose$ghosthero.player_killed_1=No!... +items.artifacts.driedrose$ghosthero.player_killed_2=I couldn't help them... +items.artifacts.driedrose$ghosthero.player_killed_3=Not like this... + +items.artifacts.driedrose$ghosthero.direct_prompt=What should I do? +items.artifacts.driedrose$ghosthero.directed_follow_1=Okay, I'll follow you +items.artifacts.driedrose$ghosthero.directed_follow_2=I'll fall in behind you +items.artifacts.driedrose$ghosthero.directed_follow_3=Following you... +items.artifacts.driedrose$ghosthero.directed_follow_4=Okay, let's go! +items.artifacts.driedrose$ghosthero.directed_follow_5=I've got your back. +items.artifacts.driedrose$ghosthero.directed_attack_1=Okay, I'll attack that one. +items.artifacts.driedrose$ghosthero.directed_attack_2=I'll get that one. +items.artifacts.driedrose$ghosthero.directed_attack_3=Engaging... +items.artifacts.driedrose$ghosthero.directed_attack_4=Let's get them! +items.artifacts.driedrose$ghosthero.directed_attack_5=TODO +items.artifacts.driedrose$ghosthero.directed_position_1=Okay, I'll hold that position. +items.artifacts.driedrose$ghosthero.directed_position_2=I'll go there and defend. +items.artifacts.driedrose$ghosthero.directed_position_3=Repositioning... +items.artifacts.driedrose$ghosthero.directed_position_4=On my way! +items.artifacts.driedrose$ghosthero.directed_position_5=TODO + +items.artifacts.driedrose$ghosthero.desc=A frail looking ethereal figure with a humanoid shape. Their power seems tied to the rose you have.\n\nThis ghost may not be much, they seem to be your only true friend down here. + +##back to artifacts items.artifacts.etherealchains.name=ethereal chains items.artifacts.etherealchains.ac_cast=CAST items.artifacts.etherealchains.no_charge=Your chains do not have enough charge.