Implement some star tower npc events

This commit is contained in:
Melledy
2025-12-04 23:40:24 -08:00
parent 3710f0a697
commit 86c607c0b3
10 changed files with 440 additions and 8 deletions
@@ -116,6 +116,7 @@ public class GameData {
@Getter private static DataTable<StarTowerGrowthNodeDef> StarTowerGrowthNodeDataTable = new DataTable<>();
@Getter private static DataTable<StarTowerFloorExpDef> StarTowerFloorExpDataTable = new DataTable<>();
@Getter private static DataTable<StarTowerTeamExpDef> StarTowerTeamExpDataTable = new DataTable<>();
@Getter private static DataTable<StarTowerEventDef> StarTowerEventDataTable = new DataTable<>();
@Getter private static DataTable<SubNoteSkillPromoteGroupDef> SubNoteSkillPromoteGroupDataTable = new DataTable<>();
@Getter private static DataTable<PotentialDef> PotentialDataTable = new DataTable<>();
@@ -0,0 +1,34 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.GameData;
import emu.nebula.data.ResourceType;
import emu.nebula.data.ResourceType.LoadPriority;
import lombok.Getter;
/**
* We don't need a DataTable for this, since we are only using this class to verify event options for the client
*/
@Getter
@ResourceType(name = "EventOptions.json", loadPriority = LoadPriority.LOW)
public class EventOptionsDef extends BaseDef {
private int Id;
@Override
public int getId() {
return Id;
}
@Override
public void onLoad() {
// Get event
var event = GameData.getStarTowerEventDataTable().get(this.Id / 100);
if (event == null) {
return;
}
// Add to avaliable options
event.getOptionIds().add(this.getId());
}
}
@@ -0,0 +1,35 @@
package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
import lombok.Getter;
@Getter
@ResourceType(name = "StarTowerEvent.json")
public class StarTowerEventDef extends BaseDef {
private int Id;
private int[] RelatedNPCs;
private transient IntList optionIds;
@Override
public int getId() {
return Id;
}
/**
* Returns a deep copy of our option ids
*/
public IntList getClonedOptionIds() {
var list = new IntArrayList();
list.addAll(this.getOptionIds());
return list;
}
@Override
public void onLoad() {
this.optionIds = new IntArrayList();
}
}