Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1.  
  2. private void TransformPawn(bool changeDef = true, bool keep = false)
  3. {
  4. //Body change to Astarte
  5. IntVec3 intv = pawn.Position;
  6. Faction faction = pawn.Faction;
  7. Map map = pawn.Map;
  8. // pawn.DeSpawn();
  9. // pawn.DestroyOrPassToWorld();
  10. RegionListersUpdater.DeregisterInRegions(pawn, map);
  11. var thingDef = PawnThingDef();
  12. if (changeDef && thingDef != null)
  13. {
  14. pawn.def = thingDef;
  15. }
  16. // pawn.SpawnSetup(map, true);
  17.  
  18. RegionListersUpdater.RegisterInRegions(pawn, map);
  19. map.mapPawns.UpdateRegistryForPawn(pawn);
  20. //remove the 19
  21. if (BlowOffParts(keep)) ReplaceAstarteParts();
  22. HarmonyPatches.Patch.ChangeBodyType(pawn, BodyTypeDefOf.Hulk);
  23. // pawn.story.bodyType = BodyTypeDefOf.Hulk;
  24. //decache graphics
  25. pawn.Drawer.renderer.graphics.ResolveAllGraphics();
  26.  
  27. //save the pawn
  28. pawn.ExposeData();
  29. if (pawn.Faction!=faction)
  30. {
  31. pawn.SetFaction(faction);
  32. }
  33. // pawn.Position = intv;
  34. }
  35.  
  36. protected virtual ThingDef PawnThingDef()
  37. {
  38. // if (SettingsHelper.latest.n17Rimhammer && N17Rimhammer.AstartesAlt != null) return N17Rimhammer.AstartesAlt;
  39.  
  40. return Constants.Astarte;
  41. }
  42.  
  43. public static ThingDef Astarte = ThingDef.Named("Human_Imperial_Astartes");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement