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.
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using RimWorld;
|
|
using Verse;
|
|
|
|
namespace FCP.Core.Robotics
|
|
{
|
|
public class CompProperties_AbilityLaunchProjectile : CompProperties_AbilityEffect
|
|
{
|
|
public ThingDef projectileDef;
|
|
|
|
public CompProperties_AbilityLaunchProjectile()
|
|
{
|
|
compClass = typeof(CompAbilityEffect_LaunchProjectile);
|
|
}
|
|
}
|
|
|
|
public class CompAbilityEffect_LaunchProjectile : CompAbilityEffect
|
|
{
|
|
public new CompProperties_AbilityLaunchProjectile Props => (CompProperties_AbilityLaunchProjectile)props;
|
|
|
|
public override void Apply(LocalTargetInfo target, LocalTargetInfo dest)
|
|
{
|
|
base.Apply(target, dest);
|
|
|
|
if (Props.projectileDef == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
Pawn pawn = parent.pawn;
|
|
Projectile projectile = (Projectile)GenSpawn.Spawn(ThingMaker.MakeThing(Props.projectileDef), pawn.Position, pawn.Map);
|
|
projectile.Launch(pawn, pawn.DrawPos, target, target, ProjectileHitFlags.IntendedTarget);
|
|
}
|
|
}
|
|
}
|