public override void Notify_QuestSignalReceived(Signal signal) { base.Notify_QuestSignalReceived(signal); if (!(signal.tag == inSignal)) { return; } pawns.RemoveAll((Pawn x) => x.Destroyed); if (mapParent == null || !mapParent.HasMap || !pawns.Any()) { return; } for (int i = 0; i < pawns.Count; i++) { if (joinPlayer && pawns[i].Faction != Faction.OfPlayer) { pawns[i].SetFaction(Faction.OfPlayer); } } IncidentParms incidentParms = new IncidentParms(); incidentParms.target = mapParent.Map; incidentParms.spawnCenter = spawnNear; PawnsArrivalModeDef obj = arrivalMode ?? PawnsArrivalModeDefOf.EdgeWalkIn; obj.Worker.TryResolveRaidSpawnCenter(incidentParms); obj.Worker.Arrive(pawns, incidentParms); if (!sendStandardLetter) { return; } TaggedString title; TaggedString text; if (joinPlayer && pawns.Count == 1 && pawns[0].RaceProps.Humanlike) { text = "LetterRefugeeJoins".Translate(pawns[0].Named("PAWN")); title = "LetterLabelRefugeeJoins".Translate(pawns[0].Named("PAWN")); PawnRelationUtility.TryAppendRelationsWithColonistsInfo(ref text, ref title, pawns[0]); } else { if (joinPlayer) { text = "LetterPawnsArriveAndJoin".Translate(GenLabel.ThingsLabel(pawns.Cast <Thing>())); title = "LetterLabelPawnsArriveAndJoin".Translate(); } else { text = "LetterPawnsArrive".Translate(GenLabel.ThingsLabel(pawns.Cast <Thing>())); title = "LetterLabelPawnsArrive".Translate(); } PawnRelationUtility.Notify_PawnsSeenByPlayer_Letter(pawns, ref title, ref text, "LetterRelatedPawnsNeutralGroup".Translate(Faction.OfPlayer.def.pawnsPlural), informEvenIfSeenBefore: true); } title = (customLetterLabel.NullOrEmpty() ? title : customLetterLabel.Formatted(title.Named("BASELABEL"))); text = (customLetterText.NullOrEmpty() ? text : customLetterText.Formatted(text.Named("BASETEXT"))); Find.LetterStack.ReceiveLetter(title, text, customLetterDef ?? LetterDefOf.PositiveEvent, pawns[0], null, quest); }
public static float AdjustedRaidPoints(float points, PawnsArrivalModeDef raidArrivalMode, RaidStrategyDef raidStrategy, Faction faction, PawnGroupKindDef groupKind) { if (raidArrivalMode.pointsFactorCurve != null) { points *= raidArrivalMode.pointsFactorCurve.Evaluate(points); } if (raidStrategy.pointsFactorCurve != null) { points *= raidStrategy.pointsFactorCurve.Evaluate(points); } points = Mathf.Max(points, raidStrategy.Worker.MinimumPoints(faction, groupKind) * 1.05f); return(points); }
public override void AssignDebugData() { base.AssignDebugData(); inSignal = "DebugSignal" + Rand.Int; if (Find.AnyPlayerHomeMap != null) { Pawn pawn = PawnGenerator.GeneratePawn(new PawnGenerationRequest(PawnKindDefOf.SpaceRefugee)); pawn.relations.everSeenByPlayer = true; if (!pawn.IsWorldPawn()) { Find.WorldPawns.PassToWorld(pawn); } pawns.Add(pawn); arrivalMode = PawnsArrivalModeDefOf.EdgeWalkIn; mapParent = Find.RandomPlayerHomeMap.Parent; joinPlayer = true; } }
internal float <> m__2(PawnsArrivalModeDef x) { return(x.Worker.GetSelectionWeight(this.parms)); }
internal bool <> m__1(PawnsArrivalModeDef x) { return(x.Worker.CanUseWith(this.parms)); }
internal bool <> m__0(PawnsArrivalModeDef d) { return(d.Worker.GetSelectionWeight(this.parms) > 0f); }
private static string <DoTable_RaidArrivalModeSampled> m__5(PawnsArrivalModeDef f) { return(f.defName); }
private static bool <ResolveRaidArriveMode> m__0(PawnsArrivalModeDef d) { return(d.forQuickMilitaryAid); }