mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-20 10:55:08 +01:00
Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
@@ -95,8 +95,8 @@ public class GameData {
|
||||
private static final Int2ObjectMap<InvestigationMonsterData> investigationMonsterDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<CityData> cityDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<WeatherData> weatherDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<BattlePassMissionExcelConfigData> battlePassMissionExcelConfigDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<BattlePassRewardExcelConfigData> battlePassRewardExcelConfigDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<BattlePassMissionData> battlePassMissionDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<BattlePassRewardData> battlePassRewardDataMap = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
// Cache
|
||||
private static Map<Integer, List<Integer>> fetters = new HashMap<>();
|
||||
@@ -424,11 +424,11 @@ public class GameData {
|
||||
return weatherDataMap;
|
||||
}
|
||||
|
||||
public static Int2ObjectMap<BattlePassMissionExcelConfigData> getBattlePassMissionExcelConfigDataMap() {
|
||||
return battlePassMissionExcelConfigDataMap;
|
||||
public static Int2ObjectMap<BattlePassMissionData> getBattlePassMissionDataMap() {
|
||||
return battlePassMissionDataMap;
|
||||
}
|
||||
|
||||
public static Int2ObjectMap<BattlePassRewardExcelConfigData> getBattlePassRewardExcelConfigDataMap() {
|
||||
return battlePassRewardExcelConfigDataMap;
|
||||
public static Int2ObjectMap<BattlePassRewardData> getBattlePassRewardDataMap() {
|
||||
return battlePassRewardDataMap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,9 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
|
||||
public class GameDepot {
|
||||
private static Int2ObjectMap<WeightedList<ReliquaryMainPropData>> relicMainPropDepot = new Int2ObjectOpenHashMap<>();
|
||||
private static Int2ObjectMap<List<ReliquaryAffixData>> relicAffixDepot = new Int2ObjectOpenHashMap<>();
|
||||
private static Int2ObjectMap<WeightedList<ReliquaryMainPropData>> relicRandomMainPropDepot = new Int2ObjectOpenHashMap<>();
|
||||
private static Int2ObjectMap<List<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<>();
|
||||
@@ -31,8 +32,10 @@ public class GameDepot {
|
||||
if (data.getWeight() <= 0 || data.getPropDepotId() <= 0) {
|
||||
continue;
|
||||
}
|
||||
WeightedList<ReliquaryMainPropData> list = relicMainPropDepot.computeIfAbsent(data.getPropDepotId(), k -> new WeightedList<>());
|
||||
list.add(data.getWeight(), data);
|
||||
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) {
|
||||
@@ -48,14 +51,18 @@ public class GameDepot {
|
||||
}
|
||||
|
||||
public static ReliquaryMainPropData getRandomRelicMainProp(int depot) {
|
||||
WeightedList<ReliquaryMainPropData> depotList = relicMainPropDepot.get(depot);
|
||||
WeightedList<ReliquaryMainPropData> depotList = relicRandomMainPropDepot.get(depot);
|
||||
if (depotList == null) {
|
||||
return null;
|
||||
}
|
||||
return depotList.next();
|
||||
}
|
||||
|
||||
public static List<ReliquaryAffixData> getRandomRelicAffixList(int depot) {
|
||||
public static List<ReliquaryMainPropData> getRelicMainPropList(int depot) {
|
||||
return relicMainPropDepot.get(depot);
|
||||
}
|
||||
|
||||
public static List<ReliquaryAffixData> getRelicAffixList(int depot) {
|
||||
return relicAffixDepot.get(depot);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.game.props.BattlePassMissionRefreshType;
|
||||
import emu.grasscutter.game.props.WatcherTriggerType;
|
||||
import emu.grasscutter.net.proto.BattlePassMissionOuterClass.BattlePassMission.MissionStatus;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@ResourceType(name = {"BattlePassMissionExcelConfigData.json"})
|
||||
@Getter
|
||||
public class BattlePassMissionData extends GameResource {
|
||||
private int addPoint;
|
||||
private int id;
|
||||
private int scheduleId;
|
||||
private int progress;
|
||||
private TriggerConfig triggerConfig;
|
||||
private BattlePassMissionRefreshType refreshType;
|
||||
|
||||
private transient Set<Integer> mainParams;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public WatcherTriggerType getTriggerType() {
|
||||
return this.getTriggerConfig().getTriggerType();
|
||||
}
|
||||
|
||||
public boolean isCycleRefresh() {
|
||||
return getRefreshType() == null || getRefreshType() == BattlePassMissionRefreshType.BATTLE_PASS_MISSION_REFRESH_CYCLE_CROSS_SCHEDULE;
|
||||
}
|
||||
|
||||
public boolean isValidRefreshType() {
|
||||
return getRefreshType() == null ||
|
||||
getRefreshType() == BattlePassMissionRefreshType.BATTLE_PASS_MISSION_REFRESH_CYCLE_CROSS_SCHEDULE ||
|
||||
getScheduleId() == 2701;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
if (this.getTriggerConfig() != null && getTriggerConfig().getParamList()[0].length() > 0) {
|
||||
this.mainParams = Arrays.stream(getTriggerConfig().getParamList()[0].split("[:;,]")).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class TriggerConfig {
|
||||
private WatcherTriggerType triggerType;
|
||||
private String[] paramList;
|
||||
}
|
||||
|
||||
public emu.grasscutter.net.proto.BattlePassMissionOuterClass.BattlePassMission toProto() {
|
||||
var protoBuilder = emu.grasscutter.net.proto.BattlePassMissionOuterClass.BattlePassMission.newBuilder();
|
||||
|
||||
protoBuilder
|
||||
.setMissionId(getId())
|
||||
.setTotalProgress(this.getProgress())
|
||||
.setRewardBattlePassPoint(this.getAddPoint())
|
||||
.setMissionStatus(MissionStatus.MISSION_STATUS_UNFINISHED)
|
||||
.setMissionType(this.getRefreshType() == null ? 0 : this.getRefreshType().getValue());
|
||||
|
||||
return protoBuilder.build();
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.FieldDefaults;
|
||||
|
||||
@ResourceType(name = {"BattlePassMissionExcelConfigData.json"})
|
||||
@FieldDefaults(level = AccessLevel.PRIVATE)
|
||||
@Getter
|
||||
@Setter
|
||||
public class BattlePassMissionExcelConfigData extends GameResource {
|
||||
|
||||
private int addPoint;
|
||||
private int id;
|
||||
private int progress;
|
||||
private String refreshType;
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,7 @@ import java.util.List;
|
||||
|
||||
@ResourceType(name = "BattlePassRewardExcelConfigData.json")
|
||||
@Getter
|
||||
@Setter
|
||||
public class BattlePassRewardExcelConfigData extends GameResource {
|
||||
public class BattlePassRewardData extends GameResource {
|
||||
private int indexId;
|
||||
private int level;
|
||||
private List<Integer> freeRewardIdList;
|
||||
@@ -23,5 +22,6 @@ public class BattlePassRewardExcelConfigData extends GameResource {
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.ResourceType.LoadPriority;
|
||||
import emu.grasscutter.data.common.ItemParamData;
|
||||
import emu.grasscutter.data.common.OpenCondData;
|
||||
|
||||
@ResourceType(name = {"ForgeExcelConfigData.json"}, loadPriority = LoadPriority.HIGHEST)
|
||||
public class ForgeData extends GameResource {
|
||||
@@ -19,6 +18,7 @@ public class ForgeData extends GameResource {
|
||||
private int queueNum;
|
||||
private int scoinCost;
|
||||
private int priority;
|
||||
private int forgePoint;
|
||||
private List<ItemParamData> materialItems;
|
||||
|
||||
@Override
|
||||
@@ -58,6 +58,10 @@ public class ForgeData extends GameResource {
|
||||
return priority;
|
||||
}
|
||||
|
||||
public int getForgePoint() {
|
||||
return forgePoint;
|
||||
}
|
||||
|
||||
public List<ItemParamData> getMaterialItems() {
|
||||
return materialItems;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import emu.grasscutter.game.inventory.*;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
import lombok.Getter;
|
||||
|
||||
@ResourceType(name = {"MaterialExcelConfigData.json",
|
||||
"WeaponExcelConfigData.json",
|
||||
@@ -19,23 +20,23 @@ import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
public class ItemData extends GameResource {
|
||||
|
||||
private int id;
|
||||
private int stackLimit = 1;
|
||||
private int maxUseCount;
|
||||
private int rankLevel;
|
||||
private String effectName;
|
||||
private int[] satiationParams;
|
||||
private int rank;
|
||||
private int weight;
|
||||
private int gadgetId;
|
||||
@Getter private int stackLimit = 1;
|
||||
@Getter private int maxUseCount;
|
||||
@Getter private int rankLevel;
|
||||
@Getter private String effectName;
|
||||
@Getter private int[] satiationParams;
|
||||
@Getter private int rank;
|
||||
@Getter private int weight;
|
||||
@Getter private int gadgetId;
|
||||
|
||||
private int[] destroyReturnMaterial;
|
||||
private int[] destroyReturnMaterialCount;
|
||||
@Getter private int[] destroyReturnMaterial;
|
||||
@Getter private int[] destroyReturnMaterialCount;
|
||||
|
||||
private List<ItemUseData> itemUse;
|
||||
@Getter private List<ItemUseData> itemUse;
|
||||
|
||||
// Food
|
||||
private String foodQuality;
|
||||
private String useTarget;
|
||||
@Getter private String foodQuality;
|
||||
@Getter private String useTarget;
|
||||
private String[] iseParam;
|
||||
|
||||
// String enums
|
||||
@@ -45,42 +46,42 @@ public class ItemData extends GameResource {
|
||||
private String effectType;
|
||||
private String destroyRule;
|
||||
|
||||
// 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 String icon;
|
||||
private long nameTextMapHash;
|
||||
|
||||
// Post load
|
||||
// Post load enum forms of above
|
||||
private transient MaterialType materialEnumType;
|
||||
private transient ItemType itemEnumType;
|
||||
private transient EquipType equipEnumType;
|
||||
|
||||
private IntSet addPropLevelSet;
|
||||
// Relic
|
||||
@Getter private int mainPropDepotId;
|
||||
@Getter private int appendPropDepotId;
|
||||
@Getter private int appendPropNum;
|
||||
@Getter private int setId;
|
||||
private int[] addPropLevels;
|
||||
@Getter private int baseConvExp;
|
||||
@Getter private int maxLevel;
|
||||
|
||||
// Weapon
|
||||
@Getter private int weaponPromoteId;
|
||||
@Getter private int weaponBaseExp;
|
||||
@Getter private int storyId;
|
||||
@Getter private int avatarPromoteId;
|
||||
@Getter private int awakenMaterial;
|
||||
@Getter private int[] awakenCosts;
|
||||
@Getter private int[] skillAffix;
|
||||
private WeaponProperty[] weaponProp;
|
||||
|
||||
// Hash
|
||||
@Getter private String icon;
|
||||
@Getter private long nameTextMapHash;
|
||||
|
||||
@Getter private IntSet addPropLevelSet;
|
||||
|
||||
// Furniture
|
||||
private int comfort;
|
||||
private List<Integer> furnType;
|
||||
private List<Integer> furnitureGadgetID;
|
||||
@Getter private int comfort;
|
||||
@Getter private List<Integer> furnType;
|
||||
@Getter private List<Integer> furnitureGadgetID;
|
||||
@SerializedName("JFDLJGDFIGL")
|
||||
private int roomSceneId;
|
||||
@Getter private int roomSceneId;
|
||||
|
||||
@Override
|
||||
public int getId(){
|
||||
@@ -91,137 +92,17 @@ public class ItemData extends GameResource {
|
||||
return this.materialType;
|
||||
}
|
||||
|
||||
public int getStackLimit(){
|
||||
return this.stackLimit;
|
||||
}
|
||||
|
||||
public int getMaxUseCount(){
|
||||
return this.maxUseCount;
|
||||
}
|
||||
|
||||
public String getUseTarget(){
|
||||
return this.useTarget;
|
||||
}
|
||||
|
||||
public String[] getUseParam(){
|
||||
return this.iseParam;
|
||||
}
|
||||
|
||||
public int getRankLevel(){
|
||||
return this.rankLevel;
|
||||
}
|
||||
|
||||
public String getFoodQuality(){
|
||||
return this.foodQuality;
|
||||
}
|
||||
|
||||
public String getEffectName(){
|
||||
return this.effectName;
|
||||
}
|
||||
|
||||
public int[] getSatiationParams(){
|
||||
return this.satiationParams;
|
||||
}
|
||||
|
||||
public int[] getDestroyReturnMaterial(){
|
||||
return this.destroyReturnMaterial;
|
||||
}
|
||||
|
||||
public int[] getDestroyReturnMaterialCount(){
|
||||
return this.destroyReturnMaterialCount;
|
||||
}
|
||||
|
||||
public List<ItemUseData> getItemUse() {
|
||||
return itemUse;
|
||||
}
|
||||
|
||||
public long getNameTextMapHash(){
|
||||
return this.nameTextMapHash;
|
||||
}
|
||||
|
||||
public String getIcon(){
|
||||
return this.icon;
|
||||
}
|
||||
|
||||
public String getItemTypeString(){
|
||||
return this.itemType;
|
||||
}
|
||||
|
||||
public int getRank(){
|
||||
return this.rank;
|
||||
}
|
||||
|
||||
public int getGadgetId() {
|
||||
return gadgetId;
|
||||
}
|
||||
|
||||
public int getBaseConvExp() {
|
||||
return baseConvExp;
|
||||
}
|
||||
|
||||
public int getMainPropDepotId() {
|
||||
return mainPropDepotId;
|
||||
}
|
||||
|
||||
public int getAppendPropDepotId() {
|
||||
return appendPropDepotId;
|
||||
}
|
||||
|
||||
public int getAppendPropNum() {
|
||||
return appendPropNum;
|
||||
}
|
||||
|
||||
public int getSetId() {
|
||||
return setId;
|
||||
}
|
||||
|
||||
public int getWeaponPromoteId() {
|
||||
return weaponPromoteId;
|
||||
}
|
||||
|
||||
public int getWeaponBaseExp() {
|
||||
return weaponBaseExp;
|
||||
}
|
||||
|
||||
public int getAwakenMaterial() {
|
||||
return awakenMaterial;
|
||||
}
|
||||
|
||||
public int[] getAwakenCosts() {
|
||||
return awakenCosts;
|
||||
}
|
||||
|
||||
public IntSet getAddPropLevelSet() {
|
||||
return addPropLevelSet;
|
||||
}
|
||||
|
||||
public int[] getSkillAffix() {
|
||||
return skillAffix;
|
||||
}
|
||||
|
||||
public WeaponProperty[] getWeaponProperties() {
|
||||
return weaponProp;
|
||||
}
|
||||
|
||||
public int getMaxLevel() {
|
||||
return maxLevel;
|
||||
}
|
||||
|
||||
public int getComfort() {
|
||||
return comfort;
|
||||
}
|
||||
|
||||
public List<Integer> getFurnType() {
|
||||
return furnType;
|
||||
}
|
||||
|
||||
public List<Integer> getFurnitureGadgetID() {
|
||||
return furnitureGadgetID;
|
||||
}
|
||||
|
||||
public int getRoomSceneId() {
|
||||
return roomSceneId;
|
||||
}
|
||||
|
||||
public ItemType getItemType() {
|
||||
return this.itemEnumType;
|
||||
@@ -274,26 +155,10 @@ public class ItemData extends GameResource {
|
||||
}
|
||||
|
||||
public static class WeaponProperty {
|
||||
private FightProperty fightProp;
|
||||
private String propType;
|
||||
private float initValue;
|
||||
private String type;
|
||||
|
||||
public String getPropType(){
|
||||
return this.propType;
|
||||
}
|
||||
|
||||
public float getInitValue(){
|
||||
return this.initValue;
|
||||
}
|
||||
|
||||
public String getType(){
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public FightProperty getFightProp() {
|
||||
return fightProp;
|
||||
}
|
||||
@Getter private FightProperty fightProp;
|
||||
@Getter private String propType;
|
||||
@Getter private float initValue;
|
||||
@Getter private String type;
|
||||
|
||||
public void onLoad() {
|
||||
this.fightProp = FightProperty.getPropByName(propType);
|
||||
|
||||
Reference in New Issue
Block a user