mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-02-06 18:17:00 +01:00
Refactor avatar skilldepot and constellation/talent changing
Ensures Traveler retains talent levels and constellations on inactive elements when switching elements. Relevant for any other skillDepot-changing activities like Windtrace too, though keeping those in the db might not be as useful. Refactor avatar talent upgrade and access Refactor skillExtraCharges
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.GameDepot;
|
||||
@@ -71,4 +72,9 @@ public class AvatarSkillDepotData extends GameResource {
|
||||
@Getter private int proudSkillGroupId;
|
||||
@Getter private int needAvatarPromoteLevel;
|
||||
}
|
||||
|
||||
public IntStream getSkillsAndEnergySkill() {
|
||||
return IntStream.concat(this.skills.stream().mapToInt(i -> i), IntStream.of(this.energySkill))
|
||||
.filter(skillId -> skillId > 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,99 +3,59 @@ package emu.grasscutter.data.excels;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import dev.morphia.annotations.Transient;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.FightPropData;
|
||||
import emu.grasscutter.data.common.ItemParamData;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = "ProudSkillExcelConfigData.json")
|
||||
public class ProudSkillData extends GameResource {
|
||||
|
||||
private int proudSkillId;
|
||||
private int proudSkillGroupId;
|
||||
private int level;
|
||||
private int coinCost;
|
||||
private int breakLevel;
|
||||
private int proudSkillType;
|
||||
private String openConfig;
|
||||
private List<ItemParamData> costItems;
|
||||
private List<String> filterConds;
|
||||
private List<String> lifeEffectParams;
|
||||
private FightPropData[] addProps;
|
||||
private float[] paramList;
|
||||
private long[] paramDescList;
|
||||
private long nameTextMapHash;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return proudSkillId;
|
||||
}
|
||||
private int proudSkillId;
|
||||
@Getter private int proudSkillGroupId;
|
||||
@Getter private int level;
|
||||
@Getter private int coinCost;
|
||||
@Getter private int breakLevel;
|
||||
@Getter private int proudSkillType;
|
||||
@Getter private String openConfig;
|
||||
@Getter private List<ItemParamData> costItems;
|
||||
@Getter private List<String> filterConds;
|
||||
@Getter private List<String> lifeEffectParams;
|
||||
@Getter private FightPropData[] addProps;
|
||||
@Getter private float[] paramList;
|
||||
@Getter private long[] paramDescList;
|
||||
@Getter private long nameTextMapHash;
|
||||
@Transient private Iterable<ItemParamData> totalCostItems;
|
||||
|
||||
public int getProudSkillGroupId() {
|
||||
return proudSkillGroupId;
|
||||
}
|
||||
@Override
|
||||
public int getId() {
|
||||
return proudSkillId;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
public Iterable<ItemParamData> getTotalCostItems() {
|
||||
if (this.totalCostItems == null) {
|
||||
ArrayList<ItemParamData> total = (this.costItems != null) ? new ArrayList<>(this.costItems) : new ArrayList<>(1);
|
||||
if (this.coinCost > 0)
|
||||
total.add(new ItemParamData(202, this.coinCost));
|
||||
this.totalCostItems = total;
|
||||
}
|
||||
return this.totalCostItems;
|
||||
}
|
||||
|
||||
public int getCoinCost() {
|
||||
return coinCost;
|
||||
}
|
||||
|
||||
public int getBreakLevel() {
|
||||
return breakLevel;
|
||||
}
|
||||
|
||||
public int getProudSkillType() {
|
||||
return proudSkillType;
|
||||
}
|
||||
|
||||
public String getOpenConfig() {
|
||||
return openConfig;
|
||||
}
|
||||
|
||||
public List<ItemParamData> getCostItems() {
|
||||
return costItems;
|
||||
}
|
||||
|
||||
public List<String> getFilterConds() {
|
||||
return filterConds;
|
||||
}
|
||||
|
||||
public List<String> getLifeEffectParams() {
|
||||
return lifeEffectParams;
|
||||
}
|
||||
|
||||
public FightPropData[] getAddProps() {
|
||||
return addProps;
|
||||
}
|
||||
|
||||
public float[] getParamList() {
|
||||
return paramList;
|
||||
}
|
||||
|
||||
public long[] getParamDescList() {
|
||||
return paramDescList;
|
||||
}
|
||||
|
||||
public long getNameTextMapHash() {
|
||||
return nameTextMapHash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
if (this.getOpenConfig() != null & this.getOpenConfig().length() > 0) {
|
||||
this.openConfig = "Avatar_" + this.getOpenConfig();
|
||||
}
|
||||
// Fight props
|
||||
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()]);
|
||||
}
|
||||
@Override
|
||||
public void onLoad() {
|
||||
if (this.getOpenConfig() != null & this.getOpenConfig().length() > 0) {
|
||||
this.openConfig = "Avatar_" + this.getOpenConfig();
|
||||
}
|
||||
// Fight props
|
||||
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()]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user