mirror of
https://github.com/FalloutCollaborationProject/FCP-Tools.git
synced 2026-07-27 16:59:37 -07:00
Refactors robot customization from apparel/equipment to hediff-driven body part overlays, adds a reusable upgrade dialog, and expands DefOf support for Protectron, Securitron, Mr. Handy, and Sentry Bot variants. Introduces manual power toggling, robot bed assignment/power-down behavior, new control modes (including Securitron guard point and Mr. Handy role-based work modes), and AI checks that respect fuel/power state and pending upgrade bench calls. Also adds new radiant quest nodes, improves settlement tile fallback logic, updates several workbench sizes/textures, and adds additional trader backstories.
40 lines
959 B
C#
40 lines
959 B
C#
using Verse;
|
|
using Verse.AI;
|
|
|
|
namespace FCP.Core.Robotics
|
|
{
|
|
public class CompProperties_RobotManualPower : CompProperties
|
|
{
|
|
public CompProperties_RobotManualPower()
|
|
{
|
|
compClass = typeof(CompRobotManualPower);
|
|
}
|
|
}
|
|
|
|
public class CompRobotManualPower : ThingComp
|
|
{
|
|
private bool poweredOn = true;
|
|
|
|
public bool PoweredOn => poweredOn;
|
|
|
|
public void TogglePower()
|
|
{
|
|
poweredOn = !poweredOn;
|
|
if (parent is Pawn pawn)
|
|
{
|
|
if (pawn.jobs?.curJob != null)
|
|
{
|
|
pawn.jobs.EndCurrentJob(JobCondition.InterruptForced);
|
|
}
|
|
pawn.GetComp<CompSecuritronFace>()?.RefreshFace();
|
|
}
|
|
}
|
|
|
|
public override void PostExposeData()
|
|
{
|
|
base.PostExposeData();
|
|
Scribe_Values.Look(ref poweredOn, "poweredOn", true);
|
|
}
|
|
}
|
|
}
|