Commit graph RynthSuite/Tools/RynthCore.RynthAiHostTests/Program.cs
Author SHA1 Message Date
Daniel Wallace
23c3359f77 Vitals: no wand swap for a vital spell while a kit or potion heals
Kits are the standard heal, and the shield stays on: putting the shield
away for a wand costs more damage than a small heal spell buys back. A
melee character under Heal At put its shield away and pulled a wand for
Heal Self with kits in the pack; the wand was skipped only at Emergency
Heal At.

CastVital (Heal Self, Stamina to Health, Revitalize, Stamina to Mana and
the script hook's heal) now refuses as not handled when the character is
out of Magic mode, no caster is in hand, and a usable kit or potion for
that vital is carried (BuffManager.VitalWandGate.cs). The chain falls
through to the potion and the kit despite Kit Min Success.

- With no kit and no potion at all the swap is still allowed.
- A caster already wielded still gets the Magic stance change (no weapon
  moves); the wielded-wand check is extracted from EnsureMagicMode into
  IsBuffWandWielded so the gate and the swap agree. With no wand found
  the Magic stance goes bare-handed (no weapon moves): not gated either.
- A swap already under way finishes.
- Stamina to Mana never swaps in a fight (InCombatNow), potion or not;
  out of a fight it may, even with a mana potion carried.
- A kit counts only if the kit picks would use it: the live pack walk,
  minus a kit its line called used up, minus a kit the server refused 3
  times within 10 s. A streak with no refusal for 10 s ages out; a kit
  landing, or the macro stopping, ends every streak.
- The stamina sources share one order (AttemptStaminaRestore) for the
  stamina step, the mana step's refill and the buffing mana floor, ending
  with the stamina kit despite Stamina Kit Min Success % as the last
  resort, since Revitalize is refused here.
- Buffing is unchanged and still swaps.

Tests: VitalWandGateTests (new, 17).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 09:35:14 -08:00
Daniel Wallace
493cca6bea Vitals: a kit its result line calls used up is not picked again
A kit's last heal ends "... Your Treated Healing Kit is used up." (ACE
Healer.DoHealing) and the server removes the kit. A use of an item the
player no longer has is answered with a bare UseDone and no chat, so a
used-up kit picked again is a heal lost.

Kit picks read the client's live pack walk (ConsumableLookup.Resolve,
BestPackHealingKit, BestPackStaminaKit), which drops the removed kit, but
a walk is reused for up to 1 s (DirectInventoryCooldownMs), and the next
kit goes out 700 ms after the line (KitLandGraceMs): inside that reuse
the used-up kit was picked again. An engine without GetContainerContents
has no walk at all; its inventory view is the object cache, which can
keep the removed kit for good.

Now the "is used up" line, when it names the kit in flight, makes every
kit pick skip that kit: for 3 s (UsedUpKitSkipMs) with the live walk, long
enough for a fresh walk to have dropped it, and for the session without
it (the server deleted the object; its id never comes back). A line
naming another kit (a late line from a kit that timed out) is logged and
ignored. ConsumableLookup.Resolve takes an optional skip predicate; a
skipped listed id falls through to the name match. Healing and stamina
kits.

WorldObjectCache.WalkClock: the clock GetDirectInventory's reuse runs on
(RynthClock unless a test sets it), so the tests can hold the walk still
and prove the skip, not a refreshed walk, keeps the kit out.

Ported from the earlier kit-drop work onto the live-walk lookup: the rest
of that work (dropping a kit after two bare answers, the 5 minute drop,
the emergency last resort for dropped kits, dropped potion stacks) is
covered by the live walk and is not carried.

