mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2024-11-23 12:29:52 +00:00
properly add ascension-locked talents
This commit is contained in:
parent
cc9beed961
commit
ed448a9f84
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user