RynthServers as of 2026-11-08 (internal 865b704): release 2026.11.8.2
This commit is contained in:
parent
e52923ba5c
commit
3dd7e983c3
7 changed files with 214 additions and 57 deletions
|
|
@ -30,6 +30,7 @@ internal static class DreamWeaveSkillsTests
|
|||
r.Add("dreamweave skills: the Attributes page (rows, values, footer, bar)", Attributes);
|
||||
r.Add("dreamweave skills: the Titles page (the server's list, updates, saving)", Titles);
|
||||
r.Add("dreamweave skills: one main panel at a time, as retail", OnePanel);
|
||||
r.Add("dreamweave skills: +10 presses made while a raise is on its way wait for its answer", HeldPresses);
|
||||
}
|
||||
|
||||
private static void Attributes()
|
||||
|
|
@ -175,7 +176,8 @@ internal static class DreamWeaveSkillsTests
|
|||
Check.True(SkillsLayout.CanRaiseTen(rich, Skill(14, SkillClass.Trained, ten: 12000)), "ten affordable");
|
||||
Check.False(SkillsLayout.CanRaiseTen(rich, Skill(14, SkillClass.Trained, ten: 90_000)), "ten too dear");
|
||||
Check.False(SkillsLayout.CanRaiseOne(rich, Skill(14, SkillClass.Trained, one: -1, raisable: false)), "at the top");
|
||||
Check.False(SkillsLayout.CanRaiseOne(rich with { Busy = true }, Skill(14, SkillClass.Trained)), "an earlier raise still pending");
|
||||
Check.True(SkillsLayout.CanRaiseOne(rich with { Busy = true }, Skill(14, SkillClass.Trained)), "lit while an earlier raise is on its way (the press is held)");
|
||||
Check.True(SkillsLayout.CanRaiseTen(rich with { Busy = true }, Skill(14, SkillClass.Trained, ten: 12000)), "+10 too");
|
||||
Check.True(SkillsLayout.CanRaiseOne(rich, Skill(23, SkillClass.Untrained, credits: 6, trainable: true)), "train with credits");
|
||||
Check.False(SkillsLayout.CanRaiseOne(rich with { SkillCredits = 5 }, Skill(23, SkillClass.Untrained, credits: 6, trainable: true)), "not enough credits");
|
||||
Check.False(SkillsLayout.CanRaiseTen(rich, Skill(23, SkillClass.Untrained, credits: 6, trainable: true)), "no +10 for untrained");
|
||||
|
|
@ -312,4 +314,56 @@ internal static class DreamWeaveSkillsTests
|
|||
rule.Reset();
|
||||
Check.Eq(rule.Next(true, Map), default(OnePanelRule.Step), "after a reset the first frame only learns again");
|
||||
}
|
||||
|
||||
private static void HeldPresses()
|
||||
{
|
||||
var held = new HeldRaises();
|
||||
var ten = new RaiseTarget(RaiseTarget.Skill, 14, Ten: true);
|
||||
Check.False(held.Next(0, busy: false, out _), "nothing pressed");
|
||||
held.Press(ten, 0);
|
||||
Check.True(held.Next(0, busy: false, out RaiseTarget t) && t == ten, "a press goes at once when nothing is on its way");
|
||||
held.Sent();
|
||||
// Spamming while the first is on its way: each waits, none is lost.
|
||||
held.Press(ten, 100); held.Press(ten, 150); held.Press(ten, 200);
|
||||
Check.Eq(held.Count, 3, "three held");
|
||||
Check.False(held.Next(250, busy: true, out _), "not while the last raise hasn't landed");
|
||||
Check.True(held.Next(300, busy: false, out _), "its answer is in: the next goes");
|
||||
held.Sent();
|
||||
Check.Eq(held.Count, 2, "one per answer");
|
||||
// Another button or row is a new decision.
|
||||
var one = new RaiseTarget(RaiseTarget.Skill, 14, Ten: false);
|
||||
held.Press(one, 400);
|
||||
Check.Eq(held.Count, 1, "another target replaces what waited");
|
||||
held.Drop();
|
||||
Check.Eq(held.Count, 0, "refused: all forgotten");
|
||||
// Train never waits twice: once trained the same arrow raises, which wasn't asked for.
|
||||
var train = new RaiseTarget(RaiseTarget.Train, 23, Ten: false);
|
||||
held.Press(train, 500); held.Press(train, 520);
|
||||
Check.Eq(held.Count, 1, "one train");
|
||||
held.Drop();
|
||||
for (int i = 0; i < 50; i++) held.Press(ten, 600);
|
||||
Check.Eq(held.Count, HeldRaises.Max, "capped");
|
||||
Check.False(held.Next(600 + HeldRaises.ForgetMs + 1, busy: false, out _), "forgotten when no answer came");
|
||||
Check.Eq(held.Count, 0, "and dropped");
|
||||
|
||||
// The Attributes tab (2026-11-08: the fix has to reach it too): +10 on Strength and on a vital are
|
||||
// held like a skill's, one per answer, not capped at one like train.
|
||||
var str = new RaiseTarget(RaiseTarget.Attribute, 1, Ten: true);
|
||||
held.Press(str, 10_000);
|
||||
Check.True(held.Next(10_000, busy: false, out t) && t == str, "an attribute +10 goes at once");
|
||||
held.Sent();
|
||||
for (int i = 0; i < 4; i++) held.Press(str, 10_050 + i);
|
||||
Check.Eq(held.Count, 4, "attribute +10 spam: four held");
|
||||
Check.False(held.Next(10_100, busy: true, out _), "attribute: not while the last raise is on its way");
|
||||
Check.True(held.Next(10_200, busy: false, out t) && t == str, "attribute: the next goes when it lands");
|
||||
held.Sent();
|
||||
Check.Eq(held.Count, 3, "attribute: one per answer");
|
||||
// A vital with the same id is another target (Kind 2), so it replaces what waited.
|
||||
var vital = new RaiseTarget(RaiseTarget.Vital, 1, Ten: true);
|
||||
held.Press(vital, 10_300);
|
||||
Check.Eq(held.Count, 1, "a vital is not the attribute with the same id");
|
||||
held.Press(vital, 10_310); held.Press(vital, 10_320);
|
||||
Check.Eq(held.Count, 3, "vital +10 spam is held too");
|
||||
held.Drop();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@
|
|||
<Compile Include="..\..\Plugins\RynthCore.Plugin.RynthDreamWeave\DreamWeave\SkillsSheet.cs" Link="DreamWeave\SkillsSheet.cs" />
|
||||
<Compile Include="..\..\Plugins\RynthCore.Plugin.RynthDreamWeave\DreamWeave\AttributesTitles.cs" Link="DreamWeave\AttributesTitles.cs" />
|
||||
<Compile Include="..\..\Plugins\RynthCore.Plugin.RynthDreamWeave\DreamWeave\OnePanelRule.cs" Link="DreamWeave\OnePanelRule.cs" />
|
||||
<Compile Include="..\..\Plugins\RynthCore.Plugin.RynthDreamWeave\DreamWeave\HeldRaises.cs" Link="DreamWeave\HeldRaises.cs" />
|
||||
<!-- The RynthAi test tools' check/runner harness (no plugin code in it). -->
|
||||
<Compile Include="$(RynthSuiteRoot)Tools\RynthCore.RynthAiTests\Harness\Check.cs" Link="Harness\Check.cs" />
|
||||
<Compile Include="$(RynthSuiteRoot)Tools\RynthCore.RynthAiTests\Harness\Runner.cs" Link="Harness\Runner.cs" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue