public static Pawn GenerateRefugee(int tile) { Pawn pawn = PawnGenerator.GeneratePawn(new PawnGenerationRequest(PawnKindDefOf.SpaceRefugee, GetRandomFactionForRefugee(), PawnGenerationContext.NonPlayer, tile, forceGenerateNewPawn: false, newborn: false, allowDead: false, allowDowned: false, canGeneratePawnRelations: true, mustBeCapableOfViolence: false, 20f, forceAddFreeWarmLayerIfNeeded: true, allowGay: true, allowFood: true, allowAddictions: true, inhabitant: false, certainlyBeenInCryptosleep: false, forceRedressWorldPawnIfFormerColonist: false, worldPawnFactionDoesntMatter: false, 0f, null, 1f, null, null, null, null, 0.2f)); HealthUtility.DamageUntilDowned(pawn, allowBleedingWounds: false); HealthUtility.DamageLegsUntilIncapableOfMoving(pawn, allowBleedingWounds: false); return(pawn); }
public static Pawn GenerateRefugee(int tile) { PawnKindDef spaceRefugee = PawnKindDefOf.SpaceRefugee; Faction ofSpacer = Faction.OfSpacer; PawnGenerationRequest request = new PawnGenerationRequest(spaceRefugee, ofSpacer, PawnGenerationContext.NonPlayer, tile, false, false, false, false, true, false, 20f, false, true, true, false, false, false, false, null, 0.2f, null, null, null, null, null); Pawn pawn = PawnGenerator.GeneratePawn(request); HealthUtility.DamageUntilDowned(pawn); HealthUtility.DamageLegsUntilIncapableOfMoving(pawn); return(pawn); }
public static Pawn GenerateRefugee(int tile) { PawnKindDef spaceRefugee = PawnKindDefOf.SpaceRefugee; Faction randomFactionForRefugee = DownedRefugeeQuestUtility.GetRandomFactionForRefugee(); PawnGenerationRequest request = new PawnGenerationRequest(spaceRefugee, randomFactionForRefugee, PawnGenerationContext.NonPlayer, tile, false, false, false, false, true, false, 20f, true, true, true, false, false, false, false, null, null, new float?(0.2f), null, null, null, null, null); Pawn pawn = PawnGenerator.GeneratePawn(request); HealthUtility.DamageUntilDowned(pawn, false); HealthUtility.DamageLegsUntilIncapableOfMoving(pawn, false); return(pawn); }
protected override void ScatterAt(IntVec3 loc, Map map, int count = 1) { DownedRefugeeComp component = map.Parent.GetComponent <DownedRefugeeComp>(); Pawn pawn = (component == null || !component.pawn.Any) ? DownedRefugeeQuestUtility.GenerateRefugee(map.Tile) : component.pawn.Take(component.pawn[0]); HealthUtility.DamageUntilDowned(pawn, allowBleedingWounds: false); HealthUtility.DamageLegsUntilIncapableOfMoving(pawn, allowBleedingWounds: false); GenSpawn.Spawn(pawn, loc, map); pawn.mindState.WillJoinColonyIfRescued = true; MapGenerator.rootsToUnfog.Add(loc); }
protected override void ScatterAt(IntVec3 loc, Map map, int count = 1) { DownedRefugeeComp component = map.Parent.GetComponent <DownedRefugeeComp>(); Pawn pawn; if (component != null && component.pawn.Any) { pawn = component.pawn.Take(component.pawn[0]); } else { pawn = DownedRefugeeQuestUtility.GenerateRefugee(map.Tile); } HealthUtility.DamageUntilDowned(pawn, false); HealthUtility.DamageLegsUntilIncapableOfMoving(pawn, false); GenSpawn.Spawn(pawn, loc, map, WipeMode.Vanish); pawn.mindState.WillJoinColonyIfRescued = true; MapGenerator.rootsToUnfog.Add(loc); }
protected override void ScatterAt(IntVec3 loc, Map map, GenStepParams parms, int count = 1) { Pawn pawn; if (parms.sitePart != null && parms.sitePart.things != null && parms.sitePart.things.Any) { pawn = (Pawn)parms.sitePart.things.Take(parms.sitePart.things[0]); } else { DownedRefugeeComp component = map.Parent.GetComponent <DownedRefugeeComp>(); pawn = ((component == null || !component.pawn.Any) ? DownedRefugeeQuestUtility.GenerateRefugee(map.Tile) : component.pawn.Take(component.pawn[0])); } HealthUtility.DamageUntilDowned(pawn, allowBleedingWounds: false); HealthUtility.DamageLegsUntilIncapableOfMoving(pawn, allowBleedingWounds: false); GenSpawn.Spawn(pawn, loc, map); pawn.mindState.WillJoinColonyIfRescued = true; MapGenerator.rootsToUnfog.Add(loc); MapGenerator.SetVar("RectOfInterest", CellRect.CenteredOn(loc, 1, 1)); }
public override void Notify_GeneratedByQuestGen(SitePart part, Slate slate, List <Rule> outExtraDescriptionRules, Dictionary <string, string> outExtraDescriptionConstants) { // Duplicate code so modularize in Util Util.SitePartWorker_Base_Notify_GeneratedByQuestGen(part, outExtraDescriptionRules, outExtraDescriptionConstants); // Replaces DownedRefugeeQuestUtility.GenerateRefugee Pawn pawn = GameComponent.GetRandomAllyForSpawning(); Util.DressPawnIfCold(pawn, part.site.Tile); HealthUtility.DamageUntilDowned(pawn, false); HealthUtility.DamageLegsUntilIncapableOfMoving(pawn, false); part.things = new ThingOwner <Pawn>(part, true, LookMode.Deep); part.things.TryAdd(pawn, true); if (pawn.relations != null) { pawn.relations.everSeenByPlayer = true; } Pawn mostImportantColonyRelative = PawnRelationUtility.GetMostImportantColonyRelative(pawn); if (mostImportantColonyRelative != null) { PawnRelationDef mostImportantRelation = mostImportantColonyRelative.GetMostImportantRelation(pawn); TaggedString taggedString = ""; if (mostImportantRelation != null && mostImportantRelation.opinionOffset > 0) { pawn.relations.relativeInvolvedInRescueQuest = mostImportantColonyRelative; taggedString = "\n\n" + "RelatedPawnInvolvedInQuest".Translate(mostImportantColonyRelative.LabelShort, mostImportantRelation.GetGenderSpecificLabel(pawn), mostImportantColonyRelative.Named("RELATIVE"), pawn.Named("PAWN")).AdjustedFor(pawn, "PAWN", true); } else { PawnRelationUtility.TryAppendRelationsWithColonistsInfo(ref taggedString, pawn); } outExtraDescriptionRules.Add(new Rule_String("pawnInvolvedInQuestInfo", taggedString)); } outExtraDescriptionRules.AddRange(GrammarUtility.RulesForPawn("refugee", pawn, outExtraDescriptionConstants, true, true)); }