This commit is contained in:
2025-12-12 20:15:24 +08:00
parent 8141c6cad2
commit a12fccc06e
9 changed files with 380 additions and 373 deletions

View File

@@ -24,15 +24,17 @@ namespace WulaFallenEmpire.EventSystem.AI.Tools
{
// Parse args: {"request": "..."}
string request = "";
var cleanArgs = args.Trim('{', '}').Replace("\"", "");
var parts = cleanArgs.Split(':');
if (parts.Length >= 2)
try
{
request = parts[1].Trim();
var parsed = SimpleJsonParser.Parse(args);
if (parsed.TryGetValue("request", out string req))
{
request = req;
}
}
else
catch
{
// Fallback: treat the whole args string as the request if not JSON format
// Fallback for non-json args
request = args.Trim('"');
}
@@ -69,6 +71,10 @@ namespace WulaFallenEmpire.EventSystem.AI.Tools
if (thingsToDrop.Count > 0)
{
DropPodUtility.DropThingsNear(dropSpot, map, thingsToDrop);
Faction faction = Find.FactionManager.FirstFactionOfDef(WulaDefOf.Wula_PIA_Legion_Faction);
Messages.Message("Wula_ResourceDrop".Translate(faction.Named("FACTION")), new LookTargets(dropSpot, map), MessageTypeDefOf.PositiveEvent);
resultLog.Length -= 2; // Remove trailing comma
resultLog.Append($" at {dropSpot}.");
return resultLog.ToString();