mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-17 01:15:52 +01:00
Add embryos for all skill depots for the main characters
This commit is contained in:
@@ -77,6 +77,7 @@ public class GameData {
|
||||
private static final ArrayList<CodexReliquaryData> codexReliquaryArrayList = new ArrayList<>();
|
||||
private static final Int2ObjectMap<FetterCharacterCardData> fetterCharacterCardDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<RewardData> rewardDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<WorldAreaData> worldAreaDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<WorldLevelData> worldLevelDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<DailyDungeonData> dailyDungeonDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<DungeonData> dungeonDataMap = new Int2ObjectOpenHashMap<>();
|
||||
@@ -319,6 +320,10 @@ public class GameData {
|
||||
|
||||
public static ArrayList<CodexReliquaryData> getcodexReliquaryArrayList(){return codexReliquaryArrayList;}
|
||||
|
||||
public static Int2ObjectMap<WorldAreaData> getWorldAreaDataMap() {
|
||||
return worldAreaDataMap;
|
||||
}
|
||||
|
||||
public static Int2ObjectMap<WorldLevelData> getWorldLevelDataMap() {
|
||||
return worldLevelDataMap;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
package emu.grasscutter.data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.danilopianini.util.FlexibleQuadTree;
|
||||
import org.danilopianini.util.SpatialIndex;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.data.ResourceLoader.AvatarConfig;
|
||||
import emu.grasscutter.data.ResourceLoader.AvatarConfigAbility;
|
||||
import emu.grasscutter.data.excels.ReliquaryAffixData;
|
||||
import emu.grasscutter.data.excels.ReliquaryMainPropData;
|
||||
import emu.grasscutter.game.world.SpawnDataEntry;
|
||||
@@ -19,6 +23,7 @@ public class GameDepot {
|
||||
private static Int2ObjectMap<WeightedList<ReliquaryMainPropData>> relicMainPropDepot = new Int2ObjectOpenHashMap<>();
|
||||
private static Int2ObjectMap<List<ReliquaryAffixData>> relicAffixDepot = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
private static Map<String, AvatarConfig> playerAbilities = new HashMap<>();
|
||||
private static Int2ObjectMap<SpatialIndex<SpawnGroupEntry>> spawnLists = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
public static void load() {
|
||||
@@ -61,4 +66,12 @@ public class GameDepot {
|
||||
public static SpatialIndex<SpawnGroupEntry> getSpawnListById(int sceneId) {
|
||||
return getSpawnLists().computeIfAbsent(sceneId, id -> new FlexibleQuadTree<>());
|
||||
}
|
||||
|
||||
public static Map<String, AvatarConfig> getPlayerAbilities() {
|
||||
return playerAbilities;
|
||||
}
|
||||
|
||||
public static void setPlayerAbilities(Map<String, AvatarConfig> playerAbilities) {
|
||||
GameDepot.playerAbilities = playerAbilities;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,37 +66,6 @@ public class ResourceLoader {
|
||||
loadQuests();
|
||||
// Load scene points - must be done AFTER resources are loaded
|
||||
loadScenePoints();
|
||||
// Custom - TODO move this somewhere else
|
||||
try {
|
||||
GameData.getAvatarSkillDepotDataMap().get(504).setAbilities(
|
||||
new AbilityEmbryoEntry(
|
||||
"",
|
||||
new String[] {
|
||||
"Avatar_PlayerBoy_ExtraAttack_Wind",
|
||||
"Avatar_Player_UziExplode_Mix",
|
||||
"Avatar_Player_UziExplode",
|
||||
"Avatar_Player_UziExplode_Strike_01",
|
||||
"Avatar_Player_UziExplode_Strike_02",
|
||||
"Avatar_Player_WindBreathe",
|
||||
"Avatar_Player_WindBreathe_CameraController"
|
||||
}
|
||||
));
|
||||
GameData.getAvatarSkillDepotDataMap().get(704).setAbilities(
|
||||
new AbilityEmbryoEntry(
|
||||
"",
|
||||
new String[] {
|
||||
"Avatar_PlayerGirl_ExtraAttack_Wind",
|
||||
"Avatar_Player_UziExplode_Mix",
|
||||
"Avatar_Player_UziExplode",
|
||||
"Avatar_Player_UziExplode_Strike_01",
|
||||
"Avatar_Player_UziExplode_Strike_02",
|
||||
"Avatar_Player_WindBreathe",
|
||||
"Avatar_Player_WindBreathe_CameraController"
|
||||
}
|
||||
));
|
||||
} catch (Exception e) {
|
||||
Grasscutter.getLogger().error("Error loading abilities", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadResources() {
|
||||
@@ -244,6 +213,16 @@ public class ResourceLoader {
|
||||
AbilityEmbryoEntry al = new AbilityEmbryoEntry(avatarName, config.abilities.stream().map(Object::toString).toArray(size -> new String[s]));
|
||||
embryoList.add(al);
|
||||
}
|
||||
|
||||
File playerElementsFile = new File(Utils.toFilePath(RESOURCE("BinOutput/AbilityGroup/AbilityGroup_Other_PlayerElementAbility.json")));
|
||||
|
||||
if (playerElementsFile.exists()) {
|
||||
try (FileReader fileReader = new FileReader(playerElementsFile)) {
|
||||
GameDepot.setPlayerAbilities(Grasscutter.getGsonFactory().fromJson(fileReader, new TypeToken<Map<String, AvatarConfig>>(){}.getType()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (embryoList == null || embryoList.isEmpty()) {
|
||||
@@ -417,14 +396,15 @@ public class ResourceLoader {
|
||||
|
||||
// BinOutput configs
|
||||
|
||||
private static class AvatarConfig {
|
||||
public static class AvatarConfig {
|
||||
@SerializedName(value="abilities", alternate={"targetAbilities"})
|
||||
public ArrayList<AvatarConfigAbility> abilities;
|
||||
|
||||
private static class AvatarConfigAbility {
|
||||
public String abilityName;
|
||||
public String toString() {
|
||||
return abilityName;
|
||||
}
|
||||
}
|
||||
|
||||
public static class AvatarConfigAbility {
|
||||
public String abilityName;
|
||||
public String toString() {
|
||||
return abilityName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,10 @@ package emu.grasscutter.data.excels;
|
||||
import java.util.List;
|
||||
|
||||
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;
|
||||
@@ -95,12 +98,21 @@ public class AvatarSkillDepotData extends GameResource {
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// Set energy skill data
|
||||
this.energySkillData = GameData.getAvatarSkillDataMap().get(this.energySkill);
|
||||
if (getEnergySkillData() != null) {
|
||||
this.elementType = getEnergySkillData().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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class InherentProudSkillOpens {
|
||||
|
||||
32
src/main/java/emu/grasscutter/data/excels/WorldAreaData.java
Normal file
32
src/main/java/emu/grasscutter/data/excels/WorldAreaData.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
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() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user