mirror of
https://github.com/FalloutCollaborationProject/FCP-Tools.git
synced 2026-07-27 16:59:37 -07:00
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.
30 lines
862 B
C#
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,
|
|
};
|
|
}
|
|
}
|
|
}
|