From ab5a37d3d584b93ceeab54faee5f40ac16c7c250 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 17 Mar 2020 20:03:08 -0400 Subject: [PATCH] v0.8.0: dieing to new DK's minions now triggers his ranking description --- .../actors/mobs/DwarfKing.java | 54 +++++++++++++------ .../actors/mobs/Ghoul.java | 6 +-- .../messages/actors/actors.properties | 3 ++ 3 files changed, 41 insertions(+), 22 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DwarfKing.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DwarfKing.java index 4273bd5aa..22b5b6eea 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DwarfKing.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DwarfKing.java @@ -44,7 +44,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon; -import com.shatteredpixel.shatteredpixeldungeon.items.quest.GooBlob; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; import com.shatteredpixel.shatteredpixeldungeon.levels.NewCityBossLevel; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; @@ -186,7 +185,7 @@ public class DwarfKing extends Mob { Sample.INSTANCE.play( Assets.SND_CHALLENGE ); yell(Messages.get(this, "wave_1")); } - summonSubject(3, Ghoul.class); + summonSubject(3, DKGhoul.class); spend(3*TICK); summonsMade++; return true; @@ -197,9 +196,9 @@ public class DwarfKing extends Mob { yell(Messages.get(this, "wave_2")); } if (summonsMade == 7){ - summonSubject(3, Random.Int(2) == 0 ? Monk.class : Warlock.class); + summonSubject(3, Random.Int(2) == 0 ? DKMonk.class : DKWarlock.class); } else { - summonSubject(3, Ghoul.class); + summonSubject(3, DKGhoul.class); } summonsMade++; spend(TICK); @@ -208,10 +207,10 @@ public class DwarfKing extends Mob { sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.4f, 2 ); Sample.INSTANCE.play( Assets.SND_CHALLENGE ); yell(Messages.get(this, "wave_3")); - summonSubject(3, Warlock.class); - summonSubject(3, Monk.class); - summonSubject(3, Ghoul.class); - summonSubject(3, Ghoul.class); + summonSubject(3, DKWarlock.class); + summonSubject(3, DKMonk.class); + summonSubject(3, DKGhoul.class); + summonSubject(3, DKGhoul.class); summonsMade = 12; spend(TICK); return true; @@ -229,9 +228,9 @@ public class DwarfKing extends Mob { private boolean summonSubject( int delay ){ //4th summon is always a monk or warlock, otherwise ghoul if (summonsMade % 4 == 3){ - return summonSubject( delay, Random.Int(2) == 0 ? Monk.class : Warlock.class ); + return summonSubject( delay, Random.Int(2) == 0 ? DKMonk.class : DKWarlock.class ); } else { - return summonSubject( delay, Ghoul.class ); + return summonSubject( delay, DKGhoul.class ); } } @@ -457,6 +456,30 @@ public class DwarfKing extends Mob { return super.isImmune(effect); } + public static class DKGhoul extends Ghoul { + { + state = HUNTING; + } + + @Override + protected boolean act() { + partnerID = -2; //no partners + return super.act(); + } + } + + public static class DKMonk extends Monk { + { + state = HUNTING; + } + } + + public static class DKWarlock extends Warlock { + { + state = HUNTING; + } + } + public static class Summoning extends Buff { private int delay; @@ -475,10 +498,10 @@ public class DwarfKing extends Mob { if (delay <= 0){ - if (summon == Warlock.class){ + if (summon == DKWarlock.class){ particles.burst(ShadowParticle.CURSE, 10); Sample.INSTANCE.play(Assets.SND_CURSED); - } else if (summon == Monk.class){ + } else if (summon == DKMonk.class){ particles.burst(ElmoParticle.FACTORY, 10); Sample.INSTANCE.play(Assets.SND_BURNING); } else { @@ -501,9 +524,6 @@ public class DwarfKing extends Mob { if (Actor.findChar(pos) == null) { Mob m = Reflection.newInstance(summon); - if (m instanceof Ghoul) { - ((Ghoul) m).setSolo(); - } m.pos = pos; m.maxLvl = -2; GameScene.add(m); @@ -531,9 +551,9 @@ public class DwarfKing extends Mob { if (on && particles == null) { particles = CellEmitter.get(pos); - if (summon == Warlock.class){ + if (summon == DKWarlock.class){ particles.pour(ShadowParticle.UP, 0.1f); - } else if (summon == Monk.class){ + } else if (summon == DKMonk.class){ particles.pour(ElmoParticle.FACTORY, 0.1f); } else { particles.pour(Speck.factory(Speck.RATTLE), 0.1f); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java index 5b820e4e9..6dcccdd0f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java @@ -76,7 +76,7 @@ public class Ghoul extends Mob { } private int timesDowned = 0; - private int partnerID = -1; + protected int partnerID = -1; private static final String PARTNER_ID = "partner_id"; private static final String TIMES_DOWNED = "times_downed"; @@ -94,10 +94,6 @@ public class Ghoul extends Mob { partnerID = bundle.getInt( PARTNER_ID ); timesDowned = bundle.getInt( TIMES_DOWNED ); } - - public void setSolo(){ - partnerID = -2; - } @Override protected boolean act() { diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties index 0e7bdae38..80ebcc2cc 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties @@ -532,6 +532,9 @@ actors.mobs.dwarfking.losing=No! You can't do this... you have no idea what lies actors.mobs.dwarfking.defeated=You've... Doomed us all... actors.mobs.dwarfking.rankings_desc=Fell Before the King of Dwarves actors.mobs.dwarfking.desc=Many years ago one of the highest wizards in the dwarven court uncovered secrets which gave him tremendous power over life and death. He soon put this power to use, subjugating and corrupting his peers, his king, and eventually every dwarven citizen. Now he is king, ruler over a legion of undead subjects.\n\nThe King of Dwarves is an aggressive foe, who will attempt to surround and overwhelm his enemies with his horde of undead minions. +actors.mobs.dwarfking$dkghoul.rankings_desc=Fell Before the King of Dwarves +actors.mobs.dwarfking$dkmonk.rankings_desc=Fell Before the King of Dwarves +actors.mobs.dwarfking$dkwarlock.rankings_desc=Fell Before the King of Dwarves actors.mobs.elemental$fire.name=fire elemental actors.mobs.elemental$fire.desc=Elementals are chaotic creatures that are often created when powerful occult magic isn't properly controlled. Elementals have minimal intelligence, and are usually associated with a particular type of magic.\n\nFire elementals are a common type of elemental which deals damage with fiery magic. They will set their target ablaze with melee attacks, and can occasionally shoot bolts of fire as well.