Hold independent work while companions regroup and leaders wait
Core tests / core (push) Successful in 36s

This commit is contained in:
Codex
2026-09-24 05:58:16 +12:00
parent 6b8ce612ad
commit 900b926b8e
3 changed files with 50 additions and 16 deletions
+4
View File
@@ -61,3 +61,7 @@ l=new();l.execute("A.hp=80;step(0);A.hp=100;local query=AuthDBQuery;function Aut
print('Readiness holds, mana recovery, outnumbered/rapid-loss retreat, and original-strategy restoration passed')
l=new();l.execute("A.combat=true;A.hp=75;A.attackers={1,2};A.enemy={GetGUID=function()return 999 end,GetLevel=function()return 5 end,ToCreature=function()return nil end};step(0);A.selected=A.enemy;A.combat=false;A.hp=100;A.attackers={};step(20);assert(A.attackStopped and calls[#calls]=='flee');A.attackStopped=false;step(601);assert(not A.attackStopped)")
print('Dangerous encounter target avoidance expires after ten minutes')
l=new();l.execute("group();A.distance=50;B.distance=50;A.strategies={rpg=true,grind=true};B.strategies={rpg=true,gather=true};step(0);assert(A.waited and not A.strategies.rpg and not B.strategies.gather);assert(AzerothAISurvivalOverride(A) and AzerothAISurvivalOverride(B));B.distance=9;step(8);assert(AzerothAISurvivalOverride(B));B.distance=5;A.distance=5;step(30);assert(not AzerothAISurvivalOverride(B),'Caught-up bot must release the hold')")
l=new();l.execute("group();B.distance=50;B.combat=true;B.hp=20;step(0);assert(calls[1]=='flee','Survival outranks regrouping');assert(not B.master)")
l=new();l.execute("group();A.distance=40;step(0);A.waited=false;step(22);assert(not A.waited,'Leader waiting must remain bounded');A.distance=5;step(2);A.distance=40;step(2);assert(A.waited,'A fresh separation starts a fresh wait')")
print('Cohesion suppresses competing work, keeps catch-up hysteresis, yields to danger, and resets bounded waits')