mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-02-07 18:46:49 +01:00
Fix player fields not being set
line seps r weird
This commit is contained in:
@@ -1,86 +1,86 @@
|
||||
package emu.grasscutter.data;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.data.ResourceLoader.AvatarConfig;
|
||||
import emu.grasscutter.data.excels.reliquary.ReliquaryAffixData;
|
||||
import emu.grasscutter.data.excels.reliquary.ReliquaryMainPropData;
|
||||
import emu.grasscutter.game.managers.blossom.BlossomConfig;
|
||||
import emu.grasscutter.game.world.SpawnDataEntry;
|
||||
import emu.grasscutter.utils.WeightedList;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
public class GameDepot {
|
||||
public static final int[] BLOCK_SIZE = new int[] {50, 500}; // Scales
|
||||
|
||||
private static final Int2ObjectMap<WeightedList<ReliquaryMainPropData>> relicRandomMainPropDepot =
|
||||
new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<List<ReliquaryMainPropData>> relicMainPropDepot =
|
||||
new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<List<ReliquaryAffixData>> relicAffixDepot =
|
||||
new Int2ObjectOpenHashMap<>();
|
||||
|
||||
@Getter @Setter private static Map<String, AvatarConfig> playerAbilities = new HashMap<>();
|
||||
|
||||
@Getter
|
||||
private static final HashMap<SpawnDataEntry.GridBlockId, ArrayList<SpawnDataEntry>> spawnLists =
|
||||
new HashMap<>();
|
||||
|
||||
@Getter @Setter private static BlossomConfig blossomConfig;
|
||||
|
||||
public static void load() {
|
||||
for (ReliquaryMainPropData data : GameData.getReliquaryMainPropDataMap().values()) {
|
||||
if (data.getWeight() <= 0 || data.getPropDepotId() <= 0) {
|
||||
continue;
|
||||
}
|
||||
List<ReliquaryMainPropData> list =
|
||||
relicMainPropDepot.computeIfAbsent(data.getPropDepotId(), k -> new ArrayList<>());
|
||||
list.add(data);
|
||||
WeightedList<ReliquaryMainPropData> weightedList =
|
||||
relicRandomMainPropDepot.computeIfAbsent(
|
||||
data.getPropDepotId(), k -> new WeightedList<>());
|
||||
weightedList.add(data.getWeight(), data);
|
||||
}
|
||||
for (ReliquaryAffixData data : GameData.getReliquaryAffixDataMap().values()) {
|
||||
if (data.getWeight() <= 0 || data.getDepotId() <= 0) {
|
||||
continue;
|
||||
}
|
||||
List<ReliquaryAffixData> list =
|
||||
relicAffixDepot.computeIfAbsent(data.getDepotId(), k -> new ArrayList<>());
|
||||
list.add(data);
|
||||
}
|
||||
// Let the server owner know if theyre missing weights
|
||||
if (relicMainPropDepot.size() == 0 || relicAffixDepot.size() == 0) {
|
||||
Grasscutter.getLogger()
|
||||
.error(
|
||||
"Relic properties are missing weights! Please check your ReliquaryMainPropExcelConfigData or ReliquaryAffixExcelConfigData files in your ExcelBinOutput folder.");
|
||||
}
|
||||
}
|
||||
|
||||
public static ReliquaryMainPropData getRandomRelicMainProp(int depot) {
|
||||
WeightedList<ReliquaryMainPropData> depotList = relicRandomMainPropDepot.get(depot);
|
||||
if (depotList == null) {
|
||||
return null;
|
||||
}
|
||||
return depotList.next();
|
||||
}
|
||||
|
||||
public static List<ReliquaryMainPropData> getRelicMainPropList(int depot) {
|
||||
return relicMainPropDepot.get(depot);
|
||||
}
|
||||
|
||||
public static List<ReliquaryAffixData> getRelicAffixList(int depot) {
|
||||
return relicAffixDepot.get(depot);
|
||||
}
|
||||
|
||||
public static void addSpawnListById(
|
||||
HashMap<SpawnDataEntry.GridBlockId, ArrayList<SpawnDataEntry>> data) {
|
||||
spawnLists.putAll(data);
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.data.ResourceLoader.AvatarConfig;
|
||||
import emu.grasscutter.data.excels.reliquary.ReliquaryAffixData;
|
||||
import emu.grasscutter.data.excels.reliquary.ReliquaryMainPropData;
|
||||
import emu.grasscutter.game.managers.blossom.BlossomConfig;
|
||||
import emu.grasscutter.game.world.SpawnDataEntry;
|
||||
import emu.grasscutter.utils.WeightedList;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
public class GameDepot {
|
||||
public static final int[] BLOCK_SIZE = new int[] {50, 500}; // Scales
|
||||
|
||||
private static final Int2ObjectMap<WeightedList<ReliquaryMainPropData>> relicRandomMainPropDepot =
|
||||
new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<List<ReliquaryMainPropData>> relicMainPropDepot =
|
||||
new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<List<ReliquaryAffixData>> relicAffixDepot =
|
||||
new Int2ObjectOpenHashMap<>();
|
||||
|
||||
@Getter @Setter private static Map<String, AvatarConfig> playerAbilities = new HashMap<>();
|
||||
|
||||
@Getter
|
||||
private static final HashMap<SpawnDataEntry.GridBlockId, ArrayList<SpawnDataEntry>> spawnLists =
|
||||
new HashMap<>();
|
||||
|
||||
@Getter @Setter private static BlossomConfig blossomConfig;
|
||||
|
||||
public static void load() {
|
||||
for (ReliquaryMainPropData data : GameData.getReliquaryMainPropDataMap().values()) {
|
||||
if (data.getWeight() <= 0 || data.getPropDepotId() <= 0) {
|
||||
continue;
|
||||
}
|
||||
List<ReliquaryMainPropData> list =
|
||||
relicMainPropDepot.computeIfAbsent(data.getPropDepotId(), k -> new ArrayList<>());
|
||||
list.add(data);
|
||||
WeightedList<ReliquaryMainPropData> weightedList =
|
||||
relicRandomMainPropDepot.computeIfAbsent(
|
||||
data.getPropDepotId(), k -> new WeightedList<>());
|
||||
weightedList.add(data.getWeight(), data);
|
||||
}
|
||||
for (ReliquaryAffixData data : GameData.getReliquaryAffixDataMap().values()) {
|
||||
if (data.getWeight() <= 0 || data.getDepotId() <= 0) {
|
||||
continue;
|
||||
}
|
||||
List<ReliquaryAffixData> list =
|
||||
relicAffixDepot.computeIfAbsent(data.getDepotId(), k -> new ArrayList<>());
|
||||
list.add(data);
|
||||
}
|
||||
// Let the server owner know if theyre missing weights
|
||||
if (relicMainPropDepot.size() == 0 || relicAffixDepot.size() == 0) {
|
||||
Grasscutter.getLogger()
|
||||
.error(
|
||||
"Relic properties are missing weights! Please check your ReliquaryMainPropExcelConfigData or ReliquaryAffixExcelConfigData files in your ExcelBinOutput folder.");
|
||||
}
|
||||
}
|
||||
|
||||
public static ReliquaryMainPropData getRandomRelicMainProp(int depot) {
|
||||
WeightedList<ReliquaryMainPropData> depotList = relicRandomMainPropDepot.get(depot);
|
||||
if (depotList == null) {
|
||||
return null;
|
||||
}
|
||||
return depotList.next();
|
||||
}
|
||||
|
||||
public static List<ReliquaryMainPropData> getRelicMainPropList(int depot) {
|
||||
return relicMainPropDepot.get(depot);
|
||||
}
|
||||
|
||||
public static List<ReliquaryAffixData> getRelicAffixList(int depot) {
|
||||
return relicAffixDepot.get(depot);
|
||||
}
|
||||
|
||||
public static void addSpawnListById(
|
||||
HashMap<SpawnDataEntry.GridBlockId, ArrayList<SpawnDataEntry>> data) {
|
||||
spawnLists.putAll(data);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,3 @@
|
||||
package emu.grasscutter.data.binout.config;
|
||||
|
||||
public class ConfigEntityAvatar extends ConfigEntityBase {}
|
||||
package emu.grasscutter.data.binout.config;
|
||||
|
||||
public class ConfigEntityAvatar extends ConfigEntityBase {}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package emu.grasscutter.data.binout.config;
|
||||
|
||||
import emu.grasscutter.data.binout.config.fields.ConfigAbilityData;
|
||||
import emu.grasscutter.data.binout.config.fields.ConfigCombat;
|
||||
import emu.grasscutter.data.binout.config.fields.ConfigCommon;
|
||||
import emu.grasscutter.data.binout.config.fields.ConfigGlobalValue;
|
||||
import java.util.Collection;
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConfigEntityBase {
|
||||
@Nullable ConfigCommon configCommon;
|
||||
@Nullable ConfigCombat combat;
|
||||
Collection<ConfigAbilityData> abilities;
|
||||
ConfigGlobalValue globalValue; // used for SGV in monsters and Gadgets
|
||||
}
|
||||
package emu.grasscutter.data.binout.config;
|
||||
|
||||
import emu.grasscutter.data.binout.config.fields.ConfigAbilityData;
|
||||
import emu.grasscutter.data.binout.config.fields.ConfigCombat;
|
||||
import emu.grasscutter.data.binout.config.fields.ConfigCommon;
|
||||
import emu.grasscutter.data.binout.config.fields.ConfigGlobalValue;
|
||||
import java.util.Collection;
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConfigEntityBase {
|
||||
@Nullable ConfigCommon configCommon;
|
||||
@Nullable ConfigCombat combat;
|
||||
Collection<ConfigAbilityData> abilities;
|
||||
ConfigGlobalValue globalValue; // used for SGV in monsters and Gadgets
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package emu.grasscutter.data.binout.config;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class ConfigEntityGadget extends ConfigEntityBase {
|
||||
// There are more values that can be added that might be useful in the json
|
||||
}
|
||||
package emu.grasscutter.data.binout.config;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class ConfigEntityGadget extends ConfigEntityBase {
|
||||
// There are more values that can be added that might be useful in the json
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package emu.grasscutter.data.binout.config;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConfigEntityMonster extends ConfigEntityBase {}
|
||||
package emu.grasscutter.data.binout.config;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConfigEntityMonster extends ConfigEntityBase {}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package emu.grasscutter.data.binout.config;
|
||||
|
||||
import emu.grasscutter.data.binout.config.fields.ConfigAbilityData;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
public class ConfigLevelEntity {
|
||||
|
||||
@Getter private List<ConfigAbilityData> abilities; // monster abilities
|
||||
@Getter private List<ConfigAbilityData> avatarAbilities;
|
||||
@Getter private List<ConfigAbilityData> teamAbilities;
|
||||
@Getter private List<Integer> preloadMonsterEntityIDs;
|
||||
}
|
||||
package emu.grasscutter.data.binout.config;
|
||||
|
||||
import emu.grasscutter.data.binout.config.fields.ConfigAbilityData;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
public class ConfigLevelEntity {
|
||||
|
||||
@Getter private List<ConfigAbilityData> abilities; // monster abilities
|
||||
@Getter private List<ConfigAbilityData> avatarAbilities;
|
||||
@Getter private List<ConfigAbilityData> teamAbilities;
|
||||
@Getter private List<Integer> preloadMonsterEntityIDs;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package emu.grasscutter.data.binout.config.fields;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConfigAbilityData {
|
||||
public String abilityID;
|
||||
public String abilityName;
|
||||
public String abilityOverride;
|
||||
}
|
||||
package emu.grasscutter.data.binout.config.fields;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConfigAbilityData {
|
||||
public String abilityID;
|
||||
public String abilityName;
|
||||
public String abilityOverride;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package emu.grasscutter.data.binout.config.fields;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConfigAiBeta {
|
||||
boolean enable;
|
||||
}
|
||||
package emu.grasscutter.data.binout.config.fields;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConfigAiBeta {
|
||||
boolean enable;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package emu.grasscutter.data.binout.config.fields;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class ConfigCombat {
|
||||
// There are more values that can be added that might be useful in the json
|
||||
ConfigCombatProperty property;
|
||||
}
|
||||
package emu.grasscutter.data.binout.config.fields;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class ConfigCombat {
|
||||
// There are more values that can be added that might be useful in the json
|
||||
ConfigCombatProperty property;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package emu.grasscutter.data.binout.config.fields;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class ConfigCombatDie {
|
||||
@SerializedName(
|
||||
value = "dieEndTime",
|
||||
alternate = {"HGGPMFGGBNC"})
|
||||
double dieEndTime;
|
||||
|
||||
double dieForceDisappearTime;
|
||||
boolean hasAnimatorDie;
|
||||
}
|
||||
package emu.grasscutter.data.binout.config.fields;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class ConfigCombatDie {
|
||||
@SerializedName(
|
||||
value = "dieEndTime",
|
||||
alternate = {"HGGPMFGGBNC"})
|
||||
double dieEndTime;
|
||||
|
||||
double dieForceDisappearTime;
|
||||
boolean hasAnimatorDie;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package emu.grasscutter.data.binout.config.fields;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class ConfigCombatProperty {
|
||||
float HP;
|
||||
boolean isLockHP;
|
||||
boolean isInvincible;
|
||||
boolean isGhostToAllied;
|
||||
float attack;
|
||||
float defence;
|
||||
float weight;
|
||||
boolean useCreatorProperty;
|
||||
}
|
||||
package emu.grasscutter.data.binout.config.fields;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class ConfigCombatProperty {
|
||||
float HP;
|
||||
boolean isLockHP;
|
||||
boolean isInvincible;
|
||||
boolean isGhostToAllied;
|
||||
float attack;
|
||||
float defence;
|
||||
float weight;
|
||||
boolean useCreatorProperty;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package emu.grasscutter.data.binout.config.fields;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConfigCommon {}
|
||||
package emu.grasscutter.data.binout.config.fields;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConfigCommon {}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package emu.grasscutter.data.binout.config.fields;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.Data;
|
||||
|
||||
/** Contains information about the entities SGVs */
|
||||
@Data
|
||||
public class ConfigGlobalValue {
|
||||
Set<String> serverGlobalValues;
|
||||
Map<String, Float> initServerGlobalValues;
|
||||
}
|
||||
package emu.grasscutter.data.binout.config.fields;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.Data;
|
||||
|
||||
/** Contains information about the entities SGVs */
|
||||
@Data
|
||||
public class ConfigGlobalValue {
|
||||
Set<String> serverGlobalValues;
|
||||
Map<String, Float> initServerGlobalValues;
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
package emu.grasscutter.data.binout.routes;
|
||||
|
||||
// import emu.grasscutter.scripts.constants.IntValueEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
public enum RotAngleType /*implements IntValueEnum */ {
|
||||
ROT_NONE(-1),
|
||||
ROT_ANGLE_X(0),
|
||||
ROT_ANGLE_Y(1),
|
||||
ROT_ANGLE_Z(2);
|
||||
|
||||
@Getter private final int id;
|
||||
|
||||
RotAngleType(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
// @Override
|
||||
public int getValue() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.binout.routes;
|
||||
|
||||
// import emu.grasscutter.scripts.constants.IntValueEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
public enum RotAngleType /*implements IntValueEnum */ {
|
||||
ROT_NONE(-1),
|
||||
ROT_ANGLE_X(0),
|
||||
ROT_ANGLE_Y(1),
|
||||
ROT_ANGLE_Z(2);
|
||||
|
||||
@Getter private final int id;
|
||||
|
||||
RotAngleType(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
// @Override
|
||||
public int getValue() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package emu.grasscutter.data.binout.routes;
|
||||
|
||||
public enum RotType {
|
||||
ROT_NONE,
|
||||
ROT_ANGLE,
|
||||
ROT_ROUND
|
||||
}
|
||||
package emu.grasscutter.data.binout.routes;
|
||||
|
||||
public enum RotType {
|
||||
ROT_NONE,
|
||||
ROT_ANGLE,
|
||||
ROT_ROUND
|
||||
}
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
package emu.grasscutter.data.binout.routes;
|
||||
|
||||
import emu.grasscutter.net.proto.RouteOuterClass;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
import lombok.val;
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class Route {
|
||||
private int localId;
|
||||
private String name;
|
||||
private RouteType type = RouteType.Unknown;
|
||||
private RoutePoint[] points;
|
||||
private float arriveRange; // optional
|
||||
private RotType rotType; // optional
|
||||
private RotAngleType rotAngleType; // optional
|
||||
|
||||
public RouteOuterClass.Route toProto() {
|
||||
val builder = RouteOuterClass.Route.newBuilder().setRouteType(type.getValue());
|
||||
if (points != null) {
|
||||
for (var routePoint : points) {
|
||||
builder.addRoutePoints(routePoint.toProto().setArriveRange(arriveRange));
|
||||
}
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.binout.routes;
|
||||
|
||||
import emu.grasscutter.net.proto.RouteOuterClass;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
import lombok.val;
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class Route {
|
||||
private int localId;
|
||||
private String name;
|
||||
private RouteType type = RouteType.Unknown;
|
||||
private RoutePoint[] points;
|
||||
private float arriveRange; // optional
|
||||
private RotType rotType; // optional
|
||||
private RotAngleType rotAngleType; // optional
|
||||
|
||||
public RouteOuterClass.Route toProto() {
|
||||
val builder = RouteOuterClass.Route.newBuilder().setRouteType(type.getValue());
|
||||
if (points != null) {
|
||||
for (var routePoint : points) {
|
||||
builder.addRoutePoints(routePoint.toProto().setArriveRange(arriveRange));
|
||||
}
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
package emu.grasscutter.data.binout.routes;
|
||||
|
||||
import emu.grasscutter.net.proto.RoutePointOuterClass;
|
||||
import emu.grasscutter.utils.Position;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
import lombok.val;
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class RoutePoint {
|
||||
private Position pos;
|
||||
private int speedLevel; // optional
|
||||
private float waitTime; // optional
|
||||
private float targetVelocity; // optional
|
||||
private boolean hasReachEvent; // optional
|
||||
// rotRoundReachDir //optional Pos with optional values
|
||||
// rotRoundLeaveDir //optional Pos with optional values
|
||||
|
||||
public RoutePointOuterClass.RoutePoint.Builder toProto() {
|
||||
val builder = RoutePointOuterClass.RoutePoint.newBuilder().setPosition(pos.toProto());
|
||||
if (waitTime != 0) {
|
||||
builder.setTime(waitTime);
|
||||
} else if (targetVelocity != 0) {
|
||||
builder.setVelocity(targetVelocity);
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.binout.routes;
|
||||
|
||||
import emu.grasscutter.net.proto.RoutePointOuterClass;
|
||||
import emu.grasscutter.utils.Position;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
import lombok.val;
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class RoutePoint {
|
||||
private Position pos;
|
||||
private int speedLevel; // optional
|
||||
private float waitTime; // optional
|
||||
private float targetVelocity; // optional
|
||||
private boolean hasReachEvent; // optional
|
||||
// rotRoundReachDir //optional Pos with optional values
|
||||
// rotRoundLeaveDir //optional Pos with optional values
|
||||
|
||||
public RoutePointOuterClass.RoutePoint.Builder toProto() {
|
||||
val builder = RoutePointOuterClass.RoutePoint.newBuilder().setPosition(pos.toProto());
|
||||
if (waitTime != 0) {
|
||||
builder.setTime(waitTime);
|
||||
} else if (targetVelocity != 0) {
|
||||
builder.setVelocity(targetVelocity);
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
package emu.grasscutter.data.binout.routes;
|
||||
|
||||
// import emu.grasscutter.scripts.constants.IntValueEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
public enum RouteType /*implements IntValueEnum*/ {
|
||||
Unknown(-1),
|
||||
OneWay(0),
|
||||
Reciprocate(1),
|
||||
Loop(2);
|
||||
|
||||
@Getter private final int id;
|
||||
|
||||
RouteType(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
// @Override
|
||||
public int getValue() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.binout.routes;
|
||||
|
||||
// import emu.grasscutter.scripts.constants.IntValueEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
public enum RouteType /*implements IntValueEnum*/ {
|
||||
Unknown(-1),
|
||||
OneWay(0),
|
||||
Reciprocate(1),
|
||||
Loop(2);
|
||||
|
||||
@Getter private final int id;
|
||||
|
||||
RouteType(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
// @Override
|
||||
public int getValue() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package emu.grasscutter.data.binout.routes;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class SceneRoutes {
|
||||
private int sceneId;
|
||||
@Nullable private Route[] routes;
|
||||
}
|
||||
package emu.grasscutter.data.binout.routes;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class SceneRoutes {
|
||||
private int sceneId;
|
||||
@Nullable private Route[] routes;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package emu.grasscutter.data.common;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BaseTrialActivityData {
|
||||
List<Integer> getAvatarIndexIdList();
|
||||
|
||||
List<Integer> getRewardIdList();
|
||||
}
|
||||
package emu.grasscutter.data.common;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BaseTrialActivityData {
|
||||
List<Integer> getAvatarIndexIdList();
|
||||
|
||||
List<Integer> getRewardIdList();
|
||||
}
|
||||
|
||||
@@ -1,70 +1,70 @@
|
||||
package emu.grasscutter.data.common;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.excels.dungeon.DailyDungeonData;
|
||||
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 final class PointData {
|
||||
@Getter @Setter private int id;
|
||||
private String $type;
|
||||
@Getter private Position tranPos;
|
||||
@Getter private Position pos;
|
||||
@Getter private Position rot;
|
||||
@Getter private Position size;
|
||||
|
||||
@SerializedName(
|
||||
value = "dungeonIds",
|
||||
alternate = {"JHHFPGJNMIN"})
|
||||
@Getter
|
||||
private int[] dungeonIds;
|
||||
|
||||
@SerializedName(
|
||||
value = "dungeonRandomList",
|
||||
alternate = {"OIBKFJNBLHO"})
|
||||
@Getter
|
||||
private int[] dungeonRandomList;
|
||||
|
||||
@SerializedName(
|
||||
value = "groupIDs",
|
||||
alternate = {"HFOBOOHKBGF"})
|
||||
@Getter
|
||||
private int[] groupIDs;
|
||||
|
||||
@SerializedName(
|
||||
value = "tranSceneId",
|
||||
alternate = {"JHBICGBAPIH"})
|
||||
@Getter
|
||||
@Setter
|
||||
private int tranSceneId;
|
||||
|
||||
public String getType() {
|
||||
return $type;
|
||||
}
|
||||
|
||||
public void updateDailyDungeon() {
|
||||
if (this.dungeonRandomList == null || this.dungeonRandomList.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
IntList newDungeons = new IntArrayList();
|
||||
int day = Grasscutter.getCurrentDayOfWeek();
|
||||
|
||||
for (int randomId : this.dungeonRandomList) {
|
||||
DailyDungeonData data = GameData.getDailyDungeonDataMap().get(randomId);
|
||||
|
||||
if (data != null) {
|
||||
for (int d : data.getDungeonsByDay(day)) {
|
||||
newDungeons.add(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.dungeonIds = newDungeons.toIntArray();
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.common;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.excels.dungeon.DailyDungeonData;
|
||||
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 final class PointData {
|
||||
@Getter @Setter private int id;
|
||||
private String $type;
|
||||
@Getter private Position tranPos;
|
||||
@Getter private Position pos;
|
||||
@Getter private Position rot;
|
||||
@Getter private Position size;
|
||||
|
||||
@SerializedName(
|
||||
value = "dungeonIds",
|
||||
alternate = {"JHHFPGJNMIN"})
|
||||
@Getter
|
||||
private int[] dungeonIds;
|
||||
|
||||
@SerializedName(
|
||||
value = "dungeonRandomList",
|
||||
alternate = {"OIBKFJNBLHO"})
|
||||
@Getter
|
||||
private int[] dungeonRandomList;
|
||||
|
||||
@SerializedName(
|
||||
value = "groupIDs",
|
||||
alternate = {"HFOBOOHKBGF"})
|
||||
@Getter
|
||||
private int[] groupIDs;
|
||||
|
||||
@SerializedName(
|
||||
value = "tranSceneId",
|
||||
alternate = {"JHBICGBAPIH"})
|
||||
@Getter
|
||||
@Setter
|
||||
private int tranSceneId;
|
||||
|
||||
public String getType() {
|
||||
return $type;
|
||||
}
|
||||
|
||||
public void updateDailyDungeon() {
|
||||
if (this.dungeonRandomList == null || this.dungeonRandomList.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
IntList newDungeons = new IntArrayList();
|
||||
int day = Grasscutter.getCurrentDayOfWeek();
|
||||
|
||||
for (int randomId : this.dungeonRandomList) {
|
||||
DailyDungeonData data = GameData.getDailyDungeonDataMap().get(randomId);
|
||||
|
||||
if (data != null) {
|
||||
for (int d : data.getDungeonsByDay(day)) {
|
||||
newDungeons.add(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.dungeonIds = newDungeons.toIntArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package emu.grasscutter.data.custom;
|
||||
|
||||
import emu.grasscutter.data.common.BaseTrialActivityData;
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
|
||||
@Data
|
||||
public class TrialAvatarActivityCustomData implements BaseTrialActivityData {
|
||||
private int ScheduleId;
|
||||
private List<Integer> AvatarIndexIdList;
|
||||
private List<Integer> RewardIdList;
|
||||
|
||||
public void onLoad() {
|
||||
this.AvatarIndexIdList = AvatarIndexIdList.stream().filter(x -> x > 0).toList();
|
||||
this.RewardIdList = RewardIdList.stream().filter(x -> x > 0).toList();
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.custom;
|
||||
|
||||
import emu.grasscutter.data.common.BaseTrialActivityData;
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
|
||||
@Data
|
||||
public class TrialAvatarActivityCustomData implements BaseTrialActivityData {
|
||||
private int ScheduleId;
|
||||
private List<Integer> AvatarIndexIdList;
|
||||
private List<Integer> RewardIdList;
|
||||
|
||||
public void onLoad() {
|
||||
this.AvatarIndexIdList = AvatarIndexIdList.stream().filter(x -> x > 0).toList();
|
||||
this.RewardIdList = RewardIdList.stream().filter(x -> x > 0).toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package emu.grasscutter.data.custom;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
|
||||
@Data
|
||||
public class TrialAvatarCustomData {
|
||||
private int trialAvatarId;
|
||||
private List<String> trialAvatarParamList;
|
||||
private int coreProudSkillLevel;
|
||||
private int skillDepotId;
|
||||
|
||||
public void onLoad() {
|
||||
this.trialAvatarParamList = trialAvatarParamList.stream().filter(x -> !x.isBlank()).toList();
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.custom;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
|
||||
@Data
|
||||
public class TrialAvatarCustomData {
|
||||
private int trialAvatarId;
|
||||
private List<String> trialAvatarParamList;
|
||||
private int coreProudSkillLevel;
|
||||
private int skillDepotId;
|
||||
|
||||
public void onLoad() {
|
||||
this.trialAvatarParamList = trialAvatarParamList.stream().filter(x -> !x.isBlank()).toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.EntityType;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "GadgetExcelConfigData.json")
|
||||
@Getter
|
||||
public final class GadgetData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private EntityType type;
|
||||
private String jsonName;
|
||||
private boolean isInteractive;
|
||||
private String[] tags;
|
||||
private String itemJsonName;
|
||||
private long nameTextMapHash;
|
||||
private int campId;
|
||||
private String visionLevel;
|
||||
}
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.EntityType;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "GadgetExcelConfigData.json")
|
||||
@Getter
|
||||
public final class GadgetData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private EntityType type;
|
||||
private String jsonName;
|
||||
private boolean isInteractive;
|
||||
private String[] tags;
|
||||
private String itemJsonName;
|
||||
private long nameTextMapHash;
|
||||
private int campId;
|
||||
private String visionLevel;
|
||||
}
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ResourceType(name = "GuideTriggerExcelConfigData.json")
|
||||
public class GuideTriggerData extends GameResource {
|
||||
// more like open state guide than quest guide
|
||||
private int id; // dont use, just to prevent resource loader from not functioning
|
||||
private String guideName;
|
||||
private String type;
|
||||
private String openState;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void onLoad() {
|
||||
GameData.getGuideTriggerDataStringMap().put(getGuideName(), this);
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ResourceType(name = "GuideTriggerExcelConfigData.json")
|
||||
public class GuideTriggerData extends GameResource {
|
||||
// more like open state guide than quest guide
|
||||
private int id; // dont use, just to prevent resource loader from not functioning
|
||||
private String guideName;
|
||||
private String type;
|
||||
private String openState;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void onLoad() {
|
||||
GameData.getGuideTriggerDataStringMap().put(getGuideName(), this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,154 +1,154 @@
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.ItemUseData;
|
||||
import emu.grasscutter.game.inventory.EquipType;
|
||||
import emu.grasscutter.game.inventory.ItemType;
|
||||
import emu.grasscutter.game.inventory.MaterialType;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import emu.grasscutter.game.props.ItemUseAction.ItemUseAction;
|
||||
import emu.grasscutter.game.props.ItemUseOp;
|
||||
import emu.grasscutter.game.props.ItemUseTarget;
|
||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(
|
||||
name = {
|
||||
"MaterialExcelConfigData.json",
|
||||
"WeaponExcelConfigData.json",
|
||||
"ReliquaryExcelConfigData.json",
|
||||
"HomeWorldFurnitureExcelConfigData.json"
|
||||
})
|
||||
@Getter
|
||||
public class ItemData extends GameResource {
|
||||
// Main
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private final int stackLimit = 1;
|
||||
private int maxUseCount;
|
||||
private int rankLevel;
|
||||
private String effectName;
|
||||
private int rank;
|
||||
private int weight;
|
||||
private int gadgetId;
|
||||
|
||||
private int[] destroyReturnMaterial;
|
||||
private int[] destroyReturnMaterialCount;
|
||||
|
||||
// Enums
|
||||
private final ItemType itemType = ItemType.ITEM_NONE;
|
||||
private MaterialType materialType = MaterialType.MATERIAL_NONE;
|
||||
private EquipType equipType = EquipType.EQUIP_NONE;
|
||||
private String effectType;
|
||||
private String destroyRule;
|
||||
|
||||
// Food
|
||||
private String foodQuality;
|
||||
private int[] satiationParams;
|
||||
|
||||
// Usable item
|
||||
private final ItemUseTarget useTarget = ItemUseTarget.ITEM_USE_TARGET_NONE;
|
||||
private List<ItemUseData> itemUse;
|
||||
private List<ItemUseAction> itemUseActions;
|
||||
private final boolean useOnGain = false;
|
||||
|
||||
// Relic
|
||||
private int mainPropDepotId;
|
||||
private int appendPropDepotId;
|
||||
private int appendPropNum;
|
||||
private int setId;
|
||||
private int[] addPropLevels;
|
||||
private int baseConvExp;
|
||||
private int maxLevel;
|
||||
|
||||
// Weapon
|
||||
private int weaponPromoteId;
|
||||
private int weaponBaseExp;
|
||||
private int storyId;
|
||||
private int avatarPromoteId;
|
||||
private int awakenMaterial;
|
||||
private int[] awakenCosts;
|
||||
private int[] skillAffix;
|
||||
private WeaponProperty[] weaponProp;
|
||||
|
||||
// Hash
|
||||
private long nameTextMapHash;
|
||||
|
||||
// Furniture
|
||||
private int comfort;
|
||||
private List<Integer> furnType;
|
||||
private List<Integer> furnitureGadgetID;
|
||||
|
||||
@SerializedName(
|
||||
value = "roomSceneId",
|
||||
alternate = {"BMEPAMCNABE", "DANFGGLKLNO", "JFDLJGDFIGL", "OHIANNAEEAK", "MFGACDIOHGF"})
|
||||
private int roomSceneId;
|
||||
|
||||
// Custom
|
||||
private transient IntSet addPropLevelSet;
|
||||
|
||||
public WeaponProperty[] getWeaponProperties() {
|
||||
return this.weaponProp;
|
||||
}
|
||||
|
||||
public boolean canAddRelicProp(int level) {
|
||||
return this.addPropLevelSet != null && this.addPropLevelSet.contains(level);
|
||||
}
|
||||
|
||||
public boolean isEquip() {
|
||||
return this.itemType == ItemType.ITEM_RELIQUARY || this.itemType == ItemType.ITEM_WEAPON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
if (this.itemType == ItemType.ITEM_RELIQUARY) {
|
||||
if (this.addPropLevels != null && this.addPropLevels.length > 0) {
|
||||
this.addPropLevelSet = new IntOpenHashSet(this.addPropLevels);
|
||||
}
|
||||
} else if (this.itemType == ItemType.ITEM_WEAPON) {
|
||||
this.equipType = EquipType.EQUIP_WEAPON;
|
||||
} else {
|
||||
this.equipType = EquipType.EQUIP_NONE;
|
||||
}
|
||||
|
||||
if (this.weaponProp != null) {
|
||||
this.weaponProp =
|
||||
Arrays.stream(this.weaponProp)
|
||||
.filter(prop -> prop.getPropType() != null)
|
||||
.toArray(WeaponProperty[]::new);
|
||||
}
|
||||
|
||||
if (this.getFurnType() != null) {
|
||||
this.furnType = this.furnType.stream().filter(x -> x > 0).toList();
|
||||
}
|
||||
if (this.getFurnitureGadgetID() != null) {
|
||||
this.furnitureGadgetID = this.furnitureGadgetID.stream().filter(x -> x > 0).toList();
|
||||
}
|
||||
|
||||
// Prevent material type from being null
|
||||
this.materialType = this.materialType == null ? MaterialType.MATERIAL_NONE : this.materialType;
|
||||
|
||||
if (this.itemUse != null && !this.itemUse.isEmpty()) {
|
||||
this.itemUseActions =
|
||||
this.itemUse.stream()
|
||||
.filter(x -> x.getUseOp() != ItemUseOp.ITEM_USE_NONE)
|
||||
.map(ItemUseAction::fromItemUseData)
|
||||
.filter(Objects::nonNull)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class WeaponProperty {
|
||||
private FightProperty propType;
|
||||
private float initValue;
|
||||
private String type;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.ItemUseData;
|
||||
import emu.grasscutter.game.inventory.EquipType;
|
||||
import emu.grasscutter.game.inventory.ItemType;
|
||||
import emu.grasscutter.game.inventory.MaterialType;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import emu.grasscutter.game.props.ItemUseAction.ItemUseAction;
|
||||
import emu.grasscutter.game.props.ItemUseOp;
|
||||
import emu.grasscutter.game.props.ItemUseTarget;
|
||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(
|
||||
name = {
|
||||
"MaterialExcelConfigData.json",
|
||||
"WeaponExcelConfigData.json",
|
||||
"ReliquaryExcelConfigData.json",
|
||||
"HomeWorldFurnitureExcelConfigData.json"
|
||||
})
|
||||
@Getter
|
||||
public class ItemData extends GameResource {
|
||||
// Main
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private final int stackLimit = 1;
|
||||
private int maxUseCount;
|
||||
private int rankLevel;
|
||||
private String effectName;
|
||||
private int rank;
|
||||
private int weight;
|
||||
private int gadgetId;
|
||||
|
||||
private int[] destroyReturnMaterial;
|
||||
private int[] destroyReturnMaterialCount;
|
||||
|
||||
// Enums
|
||||
private final ItemType itemType = ItemType.ITEM_NONE;
|
||||
private MaterialType materialType = MaterialType.MATERIAL_NONE;
|
||||
private EquipType equipType = EquipType.EQUIP_NONE;
|
||||
private String effectType;
|
||||
private String destroyRule;
|
||||
|
||||
// Food
|
||||
private String foodQuality;
|
||||
private int[] satiationParams;
|
||||
|
||||
// Usable item
|
||||
private final ItemUseTarget useTarget = ItemUseTarget.ITEM_USE_TARGET_NONE;
|
||||
private List<ItemUseData> itemUse;
|
||||
private List<ItemUseAction> itemUseActions;
|
||||
private final boolean useOnGain = false;
|
||||
|
||||
// Relic
|
||||
private int mainPropDepotId;
|
||||
private int appendPropDepotId;
|
||||
private int appendPropNum;
|
||||
private int setId;
|
||||
private int[] addPropLevels;
|
||||
private int baseConvExp;
|
||||
private int maxLevel;
|
||||
|
||||
// Weapon
|
||||
private int weaponPromoteId;
|
||||
private int weaponBaseExp;
|
||||
private int storyId;
|
||||
private int avatarPromoteId;
|
||||
private int awakenMaterial;
|
||||
private int[] awakenCosts;
|
||||
private int[] skillAffix;
|
||||
private WeaponProperty[] weaponProp;
|
||||
|
||||
// Hash
|
||||
private long nameTextMapHash;
|
||||
|
||||
// Furniture
|
||||
private int comfort;
|
||||
private List<Integer> furnType;
|
||||
private List<Integer> furnitureGadgetID;
|
||||
|
||||
@SerializedName(
|
||||
value = "roomSceneId",
|
||||
alternate = {"BMEPAMCNABE", "DANFGGLKLNO", "JFDLJGDFIGL", "OHIANNAEEAK", "MFGACDIOHGF"})
|
||||
private int roomSceneId;
|
||||
|
||||
// Custom
|
||||
private transient IntSet addPropLevelSet;
|
||||
|
||||
public WeaponProperty[] getWeaponProperties() {
|
||||
return this.weaponProp;
|
||||
}
|
||||
|
||||
public boolean canAddRelicProp(int level) {
|
||||
return this.addPropLevelSet != null && this.addPropLevelSet.contains(level);
|
||||
}
|
||||
|
||||
public boolean isEquip() {
|
||||
return this.itemType == ItemType.ITEM_RELIQUARY || this.itemType == ItemType.ITEM_WEAPON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
if (this.itemType == ItemType.ITEM_RELIQUARY) {
|
||||
if (this.addPropLevels != null && this.addPropLevels.length > 0) {
|
||||
this.addPropLevelSet = new IntOpenHashSet(this.addPropLevels);
|
||||
}
|
||||
} else if (this.itemType == ItemType.ITEM_WEAPON) {
|
||||
this.equipType = EquipType.EQUIP_WEAPON;
|
||||
} else {
|
||||
this.equipType = EquipType.EQUIP_NONE;
|
||||
}
|
||||
|
||||
if (this.weaponProp != null) {
|
||||
this.weaponProp =
|
||||
Arrays.stream(this.weaponProp)
|
||||
.filter(prop -> prop.getPropType() != null)
|
||||
.toArray(WeaponProperty[]::new);
|
||||
}
|
||||
|
||||
if (this.getFurnType() != null) {
|
||||
this.furnType = this.furnType.stream().filter(x -> x > 0).toList();
|
||||
}
|
||||
if (this.getFurnitureGadgetID() != null) {
|
||||
this.furnitureGadgetID = this.furnitureGadgetID.stream().filter(x -> x > 0).toList();
|
||||
}
|
||||
|
||||
// Prevent material type from being null
|
||||
this.materialType = this.materialType == null ? MaterialType.MATERIAL_NONE : this.materialType;
|
||||
|
||||
if (this.itemUse != null && !this.itemUse.isEmpty()) {
|
||||
this.itemUseActions =
|
||||
this.itemUse.stream()
|
||||
.filter(x -> x.getUseOp() != ItemUseOp.ITEM_USE_NONE)
|
||||
.map(ItemUseAction::fromItemUseData)
|
||||
.filter(Objects::nonNull)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class WeaponProperty {
|
||||
private FightProperty propType;
|
||||
private float initValue;
|
||||
private String type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,140 +1,140 @@
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.quest.enums.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.*;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@ResourceType(name = "QuestExcelConfigData.json")
|
||||
@Getter
|
||||
@ToString
|
||||
public class QuestData extends GameResource {
|
||||
@Getter private int subId;
|
||||
@Getter private int mainId;
|
||||
@Getter private int order;
|
||||
@Getter private long descTextMapHash;
|
||||
|
||||
@Getter private boolean finishParent;
|
||||
@Getter private boolean isRewind;
|
||||
|
||||
@Getter private LogicType acceptCondComb;
|
||||
@Getter private LogicType finishCondComb;
|
||||
@Getter private LogicType failCondComb;
|
||||
|
||||
@Getter private List<QuestAcceptCondition> acceptCond;
|
||||
@Getter private List<QuestContentCondition> finishCond;
|
||||
@Getter private List<QuestContentCondition> failCond;
|
||||
@Getter private List<QuestExecParam> beginExec;
|
||||
@Getter private List<QuestExecParam> finishExec;
|
||||
@Getter private List<QuestExecParam> failExec;
|
||||
@Getter private Guide guide;
|
||||
@Getter private List<Integer> trialAvatarList;
|
||||
|
||||
public static String questConditionKey(
|
||||
@Nonnull Enum<?> type, int firstParam, @Nullable String paramsStr) {
|
||||
return type.name() + firstParam + (paramsStr != null ? paramsStr : "");
|
||||
}
|
||||
|
||||
// ResourceLoader not happy if you remove getId() ~~
|
||||
public int getId() {
|
||||
return subId;
|
||||
}
|
||||
|
||||
public void onLoad() {
|
||||
this.acceptCond = acceptCond.stream().filter(p -> p.getType() != null).toList();
|
||||
this.finishCond = finishCond.stream().filter(p -> p.getType() != null).toList();
|
||||
this.failCond = failCond.stream().filter(p -> p.getType() != null).toList();
|
||||
|
||||
this.beginExec = beginExec.stream().filter(p -> p.type != null).toList();
|
||||
this.finishExec = finishExec.stream().filter(p -> p.type != null).toList();
|
||||
this.failExec = failExec.stream().filter(p -> p.type != null).toList();
|
||||
|
||||
if (this.acceptCondComb == null) this.acceptCondComb = LogicType.LOGIC_NONE;
|
||||
|
||||
if (this.finishCondComb == null) this.finishCondComb = LogicType.LOGIC_NONE;
|
||||
|
||||
if (this.failCondComb == null) this.failCondComb = LogicType.LOGIC_NONE;
|
||||
|
||||
addToCache();
|
||||
}
|
||||
|
||||
private void addToCache() {
|
||||
if (this.acceptCond == null) {
|
||||
Grasscutter.getLogger().warn("missing AcceptConditions for quest {}", getSubId());
|
||||
return;
|
||||
}
|
||||
|
||||
var cacheMap = GameData.getBeginCondQuestMap();
|
||||
if (getAcceptCond().isEmpty()) {
|
||||
var list =
|
||||
cacheMap.computeIfAbsent(
|
||||
QuestData.questConditionKey(QuestCond.QUEST_COND_NONE, 0, null),
|
||||
e -> new ArrayList<>());
|
||||
list.add(this);
|
||||
} else {
|
||||
this.getAcceptCond()
|
||||
.forEach(
|
||||
questCondition -> {
|
||||
if (questCondition.getType() == null) {
|
||||
Grasscutter.getLogger().warn("null accept type for quest {}", getSubId());
|
||||
return;
|
||||
}
|
||||
|
||||
var key = questCondition.asKey();
|
||||
var list = cacheMap.computeIfAbsent(key, e -> new ArrayList<>());
|
||||
list.add(this);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public static class QuestExecParam {
|
||||
@SerializedName("_type")
|
||||
QuestExec type;
|
||||
|
||||
@SerializedName("_param")
|
||||
String[] param;
|
||||
|
||||
@SerializedName("_count")
|
||||
String count;
|
||||
}
|
||||
|
||||
public static class QuestAcceptCondition extends QuestCondition<QuestCond> {}
|
||||
|
||||
public static class QuestContentCondition extends QuestCondition<QuestContent> {}
|
||||
|
||||
@Data
|
||||
public static class QuestCondition<TYPE extends Enum<?> & QuestTrigger> {
|
||||
@SerializedName("_type")
|
||||
private TYPE type;
|
||||
|
||||
@SerializedName("_param")
|
||||
private int[] param;
|
||||
|
||||
@SerializedName("_param_str")
|
||||
private String paramStr;
|
||||
|
||||
@SerializedName("_count")
|
||||
private int count;
|
||||
|
||||
public String asKey() {
|
||||
return questConditionKey(getType(), getParam()[0], getParamStr());
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Guide {
|
||||
private String type;
|
||||
private List<String> param;
|
||||
private int guideScene;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.quest.enums.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.*;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@ResourceType(name = "QuestExcelConfigData.json")
|
||||
@Getter
|
||||
@ToString
|
||||
public class QuestData extends GameResource {
|
||||
@Getter private int subId;
|
||||
@Getter private int mainId;
|
||||
@Getter private int order;
|
||||
@Getter private long descTextMapHash;
|
||||
|
||||
@Getter private boolean finishParent;
|
||||
@Getter private boolean isRewind;
|
||||
|
||||
@Getter private LogicType acceptCondComb;
|
||||
@Getter private LogicType finishCondComb;
|
||||
@Getter private LogicType failCondComb;
|
||||
|
||||
@Getter private List<QuestAcceptCondition> acceptCond;
|
||||
@Getter private List<QuestContentCondition> finishCond;
|
||||
@Getter private List<QuestContentCondition> failCond;
|
||||
@Getter private List<QuestExecParam> beginExec;
|
||||
@Getter private List<QuestExecParam> finishExec;
|
||||
@Getter private List<QuestExecParam> failExec;
|
||||
@Getter private Guide guide;
|
||||
@Getter private List<Integer> trialAvatarList;
|
||||
|
||||
public static String questConditionKey(
|
||||
@Nonnull Enum<?> type, int firstParam, @Nullable String paramsStr) {
|
||||
return type.name() + firstParam + (paramsStr != null ? paramsStr : "");
|
||||
}
|
||||
|
||||
// ResourceLoader not happy if you remove getId() ~~
|
||||
public int getId() {
|
||||
return subId;
|
||||
}
|
||||
|
||||
public void onLoad() {
|
||||
this.acceptCond = acceptCond.stream().filter(p -> p.getType() != null).toList();
|
||||
this.finishCond = finishCond.stream().filter(p -> p.getType() != null).toList();
|
||||
this.failCond = failCond.stream().filter(p -> p.getType() != null).toList();
|
||||
|
||||
this.beginExec = beginExec.stream().filter(p -> p.type != null).toList();
|
||||
this.finishExec = finishExec.stream().filter(p -> p.type != null).toList();
|
||||
this.failExec = failExec.stream().filter(p -> p.type != null).toList();
|
||||
|
||||
if (this.acceptCondComb == null) this.acceptCondComb = LogicType.LOGIC_NONE;
|
||||
|
||||
if (this.finishCondComb == null) this.finishCondComb = LogicType.LOGIC_NONE;
|
||||
|
||||
if (this.failCondComb == null) this.failCondComb = LogicType.LOGIC_NONE;
|
||||
|
||||
addToCache();
|
||||
}
|
||||
|
||||
private void addToCache() {
|
||||
if (this.acceptCond == null) {
|
||||
Grasscutter.getLogger().warn("missing AcceptConditions for quest {}", getSubId());
|
||||
return;
|
||||
}
|
||||
|
||||
var cacheMap = GameData.getBeginCondQuestMap();
|
||||
if (getAcceptCond().isEmpty()) {
|
||||
var list =
|
||||
cacheMap.computeIfAbsent(
|
||||
QuestData.questConditionKey(QuestCond.QUEST_COND_NONE, 0, null),
|
||||
e -> new ArrayList<>());
|
||||
list.add(this);
|
||||
} else {
|
||||
this.getAcceptCond()
|
||||
.forEach(
|
||||
questCondition -> {
|
||||
if (questCondition.getType() == null) {
|
||||
Grasscutter.getLogger().warn("null accept type for quest {}", getSubId());
|
||||
return;
|
||||
}
|
||||
|
||||
var key = questCondition.asKey();
|
||||
var list = cacheMap.computeIfAbsent(key, e -> new ArrayList<>());
|
||||
list.add(this);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public static class QuestExecParam {
|
||||
@SerializedName("_type")
|
||||
QuestExec type;
|
||||
|
||||
@SerializedName("_param")
|
||||
String[] param;
|
||||
|
||||
@SerializedName("_count")
|
||||
String count;
|
||||
}
|
||||
|
||||
public static class QuestAcceptCondition extends QuestCondition<QuestCond> {}
|
||||
|
||||
public static class QuestContentCondition extends QuestCondition<QuestContent> {}
|
||||
|
||||
@Data
|
||||
public static class QuestCondition<TYPE extends Enum<?> & QuestTrigger> {
|
||||
@SerializedName("_type")
|
||||
private TYPE type;
|
||||
|
||||
@SerializedName("_param")
|
||||
private int[] param;
|
||||
|
||||
@SerializedName("_param_str")
|
||||
private String paramStr;
|
||||
|
||||
@SerializedName("_count")
|
||||
private int count;
|
||||
|
||||
public String asKey() {
|
||||
return questConditionKey(getType(), getParam()[0], getParamStr());
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Guide {
|
||||
private String type;
|
||||
private List<String> param;
|
||||
private int guideScene;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,85 +1,85 @@
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.RefreshType;
|
||||
import emu.grasscutter.game.world.World;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "RefreshPolicyExcelConfigData.json")
|
||||
public class RefreshPolicyExcelConfigData extends GameResource {
|
||||
@Getter private int id;
|
||||
@Getter private RefreshType type;
|
||||
@Getter private String time;
|
||||
|
||||
private static int upperBound(List<Integer> list, int low, int high, int value) {
|
||||
while (low < high) {
|
||||
int middle = (high + low) / 2;
|
||||
if (list.size() >= middle) return low; // Just in case
|
||||
if (list.get(middle) > value) {
|
||||
high = middle;
|
||||
} else {
|
||||
low = middle + 1;
|
||||
}
|
||||
}
|
||||
return low;
|
||||
}
|
||||
|
||||
public int getIntervalInSeconds(World world) {
|
||||
if (time.isEmpty()) return -1;
|
||||
|
||||
var currentTimestamp = world.getTotalGameTimeMinutes();
|
||||
|
||||
try {
|
||||
List<String> paramsStr = Arrays.asList(time.split(";"));
|
||||
List<Integer> params = paramsStr.stream().map(Integer::parseInt).toList();
|
||||
|
||||
switch (type) {
|
||||
case REFRESH_NONE:
|
||||
return -1;
|
||||
case REFRESH_INTERVAL:
|
||||
if (params.isEmpty()) return -1;
|
||||
return params.get(0);
|
||||
case REFRESH_DAILY:
|
||||
{
|
||||
var dayTime = (world.getTotalGameTimeMinutes() / (24 * 60)) * 24 * 60 * 60;
|
||||
var temp = currentTimestamp - dayTime;
|
||||
var upper_bound_idx =
|
||||
upperBound(
|
||||
params, (int) params.get(0), (int) params.get(params.size() - 1), (int) temp);
|
||||
var upper_bound = params.get(upper_bound_idx);
|
||||
if (params.get(params.size() - 1) == upper_bound) {
|
||||
return (params.get(params.size() - 1) - params.get(0)) + 60 * 60 * 24 * 7;
|
||||
} else if (params.get(0) == upper_bound) {
|
||||
return (params.get(params.size() - 1) - params.get(0)) + 60 * 60 * 24 * 7;
|
||||
}
|
||||
return (params.get(upper_bound_idx - 1) - params.get(0));
|
||||
}
|
||||
case REFRESH_WEEKlY:
|
||||
if (params.size() < 2) return -1;
|
||||
{
|
||||
var weekTime = (world.getTotalGameTimeDays() / 7) * 60 * 60 * 24 * 7;
|
||||
var temp = currentTimestamp - weekTime;
|
||||
var upper_bound_idx =
|
||||
upperBound(
|
||||
params, (int) params.get(0), (int) params.get(params.size() - 1), (int) temp);
|
||||
var upper_bound = params.get(upper_bound_idx);
|
||||
if (params.get(params.size() - 1) == upper_bound) {
|
||||
return (params.get(params.size() - 1) - params.get(0)) + 60 * 60 * 24 * 7;
|
||||
} else if (params.get(0) == upper_bound) {
|
||||
return (params.get(params.size() - 1) - params.get(0)) + 60 * 60 * 24 * 7;
|
||||
}
|
||||
return (params.get(upper_bound_idx - 1) - params.get(0));
|
||||
}
|
||||
case REFRESH_DAYBEGIN_INTERVAL:
|
||||
if (params.size() == 0) return -1;
|
||||
return params.get(0) * 60 * 60 * 24;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.RefreshType;
|
||||
import emu.grasscutter.game.world.World;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "RefreshPolicyExcelConfigData.json")
|
||||
public class RefreshPolicyExcelConfigData extends GameResource {
|
||||
@Getter private int id;
|
||||
@Getter private RefreshType type;
|
||||
@Getter private String time;
|
||||
|
||||
private static int upperBound(List<Integer> list, int low, int high, int value) {
|
||||
while (low < high) {
|
||||
int middle = (high + low) / 2;
|
||||
if (list.size() >= middle) return low; // Just in case
|
||||
if (list.get(middle) > value) {
|
||||
high = middle;
|
||||
} else {
|
||||
low = middle + 1;
|
||||
}
|
||||
}
|
||||
return low;
|
||||
}
|
||||
|
||||
public int getIntervalInSeconds(World world) {
|
||||
if (time.isEmpty()) return -1;
|
||||
|
||||
var currentTimestamp = world.getTotalGameTimeMinutes();
|
||||
|
||||
try {
|
||||
List<String> paramsStr = Arrays.asList(time.split(";"));
|
||||
List<Integer> params = paramsStr.stream().map(Integer::parseInt).toList();
|
||||
|
||||
switch (type) {
|
||||
case REFRESH_NONE:
|
||||
return -1;
|
||||
case REFRESH_INTERVAL:
|
||||
if (params.isEmpty()) return -1;
|
||||
return params.get(0);
|
||||
case REFRESH_DAILY:
|
||||
{
|
||||
var dayTime = (world.getTotalGameTimeMinutes() / (24 * 60)) * 24 * 60 * 60;
|
||||
var temp = currentTimestamp - dayTime;
|
||||
var upper_bound_idx =
|
||||
upperBound(
|
||||
params, (int) params.get(0), (int) params.get(params.size() - 1), (int) temp);
|
||||
var upper_bound = params.get(upper_bound_idx);
|
||||
if (params.get(params.size() - 1) == upper_bound) {
|
||||
return (params.get(params.size() - 1) - params.get(0)) + 60 * 60 * 24 * 7;
|
||||
} else if (params.get(0) == upper_bound) {
|
||||
return (params.get(params.size() - 1) - params.get(0)) + 60 * 60 * 24 * 7;
|
||||
}
|
||||
return (params.get(upper_bound_idx - 1) - params.get(0));
|
||||
}
|
||||
case REFRESH_WEEKlY:
|
||||
if (params.size() < 2) return -1;
|
||||
{
|
||||
var weekTime = (world.getTotalGameTimeDays() / 7) * 60 * 60 * 24 * 7;
|
||||
var temp = currentTimestamp - weekTime;
|
||||
var upper_bound_idx =
|
||||
upperBound(
|
||||
params, (int) params.get(0), (int) params.get(params.size() - 1), (int) temp);
|
||||
var upper_bound = params.get(upper_bound_idx);
|
||||
if (params.get(params.size() - 1) == upper_bound) {
|
||||
return (params.get(params.size() - 1) - params.get(0)) + 60 * 60 * 24 * 7;
|
||||
} else if (params.get(0) == upper_bound) {
|
||||
return (params.get(params.size() - 1) - params.get(0)) + 60 * 60 * 24 * 7;
|
||||
}
|
||||
return (params.get(upper_bound_idx - 1) - params.get(0));
|
||||
}
|
||||
case REFRESH_DAYBEGIN_INTERVAL:
|
||||
if (params.size() == 0) return -1;
|
||||
return params.get(0) * 60 * 60 * 24;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.SceneType;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "SceneExcelConfigData.json")
|
||||
@Getter
|
||||
public class SceneData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
@SerializedName("type")
|
||||
private SceneType sceneType;
|
||||
|
||||
private String scriptData;
|
||||
private String levelEntityConfig;
|
||||
private List<Integer> specifiedAvatarList;
|
||||
}
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.SceneType;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "SceneExcelConfigData.json")
|
||||
@Getter
|
||||
public class SceneData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
@SerializedName("type")
|
||||
private SceneType sceneType;
|
||||
|
||||
private String scriptData;
|
||||
private String levelEntityConfig;
|
||||
private List<Integer> specifiedAvatarList;
|
||||
}
|
||||
|
||||
@@ -1,100 +1,100 @@
|
||||
package emu.grasscutter.data.excels.achievement;
|
||||
|
||||
import com.github.davidmoten.guavamini.Lists;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.excels.BattlePassMissionData;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@ResourceType(name = "AchievementExcelConfigData.json")
|
||||
public class AchievementData extends GameResource {
|
||||
private static final AtomicBoolean isDivided = new AtomicBoolean();
|
||||
private int goalId;
|
||||
private int preStageAchievementId;
|
||||
private final Set<Integer> groupAchievementIdList = new HashSet<>();
|
||||
private boolean isParent;
|
||||
private long titleTextMapHash;
|
||||
private long descTextMapHash;
|
||||
private int finishRewardId;
|
||||
private boolean isDeleteWatcherAfterFinish;
|
||||
private int id;
|
||||
private BattlePassMissionData.TriggerConfig triggerConfig;
|
||||
private int progress;
|
||||
private boolean isDisuse;
|
||||
|
||||
public static void divideIntoGroups() {
|
||||
if (isDivided.get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
isDivided.set(true);
|
||||
var map = GameData.getAchievementDataMap();
|
||||
var achievementDataList = map.values().stream().filter(AchievementData::isUsed).toList();
|
||||
for (var data : achievementDataList) {
|
||||
if (!data.hasPreStageAchievement() || data.hasGroupAchievements()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<Integer> ids = Lists.newArrayList();
|
||||
int parentId = data.getId();
|
||||
while (true) {
|
||||
var next = map.get(parentId + 1);
|
||||
if (next == null || parentId != next.getPreStageAchievementId()) {
|
||||
break;
|
||||
}
|
||||
|
||||
parentId++;
|
||||
}
|
||||
|
||||
map.get(parentId).isParent = true;
|
||||
|
||||
while (true) {
|
||||
ids.add(parentId);
|
||||
var previous = map.get(--parentId);
|
||||
if (previous == null) {
|
||||
break;
|
||||
} else if (!previous.hasPreStageAchievement()) {
|
||||
ids.add(parentId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i : ids) {
|
||||
map.get(i).groupAchievementIdList.addAll(ids);
|
||||
}
|
||||
}
|
||||
|
||||
map.values().stream()
|
||||
.filter(a -> !a.hasGroupAchievements() && a.isUsed())
|
||||
.forEach(a -> a.isParent = true);
|
||||
}
|
||||
|
||||
public boolean hasPreStageAchievement() {
|
||||
return this.preStageAchievementId != 0;
|
||||
}
|
||||
|
||||
public boolean hasGroupAchievements() {
|
||||
return !this.groupAchievementIdList.isEmpty();
|
||||
}
|
||||
|
||||
public boolean isUsed() {
|
||||
return !this.isDisuse;
|
||||
}
|
||||
|
||||
public Set<Integer> getGroupAchievementIdList() {
|
||||
return this.groupAchievementIdList.stream().collect(Collectors.toUnmodifiableSet());
|
||||
}
|
||||
|
||||
public Set<Integer> getExcludedGroupAchievementIdList() {
|
||||
return this.groupAchievementIdList.stream()
|
||||
.filter(integer -> integer != this.getId())
|
||||
.collect(Collectors.toUnmodifiableSet());
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.achievement;
|
||||
|
||||
import com.github.davidmoten.guavamini.Lists;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.excels.BattlePassMissionData;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@ResourceType(name = "AchievementExcelConfigData.json")
|
||||
public class AchievementData extends GameResource {
|
||||
private static final AtomicBoolean isDivided = new AtomicBoolean();
|
||||
private int goalId;
|
||||
private int preStageAchievementId;
|
||||
private final Set<Integer> groupAchievementIdList = new HashSet<>();
|
||||
private boolean isParent;
|
||||
private long titleTextMapHash;
|
||||
private long descTextMapHash;
|
||||
private int finishRewardId;
|
||||
private boolean isDeleteWatcherAfterFinish;
|
||||
private int id;
|
||||
private BattlePassMissionData.TriggerConfig triggerConfig;
|
||||
private int progress;
|
||||
private boolean isDisuse;
|
||||
|
||||
public static void divideIntoGroups() {
|
||||
if (isDivided.get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
isDivided.set(true);
|
||||
var map = GameData.getAchievementDataMap();
|
||||
var achievementDataList = map.values().stream().filter(AchievementData::isUsed).toList();
|
||||
for (var data : achievementDataList) {
|
||||
if (!data.hasPreStageAchievement() || data.hasGroupAchievements()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<Integer> ids = Lists.newArrayList();
|
||||
int parentId = data.getId();
|
||||
while (true) {
|
||||
var next = map.get(parentId + 1);
|
||||
if (next == null || parentId != next.getPreStageAchievementId()) {
|
||||
break;
|
||||
}
|
||||
|
||||
parentId++;
|
||||
}
|
||||
|
||||
map.get(parentId).isParent = true;
|
||||
|
||||
while (true) {
|
||||
ids.add(parentId);
|
||||
var previous = map.get(--parentId);
|
||||
if (previous == null) {
|
||||
break;
|
||||
} else if (!previous.hasPreStageAchievement()) {
|
||||
ids.add(parentId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i : ids) {
|
||||
map.get(i).groupAchievementIdList.addAll(ids);
|
||||
}
|
||||
}
|
||||
|
||||
map.values().stream()
|
||||
.filter(a -> !a.hasGroupAchievements() && a.isUsed())
|
||||
.forEach(a -> a.isParent = true);
|
||||
}
|
||||
|
||||
public boolean hasPreStageAchievement() {
|
||||
return this.preStageAchievementId != 0;
|
||||
}
|
||||
|
||||
public boolean hasGroupAchievements() {
|
||||
return !this.groupAchievementIdList.isEmpty();
|
||||
}
|
||||
|
||||
public boolean isUsed() {
|
||||
return !this.isDisuse;
|
||||
}
|
||||
|
||||
public Set<Integer> getGroupAchievementIdList() {
|
||||
return this.groupAchievementIdList.stream().collect(Collectors.toUnmodifiableSet());
|
||||
}
|
||||
|
||||
public Set<Integer> getExcludedGroupAchievementIdList() {
|
||||
return this.groupAchievementIdList.stream()
|
||||
.filter(integer -> integer != this.getId())
|
||||
.collect(Collectors.toUnmodifiableSet());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package emu.grasscutter.data.excels.achievement;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@ResourceType(name = "AchievementGoalExcelConfigData.json")
|
||||
public class AchievementGoalData extends GameResource {
|
||||
private int id;
|
||||
private long nameTextMapHash;
|
||||
private int finishRewardId;
|
||||
}
|
||||
package emu.grasscutter.data.excels.achievement;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@ResourceType(name = "AchievementGoalExcelConfigData.json")
|
||||
public class AchievementGoalData extends GameResource {
|
||||
private int id;
|
||||
private long nameTextMapHash;
|
||||
private int finishRewardId;
|
||||
}
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
package emu.grasscutter.data.excels.activity;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.activity.condition.ActivityConditions;
|
||||
import emu.grasscutter.game.quest.enums.LogicType;
|
||||
import java.util.List;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@ResourceType(name = "NewActivityCondExcelConfigData.json")
|
||||
@Getter
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class ActivityCondExcelConfigData extends GameResource {
|
||||
int condId;
|
||||
LogicType condComb;
|
||||
List<ActivityConfigCondition> cond;
|
||||
|
||||
public static class ActivityConfigCondition {
|
||||
@Getter private ActivityConditions type;
|
||||
@Getter private List<Integer> param;
|
||||
|
||||
public int[] paramArray() {
|
||||
return param.stream().mapToInt(Integer::intValue).toArray();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return condId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
cond.removeIf(c -> c.type == null);
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.activity;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.activity.condition.ActivityConditions;
|
||||
import emu.grasscutter.game.quest.enums.LogicType;
|
||||
import java.util.List;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@ResourceType(name = "NewActivityCondExcelConfigData.json")
|
||||
@Getter
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class ActivityCondExcelConfigData extends GameResource {
|
||||
int condId;
|
||||
LogicType condComb;
|
||||
List<ActivityConfigCondition> cond;
|
||||
|
||||
public static class ActivityConfigCondition {
|
||||
@Getter private ActivityConditions type;
|
||||
@Getter private List<Integer> param;
|
||||
|
||||
public int[] paramArray() {
|
||||
return param.stream().mapToInt(Integer::intValue).toArray();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return condId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
cond.removeIf(c -> c.type == null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
package emu.grasscutter.data.excels.activity;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@ResourceType(
|
||||
name = "NewActivityExcelConfigData.json",
|
||||
loadPriority = ResourceType.LoadPriority.LOW)
|
||||
@Getter
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class ActivityData extends GameResource {
|
||||
int activityId;
|
||||
String activityType;
|
||||
List<Integer> condGroupId;
|
||||
List<Integer> watcherId;
|
||||
List<ActivityWatcherData> watcherDataList;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.activityId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.watcherDataList =
|
||||
watcherId.stream()
|
||||
.map(item -> GameData.getActivityWatcherDataMap().get(item.intValue()))
|
||||
.filter(Objects::nonNull)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.activity;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@ResourceType(
|
||||
name = "NewActivityExcelConfigData.json",
|
||||
loadPriority = ResourceType.LoadPriority.LOW)
|
||||
@Getter
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class ActivityData extends GameResource {
|
||||
int activityId;
|
||||
String activityType;
|
||||
List<Integer> condGroupId;
|
||||
List<Integer> watcherId;
|
||||
List<ActivityWatcherData> watcherDataList;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.activityId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.watcherDataList =
|
||||
watcherId.stream()
|
||||
.map(item -> GameData.getActivityWatcherDataMap().get(item.intValue()))
|
||||
.filter(Objects::nonNull)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
package emu.grasscutter.data.excels.activity;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.shop.ShopType;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "ActivityShopOverallExcelConfigData.json")
|
||||
public class ActivityShopData extends GameResource {
|
||||
@Getter private int scheduleId;
|
||||
@Getter private ShopType shopType;
|
||||
@Getter private List<Integer> sheetList;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return getShopTypeId();
|
||||
}
|
||||
|
||||
public int getShopTypeId() {
|
||||
if (this.shopType == null) this.shopType = ShopType.SHOP_TYPE_NONE;
|
||||
return shopType.shopTypeId;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.activity;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.shop.ShopType;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "ActivityShopOverallExcelConfigData.json")
|
||||
public class ActivityShopData extends GameResource {
|
||||
@Getter private int scheduleId;
|
||||
@Getter private ShopType shopType;
|
||||
@Getter private List<Integer> sheetList;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return getShopTypeId();
|
||||
}
|
||||
|
||||
public int getShopTypeId() {
|
||||
if (this.shopType == null) this.shopType = ShopType.SHOP_TYPE_NONE;
|
||||
return shopType.shopTypeId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
package emu.grasscutter.data.excels.activity;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.WatcherTriggerType;
|
||||
import java.util.List;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@ResourceType(
|
||||
name = "NewActivityWatcherConfigData.json",
|
||||
loadPriority = ResourceType.LoadPriority.HIGH)
|
||||
@Getter
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class ActivityWatcherData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
int id;
|
||||
|
||||
int rewardID;
|
||||
int progress;
|
||||
WatcherTrigger triggerConfig;
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.triggerConfig.paramList =
|
||||
this.triggerConfig.paramList.stream().filter(x -> (x != null) && !x.isBlank()).toList();
|
||||
this.triggerConfig.watcherTriggerType =
|
||||
WatcherTriggerType.getTypeByName(this.triggerConfig.triggerType);
|
||||
}
|
||||
|
||||
@Getter
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public static class WatcherTrigger {
|
||||
String triggerType;
|
||||
List<String> paramList;
|
||||
|
||||
transient WatcherTriggerType watcherTriggerType;
|
||||
|
||||
public void onLoad() {
|
||||
this.paramList = this.paramList.stream().filter(x -> (x != null) && !x.isBlank()).toList();
|
||||
this.watcherTriggerType = WatcherTriggerType.getTypeByName(this.triggerType);
|
||||
}
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.activity;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.WatcherTriggerType;
|
||||
import java.util.List;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@ResourceType(
|
||||
name = "NewActivityWatcherConfigData.json",
|
||||
loadPriority = ResourceType.LoadPriority.HIGH)
|
||||
@Getter
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class ActivityWatcherData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
int id;
|
||||
|
||||
int rewardID;
|
||||
int progress;
|
||||
WatcherTrigger triggerConfig;
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.triggerConfig.paramList =
|
||||
this.triggerConfig.paramList.stream().filter(x -> (x != null) && !x.isBlank()).toList();
|
||||
this.triggerConfig.watcherTriggerType =
|
||||
WatcherTriggerType.getTypeByName(this.triggerConfig.triggerType);
|
||||
}
|
||||
|
||||
@Getter
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public static class WatcherTrigger {
|
||||
String triggerType;
|
||||
List<String> paramList;
|
||||
|
||||
transient WatcherTriggerType watcherTriggerType;
|
||||
|
||||
public void onLoad() {
|
||||
this.paramList = this.paramList.stream().filter(x -> (x != null) && !x.isBlank()).toList();
|
||||
this.watcherTriggerType = WatcherTriggerType.getTypeByName(this.triggerType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "AvatarCostumeExcelConfigData.json")
|
||||
public class AvatarCostumeData extends GameResource {
|
||||
@SerializedName(value = "skinId", alternate = "costumeId")
|
||||
private int skinId;
|
||||
|
||||
private int itemId;
|
||||
private int characterId;
|
||||
private int quality;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.skinId;
|
||||
}
|
||||
|
||||
public int getItemId() {
|
||||
return this.itemId;
|
||||
}
|
||||
|
||||
public int getCharacterId() {
|
||||
return characterId;
|
||||
}
|
||||
|
||||
public int getQuality() {
|
||||
return quality;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
GameData.getAvatarCostumeDataItemIdMap().put(this.getItemId(), this);
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "AvatarCostumeExcelConfigData.json")
|
||||
public class AvatarCostumeData extends GameResource {
|
||||
@SerializedName(value = "skinId", alternate = "costumeId")
|
||||
private int skinId;
|
||||
|
||||
private int itemId;
|
||||
private int characterId;
|
||||
private int quality;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.skinId;
|
||||
}
|
||||
|
||||
public int getItemId() {
|
||||
return this.itemId;
|
||||
}
|
||||
|
||||
public int getCharacterId() {
|
||||
return characterId;
|
||||
}
|
||||
|
||||
public int getQuality() {
|
||||
return quality;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
GameData.getAvatarCostumeDataItemIdMap().put(this.getItemId(), this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.CurveInfo;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@ResourceType(name = "AvatarCurveExcelConfigData.json")
|
||||
public class AvatarCurveData extends GameResource {
|
||||
private int level;
|
||||
private CurveInfo[] curveInfos;
|
||||
|
||||
private Map<String, Float> curveInfoMap;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.level;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public Map<String, Float> getCurveInfos() {
|
||||
return curveInfoMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.curveInfoMap = new HashMap<>();
|
||||
Stream.of(this.curveInfos)
|
||||
.forEach(info -> this.curveInfoMap.put(info.getType(), info.getValue()));
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.CurveInfo;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@ResourceType(name = "AvatarCurveExcelConfigData.json")
|
||||
public class AvatarCurveData extends GameResource {
|
||||
private int level;
|
||||
private CurveInfo[] curveInfos;
|
||||
|
||||
private Map<String, Float> curveInfoMap;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.level;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public Map<String, Float> getCurveInfos() {
|
||||
return curveInfoMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.curveInfoMap = new HashMap<>();
|
||||
Stream.of(this.curveInfos)
|
||||
.forEach(info -> this.curveInfoMap.put(info.getType(), info.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "AvatarFettersLevelExcelConfigData.json")
|
||||
public class AvatarFetterLevelData extends GameResource {
|
||||
private int fetterLevel;
|
||||
private int needExp;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.fetterLevel;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return fetterLevel;
|
||||
}
|
||||
|
||||
public int getExp() {
|
||||
return needExp;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "AvatarFettersLevelExcelConfigData.json")
|
||||
public class AvatarFetterLevelData extends GameResource {
|
||||
private int fetterLevel;
|
||||
private int needExp;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.fetterLevel;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return fetterLevel;
|
||||
}
|
||||
|
||||
public int getExp() {
|
||||
return needExp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "AvatarFlycloakExcelConfigData.json")
|
||||
public class AvatarFlycloakData extends GameResource {
|
||||
private int flycloakId;
|
||||
private long nameTextMapHash;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.flycloakId;
|
||||
}
|
||||
|
||||
public long getNameTextMapHash() {
|
||||
return nameTextMapHash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {}
|
||||
}
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "AvatarFlycloakExcelConfigData.json")
|
||||
public class AvatarFlycloakData extends GameResource {
|
||||
private int flycloakId;
|
||||
private long nameTextMapHash;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.flycloakId;
|
||||
}
|
||||
|
||||
public long getNameTextMapHash() {
|
||||
return nameTextMapHash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "AvatarLevelExcelConfigData.json")
|
||||
public class AvatarLevelData extends GameResource {
|
||||
private int level;
|
||||
private int exp;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.level;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public int getExp() {
|
||||
return exp;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "AvatarLevelExcelConfigData.json")
|
||||
public class AvatarLevelData extends GameResource {
|
||||
private int level;
|
||||
private int exp;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.level;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public int getExp() {
|
||||
return exp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,74 +1,74 @@
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.FightPropData;
|
||||
import emu.grasscutter.data.common.ItemParamData;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ResourceType(name = "AvatarPromoteExcelConfigData.json")
|
||||
public class AvatarPromoteData extends GameResource {
|
||||
|
||||
private int avatarPromoteId;
|
||||
private int promoteLevel;
|
||||
private int scoinCost;
|
||||
private ItemParamData[] costItems;
|
||||
private int unlockMaxLevel;
|
||||
private FightPropData[] addProps;
|
||||
private int requiredPlayerLevel;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return (avatarPromoteId << 8) + promoteLevel;
|
||||
}
|
||||
|
||||
public int getAvatarPromoteId() {
|
||||
return avatarPromoteId;
|
||||
}
|
||||
|
||||
public int getPromoteLevel() {
|
||||
return promoteLevel;
|
||||
}
|
||||
|
||||
public ItemParamData[] getCostItems() {
|
||||
return costItems;
|
||||
}
|
||||
|
||||
public int getCoinCost() {
|
||||
return scoinCost;
|
||||
}
|
||||
|
||||
public FightPropData[] getAddProps() {
|
||||
return addProps;
|
||||
}
|
||||
|
||||
public int getUnlockMaxLevel() {
|
||||
return unlockMaxLevel;
|
||||
}
|
||||
|
||||
public int getRequiredPlayerLevel() {
|
||||
return requiredPlayerLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// Trim item params
|
||||
ArrayList<ItemParamData> trim = new ArrayList<>(getAddProps().length);
|
||||
for (ItemParamData itemParam : getCostItems()) {
|
||||
if (itemParam.getId() == 0) {
|
||||
continue;
|
||||
}
|
||||
trim.add(itemParam);
|
||||
}
|
||||
this.costItems = trim.toArray(new ItemParamData[trim.size()]);
|
||||
// Trim fight prop data (just in case)
|
||||
ArrayList<FightPropData> parsed = new ArrayList<>(getAddProps().length);
|
||||
for (FightPropData prop : getAddProps()) {
|
||||
if (prop.getPropType() != null && prop.getValue() != 0f) {
|
||||
prop.onLoad();
|
||||
parsed.add(prop);
|
||||
}
|
||||
}
|
||||
this.addProps = parsed.toArray(new FightPropData[parsed.size()]);
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.FightPropData;
|
||||
import emu.grasscutter.data.common.ItemParamData;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ResourceType(name = "AvatarPromoteExcelConfigData.json")
|
||||
public class AvatarPromoteData extends GameResource {
|
||||
|
||||
private int avatarPromoteId;
|
||||
private int promoteLevel;
|
||||
private int scoinCost;
|
||||
private ItemParamData[] costItems;
|
||||
private int unlockMaxLevel;
|
||||
private FightPropData[] addProps;
|
||||
private int requiredPlayerLevel;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return (avatarPromoteId << 8) + promoteLevel;
|
||||
}
|
||||
|
||||
public int getAvatarPromoteId() {
|
||||
return avatarPromoteId;
|
||||
}
|
||||
|
||||
public int getPromoteLevel() {
|
||||
return promoteLevel;
|
||||
}
|
||||
|
||||
public ItemParamData[] getCostItems() {
|
||||
return costItems;
|
||||
}
|
||||
|
||||
public int getCoinCost() {
|
||||
return scoinCost;
|
||||
}
|
||||
|
||||
public FightPropData[] getAddProps() {
|
||||
return addProps;
|
||||
}
|
||||
|
||||
public int getUnlockMaxLevel() {
|
||||
return unlockMaxLevel;
|
||||
}
|
||||
|
||||
public int getRequiredPlayerLevel() {
|
||||
return requiredPlayerLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// Trim item params
|
||||
ArrayList<ItemParamData> trim = new ArrayList<>(getAddProps().length);
|
||||
for (ItemParamData itemParam : getCostItems()) {
|
||||
if (itemParam.getId() == 0) {
|
||||
continue;
|
||||
}
|
||||
trim.add(itemParam);
|
||||
}
|
||||
this.costItems = trim.toArray(new ItemParamData[trim.size()]);
|
||||
// Trim fight prop data (just in case)
|
||||
ArrayList<FightPropData> parsed = new ArrayList<>(getAddProps().length);
|
||||
for (FightPropData prop : getAddProps()) {
|
||||
if (prop.getPropType() != null && prop.getValue() != 0f) {
|
||||
prop.onLoad();
|
||||
parsed.add(prop);
|
||||
}
|
||||
}
|
||||
this.addProps = parsed.toArray(new FightPropData[parsed.size()]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@ResourceType(name = "AvatarReplaceCostumeExcelConfigData.json")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class AvatarReplaceCostumeData extends GameResource {
|
||||
private int avatarId;
|
||||
|
||||
@SerializedName(
|
||||
value = "costumeId",
|
||||
alternate = {"MGLCOPOIJIC", "BDBMOBGKIAP"})
|
||||
private int costumeId;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return costumeId;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@ResourceType(name = "AvatarReplaceCostumeExcelConfigData.json")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class AvatarReplaceCostumeData extends GameResource {
|
||||
private int avatarId;
|
||||
|
||||
@SerializedName(
|
||||
value = "costumeId",
|
||||
alternate = {"MGLCOPOIJIC", "BDBMOBGKIAP"})
|
||||
private int costumeId;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return costumeId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.ResourceType.LoadPriority;
|
||||
import emu.grasscutter.game.props.ElementType;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "AvatarSkillExcelConfigData.json", loadPriority = LoadPriority.HIGHEST)
|
||||
@Getter
|
||||
public class AvatarSkillData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private float cdTime;
|
||||
private int costElemVal;
|
||||
private int maxChargeNum;
|
||||
private int triggerID;
|
||||
private boolean isAttackCameraLock;
|
||||
private int proudSkillGroupId;
|
||||
private ElementType costElemType;
|
||||
private long nameTextMapHash;
|
||||
private long descTextMapHash;
|
||||
private String abilityName;
|
||||
}
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.ResourceType.LoadPriority;
|
||||
import emu.grasscutter.game.props.ElementType;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "AvatarSkillExcelConfigData.json", loadPriority = LoadPriority.HIGHEST)
|
||||
@Getter
|
||||
public class AvatarSkillData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private float cdTime;
|
||||
private int costElemVal;
|
||||
private int maxChargeNum;
|
||||
private int triggerID;
|
||||
private boolean isAttackCameraLock;
|
||||
private int proudSkillGroupId;
|
||||
private ElementType costElemType;
|
||||
private long nameTextMapHash;
|
||||
private long descTextMapHash;
|
||||
private String abilityName;
|
||||
}
|
||||
|
||||
@@ -1,89 +1,89 @@
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameDepot;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceLoader.AvatarConfig;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.ResourceType.LoadPriority;
|
||||
import emu.grasscutter.data.binout.AbilityEmbryoEntry;
|
||||
import emu.grasscutter.game.props.ElementType;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.IntStream;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "AvatarSkillDepotExcelConfigData.json", loadPriority = LoadPriority.HIGH)
|
||||
@Getter
|
||||
public class AvatarSkillDepotData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private int energySkill;
|
||||
private int attackModeSkill;
|
||||
|
||||
private List<Integer> skills;
|
||||
private List<Integer> subSkills;
|
||||
private List<String> extraAbilities;
|
||||
private List<Integer> talents;
|
||||
private List<InherentProudSkillOpens> inherentProudSkillOpens;
|
||||
|
||||
private String talentStarName;
|
||||
private String skillDepotAbilityGroup;
|
||||
|
||||
// Transient
|
||||
private AvatarSkillData energySkillData;
|
||||
private ElementType elementType;
|
||||
private IntList abilities;
|
||||
private int talentCostItemId;
|
||||
|
||||
public void setAbilities(AbilityEmbryoEntry info) {
|
||||
this.abilities = new IntArrayList(info.getAbilities().length);
|
||||
for (String ability : info.getAbilities()) {
|
||||
this.abilities.add(Utils.abilityHash(ability));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// Set energy skill data
|
||||
this.energySkillData = GameData.getAvatarSkillDataMap().get(this.energySkill);
|
||||
if (this.energySkillData != null) {
|
||||
this.elementType = this.energySkillData.getCostElemType();
|
||||
} else {
|
||||
this.elementType = ElementType.None;
|
||||
}
|
||||
// Set embryo abilities (if player skill depot)
|
||||
if (getSkillDepotAbilityGroup() != null && getSkillDepotAbilityGroup().length() > 0) {
|
||||
AvatarConfig config = GameDepot.getPlayerAbilities().get(getSkillDepotAbilityGroup());
|
||||
|
||||
if (config != null) {
|
||||
this.setAbilities(
|
||||
new AbilityEmbryoEntry(
|
||||
getSkillDepotAbilityGroup(),
|
||||
config.abilities.stream().map(Object::toString).toArray(String[]::new)));
|
||||
}
|
||||
}
|
||||
|
||||
// Get constellation item from GameData
|
||||
Optional.ofNullable(this.talents)
|
||||
.map(talents -> talents.get(0))
|
||||
.map(i -> GameData.getAvatarTalentDataMap().get((int) i))
|
||||
.map(talentData -> talentData.getMainCostItemId())
|
||||
.ifPresent(itemId -> this.talentCostItemId = itemId);
|
||||
}
|
||||
|
||||
public IntStream getSkillsAndEnergySkill() {
|
||||
return IntStream.concat(this.skills.stream().mapToInt(i -> i), IntStream.of(this.energySkill))
|
||||
.filter(skillId -> skillId > 0);
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class InherentProudSkillOpens {
|
||||
private int proudSkillGroupId;
|
||||
private int needAvatarPromoteLevel;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameDepot;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceLoader.AvatarConfig;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.ResourceType.LoadPriority;
|
||||
import emu.grasscutter.data.binout.AbilityEmbryoEntry;
|
||||
import emu.grasscutter.game.props.ElementType;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.IntStream;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "AvatarSkillDepotExcelConfigData.json", loadPriority = LoadPriority.HIGH)
|
||||
@Getter
|
||||
public class AvatarSkillDepotData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private int energySkill;
|
||||
private int attackModeSkill;
|
||||
|
||||
private List<Integer> skills;
|
||||
private List<Integer> subSkills;
|
||||
private List<String> extraAbilities;
|
||||
private List<Integer> talents;
|
||||
private List<InherentProudSkillOpens> inherentProudSkillOpens;
|
||||
|
||||
private String talentStarName;
|
||||
private String skillDepotAbilityGroup;
|
||||
|
||||
// Transient
|
||||
private AvatarSkillData energySkillData;
|
||||
private ElementType elementType;
|
||||
private IntList abilities;
|
||||
private int talentCostItemId;
|
||||
|
||||
public void setAbilities(AbilityEmbryoEntry info) {
|
||||
this.abilities = new IntArrayList(info.getAbilities().length);
|
||||
for (String ability : info.getAbilities()) {
|
||||
this.abilities.add(Utils.abilityHash(ability));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// Set energy skill data
|
||||
this.energySkillData = GameData.getAvatarSkillDataMap().get(this.energySkill);
|
||||
if (this.energySkillData != null) {
|
||||
this.elementType = this.energySkillData.getCostElemType();
|
||||
} else {
|
||||
this.elementType = ElementType.None;
|
||||
}
|
||||
// Set embryo abilities (if player skill depot)
|
||||
if (getSkillDepotAbilityGroup() != null && getSkillDepotAbilityGroup().length() > 0) {
|
||||
AvatarConfig config = GameDepot.getPlayerAbilities().get(getSkillDepotAbilityGroup());
|
||||
|
||||
if (config != null) {
|
||||
this.setAbilities(
|
||||
new AbilityEmbryoEntry(
|
||||
getSkillDepotAbilityGroup(),
|
||||
config.abilities.stream().map(Object::toString).toArray(String[]::new)));
|
||||
}
|
||||
}
|
||||
|
||||
// Get constellation item from GameData
|
||||
Optional.ofNullable(this.talents)
|
||||
.map(talents -> talents.get(0))
|
||||
.map(i -> GameData.getAvatarTalentDataMap().get((int) i))
|
||||
.map(talentData -> talentData.getMainCostItemId())
|
||||
.ifPresent(itemId -> this.talentCostItemId = itemId);
|
||||
}
|
||||
|
||||
public IntStream getSkillsAndEnergySkill() {
|
||||
return IntStream.concat(this.skills.stream().mapToInt(i -> i), IntStream.of(this.energySkill))
|
||||
.filter(skillId -> skillId > 0);
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class InherentProudSkillOpens {
|
||||
private int proudSkillGroupId;
|
||||
private int needAvatarPromoteLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,69 +1,69 @@
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.ResourceType.LoadPriority;
|
||||
import emu.grasscutter.data.common.FightPropData;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ResourceType(name = "AvatarTalentExcelConfigData.json", loadPriority = LoadPriority.HIGHEST)
|
||||
public class AvatarTalentData extends GameResource {
|
||||
private int talentId;
|
||||
private int prevTalent;
|
||||
private long nameTextMapHash;
|
||||
private String icon;
|
||||
private int mainCostItemId;
|
||||
private int mainCostItemCount;
|
||||
private String openConfig;
|
||||
private FightPropData[] addProps;
|
||||
private float[] paramList;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.talentId;
|
||||
}
|
||||
|
||||
public int PrevTalent() {
|
||||
return prevTalent;
|
||||
}
|
||||
|
||||
public long getNameTextMapHash() {
|
||||
return nameTextMapHash;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public int getMainCostItemId() {
|
||||
return mainCostItemId;
|
||||
}
|
||||
|
||||
public int getMainCostItemCount() {
|
||||
return mainCostItemCount;
|
||||
}
|
||||
|
||||
public String getOpenConfig() {
|
||||
return openConfig;
|
||||
}
|
||||
|
||||
public FightPropData[] getAddProps() {
|
||||
return addProps;
|
||||
}
|
||||
|
||||
public float[] getParamList() {
|
||||
return paramList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
ArrayList<FightPropData> parsed = new ArrayList<FightPropData>(getAddProps().length);
|
||||
for (FightPropData prop : getAddProps()) {
|
||||
if (prop.getPropType() != null || prop.getValue() == 0f) {
|
||||
prop.onLoad();
|
||||
parsed.add(prop);
|
||||
}
|
||||
}
|
||||
this.addProps = parsed.toArray(new FightPropData[parsed.size()]);
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.avatar;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.ResourceType.LoadPriority;
|
||||
import emu.grasscutter.data.common.FightPropData;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ResourceType(name = "AvatarTalentExcelConfigData.json", loadPriority = LoadPriority.HIGHEST)
|
||||
public class AvatarTalentData extends GameResource {
|
||||
private int talentId;
|
||||
private int prevTalent;
|
||||
private long nameTextMapHash;
|
||||
private String icon;
|
||||
private int mainCostItemId;
|
||||
private int mainCostItemCount;
|
||||
private String openConfig;
|
||||
private FightPropData[] addProps;
|
||||
private float[] paramList;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.talentId;
|
||||
}
|
||||
|
||||
public int PrevTalent() {
|
||||
return prevTalent;
|
||||
}
|
||||
|
||||
public long getNameTextMapHash() {
|
||||
return nameTextMapHash;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public int getMainCostItemId() {
|
||||
return mainCostItemId;
|
||||
}
|
||||
|
||||
public int getMainCostItemCount() {
|
||||
return mainCostItemCount;
|
||||
}
|
||||
|
||||
public String getOpenConfig() {
|
||||
return openConfig;
|
||||
}
|
||||
|
||||
public FightPropData[] getAddProps() {
|
||||
return addProps;
|
||||
}
|
||||
|
||||
public float[] getParamList() {
|
||||
return paramList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
ArrayList<FightPropData> parsed = new ArrayList<FightPropData>(getAddProps().length);
|
||||
for (FightPropData prop : getAddProps()) {
|
||||
if (prop.getPropType() != null || prop.getValue() == 0f) {
|
||||
prop.onLoad();
|
||||
parsed.add(prop);
|
||||
}
|
||||
}
|
||||
this.addProps = parsed.toArray(new FightPropData[parsed.size()]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
package emu.grasscutter.data.excels.codex;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = {"AnimalCodexExcelConfigData.json"})
|
||||
@Getter
|
||||
public class CodexAnimalData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int Id;
|
||||
|
||||
private String type;
|
||||
private int describeId;
|
||||
private int sortOrder;
|
||||
|
||||
@SerializedName(
|
||||
value = "countType",
|
||||
alternate = {"OCCLHPBCDGL"})
|
||||
private CountType countType;
|
||||
|
||||
public enum CountType {
|
||||
CODEX_COUNT_TYPE_KILL,
|
||||
CODEX_COUNT_TYPE_CAPTURE
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.codex;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = {"AnimalCodexExcelConfigData.json"})
|
||||
@Getter
|
||||
public class CodexAnimalData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int Id;
|
||||
|
||||
private String type;
|
||||
private int describeId;
|
||||
private int sortOrder;
|
||||
|
||||
@SerializedName(
|
||||
value = "countType",
|
||||
alternate = {"OCCLHPBCDGL"})
|
||||
private CountType countType;
|
||||
|
||||
public enum CountType {
|
||||
CODEX_COUNT_TYPE_KILL,
|
||||
CODEX_COUNT_TYPE_CAPTURE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
package emu.grasscutter.data.excels.codex;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = {"MaterialCodexExcelConfigData.json"})
|
||||
public class CodexMaterialData extends GameResource {
|
||||
private int Id;
|
||||
private int materialId;
|
||||
private int sortOrder;
|
||||
|
||||
public int getSortOrder() {
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
public int getMaterialId() {
|
||||
return materialId;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return Id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
GameData.getCodexMaterialDataIdMap().put(this.getMaterialId(), this);
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.codex;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = {"MaterialCodexExcelConfigData.json"})
|
||||
public class CodexMaterialData extends GameResource {
|
||||
private int Id;
|
||||
private int materialId;
|
||||
private int sortOrder;
|
||||
|
||||
public int getSortOrder() {
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
public int getMaterialId() {
|
||||
return materialId;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return Id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
GameData.getCodexMaterialDataIdMap().put(this.getMaterialId(), this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
package emu.grasscutter.data.excels.codex;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = {"QuestCodexExcelConfigData.json"})
|
||||
public class CodexQuestData extends GameResource {
|
||||
private int Id;
|
||||
private int parentQuestId;
|
||||
private int chapterId;
|
||||
private int sortOrder;
|
||||
private boolean isDisuse;
|
||||
|
||||
public int getParentQuestId() {
|
||||
return parentQuestId;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return Id;
|
||||
}
|
||||
|
||||
public int getChapterId() {
|
||||
return chapterId;
|
||||
}
|
||||
|
||||
public int getSortOrder() {
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
public boolean getIsDisuse() {
|
||||
return isDisuse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
if (!this.getIsDisuse()) {
|
||||
GameData.getCodexQuestDataIdMap().put(this.getParentQuestId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.codex;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = {"QuestCodexExcelConfigData.json"})
|
||||
public class CodexQuestData extends GameResource {
|
||||
private int Id;
|
||||
private int parentQuestId;
|
||||
private int chapterId;
|
||||
private int sortOrder;
|
||||
private boolean isDisuse;
|
||||
|
||||
public int getParentQuestId() {
|
||||
return parentQuestId;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return Id;
|
||||
}
|
||||
|
||||
public int getChapterId() {
|
||||
return chapterId;
|
||||
}
|
||||
|
||||
public int getSortOrder() {
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
public boolean getIsDisuse() {
|
||||
return isDisuse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
if (!this.getIsDisuse()) {
|
||||
GameData.getCodexQuestDataIdMap().put(this.getParentQuestId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
package emu.grasscutter.data.excels.codex;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import it.unimi.dsi.fastutil.ints.IntCollection;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = {"ReliquaryCodexExcelConfigData.json"})
|
||||
public class CodexReliquaryData extends GameResource {
|
||||
@Getter private int Id;
|
||||
@Getter private int suitId;
|
||||
@Getter private int level;
|
||||
@Getter private int cupId;
|
||||
@Getter private int leatherId;
|
||||
@Getter private int capId;
|
||||
@Getter private int flowerId;
|
||||
@Getter private int sandId;
|
||||
@Getter private int sortOrder;
|
||||
private transient IntCollection ids;
|
||||
|
||||
public boolean containsId(int id) {
|
||||
return getIds().contains(id);
|
||||
}
|
||||
|
||||
public IntCollection getIds() {
|
||||
if (this.ids == null) {
|
||||
int[] idsArr = {cupId, leatherId, capId, flowerId, sandId};
|
||||
this.ids = IntList.of(idsArr);
|
||||
}
|
||||
return this.ids;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// Normalize all itemIds to the 0-substat form
|
||||
cupId = (cupId / 10) * 10;
|
||||
leatherId = (leatherId / 10) * 10;
|
||||
capId = (capId / 10) * 10;
|
||||
flowerId = (flowerId / 10) * 10;
|
||||
sandId = (sandId / 10) * 10;
|
||||
|
||||
GameData.getCodexReliquaryArrayList().add(this);
|
||||
GameData.getCodexReliquaryDataIdMap().put(getSuitId(), this);
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.codex;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import it.unimi.dsi.fastutil.ints.IntCollection;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = {"ReliquaryCodexExcelConfigData.json"})
|
||||
public class CodexReliquaryData extends GameResource {
|
||||
@Getter private int Id;
|
||||
@Getter private int suitId;
|
||||
@Getter private int level;
|
||||
@Getter private int cupId;
|
||||
@Getter private int leatherId;
|
||||
@Getter private int capId;
|
||||
@Getter private int flowerId;
|
||||
@Getter private int sandId;
|
||||
@Getter private int sortOrder;
|
||||
private transient IntCollection ids;
|
||||
|
||||
public boolean containsId(int id) {
|
||||
return getIds().contains(id);
|
||||
}
|
||||
|
||||
public IntCollection getIds() {
|
||||
if (this.ids == null) {
|
||||
int[] idsArr = {cupId, leatherId, capId, flowerId, sandId};
|
||||
this.ids = IntList.of(idsArr);
|
||||
}
|
||||
return this.ids;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// Normalize all itemIds to the 0-substat form
|
||||
cupId = (cupId / 10) * 10;
|
||||
leatherId = (leatherId / 10) * 10;
|
||||
capId = (capId / 10) * 10;
|
||||
flowerId = (flowerId / 10) * 10;
|
||||
sandId = (sandId / 10) * 10;
|
||||
|
||||
GameData.getCodexReliquaryArrayList().add(this);
|
||||
GameData.getCodexReliquaryDataIdMap().put(getSuitId(), this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
package emu.grasscutter.data.excels.codex;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = {"WeaponCodexExcelConfigData.json"})
|
||||
public class CodexWeaponData extends GameResource {
|
||||
private int Id;
|
||||
private int weaponId;
|
||||
private int sortOrder;
|
||||
|
||||
public int getSortOrder() {
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
public int getWeaponId() {
|
||||
return weaponId;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return Id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
GameData.getCodexWeaponDataIdMap().put(this.getWeaponId(), this);
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.codex;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = {"WeaponCodexExcelConfigData.json"})
|
||||
public class CodexWeaponData extends GameResource {
|
||||
private int Id;
|
||||
private int weaponId;
|
||||
private int sortOrder;
|
||||
|
||||
public int getSortOrder() {
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
public int getWeaponId() {
|
||||
return weaponId;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return Id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
GameData.getCodexWeaponDataIdMap().put(this.getWeaponId(), this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,44 +1,44 @@
|
||||
package emu.grasscutter.data.excels.dungeon;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import java.util.Calendar;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "DailyDungeonConfigData.json")
|
||||
public class DailyDungeonData extends GameResource {
|
||||
private static final int[] empty = new int[0];
|
||||
private final Int2ObjectMap<int[]> map;
|
||||
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private int[] monday;
|
||||
private int[] tuesday;
|
||||
private int[] wednesday;
|
||||
private int[] thursday;
|
||||
private int[] friday;
|
||||
private int[] saturday;
|
||||
private int[] sunday;
|
||||
|
||||
public DailyDungeonData() {
|
||||
this.map = new Int2ObjectOpenHashMap<>();
|
||||
}
|
||||
|
||||
public int[] getDungeonsByDay(int day) {
|
||||
return map.getOrDefault(day, empty);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
map.put(Calendar.MONDAY, monday);
|
||||
map.put(Calendar.TUESDAY, tuesday);
|
||||
map.put(Calendar.WEDNESDAY, wednesday);
|
||||
map.put(Calendar.THURSDAY, thursday);
|
||||
map.put(Calendar.FRIDAY, friday);
|
||||
map.put(Calendar.SATURDAY, saturday);
|
||||
map.put(Calendar.SUNDAY, sunday);
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.dungeon;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import java.util.Calendar;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "DailyDungeonConfigData.json")
|
||||
public class DailyDungeonData extends GameResource {
|
||||
private static final int[] empty = new int[0];
|
||||
private final Int2ObjectMap<int[]> map;
|
||||
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private int[] monday;
|
||||
private int[] tuesday;
|
||||
private int[] wednesday;
|
||||
private int[] thursday;
|
||||
private int[] friday;
|
||||
private int[] saturday;
|
||||
private int[] sunday;
|
||||
|
||||
public DailyDungeonData() {
|
||||
this.map = new Int2ObjectOpenHashMap<>();
|
||||
}
|
||||
|
||||
public int[] getDungeonsByDay(int day) {
|
||||
return map.getOrDefault(day, empty);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
map.put(Calendar.MONDAY, monday);
|
||||
map.put(Calendar.TUESDAY, tuesday);
|
||||
map.put(Calendar.WEDNESDAY, wednesday);
|
||||
map.put(Calendar.THURSDAY, thursday);
|
||||
map.put(Calendar.FRIDAY, friday);
|
||||
map.put(Calendar.SATURDAY, saturday);
|
||||
map.put(Calendar.SUNDAY, sunday);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,82 +1,82 @@
|
||||
package emu.grasscutter.data.excels.dungeon;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType;
|
||||
import java.util.HashSet;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@ResourceType(name = "DungeonChallengeConfigData.json")
|
||||
public class DungeonChallengeConfigData extends GameResource {
|
||||
private int id;
|
||||
private ChallengeType challengeType;
|
||||
private boolean noSuccessHint;
|
||||
private boolean noFailHint;
|
||||
private boolean isBlockTopTimer;
|
||||
private int subChallengeFadeOutDelayTime;
|
||||
private int activitySkillId;
|
||||
private HashSet<String> teamAbilityGroupList;
|
||||
|
||||
private SubChallengeFadeOutType subChallengeFadeOutRule;
|
||||
private SubChallengeBannerType subChallengeBannerRule;
|
||||
private InterruptButtonType interruptButtonType;
|
||||
|
||||
@SerializedName(
|
||||
value = "subChallengeSortType",
|
||||
alternate = {"PNCLDNBHKDJ"})
|
||||
private SubChallengeSortType subChallengeSortType;
|
||||
|
||||
@SerializedName(
|
||||
value = "animationOnSubStart",
|
||||
alternate = {"DNFAFNMMMDP"})
|
||||
private AllowAnimationType animationOnSubStart;
|
||||
|
||||
@SerializedName(
|
||||
value = "animationOnSubSuccess",
|
||||
alternate = {"ENONHOGJDDN"})
|
||||
private AllowAnimationType animationOnSubSuccess;
|
||||
|
||||
@SerializedName(
|
||||
value = "animationOnSubFail",
|
||||
alternate = {"NJBJIKAIENN"})
|
||||
private AllowAnimationType animationOnSubFail;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public enum InterruptButtonType {
|
||||
INTERRUPT_BUTTON_TYPE_NONE,
|
||||
INTERRUPT_BUTTON_TYPE_HOST,
|
||||
INTERRUPT_BUTTON_TYPE_ALL
|
||||
}
|
||||
|
||||
public enum SubChallengeFadeOutType {
|
||||
SUBCHALLENGE_FADEOUT_TYPE_NONE,
|
||||
SUBCHALLENGE_FADEOUT_TYPE_SUCCESS,
|
||||
SUBCHALLENGE_FADEOUT_TYPE_FAIL,
|
||||
SUBCHALLENGE_FADEOUT_TYPE_FINISH
|
||||
}
|
||||
|
||||
public enum SubChallengeBannerType {
|
||||
SUBCHALLENGE_BANNER_TYPE_NONE,
|
||||
SUBCHALLENGE_BANNER_TYPE_SUCCESS,
|
||||
SUBCHALLENGE_BANNER_TYPE_FAIL,
|
||||
SUBCHALLENGE_BANNER_TYPE_HIDE_FINAL,
|
||||
SUBCHALLENGE_BANNER_TYPE_SHOW_FINAL
|
||||
}
|
||||
|
||||
public enum SubChallengeSortType {
|
||||
SUB_CHALLENGE_SORT_TYPE_DEFAULT,
|
||||
SUB_CHALLENGE_SORT_TYPE_CHALLENGEINDEX
|
||||
}
|
||||
|
||||
public enum AllowAnimationType {
|
||||
SUB_CHALLENGE_ANIM_TYPE_DEFAULT,
|
||||
SUB_CHALLENGE_ANIM_TYPE_FORBID,
|
||||
SUB_CHALLENGE_ANIM_TYPE_SUCCESS,
|
||||
SUB_CHALLENGE_ANIM_TYPE_FAIL
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.dungeon;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType;
|
||||
import java.util.HashSet;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@ResourceType(name = "DungeonChallengeConfigData.json")
|
||||
public class DungeonChallengeConfigData extends GameResource {
|
||||
private int id;
|
||||
private ChallengeType challengeType;
|
||||
private boolean noSuccessHint;
|
||||
private boolean noFailHint;
|
||||
private boolean isBlockTopTimer;
|
||||
private int subChallengeFadeOutDelayTime;
|
||||
private int activitySkillId;
|
||||
private HashSet<String> teamAbilityGroupList;
|
||||
|
||||
private SubChallengeFadeOutType subChallengeFadeOutRule;
|
||||
private SubChallengeBannerType subChallengeBannerRule;
|
||||
private InterruptButtonType interruptButtonType;
|
||||
|
||||
@SerializedName(
|
||||
value = "subChallengeSortType",
|
||||
alternate = {"PNCLDNBHKDJ"})
|
||||
private SubChallengeSortType subChallengeSortType;
|
||||
|
||||
@SerializedName(
|
||||
value = "animationOnSubStart",
|
||||
alternate = {"DNFAFNMMMDP"})
|
||||
private AllowAnimationType animationOnSubStart;
|
||||
|
||||
@SerializedName(
|
||||
value = "animationOnSubSuccess",
|
||||
alternate = {"ENONHOGJDDN"})
|
||||
private AllowAnimationType animationOnSubSuccess;
|
||||
|
||||
@SerializedName(
|
||||
value = "animationOnSubFail",
|
||||
alternate = {"NJBJIKAIENN"})
|
||||
private AllowAnimationType animationOnSubFail;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public enum InterruptButtonType {
|
||||
INTERRUPT_BUTTON_TYPE_NONE,
|
||||
INTERRUPT_BUTTON_TYPE_HOST,
|
||||
INTERRUPT_BUTTON_TYPE_ALL
|
||||
}
|
||||
|
||||
public enum SubChallengeFadeOutType {
|
||||
SUBCHALLENGE_FADEOUT_TYPE_NONE,
|
||||
SUBCHALLENGE_FADEOUT_TYPE_SUCCESS,
|
||||
SUBCHALLENGE_FADEOUT_TYPE_FAIL,
|
||||
SUBCHALLENGE_FADEOUT_TYPE_FINISH
|
||||
}
|
||||
|
||||
public enum SubChallengeBannerType {
|
||||
SUBCHALLENGE_BANNER_TYPE_NONE,
|
||||
SUBCHALLENGE_BANNER_TYPE_SUCCESS,
|
||||
SUBCHALLENGE_BANNER_TYPE_FAIL,
|
||||
SUBCHALLENGE_BANNER_TYPE_HIDE_FINAL,
|
||||
SUBCHALLENGE_BANNER_TYPE_SHOW_FINAL
|
||||
}
|
||||
|
||||
public enum SubChallengeSortType {
|
||||
SUB_CHALLENGE_SORT_TYPE_DEFAULT,
|
||||
SUB_CHALLENGE_SORT_TYPE_CHALLENGEINDEX
|
||||
}
|
||||
|
||||
public enum AllowAnimationType {
|
||||
SUB_CHALLENGE_ANIM_TYPE_DEFAULT,
|
||||
SUB_CHALLENGE_ANIM_TYPE_FORBID,
|
||||
SUB_CHALLENGE_ANIM_TYPE_SUCCESS,
|
||||
SUB_CHALLENGE_ANIM_TYPE_FAIL
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,71 +1,71 @@
|
||||
package emu.grasscutter.data.excels.dungeon;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.excels.RewardPreviewData;
|
||||
import emu.grasscutter.game.dungeons.enums.*;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "DungeonExcelConfigData.json")
|
||||
public class DungeonData extends GameResource {
|
||||
|
||||
@Getter(onMethod = @__(@Override))
|
||||
private int id;
|
||||
|
||||
@Getter private int sceneId;
|
||||
@Getter private int showLevel;
|
||||
private DungeonType type;
|
||||
private DungeonSubType subType;
|
||||
private DungeonPlayType playType;
|
||||
private DungeonInvolveType involveType;
|
||||
@Getter private int limitLevel;
|
||||
@Getter private int passCond;
|
||||
@Getter private int reviveMaxCount;
|
||||
@Getter private int settleCountdownTime;
|
||||
@Getter private int failSettleCountdownTime;
|
||||
@Getter private int quitSettleCountdownTime;
|
||||
@Getter private List<SettleShowType> settleShows;
|
||||
@Getter private int passRewardPreviewID;
|
||||
@Getter private int statueCostID;
|
||||
@Getter private int statueCostCount;
|
||||
|
||||
// not part of DungeonExcelConfigData
|
||||
@Getter private RewardPreviewData rewardPreviewData;
|
||||
|
||||
public DungeonType getType() {
|
||||
if (type == null) {
|
||||
return DungeonType.DUNGEON_NONE;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
public DungeonSubType getSubType() {
|
||||
if (subType == null) {
|
||||
return DungeonSubType.DUNGEON_SUB_NONE;
|
||||
}
|
||||
return subType;
|
||||
}
|
||||
|
||||
public DungeonPlayType getPlayType() {
|
||||
if (playType == null) {
|
||||
return DungeonPlayType.DUNGEON_PLAY_TYPE_NONE;
|
||||
}
|
||||
return playType;
|
||||
}
|
||||
|
||||
public DungeonInvolveType getInvolveType() {
|
||||
if (involveType == null) {
|
||||
return DungeonInvolveType.INVOLVE_NONE;
|
||||
}
|
||||
return involveType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
if (this.passRewardPreviewID > 0) {
|
||||
this.rewardPreviewData = GameData.getRewardPreviewDataMap().get(this.passRewardPreviewID);
|
||||
}
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.dungeon;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.excels.RewardPreviewData;
|
||||
import emu.grasscutter.game.dungeons.enums.*;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "DungeonExcelConfigData.json")
|
||||
public class DungeonData extends GameResource {
|
||||
|
||||
@Getter(onMethod = @__(@Override))
|
||||
private int id;
|
||||
|
||||
@Getter private int sceneId;
|
||||
@Getter private int showLevel;
|
||||
private DungeonType type;
|
||||
private DungeonSubType subType;
|
||||
private DungeonPlayType playType;
|
||||
private DungeonInvolveType involveType;
|
||||
@Getter private int limitLevel;
|
||||
@Getter private int passCond;
|
||||
@Getter private int reviveMaxCount;
|
||||
@Getter private int settleCountdownTime;
|
||||
@Getter private int failSettleCountdownTime;
|
||||
@Getter private int quitSettleCountdownTime;
|
||||
@Getter private List<SettleShowType> settleShows;
|
||||
@Getter private int passRewardPreviewID;
|
||||
@Getter private int statueCostID;
|
||||
@Getter private int statueCostCount;
|
||||
|
||||
// not part of DungeonExcelConfigData
|
||||
@Getter private RewardPreviewData rewardPreviewData;
|
||||
|
||||
public DungeonType getType() {
|
||||
if (type == null) {
|
||||
return DungeonType.DUNGEON_NONE;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
public DungeonSubType getSubType() {
|
||||
if (subType == null) {
|
||||
return DungeonSubType.DUNGEON_SUB_NONE;
|
||||
}
|
||||
return subType;
|
||||
}
|
||||
|
||||
public DungeonPlayType getPlayType() {
|
||||
if (playType == null) {
|
||||
return DungeonPlayType.DUNGEON_PLAY_TYPE_NONE;
|
||||
}
|
||||
return playType;
|
||||
}
|
||||
|
||||
public DungeonInvolveType getInvolveType() {
|
||||
if (involveType == null) {
|
||||
return DungeonInvolveType.INVOLVE_NONE;
|
||||
}
|
||||
return involveType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
if (this.passRewardPreviewID > 0) {
|
||||
this.rewardPreviewData = GameData.getRewardPreviewDataMap().get(this.passRewardPreviewID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package emu.grasscutter.data.excels.dungeon;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@ResourceType(name = "DungeonEntryExcelConfigData.json")
|
||||
@Getter
|
||||
@Setter // TODO: remove this next API break
|
||||
public class DungeonEntryData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private int dungeonEntryId;
|
||||
private int sceneId;
|
||||
}
|
||||
package emu.grasscutter.data.excels.dungeon;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@ResourceType(name = "DungeonEntryExcelConfigData.json")
|
||||
@Getter
|
||||
@Setter // TODO: remove this next API break
|
||||
public class DungeonEntryData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private int dungeonEntryId;
|
||||
private int sceneId;
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
package emu.grasscutter.data.excels.dungeon;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.dungeons.enums.DungeonPassConditionType;
|
||||
import emu.grasscutter.game.quest.enums.LogicType;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "DungeonPassExcelConfigData.json")
|
||||
public class DungeonPassConfigData extends GameResource {
|
||||
@Getter private int id;
|
||||
@Getter private LogicType logicType;
|
||||
@Getter private List<DungeonPassCondition> conds;
|
||||
|
||||
public static class DungeonPassCondition {
|
||||
@Getter private DungeonPassConditionType condType;
|
||||
@Getter int[] param;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
super.onLoad();
|
||||
conds = conds.stream().filter(condition -> condition.getCondType() != null).toList();
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.dungeon;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.dungeons.enums.DungeonPassConditionType;
|
||||
import emu.grasscutter.game.quest.enums.LogicType;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "DungeonPassExcelConfigData.json")
|
||||
public class DungeonPassConfigData extends GameResource {
|
||||
@Getter private int id;
|
||||
@Getter private LogicType logicType;
|
||||
@Getter private List<DungeonPassCondition> conds;
|
||||
|
||||
public static class DungeonPassCondition {
|
||||
@Getter private DungeonPassConditionType condType;
|
||||
@Getter int[] param;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
super.onLoad();
|
||||
conds = conds.stream().filter(condition -> condition.getCondType() != null).toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
package emu.grasscutter.data.excels.monster;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.CurveInfo;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@ResourceType(name = "MonsterCurveExcelConfigData.json")
|
||||
public class MonsterCurveData extends GameResource {
|
||||
private int level;
|
||||
private CurveInfo[] curveInfos;
|
||||
|
||||
private Map<String, Float> curveInfoMap;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public float getMultByProp(String fightProp) {
|
||||
return curveInfoMap.getOrDefault(fightProp, 1f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.curveInfoMap = new HashMap<>();
|
||||
Stream.of(this.curveInfos)
|
||||
.forEach(info -> this.curveInfoMap.put(info.getType(), info.getValue()));
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.monster;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.CurveInfo;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@ResourceType(name = "MonsterCurveExcelConfigData.json")
|
||||
public class MonsterCurveData extends GameResource {
|
||||
private int level;
|
||||
private CurveInfo[] curveInfos;
|
||||
|
||||
private Map<String, Float> curveInfoMap;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public float getMultByProp(String fightProp) {
|
||||
return curveInfoMap.getOrDefault(fightProp, 1f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.curveInfoMap = new HashMap<>();
|
||||
Stream.of(this.curveInfos)
|
||||
.forEach(info -> this.curveInfoMap.put(info.getType(), info.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,133 +1,133 @@
|
||||
package emu.grasscutter.data.excels.monster;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.ResourceType.LoadPriority;
|
||||
import emu.grasscutter.data.common.PropGrowCurve;
|
||||
import emu.grasscutter.data.excels.GadgetData;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import emu.grasscutter.game.props.MonsterType;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "MonsterExcelConfigData.json", loadPriority = LoadPriority.LOW)
|
||||
@Getter
|
||||
public class MonsterData extends GameResource {
|
||||
public static Set<FightProperty> definedFightProperties =
|
||||
Set.of(
|
||||
FightProperty.FIGHT_PROP_BASE_HP,
|
||||
FightProperty.FIGHT_PROP_BASE_ATTACK,
|
||||
FightProperty.FIGHT_PROP_BASE_DEFENSE,
|
||||
FightProperty.FIGHT_PROP_PHYSICAL_SUB_HURT,
|
||||
FightProperty.FIGHT_PROP_FIRE_SUB_HURT,
|
||||
FightProperty.FIGHT_PROP_ELEC_SUB_HURT,
|
||||
FightProperty.FIGHT_PROP_WATER_SUB_HURT,
|
||||
FightProperty.FIGHT_PROP_GRASS_SUB_HURT,
|
||||
FightProperty.FIGHT_PROP_WIND_SUB_HURT,
|
||||
FightProperty.FIGHT_PROP_ROCK_SUB_HURT,
|
||||
FightProperty.FIGHT_PROP_ICE_SUB_HURT);
|
||||
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private String monsterName;
|
||||
private MonsterType type;
|
||||
private String serverScript;
|
||||
private List<Integer> affix;
|
||||
private String ai;
|
||||
private int[] equips;
|
||||
private List<HpDrops> hpDrops;
|
||||
private int killDropId;
|
||||
private String excludeWeathers;
|
||||
private int featureTagGroupID;
|
||||
private int mpPropID;
|
||||
private String skin;
|
||||
private int describeId;
|
||||
private int combatBGMLevel;
|
||||
private int entityBudgetLevel;
|
||||
|
||||
@SerializedName("hpBase")
|
||||
private float baseHp;
|
||||
|
||||
@SerializedName("attackBase")
|
||||
private float baseAttack;
|
||||
|
||||
@SerializedName("defenseBase")
|
||||
private float baseDefense;
|
||||
|
||||
private float fireSubHurt;
|
||||
private float elecSubHurt;
|
||||
private float grassSubHurt;
|
||||
private float waterSubHurt;
|
||||
private float windSubHurt;
|
||||
private float rockSubHurt;
|
||||
private float iceSubHurt;
|
||||
private float physicalSubHurt;
|
||||
private List<PropGrowCurve> propGrowCurves;
|
||||
private long nameTextMapHash;
|
||||
private int campID;
|
||||
|
||||
// Transient
|
||||
private int weaponId;
|
||||
private MonsterDescribeData describeData;
|
||||
|
||||
private int specialNameId; // will only be set if describe data is available
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
for (int id : this.equips) {
|
||||
if (id == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
GadgetData gadget = GameData.getGadgetDataMap().get(id);
|
||||
if (gadget == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (gadget.getItemJsonName().equals("Default_MonsterWeapon")) {
|
||||
this.weaponId = id;
|
||||
}
|
||||
}
|
||||
|
||||
this.describeData = GameData.getMonsterDescribeDataMap().get(this.getDescribeId());
|
||||
|
||||
if (this.describeData == null) {
|
||||
return;
|
||||
}
|
||||
for (Entry<Integer, MonsterSpecialNameData> entry :
|
||||
GameData.getMonsterSpecialNameDataMap().entrySet()) {
|
||||
if (entry.getValue().getSpecialNameLabId() == this.getDescribeData().getSpecialNameLabId()) {
|
||||
this.specialNameId = entry.getKey();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public float getFightProperty(FightProperty prop) {
|
||||
return switch (prop) {
|
||||
case FIGHT_PROP_BASE_HP -> this.baseHp;
|
||||
case FIGHT_PROP_BASE_ATTACK -> this.baseAttack;
|
||||
case FIGHT_PROP_BASE_DEFENSE -> this.baseDefense;
|
||||
case FIGHT_PROP_PHYSICAL_SUB_HURT -> this.physicalSubHurt;
|
||||
case FIGHT_PROP_FIRE_SUB_HURT -> this.fireSubHurt;
|
||||
case FIGHT_PROP_ELEC_SUB_HURT -> this.elecSubHurt;
|
||||
case FIGHT_PROP_WATER_SUB_HURT -> this.waterSubHurt;
|
||||
case FIGHT_PROP_GRASS_SUB_HURT -> this.grassSubHurt;
|
||||
case FIGHT_PROP_WIND_SUB_HURT -> this.windSubHurt;
|
||||
case FIGHT_PROP_ROCK_SUB_HURT -> this.rockSubHurt;
|
||||
case FIGHT_PROP_ICE_SUB_HURT -> this.iceSubHurt;
|
||||
default -> 0f;
|
||||
};
|
||||
}
|
||||
|
||||
@Getter
|
||||
public class HpDrops {
|
||||
private int DropId;
|
||||
private int HpPercent;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.monster;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.ResourceType.LoadPriority;
|
||||
import emu.grasscutter.data.common.PropGrowCurve;
|
||||
import emu.grasscutter.data.excels.GadgetData;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import emu.grasscutter.game.props.MonsterType;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "MonsterExcelConfigData.json", loadPriority = LoadPriority.LOW)
|
||||
@Getter
|
||||
public class MonsterData extends GameResource {
|
||||
public static Set<FightProperty> definedFightProperties =
|
||||
Set.of(
|
||||
FightProperty.FIGHT_PROP_BASE_HP,
|
||||
FightProperty.FIGHT_PROP_BASE_ATTACK,
|
||||
FightProperty.FIGHT_PROP_BASE_DEFENSE,
|
||||
FightProperty.FIGHT_PROP_PHYSICAL_SUB_HURT,
|
||||
FightProperty.FIGHT_PROP_FIRE_SUB_HURT,
|
||||
FightProperty.FIGHT_PROP_ELEC_SUB_HURT,
|
||||
FightProperty.FIGHT_PROP_WATER_SUB_HURT,
|
||||
FightProperty.FIGHT_PROP_GRASS_SUB_HURT,
|
||||
FightProperty.FIGHT_PROP_WIND_SUB_HURT,
|
||||
FightProperty.FIGHT_PROP_ROCK_SUB_HURT,
|
||||
FightProperty.FIGHT_PROP_ICE_SUB_HURT);
|
||||
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private String monsterName;
|
||||
private MonsterType type;
|
||||
private String serverScript;
|
||||
private List<Integer> affix;
|
||||
private String ai;
|
||||
private int[] equips;
|
||||
private List<HpDrops> hpDrops;
|
||||
private int killDropId;
|
||||
private String excludeWeathers;
|
||||
private int featureTagGroupID;
|
||||
private int mpPropID;
|
||||
private String skin;
|
||||
private int describeId;
|
||||
private int combatBGMLevel;
|
||||
private int entityBudgetLevel;
|
||||
|
||||
@SerializedName("hpBase")
|
||||
private float baseHp;
|
||||
|
||||
@SerializedName("attackBase")
|
||||
private float baseAttack;
|
||||
|
||||
@SerializedName("defenseBase")
|
||||
private float baseDefense;
|
||||
|
||||
private float fireSubHurt;
|
||||
private float elecSubHurt;
|
||||
private float grassSubHurt;
|
||||
private float waterSubHurt;
|
||||
private float windSubHurt;
|
||||
private float rockSubHurt;
|
||||
private float iceSubHurt;
|
||||
private float physicalSubHurt;
|
||||
private List<PropGrowCurve> propGrowCurves;
|
||||
private long nameTextMapHash;
|
||||
private int campID;
|
||||
|
||||
// Transient
|
||||
private int weaponId;
|
||||
private MonsterDescribeData describeData;
|
||||
|
||||
private int specialNameId; // will only be set if describe data is available
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
for (int id : this.equips) {
|
||||
if (id == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
GadgetData gadget = GameData.getGadgetDataMap().get(id);
|
||||
if (gadget == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (gadget.getItemJsonName().equals("Default_MonsterWeapon")) {
|
||||
this.weaponId = id;
|
||||
}
|
||||
}
|
||||
|
||||
this.describeData = GameData.getMonsterDescribeDataMap().get(this.getDescribeId());
|
||||
|
||||
if (this.describeData == null) {
|
||||
return;
|
||||
}
|
||||
for (Entry<Integer, MonsterSpecialNameData> entry :
|
||||
GameData.getMonsterSpecialNameDataMap().entrySet()) {
|
||||
if (entry.getValue().getSpecialNameLabId() == this.getDescribeData().getSpecialNameLabId()) {
|
||||
this.specialNameId = entry.getKey();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public float getFightProperty(FightProperty prop) {
|
||||
return switch (prop) {
|
||||
case FIGHT_PROP_BASE_HP -> this.baseHp;
|
||||
case FIGHT_PROP_BASE_ATTACK -> this.baseAttack;
|
||||
case FIGHT_PROP_BASE_DEFENSE -> this.baseDefense;
|
||||
case FIGHT_PROP_PHYSICAL_SUB_HURT -> this.physicalSubHurt;
|
||||
case FIGHT_PROP_FIRE_SUB_HURT -> this.fireSubHurt;
|
||||
case FIGHT_PROP_ELEC_SUB_HURT -> this.elecSubHurt;
|
||||
case FIGHT_PROP_WATER_SUB_HURT -> this.waterSubHurt;
|
||||
case FIGHT_PROP_GRASS_SUB_HURT -> this.grassSubHurt;
|
||||
case FIGHT_PROP_WIND_SUB_HURT -> this.windSubHurt;
|
||||
case FIGHT_PROP_ROCK_SUB_HURT -> this.rockSubHurt;
|
||||
case FIGHT_PROP_ICE_SUB_HURT -> this.iceSubHurt;
|
||||
default -> 0f;
|
||||
};
|
||||
}
|
||||
|
||||
@Getter
|
||||
public class HpDrops {
|
||||
private int DropId;
|
||||
private int HpPercent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
package emu.grasscutter.data.excels.monster;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.ResourceType.LoadPriority;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "MonsterDescribeExcelConfigData.json", loadPriority = LoadPriority.HIGH)
|
||||
@Getter
|
||||
public class MonsterDescribeData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private long nameTextMapHash;
|
||||
|
||||
@SerializedName(
|
||||
value = "titleId",
|
||||
alternate = {"titleID"})
|
||||
private int titleId;
|
||||
|
||||
@SerializedName(
|
||||
value = "specialNameLabId",
|
||||
alternate = {"specialNameLabID"})
|
||||
private int specialNameLabId;
|
||||
|
||||
private MonsterSpecialNameData specialNameData;
|
||||
}
|
||||
package emu.grasscutter.data.excels.monster;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.ResourceType.LoadPriority;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "MonsterDescribeExcelConfigData.json", loadPriority = LoadPriority.HIGH)
|
||||
@Getter
|
||||
public class MonsterDescribeData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private long nameTextMapHash;
|
||||
|
||||
@SerializedName(
|
||||
value = "titleId",
|
||||
alternate = {"titleID"})
|
||||
private int titleId;
|
||||
|
||||
@SerializedName(
|
||||
value = "specialNameLabId",
|
||||
alternate = {"specialNameLabID"})
|
||||
private int specialNameLabId;
|
||||
|
||||
private MonsterSpecialNameData specialNameData;
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
package emu.grasscutter.data.excels.monster;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.ResourceType.LoadPriority;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ResourceType(name = "MonsterSpecialNameExcelConfigData.json", loadPriority = LoadPriority.HIGH)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
public class MonsterSpecialNameData extends GameResource {
|
||||
private int specialNameId;
|
||||
private int specialNameLabId;
|
||||
private long specialNameTextMapHash;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return specialNameId;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.monster;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.ResourceType.LoadPriority;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ResourceType(name = "MonsterSpecialNameExcelConfigData.json", loadPriority = LoadPriority.HIGH)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
public class MonsterSpecialNameData extends GameResource {
|
||||
private int specialNameId;
|
||||
private int specialNameLabId;
|
||||
private long specialNameTextMapHash;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return specialNameId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
package emu.grasscutter.data.excels.reliquary;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "ReliquaryAffixExcelConfigData.json")
|
||||
@Getter
|
||||
public class ReliquaryAffixData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private int depotId;
|
||||
private int groupId;
|
||||
|
||||
@SerializedName("propType")
|
||||
private FightProperty fightProp;
|
||||
|
||||
private float propValue;
|
||||
private int weight;
|
||||
private int upgradeWeight;
|
||||
}
|
||||
package emu.grasscutter.data.excels.reliquary;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "ReliquaryAffixExcelConfigData.json")
|
||||
@Getter
|
||||
public class ReliquaryAffixData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private int depotId;
|
||||
private int groupId;
|
||||
|
||||
@SerializedName("propType")
|
||||
private FightProperty fightProp;
|
||||
|
||||
private float propValue;
|
||||
private int weight;
|
||||
private int upgradeWeight;
|
||||
}
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
package emu.grasscutter.data.excels.reliquary;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import it.unimi.dsi.fastutil.ints.Int2FloatMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2FloatOpenHashMap;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "ReliquaryLevelExcelConfigData.json")
|
||||
public class ReliquaryLevelData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private Int2FloatMap propMap;
|
||||
|
||||
@Getter private int rank;
|
||||
@Getter private int level;
|
||||
@Getter private int exp;
|
||||
private List<RelicLevelProperty> addProps;
|
||||
|
||||
public float getPropValue(FightProperty prop) {
|
||||
return getPropValue(prop.getId());
|
||||
}
|
||||
|
||||
public float getPropValue(int id) {
|
||||
return propMap.getOrDefault(id, 0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.id = (rank << 8) + this.getLevel();
|
||||
this.propMap = new Int2FloatOpenHashMap();
|
||||
for (RelicLevelProperty p : addProps) {
|
||||
this.propMap.put(FightProperty.getPropByName(p.getPropType()).getId(), p.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
public class RelicLevelProperty {
|
||||
private String propType;
|
||||
private float value;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.reliquary;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import it.unimi.dsi.fastutil.ints.Int2FloatMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2FloatOpenHashMap;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "ReliquaryLevelExcelConfigData.json")
|
||||
public class ReliquaryLevelData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private Int2FloatMap propMap;
|
||||
|
||||
@Getter private int rank;
|
||||
@Getter private int level;
|
||||
@Getter private int exp;
|
||||
private List<RelicLevelProperty> addProps;
|
||||
|
||||
public float getPropValue(FightProperty prop) {
|
||||
return getPropValue(prop.getId());
|
||||
}
|
||||
|
||||
public float getPropValue(int id) {
|
||||
return propMap.getOrDefault(id, 0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.id = (rank << 8) + this.getLevel();
|
||||
this.propMap = new Int2FloatOpenHashMap();
|
||||
for (RelicLevelProperty p : addProps) {
|
||||
this.propMap.put(FightProperty.getPropByName(p.getPropType()).getId(), p.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
public class RelicLevelProperty {
|
||||
private String propType;
|
||||
private float value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
package emu.grasscutter.data.excels.reliquary;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "ReliquaryMainPropExcelConfigData.json")
|
||||
@Getter
|
||||
public class ReliquaryMainPropData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private int propDepotId;
|
||||
|
||||
@SerializedName("propType")
|
||||
private FightProperty fightProp;
|
||||
|
||||
private int weight;
|
||||
}
|
||||
package emu.grasscutter.data.excels.reliquary;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "ReliquaryMainPropExcelConfigData.json")
|
||||
@Getter
|
||||
public class ReliquaryMainPropData extends GameResource {
|
||||
@Getter(onMethod_ = @Override)
|
||||
private int id;
|
||||
|
||||
private int propDepotId;
|
||||
|
||||
@SerializedName("propType")
|
||||
private FightProperty fightProp;
|
||||
|
||||
private int weight;
|
||||
}
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
package emu.grasscutter.data.excels.reliquary;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "ReliquarySetExcelConfigData.json")
|
||||
public class ReliquarySetData extends GameResource {
|
||||
private int setId;
|
||||
private int[] setNeedNum;
|
||||
|
||||
@SerializedName(
|
||||
value = "equipAffixId",
|
||||
alternate = {"EquipAffixId"})
|
||||
private int equipAffixId;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return setId;
|
||||
}
|
||||
|
||||
public int[] getSetNeedNum() {
|
||||
return setNeedNum;
|
||||
}
|
||||
|
||||
public int getEquipAffixId() {
|
||||
return equipAffixId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {}
|
||||
}
|
||||
package emu.grasscutter.data.excels.reliquary;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "ReliquarySetExcelConfigData.json")
|
||||
public class ReliquarySetData extends GameResource {
|
||||
private int setId;
|
||||
private int[] setNeedNum;
|
||||
|
||||
@SerializedName(
|
||||
value = "equipAffixId",
|
||||
alternate = {"EquipAffixId"})
|
||||
private int equipAffixId;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return setId;
|
||||
}
|
||||
|
||||
public int[] getSetNeedNum() {
|
||||
return setNeedNum;
|
||||
}
|
||||
|
||||
public int getEquipAffixId() {
|
||||
return equipAffixId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
package emu.grasscutter.data.excels.tower;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "TowerFloorExcelConfigData.json")
|
||||
@Getter
|
||||
public class TowerFloorData extends GameResource {
|
||||
private int floorId;
|
||||
private int floorIndex;
|
||||
private int levelGroupId;
|
||||
private int overrideMonsterLevel;
|
||||
private int teamNum;
|
||||
private int floorLevelConfigId;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.floorId;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.tower;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "TowerFloorExcelConfigData.json")
|
||||
@Getter
|
||||
public class TowerFloorData extends GameResource {
|
||||
private int floorId;
|
||||
private int floorIndex;
|
||||
private int levelGroupId;
|
||||
private int overrideMonsterLevel;
|
||||
private int teamNum;
|
||||
private int floorLevelConfigId;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.floorId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
package emu.grasscutter.data.excels.tower;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "TowerLevelExcelConfigData.json")
|
||||
public class TowerLevelData extends GameResource {
|
||||
|
||||
private int levelId;
|
||||
private int levelIndex;
|
||||
private int levelGroupId;
|
||||
private int dungeonId;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.getLevelId();
|
||||
}
|
||||
|
||||
public int getLevelId() {
|
||||
return levelId;
|
||||
}
|
||||
|
||||
public int getLevelGroupId() {
|
||||
return levelGroupId;
|
||||
}
|
||||
|
||||
public int getLevelIndex() {
|
||||
return levelIndex;
|
||||
}
|
||||
|
||||
public int getDungeonId() {
|
||||
return dungeonId;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.tower;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "TowerLevelExcelConfigData.json")
|
||||
public class TowerLevelData extends GameResource {
|
||||
|
||||
private int levelId;
|
||||
private int levelIndex;
|
||||
private int levelGroupId;
|
||||
private int dungeonId;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.getLevelId();
|
||||
}
|
||||
|
||||
public int getLevelId() {
|
||||
return levelId;
|
||||
}
|
||||
|
||||
public int getLevelGroupId() {
|
||||
return levelGroupId;
|
||||
}
|
||||
|
||||
public int getLevelIndex() {
|
||||
return levelIndex;
|
||||
}
|
||||
|
||||
public int getDungeonId() {
|
||||
return dungeonId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
package emu.grasscutter.data.excels.tower;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import java.util.List;
|
||||
|
||||
@ResourceType(name = "TowerScheduleExcelConfigData.json")
|
||||
public class TowerScheduleData extends GameResource {
|
||||
private int scheduleId;
|
||||
private List<Integer> entranceFloorId;
|
||||
private List<ScheduleDetail> schedules;
|
||||
private int monthlyLevelConfigId;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return scheduleId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
super.onLoad();
|
||||
this.schedules =
|
||||
this.schedules.stream().filter(item -> item.getFloorList().size() > 0).toList();
|
||||
}
|
||||
|
||||
public int getScheduleId() {
|
||||
return scheduleId;
|
||||
}
|
||||
|
||||
public List<Integer> getEntranceFloorId() {
|
||||
return entranceFloorId;
|
||||
}
|
||||
|
||||
public List<ScheduleDetail> getSchedules() {
|
||||
return schedules;
|
||||
}
|
||||
|
||||
public int getMonthlyLevelConfigId() {
|
||||
return monthlyLevelConfigId;
|
||||
}
|
||||
|
||||
public static class ScheduleDetail {
|
||||
private List<Integer> floorList;
|
||||
|
||||
public List<Integer> getFloorList() {
|
||||
return floorList;
|
||||
}
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.tower;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import java.util.List;
|
||||
|
||||
@ResourceType(name = "TowerScheduleExcelConfigData.json")
|
||||
public class TowerScheduleData extends GameResource {
|
||||
private int scheduleId;
|
||||
private List<Integer> entranceFloorId;
|
||||
private List<ScheduleDetail> schedules;
|
||||
private int monthlyLevelConfigId;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return scheduleId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
super.onLoad();
|
||||
this.schedules =
|
||||
this.schedules.stream().filter(item -> item.getFloorList().size() > 0).toList();
|
||||
}
|
||||
|
||||
public int getScheduleId() {
|
||||
return scheduleId;
|
||||
}
|
||||
|
||||
public List<Integer> getEntranceFloorId() {
|
||||
return entranceFloorId;
|
||||
}
|
||||
|
||||
public List<ScheduleDetail> getSchedules() {
|
||||
return schedules;
|
||||
}
|
||||
|
||||
public int getMonthlyLevelConfigId() {
|
||||
return monthlyLevelConfigId;
|
||||
}
|
||||
|
||||
public static class ScheduleDetail {
|
||||
private List<Integer> floorList;
|
||||
|
||||
public List<Integer> getFloorList() {
|
||||
return floorList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
package emu.grasscutter.data.excels.trial;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.BaseTrialActivityData;
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
|
||||
@ResourceType(name = "TrialAvatarActivityExcelConfigData.json")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
public class TrialAvatarActivityData extends GameResource implements BaseTrialActivityData {
|
||||
private int ScheduleId;
|
||||
private List<Integer> AvatarIndexIdList;
|
||||
private List<Integer> RewardIdList;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return ScheduleId;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.trial;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.BaseTrialActivityData;
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
|
||||
@ResourceType(name = "TrialAvatarActivityExcelConfigData.json")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
public class TrialAvatarActivityData extends GameResource implements BaseTrialActivityData {
|
||||
private int ScheduleId;
|
||||
private List<Integer> AvatarIndexIdList;
|
||||
private List<Integer> RewardIdList;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return ScheduleId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
package emu.grasscutter.data.excels.trial;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.excels.activity.ActivityWatcherData;
|
||||
import lombok.*;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@ResourceType(name = "TrialAvatarActivityDataExcelConfigData.json")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class TrialAvatarActivityDataData extends GameResource {
|
||||
@Getter(onMethod = @__(@Override))
|
||||
private int id;
|
||||
|
||||
private int trialAvatarIndexId;
|
||||
private int trialAvatarId;
|
||||
private int dungeonId;
|
||||
private String battleAvatarsList;
|
||||
private int firstPassReward;
|
||||
private ActivityWatcherData.WatcherTrigger triggerConfig;
|
||||
private int progress;
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.triggerConfig.onLoad();
|
||||
GameData.getTrialAvatarIndexIdTrialActivityDataDataMap().put(trialAvatarIndexId, id);
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.trial;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.excels.activity.ActivityWatcherData;
|
||||
import lombok.*;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@ResourceType(name = "TrialAvatarActivityDataExcelConfigData.json")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
public class TrialAvatarActivityDataData extends GameResource {
|
||||
@Getter(onMethod = @__(@Override))
|
||||
private int id;
|
||||
|
||||
private int trialAvatarIndexId;
|
||||
private int trialAvatarId;
|
||||
private int dungeonId;
|
||||
private String battleAvatarsList;
|
||||
private int firstPassReward;
|
||||
private ActivityWatcherData.WatcherTrigger triggerConfig;
|
||||
private int progress;
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.triggerConfig.onLoad();
|
||||
GameData.getTrialAvatarIndexIdTrialActivityDataDataMap().put(trialAvatarIndexId, id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package emu.grasscutter.data.excels.trial;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
|
||||
@ResourceType(name = "TrialAvatarExcelConfigData.json")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
public class TrialAvatarData extends GameResource {
|
||||
private int trialAvatarId;
|
||||
private List<Integer> trialAvatarParamList;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return trialAvatarId;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.trial;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
|
||||
@ResourceType(name = "TrialAvatarExcelConfigData.json")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
public class TrialAvatarData extends GameResource {
|
||||
private int trialAvatarId;
|
||||
private List<Integer> trialAvatarParamList;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return trialAvatarId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package emu.grasscutter.data.excels.trial;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
|
||||
@ResourceType(name = "TrialAvatarTemplateExcelConfigData.json")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
public class TrialAvatarTemplateData extends GameResource {
|
||||
private int TrialAvatarLevel;
|
||||
private List<Integer> TrialReliquaryList;
|
||||
private int TrialAvatarSkillLevel;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return TrialAvatarLevel;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.trial;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
|
||||
@ResourceType(name = "TrialAvatarTemplateExcelConfigData.json")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
public class TrialAvatarTemplateData extends GameResource {
|
||||
private int TrialAvatarLevel;
|
||||
private List<Integer> TrialReliquaryList;
|
||||
private int TrialAvatarSkillLevel;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return TrialAvatarLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
package emu.grasscutter.data.excels.trial;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
|
||||
@ResourceType(name = "TrialReliquaryExcelConfigData.json")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
public class TrialReliquaryData extends GameResource {
|
||||
private int Id;
|
||||
private int ReliquaryId;
|
||||
private int Level;
|
||||
private int MainPropId;
|
||||
private List<Integer> AppendPropList;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return Id;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.trial;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
|
||||
@ResourceType(name = "TrialReliquaryExcelConfigData.json")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
public class TrialReliquaryData extends GameResource {
|
||||
private int Id;
|
||||
private int ReliquaryId;
|
||||
private int Level;
|
||||
private int MainPropId;
|
||||
private List<Integer> AppendPropList;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return Id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
package emu.grasscutter.data.excels.weapon;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.CurveInfo;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@ResourceType(name = "WeaponCurveExcelConfigData.json")
|
||||
public class WeaponCurveData extends GameResource {
|
||||
private int level;
|
||||
private CurveInfo[] curveInfos;
|
||||
|
||||
private Map<String, Float> curveInfosMap;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public float getMultByProp(String fightProp) {
|
||||
return curveInfosMap.getOrDefault(fightProp, 1f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.curveInfosMap = new HashMap<>();
|
||||
Stream.of(this.curveInfos)
|
||||
.forEach(info -> this.curveInfosMap.put(info.getType(), info.getValue()));
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.weapon;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.CurveInfo;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@ResourceType(name = "WeaponCurveExcelConfigData.json")
|
||||
public class WeaponCurveData extends GameResource {
|
||||
private int level;
|
||||
private CurveInfo[] curveInfos;
|
||||
|
||||
private Map<String, Float> curveInfosMap;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public float getMultByProp(String fightProp) {
|
||||
return curveInfosMap.getOrDefault(fightProp, 1f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.curveInfosMap = new HashMap<>();
|
||||
Stream.of(this.curveInfos)
|
||||
.forEach(info -> this.curveInfosMap.put(info.getType(), info.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
package emu.grasscutter.data.excels.weapon;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "WeaponLevelExcelConfigData.json")
|
||||
public class WeaponLevelData extends GameResource {
|
||||
private int level;
|
||||
private int[] requiredExps;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.level;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public int[] getRequiredExps() {
|
||||
return requiredExps;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.weapon;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "WeaponLevelExcelConfigData.json")
|
||||
public class WeaponLevelData extends GameResource {
|
||||
private int level;
|
||||
private int[] requiredExps;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.level;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public int[] getRequiredExps() {
|
||||
return requiredExps;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,74 +1,74 @@
|
||||
package emu.grasscutter.data.excels.weapon;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.FightPropData;
|
||||
import emu.grasscutter.data.common.ItemParamData;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ResourceType(name = "WeaponPromoteExcelConfigData.json")
|
||||
public class WeaponPromoteData extends GameResource {
|
||||
|
||||
private int weaponPromoteId;
|
||||
private int promoteLevel;
|
||||
private ItemParamData[] costItems;
|
||||
private int coinCost;
|
||||
private FightPropData[] addProps;
|
||||
private int unlockMaxLevel;
|
||||
private int requiredPlayerLevel;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return (weaponPromoteId << 8) + promoteLevel;
|
||||
}
|
||||
|
||||
public int getWeaponPromoteId() {
|
||||
return weaponPromoteId;
|
||||
}
|
||||
|
||||
public int getPromoteLevel() {
|
||||
return promoteLevel;
|
||||
}
|
||||
|
||||
public ItemParamData[] getCostItems() {
|
||||
return costItems;
|
||||
}
|
||||
|
||||
public int getCoinCost() {
|
||||
return coinCost;
|
||||
}
|
||||
|
||||
public FightPropData[] getAddProps() {
|
||||
return addProps;
|
||||
}
|
||||
|
||||
public int getUnlockMaxLevel() {
|
||||
return unlockMaxLevel;
|
||||
}
|
||||
|
||||
public int getRequiredPlayerLevel() {
|
||||
return requiredPlayerLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// Trim item params
|
||||
ArrayList<ItemParamData> trim = new ArrayList<>(getAddProps().length);
|
||||
for (ItemParamData itemParam : getCostItems()) {
|
||||
if (itemParam.getId() == 0) {
|
||||
continue;
|
||||
}
|
||||
trim.add(itemParam);
|
||||
}
|
||||
this.costItems = trim.toArray(new ItemParamData[trim.size()]);
|
||||
// Trim fight prop data
|
||||
ArrayList<FightPropData> parsed = new ArrayList<>(getAddProps().length);
|
||||
for (FightPropData prop : getAddProps()) {
|
||||
if (prop.getPropType() != null && prop.getValue() != 0f) {
|
||||
prop.onLoad();
|
||||
parsed.add(prop);
|
||||
}
|
||||
}
|
||||
this.addProps = parsed.toArray(new FightPropData[parsed.size()]);
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.weapon;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.FightPropData;
|
||||
import emu.grasscutter.data.common.ItemParamData;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ResourceType(name = "WeaponPromoteExcelConfigData.json")
|
||||
public class WeaponPromoteData extends GameResource {
|
||||
|
||||
private int weaponPromoteId;
|
||||
private int promoteLevel;
|
||||
private ItemParamData[] costItems;
|
||||
private int coinCost;
|
||||
private FightPropData[] addProps;
|
||||
private int unlockMaxLevel;
|
||||
private int requiredPlayerLevel;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return (weaponPromoteId << 8) + promoteLevel;
|
||||
}
|
||||
|
||||
public int getWeaponPromoteId() {
|
||||
return weaponPromoteId;
|
||||
}
|
||||
|
||||
public int getPromoteLevel() {
|
||||
return promoteLevel;
|
||||
}
|
||||
|
||||
public ItemParamData[] getCostItems() {
|
||||
return costItems;
|
||||
}
|
||||
|
||||
public int getCoinCost() {
|
||||
return coinCost;
|
||||
}
|
||||
|
||||
public FightPropData[] getAddProps() {
|
||||
return addProps;
|
||||
}
|
||||
|
||||
public int getUnlockMaxLevel() {
|
||||
return unlockMaxLevel;
|
||||
}
|
||||
|
||||
public int getRequiredPlayerLevel() {
|
||||
return requiredPlayerLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// Trim item params
|
||||
ArrayList<ItemParamData> trim = new ArrayList<>(getAddProps().length);
|
||||
for (ItemParamData itemParam : getCostItems()) {
|
||||
if (itemParam.getId() == 0) {
|
||||
continue;
|
||||
}
|
||||
trim.add(itemParam);
|
||||
}
|
||||
this.costItems = trim.toArray(new ItemParamData[trim.size()]);
|
||||
// Trim fight prop data
|
||||
ArrayList<FightPropData> parsed = new ArrayList<>(getAddProps().length);
|
||||
for (FightPropData prop : getAddProps()) {
|
||||
if (prop.getPropType() != null && prop.getValue() != 0f) {
|
||||
prop.onLoad();
|
||||
parsed.add(prop);
|
||||
}
|
||||
}
|
||||
this.addProps = parsed.toArray(new FightPropData[parsed.size()]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
package emu.grasscutter.data.excels.world;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.ClimateType;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "WeatherExcelConfigData.json")
|
||||
public class WeatherData extends GameResource {
|
||||
@Getter private int areaID;
|
||||
@Getter private int weatherAreaId;
|
||||
@Getter private String maxHeightStr;
|
||||
@Getter private int gadgetID;
|
||||
@Getter private boolean isDefaultValid;
|
||||
@Getter private String templateName;
|
||||
@Getter private int priority;
|
||||
@Getter private String profileName;
|
||||
@Getter private ClimateType defaultClimate;
|
||||
@Getter private boolean isUseDefault;
|
||||
@Getter private int sceneID;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.areaID;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.excels.world;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.ClimateType;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "WeatherExcelConfigData.json")
|
||||
public class WeatherData extends GameResource {
|
||||
@Getter private int areaID;
|
||||
@Getter private int weatherAreaId;
|
||||
@Getter private String maxHeightStr;
|
||||
@Getter private int gadgetID;
|
||||
@Getter private boolean isDefaultValid;
|
||||
@Getter private String templateName;
|
||||
@Getter private int priority;
|
||||
@Getter private String profileName;
|
||||
@Getter private ClimateType defaultClimate;
|
||||
@Getter private boolean isUseDefault;
|
||||
@Getter private int sceneID;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.areaID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
package emu.grasscutter.data.excels.world;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.ElementType;
|
||||
|
||||
@ResourceType(name = "WorldAreaConfigData.json")
|
||||
public class WorldAreaData extends GameResource {
|
||||
private int ID;
|
||||
private int AreaID1;
|
||||
private int AreaID2;
|
||||
private int SceneID;
|
||||
private ElementType elementType;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return (this.AreaID2 << 16) + this.AreaID1;
|
||||
}
|
||||
|
||||
public int getSceneID() {
|
||||
return this.SceneID;
|
||||
}
|
||||
|
||||
public ElementType getElementType() {
|
||||
return this.elementType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {}
|
||||
}
|
||||
package emu.grasscutter.data.excels.world;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.ElementType;
|
||||
|
||||
@ResourceType(name = "WorldAreaConfigData.json")
|
||||
public class WorldAreaData extends GameResource {
|
||||
private int ID;
|
||||
private int AreaID1;
|
||||
private int AreaID2;
|
||||
private int SceneID;
|
||||
private ElementType elementType;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return (this.AreaID2 << 16) + this.AreaID1;
|
||||
}
|
||||
|
||||
public int getSceneID() {
|
||||
return this.SceneID;
|
||||
}
|
||||
|
||||
public ElementType getElementType() {
|
||||
return this.elementType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
package emu.grasscutter.data.excels.world;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "WorldLevelExcelConfigData.json")
|
||||
public class WorldLevelData extends GameResource {
|
||||
private int level;
|
||||
private int monsterLevel;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.level;
|
||||
}
|
||||
|
||||
public int getMonsterLevel() {
|
||||
return monsterLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {}
|
||||
}
|
||||
package emu.grasscutter.data.excels.world;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "WorldLevelExcelConfigData.json")
|
||||
public class WorldLevelData extends GameResource {
|
||||
private int level;
|
||||
private int monsterLevel;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.level;
|
||||
}
|
||||
|
||||
public int getMonsterLevel() {
|
||||
return monsterLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package emu.grasscutter.data.server;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ActivityCondGroup {
|
||||
int condGroupId;
|
||||
List<Integer> condIds;
|
||||
}
|
||||
package emu.grasscutter.data.server;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ActivityCondGroup {
|
||||
int condGroupId;
|
||||
List<Integer> condIds;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package emu.grasscutter.data.server;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GadgetMapping {
|
||||
private int gadgetId;
|
||||
private String serverController;
|
||||
}
|
||||
package emu.grasscutter.data.server;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GadgetMapping {
|
||||
private int gadgetId;
|
||||
private String serverController;
|
||||
}
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
package emu.grasscutter.data.server;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.utils.GridPosition;
|
||||
import emu.grasscutter.utils.Position;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class Grid {
|
||||
public Map<GridPosition, Set<Integer>> grid;
|
||||
|
||||
public Set<Integer> getNearbyGroups(int vision_level, Position position) {
|
||||
int width = Grasscutter.getConfig().server.game.visionOptions[vision_level].gridWidth;
|
||||
int vision_range = Grasscutter.getConfig().server.game.visionOptions[vision_level].visionRange;
|
||||
int vision_range_grid = vision_range / width;
|
||||
|
||||
GridPosition pos = new GridPosition(position, width);
|
||||
|
||||
Set<Integer> nearbyGroups = new HashSet<>();
|
||||
// construct a nearby pisition list, add 1 more because a player can be in an edge case, this
|
||||
// should not affect much the loading
|
||||
for (int x = 0; x < vision_range_grid + 1; x++) {
|
||||
for (int z = 0; z < vision_range_grid + 1; z++) {
|
||||
nearbyGroups.addAll(grid.getOrDefault(pos.addClone(x, z), new HashSet<>()));
|
||||
nearbyGroups.addAll(grid.getOrDefault(pos.addClone(-x, z), new HashSet<>()));
|
||||
nearbyGroups.addAll(grid.getOrDefault(pos.addClone(x, -z), new HashSet<>()));
|
||||
nearbyGroups.addAll(grid.getOrDefault(pos.addClone(-x, -z), new HashSet<>()));
|
||||
}
|
||||
}
|
||||
|
||||
return nearbyGroups;
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.data.server;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.utils.GridPosition;
|
||||
import emu.grasscutter.utils.Position;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class Grid {
|
||||
public Map<GridPosition, Set<Integer>> grid;
|
||||
|
||||
public Set<Integer> getNearbyGroups(int vision_level, Position position) {
|
||||
int width = Grasscutter.getConfig().server.game.visionOptions[vision_level].gridWidth;
|
||||
int vision_range = Grasscutter.getConfig().server.game.visionOptions[vision_level].visionRange;
|
||||
int vision_range_grid = vision_range / width;
|
||||
|
||||
GridPosition pos = new GridPosition(position, width);
|
||||
|
||||
Set<Integer> nearbyGroups = new HashSet<>();
|
||||
// construct a nearby pisition list, add 1 more because a player can be in an edge case, this
|
||||
// should not affect much the loading
|
||||
for (int x = 0; x < vision_range_grid + 1; x++) {
|
||||
for (int z = 0; z < vision_range_grid + 1; z++) {
|
||||
nearbyGroups.addAll(grid.getOrDefault(pos.addClone(x, z), new HashSet<>()));
|
||||
nearbyGroups.addAll(grid.getOrDefault(pos.addClone(-x, z), new HashSet<>()));
|
||||
nearbyGroups.addAll(grid.getOrDefault(pos.addClone(x, -z), new HashSet<>()));
|
||||
nearbyGroups.addAll(grid.getOrDefault(pos.addClone(-x, -z), new HashSet<>()));
|
||||
}
|
||||
}
|
||||
|
||||
return nearbyGroups;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user