Fix mirror tower stages; fix tower time challenge and star scoring (#2406)

This commit is contained in:
longfruit
2023-10-19 06:18:12 -07:00
committed by GitHub
Unverified
parent bc8e7c21ce
commit f5703e5964
13 changed files with 264 additions and 53 deletions
@@ -1,33 +1,82 @@
package emu.grasscutter.data.excels.tower;
import emu.grasscutter.data.*;
import java.util.List;
import lombok.*;
@ResourceType(name = "TowerLevelExcelConfigData.json")
@Getter
public class TowerLevelData extends GameResource {
private int levelId;
private int levelIndex;
private int levelGroupId;
private int dungeonId;
private List<TowerLevelCond> conds;
public static class TowerLevelCond {
private TowerCondType towerCondType;
private List<Integer> argumentList;
}
public enum TowerCondType {
TOWER_COND_NONE,
TOWER_COND_CHALLENGE_LEFT_TIME_MORE_THAN,
TOWER_COND_LEFT_HP_GREATER_THAN
}
// Not actual data in TowerLevelExcelConfigData.
// Just packaging condition parameters for convenience.
@Getter
public class TowerCondTimeParams {
private int param1;
private int minimumTimeInSeconds;
public TowerCondTimeParams(int param1, int minimumTimeInSeconds) {
this.param1 = param1;
this.minimumTimeInSeconds = minimumTimeInSeconds;
}
}
@Getter
public class TowerCondHpParams {
private int sceneId;
private int configId;
private int minimumHpPercentage;
public TowerCondHpParams(int sceneId, int configId, int minimumHpPercentage) {
this.sceneId = sceneId;
this.configId = configId;
this.minimumHpPercentage = minimumHpPercentage;
}
}
@Override
public int getId() {
return this.getLevelId();
}
public int getLevelId() {
return levelId;
public TowerCondType getCondType(int star) {
if (star < 0 || conds == null || star >= conds.size()) {
return TowerCondType.TOWER_COND_NONE;
}
var condType = conds.get(star).towerCondType;
return condType == null ? TowerCondType.TOWER_COND_NONE : condType;
}
public int getLevelGroupId() {
return levelGroupId;
public TowerCondTimeParams getTimeCond(int star) {
if (star < 0 || conds == null || star >= conds.size()) {
return null;
}
var params = conds.get(star).argumentList;
return new TowerCondTimeParams(params.get(0), params.get(1));
}
public int getLevelIndex() {
return levelIndex;
}
public int getDungeonId() {
return dungeonId;
public TowerCondHpParams getHpCond(int star) {
if (star < 0 || conds == null || star >= conds.size()) {
return null;
}
var params = conds.get(star).argumentList;
return new TowerCondHpParams(params.get(0), params.get(1), params.get(2));
}
}