mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-13 05:44:36 +01:00
Only teleport back to anchors when retreating from maze battles
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user