Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
1c691748
Commit
1c691748
authored
Apr 25, 2022
by
Melledy
Browse files
Make monsters scale off world level
parent
f28f21b0
Changes
3
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/data/GenshinData.java
View file @
1c691748
...
...
@@ -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
;
}
}
src/main/java/emu/grasscutter/data/def/WorldLevelData.java
0 → 100644
View file @
1c691748
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
()
{
}
}
src/main/java/emu/grasscutter/game/GenshinScene.java
View file @
1c691748
...
...
@@ -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
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment