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.
57 lines
1.5 KiB
C#
57 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
using RimWorld;
|
|
using Verse;
|
|
using Verse.AI;
|
|
|
|
namespace FCP.Core.Robotics
|
|
{
|
|
public class CompProperties_RobotUpgrade : CompProperties
|
|
{
|
|
public CompProperties_RobotUpgrade()
|
|
{
|
|
compClass = typeof(CompRobotUpgrade);
|
|
}
|
|
}
|
|
|
|
public class CompRobotUpgrade : ThingComp
|
|
{
|
|
public Thing PendingBench;
|
|
|
|
public CompProperties_RobotUpgrade Props => (CompProperties_RobotUpgrade)props;
|
|
|
|
public override void PostExposeData()
|
|
{
|
|
base.PostExposeData();
|
|
Scribe_References.Look(ref PendingBench, "pendingUpgradeBench");
|
|
}
|
|
|
|
public override string CompInspectStringExtra()
|
|
{
|
|
if (PendingBench == null)
|
|
{
|
|
return null;
|
|
}
|
|
return "FCP_UpgradeRobot_CalledToBench".Translate();
|
|
}
|
|
|
|
public override IEnumerable<FloatMenuOption> CompFloatMenuOptions(Pawn selPawn)
|
|
{
|
|
Pawn pawn = parent as Pawn;
|
|
if (pawn == null || PendingBench == null || pawn.Faction != Faction.OfPlayer)
|
|
{
|
|
yield break;
|
|
}
|
|
|
|
if (!selPawn.CanReach(parent, PathEndMode.Touch, Danger.Deadly))
|
|
{
|
|
yield break;
|
|
}
|
|
|
|
yield return new FloatMenuOption("FCP_UpgradeRobot_Release".Translate(), delegate
|
|
{
|
|
PendingBench = null;
|
|
});
|
|
}
|
|
}
|
|
}
|