feat(player): port retail augmentation stat chain
This commit is contained in:
parent
0cb60d98a0
commit
461a1fb7b4
22 changed files with 953 additions and 138 deletions
|
|
@ -3,6 +3,7 @@ using System.Linq;
|
|||
using AcDream.App.UI.Layout;
|
||||
using AcDream.Core.Items;
|
||||
using AcDream.Core.Player;
|
||||
using AcDream.Core.Properties;
|
||||
using AcDream.Core.Spells;
|
||||
using Xunit;
|
||||
|
||||
|
|
@ -285,6 +286,65 @@ public sealed class CharacterSheetProviderTests
|
|||
Assert.Equal(-100, skill.VitaeModifier); // the exact user-reported oracle example
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildSheet_SkillAugmentations_UseRetailBeforeAndAfterOrdering()
|
||||
{
|
||||
var h = new VitaeHarness();
|
||||
var properties = new PropertyBundle();
|
||||
properties.Ints[(uint)PropertyInt.LumAugAllSkills] = 3;
|
||||
properties.Ints[(uint)PropertyInt.AugmentationSkilledMagic] = 1;
|
||||
properties.Ints[(uint)PropertyInt.AugmentationJackOfAllTrades] = 1;
|
||||
properties.Ints[(uint)PropertyInt.LumAugSkilledSpec] = 4;
|
||||
h.Player.OnProperties(properties);
|
||||
h.Player.OnSkillUpdate(
|
||||
skillId: 0x1Fu,
|
||||
ranks: 100u,
|
||||
status: 3u,
|
||||
xp: 0u,
|
||||
init: 0u,
|
||||
resistance: 0u,
|
||||
lastUsed: 0d,
|
||||
formulaBonus: 0u);
|
||||
|
||||
CharacterSkill skill = Assert.Single(h.Provider.BuildSheet().Skills);
|
||||
|
||||
Assert.Equal(113, skill.BaseLevel);
|
||||
Assert.Equal(126, skill.CurrentLevel);
|
||||
Assert.Equal(0, skill.VitaeModifier);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildSheet_VitalPairsCarryBaseAndVitaeContribution()
|
||||
{
|
||||
var h = new VitaeHarness();
|
||||
h.Player.OnAttributeUpdate(
|
||||
atType: 2u,
|
||||
ranks: 100u,
|
||||
start: 100u,
|
||||
xp: 0u);
|
||||
h.Player.OnVitalUpdate(
|
||||
vitalId: 7u,
|
||||
ranks: 0u,
|
||||
start: 100u,
|
||||
xp: 0u,
|
||||
current: 150u);
|
||||
h.Book.OnEnchantmentAdded(new ActiveEnchantmentRecord(
|
||||
SpellId: 1u,
|
||||
LayerId: 1u,
|
||||
Duration: -1d,
|
||||
CasterGuid: 0u,
|
||||
StatModType: 0u,
|
||||
StatModKey: 0u,
|
||||
StatModValue: 0.8f,
|
||||
Bucket: 4u));
|
||||
|
||||
CharacterSheet sheet = h.Provider.BuildSheet();
|
||||
|
||||
Assert.Equal(200, sheet.VitalBaseMaxValues[0]);
|
||||
Assert.Equal(-40, sheet.VitalVitaeModifiers[0]);
|
||||
Assert.Equal(160, sheet.HealthMax);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SubscribeChanged_FiresOnEnchantmentsChanged_AndRebuildReflectsNewValue()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue