Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void TransformPawn(bool changeDef = true, bool keep = false)
- {
- //Body change to Astarte
- IntVec3 intv = pawn.Position;
- Faction faction = pawn.Faction;
- Map map = pawn.Map;
- // pawn.DeSpawn();
- // pawn.DestroyOrPassToWorld();
- RegionListersUpdater.DeregisterInRegions(pawn, map);
- var thingDef = PawnThingDef();
- if (changeDef && thingDef != null)
- {
- pawn.def = thingDef;
- }
- // pawn.SpawnSetup(map, true);
- RegionListersUpdater.RegisterInRegions(pawn, map);
- map.mapPawns.UpdateRegistryForPawn(pawn);
- //remove the 19
- if (BlowOffParts(keep)) ReplaceAstarteParts();
- HarmonyPatches.Patch.ChangeBodyType(pawn, BodyTypeDefOf.Hulk);
- // pawn.story.bodyType = BodyTypeDefOf.Hulk;
- //decache graphics
- pawn.Drawer.renderer.graphics.ResolveAllGraphics();
- //save the pawn
- pawn.ExposeData();
- if (pawn.Faction!=faction)
- {
- pawn.SetFaction(faction);
- }
- // pawn.Position = intv;
- }
- protected virtual ThingDef PawnThingDef()
- {
- // if (SettingsHelper.latest.n17Rimhammer && N17Rimhammer.AstartesAlt != null) return N17Rimhammer.AstartesAlt;
- return Constants.Astarte;
- }
- public static ThingDef Astarte = ThingDef.Named("Human_Imperial_Astartes");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement