mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-30 18:42:12 +00:00
Make monsters scale off world level
This commit is contained in:
parent
b0322fa3e5
commit
a9b7a5a5f6
@ -60,6 +60,7 @@ public class GenshinData {
|
||||
private static final Int2ObjectMap<FetterData> fetterDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<FetterCharacterCardData> fetterCharacterCardDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<RewardData> rewardDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<WorldLevelData> worldLevelDataMap = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
// Cache
|
||||
private static Map<Integer, List<Integer>> fetters = new HashMap<>();
|
||||
@ -260,4 +261,8 @@ public class GenshinData {
|
||||
|
||||
return fetters;
|
||||
}
|
||||
|
||||
public static Int2ObjectMap<WorldLevelData> getWorldLevelDataMap() {
|
||||
return worldLevelDataMap;
|
||||
}
|
||||
}
|
||||
|
24
src/main/java/emu/grasscutter/data/def/WorldLevelData.java
Normal file
24
src/main/java/emu/grasscutter/data/def/WorldLevelData.java
Normal file
@ -0,0 +1,24 @@
|
||||
package emu.grasscutter.data.def;
|
||||
|
||||
import emu.grasscutter.data.GenshinResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
|
||||
@ResourceType(name = "WorldLevelExcelConfigData.json")
|
||||
public class WorldLevelData extends GenshinResource {
|
||||
private int Level;
|
||||
private int MonsterLevel;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.Level;
|
||||
}
|
||||
|
||||
public int getMonsterLevel() {
|
||||
return MonsterLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
|
||||
}
|
||||
}
|
@ -17,6 +17,7 @@ import emu.grasscutter.data.GenshinDepot;
|
||||
import emu.grasscutter.data.GenshinResource;
|
||||
import emu.grasscutter.data.def.MonsterData;
|
||||
import emu.grasscutter.data.def.SceneData;
|
||||
import emu.grasscutter.data.def.WorldLevelData;
|
||||
import emu.grasscutter.game.entity.EntityAvatar;
|
||||
import emu.grasscutter.game.entity.EntityClientGadget;
|
||||
import emu.grasscutter.game.entity.EntityGadget;
|
||||
@ -337,6 +338,14 @@ public class GenshinScene {
|
||||
}
|
||||
}
|
||||
|
||||
// World level
|
||||
WorldLevelData worldLevelData = GenshinData.getWorldLevelDataMap().get(player.getWorldLevel());
|
||||
int worldLevelOverride = 0;
|
||||
|
||||
if (worldLevelData != null) {
|
||||
worldLevelOverride = worldLevelData.getMonsterLevel();
|
||||
}
|
||||
|
||||
// Todo
|
||||
List<GenshinEntity> toAdd = new LinkedList<>();
|
||||
List<GenshinEntity> toRemove = new LinkedList<>();
|
||||
@ -350,7 +359,7 @@ public class GenshinScene {
|
||||
continue;
|
||||
}
|
||||
|
||||
EntityMonster entity = new EntityMonster(this, data, entry.getPos(), entry.getLevel());
|
||||
EntityMonster entity = new EntityMonster(this, data, entry.getPos(), worldLevelOverride > 0 ? worldLevelOverride : entry.getLevel());
|
||||
entity.getRotation().set(entry.getRot());
|
||||
entity.setGroupId(entry.getGroup().getGroupId());
|
||||
entity.setPoseId(entry.getPoseId());
|
||||
|
Loading…
Reference in New Issue
Block a user