diff --git a/src/main/java/emu/grasscutter/data/excels/AvatarData.java b/src/main/java/emu/grasscutter/data/excels/AvatarData.java index b9b4cfb22..64a26c70a 100644 --- a/src/main/java/emu/grasscutter/data/excels/AvatarData.java +++ b/src/main/java/emu/grasscutter/data/excels/AvatarData.java @@ -14,28 +14,29 @@ import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; +import lombok.Getter; @ResourceType(name = "AvatarExcelConfigData.json", loadPriority = LoadPriority.LOW) public class AvatarData extends GameResource { - - private String iconName; - private String bodyType; - private String qualityType; - private int chargeEfficiency; - private int initialWeapon; - private WeaponType weaponType; - private String imageName; - private int avatarPromoteId; - private String cutsceneShow; - private int skillDepotId; - private int staminaRecoverSpeed; - private List candSkillDepotIds; - private String avatarIdentityType; - private List avatarPromoteRewardLevelList; - private List avatarPromoteRewardIdList; - private long nameTextMapHash; - + private String iconName; + @Getter private String bodyType; + @Getter private String qualityType; + @Getter private int chargeEfficiency; + @Getter private int initialWeapon; + @Getter private WeaponType weaponType; + @Getter private String imageName; + @Getter private int avatarPromoteId; + @Getter private String cutsceneShow; + @Getter private int skillDepotId; + @Getter private int staminaRecoverSpeed; + @Getter private List candSkillDepotIds; + @Getter private String avatarIdentityType; + @Getter private List avatarPromoteRewardLevelList; + @Getter private List avatarPromoteRewardIdList; + + @Getter private long nameTextMapHash; + private float hpBase; private float attackBase; private float defenseBase; @@ -44,85 +45,25 @@ public class AvatarData extends GameResource { private List propGrowCurves; private int id; - + // Transient - private String name; - + @Getter private String name; + private Int2ObjectMap growthCurveMap; private float[] hpGrowthCurve; private float[] attackGrowthCurve; private float[] defenseGrowthCurve; - private AvatarSkillDepotData skillDepot; - private IntList abilities; + @Getter private AvatarSkillDepotData skillDepot; + @Getter private IntList abilities; + + @Getter private List fetters; + @Getter private int nameCardRewardId; + @Getter private int nameCardId; - private List fetters; - private int nameCardRewardId; - private int nameCardId; - @Override public int getId(){ return this.id; } - - public String getName() { - return name; - } - - public String getBodyType(){ - return this.bodyType; - } - - public String getQualityType(){ - return this.qualityType; - } - - public int getChargeEfficiency(){ - return this.chargeEfficiency; - } - - public int getInitialWeapon(){ - return this.initialWeapon; - } - - public WeaponType getWeaponType(){ - return this.weaponType; - } - - public String getImageName(){ - return this.imageName; - } - - public int getAvatarPromoteId(){ - return this.avatarPromoteId; - } - - public String getCutsceneShow(){ - return this.cutsceneShow; - } - - public int getSkillDepotId(){ - return this.skillDepotId; - } - - public int getStaminaRecoverSpeed(){ - return this.staminaRecoverSpeed; - } - - public List getCandSkillDepotIds(){ - return this.candSkillDepotIds; - } - - public String getAvatarIdentityType(){ - return this.avatarIdentityType; - } - - public List getAvatarPromoteRewardLevelList(){ - return this.avatarPromoteRewardLevelList; - } - - public List getAvatarPromoteRewardIdList(){ - return this.avatarPromoteRewardIdList; - } public float getBaseHp(int level){ try { @@ -168,30 +109,6 @@ public class AvatarData extends GameResource { return curveData.getCurveInfos().getOrDefault(growCurve, 1f); } - public long getNameTextMapHash(){ - return this.nameTextMapHash; - } - - public AvatarSkillDepotData getSkillDepot() { - return skillDepot; - } - - public IntList getAbilities() { - return abilities; - } - - public List getFetters() { - return fetters; - } - - public int getNameCardRewardId() { - return nameCardRewardId; - } - - public int getNameCardId() { - return nameCardId; - } - @Override public void onLoad() { this.skillDepot = GameData.getAvatarSkillDepotDataMap().get(this.skillDepotId); diff --git a/src/main/java/emu/grasscutter/data/excels/AvatarSkillDepotData.java b/src/main/java/emu/grasscutter/data/excels/AvatarSkillDepotData.java index 4dd5c7e25..9d775f5f2 100644 --- a/src/main/java/emu/grasscutter/data/excels/AvatarSkillDepotData.java +++ b/src/main/java/emu/grasscutter/data/excels/AvatarSkillDepotData.java @@ -6,7 +6,6 @@ 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.ResourceLoader.AvatarConfigAbility; import emu.grasscutter.data.ResourceType; import emu.grasscutter.data.ResourceType.LoadPriority; import emu.grasscutter.data.binout.AbilityEmbryoEntry; @@ -14,81 +13,34 @@ 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 lombok.Getter; @ResourceType(name = "AvatarSkillDepotExcelConfigData.json", loadPriority = LoadPriority.HIGH) public class AvatarSkillDepotData extends GameResource { private int id; - private int energySkill; - private int attackModeSkill; + @Getter private int energySkill; + @Getter private int attackModeSkill; - private List skills; - private List subSkills; - private List extraAbilities; - private List talents; - private List inherentProudSkillOpens; + @Getter private List skills; + @Getter private List subSkills; + @Getter private List extraAbilities; + @Getter private List talents; + @Getter private List inherentProudSkillOpens; - private String talentStarName; - private String skillDepotAbilityGroup; + @Getter private String talentStarName; + @Getter private String skillDepotAbilityGroup; // Transient - private AvatarSkillData energySkillData; - private ElementType elementType; - private IntList abilities; + @Getter private AvatarSkillData energySkillData; + @Getter private ElementType elementType; + @Getter private IntList abilities; @Override public int getId(){ return this.id; } - - public int getEnergySkill(){ - return this.energySkill; - } - - public List getSkills(){ - return this.skills; - } - - public List getSubSkills(){ - return this.subSkills; - } - - public int getAttackModeSkill(){ - return this.attackModeSkill; - } - - public List getExtraAbilities(){ - return this.extraAbilities; - } - - public List getTalents(){ - return this.talents; - } - - public String getTalentStarName(){ - return this.talentStarName; - } - - public List getInherentProudSkillOpens(){ - return this.inherentProudSkillOpens; - } - - public String getSkillDepotAbilityGroup(){ - return this.skillDepotAbilityGroup; - } - - public AvatarSkillData getEnergySkillData() { - return this.energySkillData; - } - - public ElementType getElementType() { - return elementType; - } - - public IntList getAbilities() { - return abilities; - } - + public void setAbilities(AbilityEmbryoEntry info) { this.abilities = new IntArrayList(info.getAbilities().length); for (String ability : info.getAbilities()) { @@ -100,8 +52,8 @@ public class AvatarSkillDepotData extends GameResource { public void onLoad() { // Set energy skill data this.energySkillData = GameData.getAvatarSkillDataMap().get(this.energySkill); - if (getEnergySkillData() != null) { - this.elementType = getEnergySkillData().getCostElemType(); + if (this.energySkillData != null) { + this.elementType = this.energySkillData.getCostElemType(); } else { this.elementType = ElementType.None; } @@ -116,15 +68,7 @@ public class AvatarSkillDepotData extends GameResource { } public static class InherentProudSkillOpens { - private int proudSkillGroupId; - private int needAvatarPromoteLevel; - - public int getProudSkillGroupId(){ - return this.proudSkillGroupId; - } - - public int getNeedAvatarPromoteLevel(){ - return this.needAvatarPromoteLevel; - } + @Getter private int proudSkillGroupId; + @Getter private int needAvatarPromoteLevel; } } diff --git a/src/main/java/emu/grasscutter/game/props/ElementType.java b/src/main/java/emu/grasscutter/game/props/ElementType.java index 80b6cf968..fbf7ec818 100644 --- a/src/main/java/emu/grasscutter/game/props/ElementType.java +++ b/src/main/java/emu/grasscutter/game/props/ElementType.java @@ -7,6 +7,7 @@ import java.util.stream.Stream; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; +import lombok.Getter; public enum ElementType { None (0, FightProperty.FIGHT_PROP_CUR_FIRE_ENERGY, FightProperty.FIGHT_PROP_MAX_FIRE_ENERGY), @@ -21,12 +22,12 @@ public enum ElementType { AntiFire (9, FightProperty.FIGHT_PROP_CUR_FIRE_ENERGY, FightProperty.FIGHT_PROP_MAX_FIRE_ENERGY), Default (255, FightProperty.FIGHT_PROP_CUR_FIRE_ENERGY, FightProperty.FIGHT_PROP_MAX_FIRE_ENERGY, 10801, "TeamResonance_AllDifferent"); - private final int value; - private final int teamResonanceId; - private final FightProperty curEnergyProp; - private final FightProperty maxEnergyProp; - private int depotValue; - private final int configHash; + @Getter private final int value; + @Getter private final int teamResonanceId; + @Getter private final FightProperty curEnergyProp; + @Getter private final FightProperty maxEnergyProp; + @Getter private int depotValue; + @Getter private final int configHash; private static final Int2ObjectMap map = new Int2ObjectOpenHashMap<>(); private static final Map stringMap = new HashMap<>(); @@ -58,30 +59,6 @@ public enum ElementType { this.depotValue = depotValue; } - public int getValue() { - return value; - } - - public FightProperty getCurEnergyProp() { - return curEnergyProp; - } - - public FightProperty getMaxEnergyProp() { - return maxEnergyProp; - } - - public int getDepotValue() { - return depotValue; - } - - public int getTeamResonanceId() { - return teamResonanceId; - } - - public int getConfigHash() { - return configHash; - } - public static ElementType getTypeByValue(int value) { return map.getOrDefault(value, None); }