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
ed448a9f
Commit
ed448a9f
authored
Apr 19, 2022
by
SpikeHD
Browse files
properly add ascension-locked talents
parent
cc9beed9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/commands/PlayerCommands.java
View file @
ed448a9f
...
...
@@ -4,6 +4,7 @@ import emu.grasscutter.Grasscutter;
import
emu.grasscutter.data.GenshinData
;
import
emu.grasscutter.data.def.ItemData
;
import
emu.grasscutter.data.def.AvatarData
;
import
emu.grasscutter.data.def.AvatarSkillDepotData
;
import
emu.grasscutter.data.def.MonsterData
;
import
emu.grasscutter.game.GenshinPlayer
;
import
emu.grasscutter.game.World
;
...
...
@@ -254,6 +255,9 @@ public final class PlayerCommands {
GenshinAvatar
avatar
=
new
GenshinAvatar
(
avatarID
);
avatar
.
setLevel
(
level
);
avatar
.
setPromoteLevel
(
ascension
);
// This will handle stats and talents
avatar
.
recalcStats
();
targetPlayer
.
addAvatar
(
avatar
);
}
...
...
@@ -291,6 +295,9 @@ public final class PlayerCommands {
GenshinAvatar
avatar
=
new
GenshinAvatar
(
avatarID
);
avatar
.
setLevel
(
level
);
avatar
.
setPromoteLevel
(
ascension
);
// This will handle stats and talents
avatar
.
recalcStats
();
targetPlayer
.
addAvatar
(
avatar
);
}
catch
(
NumberFormatException
ignored
)
{
...
...
src/main/java/emu/grasscutter/game/avatar/GenshinAvatar.java
View file @
ed448a9f
...
...
@@ -510,6 +510,21 @@ public class GenshinAvatar {
}
}
// Add proud skills and unlock them if needed
AvatarSkillDepotData
skillDepot
=
GenshinData
.
getAvatarSkillDepotDataMap
().
get
(
this
.
getSkillDepotId
());
this
.
getProudSkillList
().
clear
();
for
(
InherentProudSkillOpens
openData
:
skillDepot
.
getInherentProudSkillOpens
())
{
if
(
openData
.
getProudSkillGroupId
()
==
0
)
{
continue
;
}
if
(
openData
.
getNeedAvatarPromoteLevel
()
<=
this
.
getPromoteLevel
())
{
int
proudSkillId
=
(
openData
.
getProudSkillGroupId
()
*
100
)
+
1
;
if
(
GenshinData
.
getProudSkillDataMap
().
containsKey
(
proudSkillId
))
{
this
.
getProudSkillList
().
add
(
proudSkillId
);
}
}
}
// Proud skills
for
(
int
proudSkillId
:
this
.
getProudSkillList
())
{
ProudSkillData
proudSkillData
=
GenshinData
.
getProudSkillDataMap
().
get
(
proudSkillId
);
...
...
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