Files
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

30 lines
862 B
C#

using System.Collections.Generic;
using Verse;
using Verse.AI;
namespace FCP.Core.Robotics
{
public class JobDriver_ControlRobots : JobDriver
{
private Thing Terminal => job.GetTarget(TargetIndex.A).Thing;
public override bool TryMakePreToilReservations(bool errorOnFailed)
{
return pawn.Reserve(Terminal, job, 1, -1, null, errorOnFailed);
}
protected override IEnumerable<Toil> MakeNewToils()
{
this.FailOnDestroyedOrNull(TargetIndex.A);
yield return Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.InteractionCell);
yield return new Toil
{
initAction = () => Terminal.TryGetComp<CompRobotController>()?.OpenRobotSelectMenu(),
defaultCompleteMode = ToilCompleteMode.Instant,
};
}
}
}