diff --git a/src/RynthCore.Engine/UI/Data/SettingsData.cs b/src/RynthCore.Engine/UI/Data/SettingsData.cs index 9773081..f582a9a 100644 --- a/src/RynthCore.Engine/UI/Data/SettingsData.cs +++ b/src/RynthCore.Engine/UI/Data/SettingsData.cs @@ -96,6 +96,9 @@ internal sealed class RynthAiSettings public bool? TargetLock { get; set; } // Fight the monster I select (RynthAi 2026-11-01). Null: a RynthAi without it; it leaves it alone. public bool? FightSelectedTarget { get; set; } + // Melee through walls (RynthAi 2026-11-15, on by default). Null until RynthAi sends it; a save from an + // engine with the row never sends null over an older RynthAi's value (it leaves an absent one alone). + public bool? MeleeThroughWalls { get; set; } public int TargetNoProgressTimeoutSec { get; set; } public int GiveQueueIntervalMs { get; set; } = 150; // Recharge @@ -1341,6 +1344,14 @@ internal static class SettingsSchema "another monster or deselect. The bot's own selections never count. Ignored (Priority 0) and\n" + "never-attack monsters are not followed (/ra targetlock still forces them). Out to Disengage Range.\n" + "/ra fightselected [on|off]"), + Bool("Melee through walls", s => s.MeleeThroughWalls ?? true, (s, v) => s.MeleeThroughWalls = v, + "On: melee reaches a monster within 4 m even when the line of sight test says a wall is in the way\n" + + "(a corner, a pillar, a thin dungeon wall: melee lands where the test is too strict). Not across a\n" + + "building's wall: one of you inside its rooms and the other outside is left to the hunt, which walks\n" + + "in through a door.\n" + + "Off: a monster behind a wall is never a melee target for being close; it is treated like any monster\n" + + "out of sight. On by default. /ra meleewalls [on|off]", + when: s => s.MeleeThroughWalls.HasValue), Int("Attempts Before Blacklist", s => s.BlacklistAttempts, (s, v) => s.BlacklistAttempts = v, 1, 20, 1, "How many failed attack attempts on a mob before it gets blacklisted."), Int("Blacklist Timeout (sec)", s => s.BlacklistTimeoutSec, (s, v) => s.BlacklistTimeoutSec = v, 5, 120, 5, diff --git a/tools/CombatSettingsTests/Program.cs b/tools/CombatSettingsTests/Program.cs index 0ec04a0..e773818 100644 --- a/tools/CombatSettingsTests/Program.cs +++ b/tools/CombatSettingsTests/Program.cs @@ -33,6 +33,7 @@ namespace CombatSettingsTests ("EnvironmentSkipSec", typeof(int?), "30"), ("KitePullMeters", typeof(int?), "20"), ("KiteTagFirst", typeof(bool?), "true"), + ("MeleeThroughWalls", typeof(bool?), "true"), // Combat > Targeting > Melee through walls (2026-11-15) }; private static int Main() @@ -99,11 +100,12 @@ namespace CombatSettingsTests ("Combat", "Pull Distance (m)", "Int", 20, 3, 100), ("Combat", "Tag Before Fleeing", "Bool", 1, 0, 1), ("Combat", "Magic Response", "Combo", 0, 0, 3), // beside Missile Response since 2026-11-11 + ("Combat", "Melee through walls", "Bool", 1, 0, 1), // on by default (2026-11-15) }; object older = Parse("{\"BoostNavPriority\":true}"); // what an older RynthAi sends object newer = Parse("{\"VariablePowerMin\":50,\"VariablePowerMax\":100,\"MissileEnvironmentResponse\":0,\"MagicEnvironmentResponse\":0," + "\"EnvironmentImpactLimit\":2,\"EnvironmentImpactWindowSec\":20,\"EnvironmentApproachMeters\":6,\"EnvironmentMinDistance\":3," + - "\"EnvironmentSkipSec\":30,\"KitePullMeters\":20,\"KiteTagFirst\":true}"); // the plugin's own defaults + "\"EnvironmentSkipSec\":30,\"KitePullMeters\":20,\"KiteTagFirst\":true,\"MeleeThroughWalls\":true}"); // the plugin's own defaults foreach (var (tab, label, kind, def, min, max) in rows) { object? row = Row(tab, label, kind); @@ -141,7 +143,9 @@ namespace CombatSettingsTests Set(Row("Combat", "Pull Distance (m)", "Int")!, edit, 55); Set(Row("Combat", "Tag Before Fleeing", "Bool")!, edit, 1); Set(Row("Combat", "Magic Response", "Combo")!, edit, 1); + Set(Row("Combat", "Melee through walls", "Bool")!, edit, 0); string after = JsonSerializer.Serialize(edit, info); + Check(after.Contains("\"MeleeThroughWalls\":false"), "Melee through walls unticked saves false (RynthAi turns it off)"); Check(after.Contains("\"KitePullMeters\":55") && after.Contains("\"KiteTagFirst\":true") && after.Contains("\"MagicEnvironmentResponse\":1"), "the edits land on their own properties"); Check(after.Contains("\"BoostNavPriority\":true") && after.Contains("\"EnvironmentSkipSec\":60") && after.Contains("\"MissileEnvironmentResponse\":2"), "the other settings ride along unchanged");