mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2024-11-30 07:40:47 +00:00
Handle Dungeons with null config (#2279)
This commit is contained in:
parent
4320bc7d29
commit
465582b8da
@ -6,12 +6,13 @@ import emu.grasscutter.game.dungeons.enums.DungeonPassConditionType;
|
|||||||
import emu.grasscutter.game.quest.enums.LogicType;
|
import emu.grasscutter.game.quest.enums.LogicType;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
@ResourceType(name = "DungeonPassExcelConfigData.json")
|
@ResourceType(name = "DungeonPassExcelConfigData.json")
|
||||||
public class DungeonPassConfigData extends GameResource {
|
public class DungeonPassConfigData extends GameResource {
|
||||||
@Getter private int id;
|
@Getter private int id;
|
||||||
@Getter private LogicType logicType;
|
@Getter private LogicType logicType;
|
||||||
@Getter private List<DungeonPassCondition> conds;
|
@Getter @Setter private List<DungeonPassCondition> conds;
|
||||||
|
|
||||||
public static class DungeonPassCondition {
|
public static class DungeonPassCondition {
|
||||||
@Getter private DungeonPassConditionType condType;
|
@Getter private DungeonPassConditionType condType;
|
||||||
|
@ -53,8 +53,13 @@ public final class DungeonManager {
|
|||||||
public DungeonManager(@NonNull Scene scene, @NonNull DungeonData dungeonData) {
|
public DungeonManager(@NonNull Scene scene, @NonNull DungeonData dungeonData) {
|
||||||
this.scene = scene;
|
this.scene = scene;
|
||||||
this.dungeonData = dungeonData;
|
this.dungeonData = dungeonData;
|
||||||
this.passConfigData = GameData.getDungeonPassConfigDataMap().get(dungeonData.getPassCond());
|
if(dungeonData.getPassCond() == 0){
|
||||||
this.finishedConditions = new int[passConfigData.getConds().size()];
|
this.passConfigData = new DungeonPassConfigData();
|
||||||
|
this.passConfigData.setConds(new ArrayList<>());
|
||||||
|
}else {
|
||||||
|
this.passConfigData = GameData.getDungeonPassConfigDataMap().get(dungeonData.getPassCond());
|
||||||
|
}
|
||||||
|
this.finishedConditions = new int[this.passConfigData.getConds().size()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public void triggerEvent(DungeonPassConditionType conditionType, int... params) {
|
public void triggerEvent(DungeonPassConditionType conditionType, int... params) {
|
||||||
@ -76,6 +81,7 @@ public final class DungeonManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFinishedSuccessfully() {
|
public boolean isFinishedSuccessfully() {
|
||||||
|
if(passConfigData.getLogicType()==null) return false;
|
||||||
return LogicType.calculate(passConfigData.getLogicType(), finishedConditions);
|
return LogicType.calculate(passConfigData.getLogicType(), finishedConditions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user