Minor Adventure bug fixes (#3683)

Prevent NPE with invalid event history
Correct transition from aggro to previous movement behavior with dungeon mobs
This commit is contained in:
TabletopGeneral
2023-08-23 16:15:25 -07:00
committed by GitHub
parent de91e5cb33
commit 1ccb76745f
3 changed files with 8 additions and 1 deletions

View File

@@ -361,6 +361,8 @@ public class EnemySprite extends CharacterSprite implements Steerable<Vector2> {
}
if (aggro && spriteToPlayer.len() > pursueRange) {
aggro = false;
if (navPath != null)
navPath.clear();
initializeBaseMovementBehavior();
}
}

View File

@@ -110,8 +110,12 @@ public class PlayerStatistic implements SaveFileContent {
else
winLossRecord.clear();
if (data!=null&&data.containsKey("completedEvents"))
if (data!=null&&data.containsKey("completedEvents")) {
completedEvents = (ArrayList<AdventureEventData>) data.readObject("completedEvents");
if (completedEvents == null) {
completedEvents = new ArrayList<>();
}
}
else
completedEvents.clear();
}

View File

@@ -8,3 +8,4 @@ SVar:TrigLoseLife:DB$ LoseLife | LifeAmount$ X
SVar:X:Count$InYourHand/Times.2
SVar:DonateMe:5
Oracle:When Demonic Lore enters the battlefield, draw three cards.\nAt the beginning of your end step, you lose 2 life for each card in your hand.
AI:Remove:Random