Only teleport back to anchors when retreating from maze battles

This commit is contained in:
Melledy
2023-10-03 02:09:10 -07:00
parent 94456d200e
commit 94935fde83
2 changed files with 21 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import emu.lunarcore.data.GameData;
import emu.lunarcore.data.excel.MazeBuffExcel;
import emu.lunarcore.data.excel.StageExcel;
import emu.lunarcore.game.avatar.GameAvatar;
import emu.lunarcore.game.enums.StageType;
import emu.lunarcore.game.player.Player;
import emu.lunarcore.game.player.PlayerLineup;
import emu.lunarcore.game.scene.entity.EntityMonster;
@@ -49,6 +50,22 @@ public class Battle {
this.stages.addAll(stages);
}
public StageType getStageType() {
StageExcel stage = this.getFirstStage();
if (stage != null) {
return stage.getStageType();
}
return StageType.Unknown;
}
public StageExcel getFirstStage() {
if (this.getStages().size() > 0) {
return this.getStages().get(0);
} else {
return null;
}
}
public int getStageId() {
if (this.getStages().size() > 0) {
return this.getStages().get(0).getId();
@@ -57,7 +74,6 @@ public class Battle {
}
}
public MazeBuff addBuff(int buffId, int ownerIndex) {
return addBuff(buffId, ownerIndex, 0xffffffff);
}

View File

@@ -206,8 +206,11 @@ public class BattleService extends BaseGameService {
teleportToAnchor = true;
}
case BATTLE_END_QUIT -> {
teleportToAnchor = true;
updateStatus = false;
// Only teleport back to anchor if stage is a random fight
if (battle.getStageType().getVal() <= StageType.Maze.getVal()) {
teleportToAnchor = true;
}
}
default -> {
updateStatus = false;