Exemple #1
0
            public static bool Prefix(Pawn __instance)
            {
                RimSpawnersPawnComp customThingComp = __instance.GetComp <RimSpawnersPawnComp>();

                if ((customThingComp != null))
                {
                    if (Settings.cachePawns && __instance.RaceProps.Humanlike)
                    {
                        // recycle pawn into spawner
                        CompVanometricFabricatorPawn cusp = customThingComp.Props.SpawnerComp;
                        cusp.RecyclePawn(__instance);
                    }

                    // make it like the pawn never existed
                    __instance.SetFaction(null);
                    __instance.relations?.ClearAllRelations();

                    if (Settings.disableCorpses)
                    {
                        // destroy everything they owned
                        __instance.inventory?.DestroyAll();
                        __instance.apparel?.DestroyAll();
                        __instance.equipment?.DestroyAllEquipment();
                    }
                }
                return(true);
            }
Exemple #2
0
            public static void Postfix(Pawn __instance)
            {
                RimSpawnersPawnComp customThingComp = __instance.GetComp <RimSpawnersPawnComp>();

                if ((customThingComp != null) && Settings.disableCorpses)
                {
                    __instance.Corpse?.Destroy();
                }
            }
Exemple #3
0
            public static bool Prefix(ref bool __result, Pawn pawn)
            {
                RimSpawnersPawnComp customThingComp = pawn.GetComp <RimSpawnersPawnComp>();

                if (customThingComp != null)
                {
                    __result = true;
                    return(false);
                }

                return(true);
            }
Exemple #4
0
            public static bool Prefix(Pawn_HealthTracker __instance, DamageInfo?dinfo, Hediff hediff, Pawn ___pawn)
            {
                // the spawner Lord has LordJob.RemoveDownedPawns = true
                //   cannot loop over spawnedPawns later to kill downed, must kill before MakeDowned runs
                RimSpawnersPawnComp customThingComp = ___pawn.GetComp <RimSpawnersPawnComp>();

                if (customThingComp != null)
                {
                    ___pawn.Kill(dinfo);
                    return(false);
                }

                return(true);
            }