Tests: KitUsedUpTests (new, 6). The walk-window cases fail on main and
with KitUsedUp stubbed to false; the no-walk case fails with a 3 s skip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 09:32:29 -08:00
7166d256ce RynthSuite as of 2026-11-05 (internal a77109a): release 2026.11.3.2 2026-11-05 07:42:37 -05:00
d02690c0d2 RynthSuite as of 2026-11-03 (internal bebcd8c): release 2026.11.3.1 2026-11-03 07:37:26 -05:00
79cbb84d61 Snapshot for release 2026.11.2.1 (internal 03dbb32) 2026-11-02 03:33:34 -05:00
e73d4afb04 Snapshot for release 2026.10.31.4 (internal b309731) 2026-11-01 18:47:29 -05:00
d54613aa63 Snapshot for release 2026.10.31.2 (internal 4a0710c) 2026-10-31 19:00:25 -04:00
76aca938b6 Snapshot for release 2026.10.30.1 (internal 50ae062) 2026-10-31 06:01:30 -04:00
aa8bf65897 Snapshot for release 2026.10.29.3 (internal f81a090) 2026-10-29 15:22:43 -04:00
e6642d0e10 Snapshot for release 2026.10.28.3 (internal db7f094) 2026-10-28 23:23:42 -04:00
636adfcef2 Snapshot for release 2026.10.28.2 (internal 48c46bd) 2026-10-28 19:47:19 -04:00
b23cabc338 Snapshot for release 2026.10.28.1 (internal decb3ab) 2026-10-28 06:36:39 -04:00
2dd532963f Snapshot for release 2026.10.27.1 (internal 48d0d60) 2026-10-27 08:41:02 -04:00
92f28bd243 Snapshot for release 2026.10.23.1 (internal 7581cff) 2026-10-23 16:34:02 -04:00
893973d0dd Snapshot for release 2026.10.22.2 (internal e613280) 2026-10-22 16:42:33 -04:00
10c58b53b6 Snapshot for release 2026.10.21.3 (internal 24a7b4f) 2026-10-21 21:03:48 -04:00
d0c95956a0 Snapshot for release 2026.10.21.1 (internal 7a4c0dd) 2026-10-21 09:35:07 -04:00
bfcd48950d Snapshot for release 2026.10.20.1 (internal 7116fab) 2026-10-20 21:28:18 -04:00
39de36d3af Snapshot for release 2026.10.19.1 (internal f0bdcf8) 2026-10-19 09:11:22 -04:00
c7807b6e1c Snapshot for release 2026.10.17.1 (internal 759f36d) 2026-10-17 00:41:03 -04:00
3cce8ffcba Snapshot for release 2026.10.15.3 (internal d7a5b0f) 2026-10-15 21:40:02 -04:00
d5e0b50de7 Snapshot for release 2026.10.15.2 (internal 2d4b0af) 2026-10-15 20:32:35 -04:00
e25cb7c9ae Snapshot for release 2026.10.13.3 (internal 8440a2e) 2026-10-13 18:52:40 -04:00
56b9f6c813 Snapshot for release 2026.10.13.2 (internal 6cd69e2) 2026-10-13 15:07:08 -04:00
319740ff5d Snapshot for release 2026.10.13.1 (internal d2b5fb3) 2026-10-13 14:25:49 -04:00
3c4f093e3d Snapshot for release 2026.10.12.1 (internal 8d252bd) 2026-10-12 00:33:13 -04:00
504a6f080a Snapshot for release 2026.10.11.1 (internal d20160b) 2026-10-11 15:00:56 -04:00
e6fffb0f42 Snapshot for release 2026.10.9.3 (internal 8c6b770) 2026-10-09 21:42:40 -04:00
0daf0a44a3 Snapshot for release 2026.10.8.1 (internal f3d67ec) 2026-10-08 17:29:51 -04:00
26907e6ab1 Snapshot for release 2026.10.7.1 (internal 2a9c773) 2026-10-07 12:54:26 -04:00
dafd6084a7 Snapshot for release 2026.10.6.2 (internal e3a94cf)
Faster weapon switches; T11 loot support (by SilentKelpie, rynth/RynthSuite PR #3).
2026-10-06 11:21:16 -04:00
5416e8066a Snapshot for release 2026.10.6.1 (internal bd2f068) 2026-10-06 08:47:11 -04:00
6847868401 RynthSuite as of 2026-10-05 evening (internal a078b8e): release 2026.10.5.20 - healing delay fixes, stuck-cast safeguards, buffs over items, slayers recognised and chosen first, recover my corpse, /ub give and /mt give, Mana Tap skips wands, dungeon floor-plan bake, heal latency log 2026-10-05 14:59:43 -04:00
53438c65c1 RynthSuite as of 2026-10-05 (internal 8b7d487): navigation no longer stalls after doorway turns, faster target and attack, corpses used from a distance and closed after looting, patrol wall clearance, add-to-loot-profile from an item, WCID loot rules, scroll and slayer fixes, release 2026.10.5.1 2026-10-05 08:03:08 -04:00
12ca25f911 RynthSuite as of 2026-10-04 (internal c94715f): RynthOracle (based on Oracle of Dereth by Advis Eveldan) and RynthInventory, RynthAi patrol doorways and rooms, healing priority, strict monster priority, finish the wounded target, slayer weapons, arcs when clear, blasts like rings, learn unknown spells, looting fixes, release 2026.10.4.6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 18:34:29 -04:00