diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java index c1add998d..0a4b57d87 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -61,6 +61,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shocki import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.ShockingDart; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; +import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; @@ -334,7 +335,7 @@ public abstract class Char extends Actor { public void die( Object src ) { destroy(); - sprite.die(); + if (src != Chasm.class) sprite.die(); } public boolean isAlive() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index 5110e4eb0..ec4cd87f4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -48,6 +48,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourg import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfWealth; +import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -556,6 +557,12 @@ public abstract class Mob extends Char { @Override public void die( Object cause ) { + if (cause == Chasm.class){ + //50% chance to round up, 50% to round down + if (EXP % 2 == 1) EXP += Random.Int(2); + EXP /= 2; + } + super.die( cause ); if (alignment == Alignment.ENEMY){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java index 55ed0cd62..1ca1a2943 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java @@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; +import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.SkeletonSprite; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -35,8 +36,6 @@ import com.watabou.utils.PathFinder; import com.watabou.utils.Random; public class Skeleton extends Mob { - - private static final String TXT_HERO_KILLED = "You were killed by the explosion of bones..."; { spriteClass = SkeletonSprite.class; @@ -64,6 +63,8 @@ public class Skeleton extends Mob { super.die( cause ); + if (cause == Chasm.class) return; + boolean heroKilled = false; for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { Char ch = findChar( pos + PathFinder.NEIGHBOURS8[i] ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java index 3da68ebcd..c4653d8e2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java @@ -114,7 +114,7 @@ public class Chasm { } public static void mobFall( Mob mob ) { - mob.die( null ); + mob.die( Chasm.class ); ((MobSprite)mob.sprite).fall(); }