From 3697b1b8c641d2b3b9ff3a42af679f78409432a3 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 11 Feb 2020 18:16:32 -0500 Subject: [PATCH] v0.8.0: bugfixes: - reverted unintential commit of debug stats for ghouls - fixed ghoul life link not transferring correctly in some cases - mobs now retain their max level for xp between save/load - fixed DM-300 incorrectly being immune to rooting --- .../shatteredpixeldungeon/actors/mobs/Ghoul.java | 6 +++--- .../shatteredpixeldungeon/actors/mobs/Mob.java | 4 ++++ .../shatteredpixeldungeon/actors/mobs/NewDM300.java | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) 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 027a898bc..51b2c1191 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 @@ -42,8 +42,8 @@ public class Ghoul extends Mob { { spriteClass = GhoulSprite.class; - HP = HT = 5; - defenseSkill = 0; + HP = HT = 45; + defenseSkill = 20; EXP = 5; maxLvl = 20; @@ -313,7 +313,7 @@ public class Ghoul extends Mob { super.detach(); Ghoul newHost = searchForHost(ghoul); if (newHost != null){ - newHost.add(this); + attachTo(newHost); } else { ghoul.die(this); } 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 125e29f14..38988e19a 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 @@ -107,6 +107,7 @@ public abstract class Mob extends Char { private static final String STATE = "state"; private static final String SEEN = "seen"; private static final String TARGET = "target"; + private static final String MAX_LVL = "max_lvl"; @Override public void storeInBundle( Bundle bundle ) { @@ -126,6 +127,7 @@ public abstract class Mob extends Char { } bundle.put( SEEN, enemySeen ); bundle.put( TARGET, target ); + bundle.put( MAX_LVL, maxLvl ); } @Override @@ -149,6 +151,8 @@ public abstract class Mob extends Char { enemySeen = bundle.getBoolean( SEEN ); target = bundle.getInt( TARGET ); + + if (bundle.contains(MAX_LVL)) maxLvl = bundle.getInt(MAX_LVL); } public CharSprite sprite() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java index 7281ced80..ed77329a5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java @@ -490,6 +490,10 @@ public class NewDM300 extends Mob { return true; } else { + if (rooted || target == pos) { + return false; + } + int bestpos = pos; for (int i : PathFinder.NEIGHBOURS8){ if (Dungeon.level.openSpace[pos+i] && Actor.findChar(pos+i) == null &&