From 574c0cd29b83c559b764e147bd33db6884c00df3 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 23 Jan 2018 20:02:40 -0500 Subject: [PATCH] v0.6.3: various bugfixes: - new corruption logic now works with piranha and dwarf tokens - wand of corruption can now apply to NPCs - fixed being able to attempt assassination on NPCs --- .../shatteredpixeldungeon/actors/buffs/Preparation.java | 3 ++- .../shatteredpixeldungeon/actors/mobs/Golem.java | 6 +++--- .../shatteredpixeldungeon/actors/mobs/Monk.java | 4 ++-- .../shatteredpixeldungeon/actors/mobs/Piranha.java | 4 +++- .../shatteredpixeldungeon/items/wands/WandOfCorruption.java | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java index 06064bb9c..14ee08b12 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java @@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Rat; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Effects; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; @@ -233,7 +234,7 @@ public class Preparation extends Buff implements ActionIndicator.Action { public void onSelect(Integer cell) { if (cell == null) return; final Char enemy = Actor.findChar( cell ); - if (enemy == null || Dungeon.hero.isCharmedBy(enemy)){ + if (enemy == null || Dungeon.hero.isCharmedBy(enemy) || enemy instanceof NPC){ GLog.w(Messages.get(Preparation.class, "no_target")); } else { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Golem.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Golem.java index 54c51bb71..119bfb1db 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Golem.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Golem.java @@ -60,12 +60,12 @@ public class Golem extends Mob { public int drRoll() { return Random.NormalIntRange(0, 12); } - + @Override - public void die( Object cause ) { + public void rollToDropLoot() { Imp.Quest.process( this ); - super.die( cause ); + super.rollToDropLoot(); } { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Monk.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Monk.java index 67b7c4453..6d3b47141 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Monk.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Monk.java @@ -74,10 +74,10 @@ public class Monk extends Mob { } @Override - public void die( Object cause ) { + public void rollToDropLoot() { Imp.Quest.process( this ); - super.die( cause ); + super.rollToDropLoot(); } private int hitsToDisarm = 0; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java index 562382599..10f483a34 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java @@ -47,6 +47,9 @@ public class Piranha extends Mob { EXP = 0; + loot = MysteryMeat.class; + lootChance = 1f; + HUNTING = new Hunting(); } @@ -86,7 +89,6 @@ public class Piranha extends Mob { @Override public void die( Object cause ) { - Dungeon.level.drop( new MysteryMeat(), pos ).sprite.drop(); super.die( cause ); Statistics.piranhasKilled++; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java index 65cd1c52f..978ee1ea2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java @@ -125,7 +125,7 @@ public class WandOfCorruption extends Wand { if (ch != null){ - if (!(ch instanceof Mob) || ch instanceof NPC){ + if (!(ch instanceof Mob)){ return; }