Implement character stories

This commit is contained in:
Melledy
2025-10-28 01:09:03 -07:00
parent 38d44f7a71
commit 276d9f9002
5 changed files with 89 additions and 2 deletions

View File

@@ -43,6 +43,7 @@ public class GameData {
@Getter private static DataTable<WorldClassDef> WorldClassDataTable = new DataTable<>();
@Getter private static DataTable<GuideGroupDef> GuideGroupDataTable = new DataTable<>();
@Getter private static DataTable<StoryDef> StoryDataTable = new DataTable<>();
@Getter private static DataTable<StorySetSectionDef> StorySetSectionDataTable = new DataTable<>();
@Getter private static DataTable<StarTowerDef> StarTowerDataTable = new DataTable<>();
@Getter private static DataTable<StarTowerStageDef> StarTowerStageDataTable = new DataTable<>();

View File

@@ -2,6 +2,7 @@ package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.game.inventory.ItemParamMap;
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
import it.unimi.dsi.fastutil.ints.IntSet;
import lombok.Getter;
@@ -12,6 +13,11 @@ public class StorySetSectionDef extends BaseDef {
private int Id;
private int ChapterId;
private int RewardItem1Tid;
private int RewardItem1Qty;
private transient ItemParamMap rewards;
@Getter
private static IntSet chapterIds = new IntOpenHashSet();
@@ -22,6 +28,14 @@ public class StorySetSectionDef extends BaseDef {
@Override
public void onLoad() {
// Add to chapter ids
chapterIds.add(this.getChapterId());
// Parse rewards
this.rewards = new ItemParamMap();
if (this.RewardItem1Tid > 0) {
this.rewards.add(this.RewardItem1Tid, this.RewardItem1Qty);
}
}
}