fix: Consolidates debug check messages for AI and adds debounce (#2235)

This commit is contained in:
Kamron Batman 2025-07-18 18:08:03 -07:00 • committed by GitHub
parent 8f88de68a7
commit f89150735e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 838 additions and 594 deletions

View file

@ -0,0 +1,20 @@
using System.Runtime.CompilerServices;
using Server.Mobiles.AI.BaseAI;
namespace Server.Mobiles;
public static class BaseAIExtensions
{
public static void DebugSayFormatted(this BaseAI ai,
[InterpolatedStringHandlerArgument("ai")] ref DebugInterpolatedStringHandler handler, int cooldownMs = 5000)
{
var message = handler.Text;
if (message.Length > 0)
{
ai.Mobile.PublicOverheadMessage(MessageType.Regular, 41, false, message.ToString());
ai.NextDebugMessage = Core.TickCount + cooldownMs;
}
handler.Clear();
}
}