mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-16 08:56:04 +01:00
Refactor GameData, remove deprecated getGsonFactory
- Fix day-of-week dungeons - AvatarSkill max level enforcement from excels - Partial fix to bonus levels (need packet on talent update)
This commit is contained in:
@@ -5,71 +5,44 @@ import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.excels.DailyDungeonData;
|
||||
import emu.grasscutter.utils.JsonUtils;
|
||||
import emu.grasscutter.utils.Position;
|
||||
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
public class PointData {
|
||||
private int id;
|
||||
@Getter @Setter private int id;
|
||||
private String $type;
|
||||
private Position tranPos;
|
||||
@Getter private Position tranPos;
|
||||
|
||||
@SerializedName(value="dungeonIds", alternate={"JHHFPGJNMIN"})
|
||||
private int[] dungeonIds;
|
||||
@Getter private int[] dungeonIds;
|
||||
|
||||
@SerializedName(value="dungeonRandomList", alternate={"OIBKFJNBLHO"})
|
||||
private int[] dungeonRandomList;
|
||||
@Getter private int[] dungeonRandomList;
|
||||
|
||||
@SerializedName(value="tranSceneId", alternate={"JHBICGBAPIH"})
|
||||
private int tranSceneId;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
@Getter @Setter private int tranSceneId;
|
||||
|
||||
public String getType() {
|
||||
return $type;
|
||||
}
|
||||
|
||||
public Position getTranPos() {
|
||||
return tranPos;
|
||||
}
|
||||
|
||||
public int[] getDungeonIds() {
|
||||
return dungeonIds;
|
||||
}
|
||||
|
||||
public int[] getDungeonRandomList() {
|
||||
return dungeonRandomList;
|
||||
}
|
||||
|
||||
public int getTranSceneId() {
|
||||
return tranSceneId;
|
||||
}
|
||||
|
||||
public void setTranSceneId(int tranSceneId) {
|
||||
this.tranSceneId = tranSceneId;
|
||||
}
|
||||
|
||||
public void updateDailyDungeon() {
|
||||
if (getDungeonRandomList() == null || getDungeonRandomList().length == 0) {
|
||||
if (this.dungeonRandomList == null || this.dungeonRandomList.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
IntList newDungeons = new IntArrayList();
|
||||
int day = Grasscutter.getCurrentDayOfWeek();
|
||||
|
||||
for (int randomId : getDungeonRandomList()) {
|
||||
for (int randomId : this.dungeonRandomList) {
|
||||
DailyDungeonData data = GameData.getDailyDungeonDataMap().get(randomId);
|
||||
|
||||
if (data != null) {
|
||||
int[] addDungeons = data.getDungeonsByDay(day);
|
||||
|
||||
for (int d : addDungeons) {
|
||||
for (int d : data.getDungeonsByDay(day)) {
|
||||
newDungeons.add(d);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user