Commit ed448a9f authored by SpikeHD's avatar SpikeHD
Browse files

properly add ascension-locked talents

parent cc9beed9
...@@ -4,6 +4,7 @@ import emu.grasscutter.Grasscutter; ...@@ -4,6 +4,7 @@ import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.GenshinData; import emu.grasscutter.data.GenshinData;
import emu.grasscutter.data.def.ItemData; import emu.grasscutter.data.def.ItemData;
import emu.grasscutter.data.def.AvatarData; import emu.grasscutter.data.def.AvatarData;
import emu.grasscutter.data.def.AvatarSkillDepotData;
import emu.grasscutter.data.def.MonsterData; import emu.grasscutter.data.def.MonsterData;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.World; import emu.grasscutter.game.World;
...@@ -254,6 +255,9 @@ public final class PlayerCommands { ...@@ -254,6 +255,9 @@ public final class PlayerCommands {
GenshinAvatar avatar = new GenshinAvatar(avatarID); GenshinAvatar avatar = new GenshinAvatar(avatarID);
avatar.setLevel(level); avatar.setLevel(level);
avatar.setPromoteLevel(ascension); avatar.setPromoteLevel(ascension);
// This will handle stats and talents
avatar.recalcStats();
targetPlayer.addAvatar(avatar); targetPlayer.addAvatar(avatar);
} }
...@@ -291,6 +295,9 @@ public final class PlayerCommands { ...@@ -291,6 +295,9 @@ public final class PlayerCommands {
GenshinAvatar avatar = new GenshinAvatar(avatarID); GenshinAvatar avatar = new GenshinAvatar(avatarID);
avatar.setLevel(level); avatar.setLevel(level);
avatar.setPromoteLevel(ascension); avatar.setPromoteLevel(ascension);
// This will handle stats and talents
avatar.recalcStats();
targetPlayer.addAvatar(avatar); targetPlayer.addAvatar(avatar);
} catch (NumberFormatException ignored) { } catch (NumberFormatException ignored) {
......
...@@ -510,6 +510,21 @@ public class GenshinAvatar { ...@@ -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 // Proud skills
for (int proudSkillId : this.getProudSkillList()) { for (int proudSkillId : this.getProudSkillList()) {
ProudSkillData proudSkillData = GenshinData.getProudSkillDataMap().get(proudSkillId); ProudSkillData proudSkillData = GenshinData.getProudSkillDataMap().get(proudSkillId);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment