This commit is contained in:
2025-12-28 14:54:51 +08:00
parent 3f823a9148
commit 90f87c2f8a
9 changed files with 939 additions and 451 deletions

View File

@@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using RimWorld;
using UnityEngine;
using Verse;
using WulaFallenEmpire.EventSystem.AI;
namespace WulaFallenEmpire.EventSystem.AI.Alerts
{
public class Alert_AIOverwatchActive : Alert_Critical
{
public Alert_AIOverwatchActive()
{
this.defaultLabel = "WULA_AIOverwatch_Label".Translate();
this.defaultExplanation = "WULA_AIOverwatch_Desc".Translate(0);
}
public override AlertReport GetReport()
{
var map = Find.CurrentMap;
if (map == null) return AlertReport.Inactive;
var comp = map.GetComponent<MapComponent_AIOverwatch>();
if (comp != null && comp.IsEnabled)
{
return AlertReport.Active;
}
return AlertReport.Inactive;
}
public override string GetLabel()
{
var map = Find.CurrentMap;
if (map != null)
{
var comp = map.GetComponent<MapComponent_AIOverwatch>();
if (comp != null && comp.IsEnabled)
{
int secondsLeft = comp.DurationTicks / 60;
return "WULA_AIOverwatch_Label".Translate() + $"\n({secondsLeft}s)";
}
}
return "WULA_AIOverwatch_Label".Translate();
}
public override TaggedString GetExplanation()
{
var map = Find.CurrentMap;
if (map != null)
{
var comp = map.GetComponent<MapComponent_AIOverwatch>();
if (comp != null && comp.IsEnabled)
{
return "WULA_AIOverwatch_Desc".Translate(comp.DurationTicks / 60);
}
}
return base.GetExplanation();
}
}
}