Files
FCP-Tools/Source/FCPTools/FalloutCore/Robotics/CompRobotController.cs
T
RickGrymes f84841be45 Merge modules into core and add robotics
Consolidates Enlist, Laser, and PresettablePocketMap code into FCP_Core and removes their separate projects/assemblies. Adds a full robotics feature set (robot control terminal, modes, hacking, docking/upgrading, loadouts, quest integration, derelict/wild robot behavior, and supporting defs/jobs), plus biome-restricted raid support and dedicated trader-character spawning updates. Also expands game content with new weapon/melee sound defs and assets, many new site map icons, a new Fusion Core item, lunchbox loot table additions, and several compatibility/bug fixes for updated RimWorld APIs and edge cases.
2026-07-15 23:24:32 -05:00

41 lines
1.2 KiB
C#

using System.Collections.Generic;
using RimWorld;
using Verse;
using Verse.AI;
namespace FCP.Core.Robotics
{
public class CompProperties_RobotController : CompProperties
{
public CompProperties_RobotController()
{
compClass = typeof(CompRobotController);
}
}
public class CompRobotController : ThingComp
{
public CompProperties_RobotController Props => (CompProperties_RobotController)props;
public override IEnumerable<FloatMenuOption> CompFloatMenuOptions(Pawn selPawn)
{
if (!selPawn.CanReach(parent, PathEndMode.InteractionCell, Danger.Deadly))
{
yield return new FloatMenuOption("FCP_ControlRobots_Gizmo".Translate() + ": " + "NoPath".Translate(), null);
yield break;
}
yield return new FloatMenuOption("FCP_ControlRobots_Gizmo".Translate(), delegate
{
Job job = JobMaker.MakeJob(JobDefOf_Robotics.FCP_ControlRobots, parent);
selPawn.jobs.TryTakeOrderedJob(job, JobTag.Misc);
});
}
public void OpenRobotSelectMenu()
{
Find.WindowStack.Add(new Dialog_RobotControl(parent.Map));
}
}
}