Event pages and NPC move routes on RPG maps; rpg action schemas; walk test passes the RPG Plus prologue
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e1b733ea01
commit
afc49a16e0
18 files changed
+550
-15
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "RPG Walk Test",
|
||||
"description": "Integration test of the rpg mod on the rpg_demo game: real WASD/E key events walk the hero, collide, read a sign, turn an NPC, go through a door teleport, flip events by a story flag, fight a battle that returns to the same cell with the win flag set. A pickup the suite adds to the village through its own map_events file is picked up and must stay gone after leaving the map and coming back, and after a save is loaded. Activated by --itest=rpg_walk with --game=rpg_demo --new; --shots=<dir> saves screenshots (windowed runs only).",
|
||||
"description": "Integration test of the rpg mod on the rpg_plus game (its rpg_demo_game world): real WASD/E key events walk the hero, collide, read a sign, turn an NPC, go through a door teleport, flip events by a story flag, fight a battle that returns to the same cell with the win flag set. A pickup the suite adds to the village through its own map_events file is picked up and must stay gone after leaving the map and coming back, and after a save is loaded. Activated by --itest=rpg_walk with --game=rpg_plus --new (the prologue is clicked through first); --shots=<dir> saves screenshots (windowed runs only).",
|
||||
"sources": [
|
||||
"src/*.cs"
|
||||
],
|
||||
|
||||
@@ -97,6 +97,8 @@ namespace Cthangover.Mods.Rpg.Tests
|
||||
switch (step)
|
||||
{
|
||||
case 0:
|
||||
if (Boot.IsReady && SkipPrologue())
|
||||
return;
|
||||
if (Boot.IsReady && View?.Map?.ID == Village)
|
||||
Next();
|
||||
return;
|
||||
@@ -319,6 +321,26 @@ namespace Cthangover.Mods.Rpg.Tests
|
||||
}
|
||||
|
||||
/// <summary>Advances a running dialog with the action key; true while it is still running.</summary>
|
||||
/// <summary>
|
||||
/// The game opens with a novel-style prologue (no map yet): its lines are clicked
|
||||
/// through and every choice takes the first answer. True while it runs.
|
||||
/// </summary>
|
||||
private static bool SkipPrologue()
|
||||
{
|
||||
// Asking for the dialog box before the first scene is up caches the wrong node.
|
||||
var scene = ((SceneTree)Engine.GetMainLoop()).Root.GetNodeOrNull<SceneManager>("SceneManager")?.CurrentSceneName;
|
||||
if (string.IsNullOrEmpty(scene) || RpgWorldHost.Current?.View?.Map != null)
|
||||
return false;
|
||||
var box = RpgInput.FindDialogBox();
|
||||
if (box == null || !box.IsRunning)
|
||||
return false;
|
||||
if (box.IsWaitingAnswer)
|
||||
box.TrySelectVariant(0);
|
||||
else
|
||||
box.NextAction();
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool AdvanceDialog()
|
||||
{
|
||||
var box = RpgInput.FindDialogBox();
|
||||
|
||||
Reference in new issue
Block a user