Skip to content

Commit

Permalink
Fixed master skills in skill list
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-n committed Aug 29, 2023
1 parent dd042e3 commit a1243dd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/GameLogic/SkillList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ public async ValueTask AddLearnedSkillAsync(Skill skill)
skillEntry.Skill = skill;
skillEntry.Level = 0;
await this.AddLearnedSkillAsync(skillEntry).ConfigureAwait(false);

if (skill.MasterDefinition?.ReplacedSkill is { } replacedSkill)
{
await this._player.InvokeViewPlugInAsync<ISkillListViewPlugIn>(p => p.RemoveSkillAsync(replacedSkill)).ConfigureAwait(false);
}
}

/// <inheritdoc/>
Expand Down Expand Up @@ -137,11 +142,14 @@ private async ValueTask AddLearnedSkillAsync(SkillEntry skill)
this._availableSkills.Add(skill.Skill!.Number.ToUnsigned(), skill);
this._learnedSkills.Add(skill);

await this._player.InvokeViewPlugInAsync<ISkillListViewPlugIn>(p => p.AddSkillAsync(skill.Skill)).ConfigureAwait(false);
if (skill.Skill.SkillType == SkillType.PassiveBoost)
{
this.CreatePowerUpForPassiveSkill(skill);
}
else
{
await this._player.InvokeViewPlugInAsync<ISkillListViewPlugIn>(p => p.AddSkillAsync(skill.Skill)).ConfigureAwait(false);
}
}

private void CreatePowerUpForPassiveSkill(SkillEntry skillEntry)
Expand Down
1 change: 1 addition & 0 deletions src/GameServer/RemoteView/Character/SkillListViewPlugIn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ protected void BuildSkillList()
{
var replacedSkills = skills.Select(entry => entry.Skill?.MasterDefinition?.ReplacedSkill).Where(skill => skill != null);
skills.RemoveAll(s => replacedSkills.Contains(s.Skill));
skills.RemoveAll(s => s.Skill?.SkillType == SkillType.PassiveBoost);
}

skills.RemoveAll(s => s.Skill?.Number == ForceWaveSkillId);
Expand Down
4 changes: 2 additions & 2 deletions src/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("0.7.17.0")]
[assembly: AssemblyFileVersion("0.7.17.0")]
[assembly: AssemblyVersion("0.7.18.0")]
[assembly: AssemblyFileVersion("0.7.18.0")]

0 comments on commit a1243dd

Please sign in to comment.