mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-14 14:24:37 +01:00
Refactor how challenges handle dead avatars
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package emu.lunarcore.game.challenge;
|
package emu.lunarcore.game.challenge;
|
||||||
|
|
||||||
import dev.morphia.annotations.Entity;
|
import dev.morphia.annotations.Entity;
|
||||||
|
|
||||||
import emu.lunarcore.data.GameData;
|
import emu.lunarcore.data.GameData;
|
||||||
import emu.lunarcore.data.excel.ChallengeExcel;
|
import emu.lunarcore.data.excel.ChallengeExcel;
|
||||||
import emu.lunarcore.game.battle.Battle;
|
import emu.lunarcore.game.battle.Battle;
|
||||||
@@ -82,8 +81,8 @@ public class ChallengeInstance {
|
|||||||
public void onBattleFinish(Battle battle, BattleEndStatus result, BattleStatistics stats) {
|
public void onBattleFinish(Battle battle, BattleEndStatus result, BattleStatistics stats) {
|
||||||
if (result == BattleEndStatus.BATTLE_END_WIN) {
|
if (result == BattleEndStatus.BATTLE_END_WIN) {
|
||||||
// Check if any avatar in the lineup has died
|
// Check if any avatar in the lineup has died
|
||||||
player.getCurrentLineup().forEachAvatar(avatar -> {
|
battle.getLineup().forEachAvatar(avatar -> {
|
||||||
if (!avatar.isAlive()) {
|
if (avatar.getCurrentHp(battle.getLineup()) <= 0) {
|
||||||
hasAvatarDied = true;
|
hasAvatarDied = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user