mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-17 09:25:06 +01:00
@@ -307,18 +307,7 @@ public class ResourceLoader {
|
||||
}
|
||||
|
||||
for (Entry<String, OpenConfigData[]> e : config.entrySet()) {
|
||||
List<String> abilityList = new ArrayList<>();
|
||||
int extraTalentIndex = 0;
|
||||
|
||||
for (OpenConfigData entry : e.getValue()) {
|
||||
if (entry.$type.contains("AddAbility")) {
|
||||
abilityList.add(entry.abilityName);
|
||||
} else if (entry.talentIndex > 0) {
|
||||
extraTalentIndex = entry.talentIndex;
|
||||
}
|
||||
}
|
||||
|
||||
OpenConfigEntry entry = new OpenConfigEntry(e.getKey(), abilityList, extraTalentIndex);
|
||||
OpenConfigEntry entry = new OpenConfigEntry(e.getKey(), e.getValue());
|
||||
map.put(entry.getName(), entry);
|
||||
}
|
||||
}
|
||||
@@ -354,9 +343,11 @@ public class ResourceLoader {
|
||||
public OpenConfigData[] data;
|
||||
}
|
||||
|
||||
private static class OpenConfigData {
|
||||
public static class OpenConfigData {
|
||||
public String $type;
|
||||
public String abilityName;
|
||||
public int talentIndex;
|
||||
public int skillID;
|
||||
public int pointDelta;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,39 @@
|
||||
package emu.grasscutter.data.custom;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import emu.grasscutter.data.ResourceLoader.OpenConfigData;
|
||||
|
||||
public class OpenConfigEntry {
|
||||
private String name;
|
||||
private String[] addAbilities;
|
||||
private int extraTalentIndex;
|
||||
|
||||
public OpenConfigEntry(String name, List<String> abilityList, int extraTalentIndex) {
|
||||
private SkillPointModifier[] skillPointModifiers;
|
||||
|
||||
public OpenConfigEntry(String name, OpenConfigData[] data) {
|
||||
this.name = name;
|
||||
this.extraTalentIndex = extraTalentIndex;
|
||||
|
||||
List<String> abilityList = new ArrayList<>();
|
||||
List<SkillPointModifier> modList = new ArrayList<>();
|
||||
|
||||
for (OpenConfigData entry : data) {
|
||||
if (entry.$type.contains("AddAbility")) {
|
||||
abilityList.add(entry.abilityName);
|
||||
} else if (entry.talentIndex > 0) {
|
||||
this.extraTalentIndex = entry.talentIndex;
|
||||
} else if (entry.$type.contains("ModifySkillPoint")) {
|
||||
modList.add(new SkillPointModifier(entry.skillID, entry.pointDelta));
|
||||
}
|
||||
}
|
||||
|
||||
if (abilityList.size() > 0) {
|
||||
this.addAbilities = abilityList.toArray(new String[0]);
|
||||
}
|
||||
|
||||
if (modList.size() > 0) {
|
||||
this.skillPointModifiers = modList.toArray(new SkillPointModifier[0]);
|
||||
}
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
@@ -26,4 +47,26 @@ public class OpenConfigEntry {
|
||||
public int getExtraTalentIndex() {
|
||||
return extraTalentIndex;
|
||||
}
|
||||
|
||||
public SkillPointModifier[] getSkillPointModifiers() {
|
||||
return skillPointModifiers;
|
||||
}
|
||||
|
||||
public static class SkillPointModifier {
|
||||
private int skillId;
|
||||
private int delta;
|
||||
|
||||
public SkillPointModifier(int skillId, int delta) {
|
||||
this.skillId = skillId;
|
||||
this.delta = delta;
|
||||
}
|
||||
|
||||
public int getSkillId() {
|
||||
return skillId;
|
||||
}
|
||||
|
||||
public int getDelta() {
|
||||
return delta;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user