Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection of War Stories skillbook proportional skill gain fix #15281

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ public class GiveSkill
/// </summary>
public readonly bool Proportional;
/// <summary>
/// What is the maximum skill amount that can be added proportionally.
/// </summary>
public readonly float ProportionalMaxAmount;
/// <summary>
/// Should the skill increase popup be always shown regardless of how much the skill increases?
/// Normally it's only shown when the skill reaches the next integer value.
/// </summary>
Expand All @@ -396,6 +400,7 @@ public GiveSkill(ContentXElement element, string parentDebugName)
TriggerTalents = element.GetAttributeBool(nameof(TriggerTalents), true);
UseDeltaTime = element.GetAttributeBool(nameof(UseDeltaTime), false);
Proportional = element.GetAttributeBool(nameof(Proportional), false);
ProportionalMaxAmount = element.GetAttributeFloat(nameof(ProportionalMaxAmount), 2);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will cause backwards compatibility problems, because the value defaults to 2 (when previously there was no limit). Items that used to give more than 2 proportional skill will now only give up to 2.

AlwayShowNotification = element.GetAttributeBool(nameof(AlwayShowNotification), false);

if (SkillIdentifier == Identifier.Empty)
Expand Down Expand Up @@ -1975,7 +1980,7 @@ protected void Apply(float deltaTime, Entity entity, IReadOnlyList<ISerializable

if (giveSkill.Proportional)
{
targetCharacter.Info?.ApplySkillGain(skillIdentifier, amount, !giveSkill.TriggerTalents, forceNotification: giveSkill.AlwayShowNotification);
targetCharacter.Info?.ApplySkillGain(skillIdentifier, amount, !giveSkill.TriggerTalents, giveSkill.ProportionalMaxAmount, giveSkill.AlwayShowNotification);
}
else
{
Expand Down