public override void PostEnd() { if (!this.def.recoveryMessage.NullOrEmpty() && PawnUtility.ShouldSendNotificationAbout(this.pawn)) { TaggedString taggedString = this.def.recoveryMessage.Formatted(this.pawn.LabelShort, this.pawn.Named("PAWN")); if (!taggedString.NullOrEmpty()) { Messages.Message(taggedString.AdjustedFor(this.pawn, "PAWN", true).CapitalizeFirst(), this.pawn, MessageTypeDefOf.SituationResolved, true); } } this.pawn.jobs.StopAll(false, true); this.pawn.mindState.meleeThreat = null; if (this.IsOtherPawnSocialFightingWithMe) { this.otherPawn.MentalState.RecoverFromState(); } if ((PawnUtility.ShouldSendNotificationAbout(this.pawn) || PawnUtility.ShouldSendNotificationAbout(this.otherPawn)) && this.pawn.thingIDNumber < this.otherPawn.thingIDNumber) { Messages.Message("AdeptusMechanicus.Ork.MessageNoLongerSocialFighting".Translate(this.pawn.LabelShort, this.otherPawn.LabelShort, this.pawn.Named("PAWN1"), this.otherPawn.Named("PAWN2")), this.pawn, MessageTypeDefOf.SituationResolved, true); } if (!this.pawn.Dead && this.pawn.needs.mood != null && !this.otherPawn.Dead) { ThoughtDef def; if (pawn.isOrk()) { def = ThoughtDefOf.HadCatharticFight; } else { def = ThoughtDefOf.HadAngeringFight; } this.pawn.needs.mood.thoughts.memories.TryGainMemory(def, this.otherPawn); } }
public virtual void PostEnd() { if (!def.recoveryMessage.NullOrEmpty() && PawnUtility.ShouldSendNotificationAbout(pawn)) { TaggedString taggedString = def.recoveryMessage.Formatted(pawn.LabelShort, pawn.Named("PAWN")); if (!taggedString.NullOrEmpty()) { Messages.Message(taggedString.AdjustedFor(pawn).CapitalizeFirst(), pawn, MessageTypeDefOf.SituationResolved); } } }
public static TaggedString AppendContractDetails(TaggedString text, Pawn pawn) { var tenantComp = pawn.GetTenantComponent(); var stringBuilder = new StringBuilder(text); stringBuilder.AppendLine(); stringBuilder.Append("RequestForTenancyContract".Translate(tenantComp.ContractLength / 60000, tenantComp.Payment, pawn.Named("PAWN"))); text = stringBuilder.ToString(); text = text.AdjustedFor(pawn); text = AppendPawnDescription(text, pawn); PawnRelationUtility.TryAppendRelationsWithColonistsInfo(ref text, pawn); return(text); }
protected bool TrySendLetter(Pawn pawn, string textKey, string reason) { if (!PawnUtility.ShouldSendNotificationAbout(pawn)) { return(false); } TaggedString label = def.LabelCap + ": " + pawn.LabelShortCap; TaggedString taggedString = textKey.Translate(pawn.Label, pawn.Named("PAWN")).CapitalizeFirst(); if (reason != null) { taggedString += "\n\n" + reason; } taggedString = taggedString.AdjustedFor(pawn); Find.LetterStack.ReceiveLetter(label, taggedString, LetterDefOf.NegativeEvent, pawn); return(true); }
private static bool Prefix(Pawn_HealthTracker __instance, Pawn ___pawn, DamageInfo?dinfo, Hediff hediff, Caravan caravan) { if (DisableKilledEffect) { if (!___pawn.IsEmptySleeve()) { TaggedString taggedString = ""; taggedString = (dinfo.HasValue ? "AlteredCarbon.SleveOf".Translate() + dinfo.Value.Def.deathMessage .Formatted(___pawn.LabelShortCap, ___pawn.Named("PAWN")) : ((hediff == null) ? "AlteredCarbon.PawnDied".Translate(___pawn.LabelShortCap, ___pawn.Named("PAWN")) : "AlteredCarbon.PawnDiedBecauseOf".Translate(___pawn.LabelShortCap, hediff.def.LabelCap, ___pawn.Named("PAWN")))); taggedString = taggedString.AdjustedFor(___pawn); TaggedString label = "AlteredCarbon.SleeveDeath".Translate() + ": " + ___pawn.LabelShortCap; Find.LetterStack.ReceiveLetter(label, taggedString, LetterDefOf.NegativeEvent, ___pawn); } DisableKilledEffect = false; return(false); } return(true); }
// Token: 0x06000E91 RID: 3729 RVA: 0x0006C94C File Offset: 0x0006AD4C protected override bool TryExecuteWorker(IncidentParms parms) { Map map = (Map)parms.target; IntVec3 spawnSpot; if (!this.TryFindSpawnSpot(map, out spawnSpot)) { return(false); } Faction faction; if (!this.TryFindEnemyFaction(out faction)) { return(false); } int @int = Rand.Int; IncidentParms raidParms = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.ThreatBig, map); raidParms.forced = true; raidParms.faction = faction; raidParms.raidStrategy = RaidStrategyDefOf.ImmediateAttack; raidParms.raidArrivalMode = PawnsArrivalModeDefOf.EdgeWalkIn; raidParms.spawnCenter = spawnSpot; raidParms.points = Mathf.Max(raidParms.points * IncidentWorker_RefugeeChased.RaidPointsFactorRange.RandomInRange, faction.def.MinPointsToGeneratePawnGroup(PawnGroupKindDefOf.Combat)); raidParms.pawnGroupMakerSeed = new int?(@int); PawnGroupMakerParms defaultPawnGroupMakerParms = IncidentParmsUtility.GetDefaultPawnGroupMakerParms(PawnGroupKindDefOf.Combat, raidParms, false); defaultPawnGroupMakerParms.points = IncidentWorker_Raid.AdjustedRaidPoints(defaultPawnGroupMakerParms.points, raidParms.raidArrivalMode, raidParms.raidStrategy, defaultPawnGroupMakerParms.faction, PawnGroupKindDefOf.Combat); IEnumerable <PawnKindDef> pawnKinds = PawnGroupMakerUtility.GeneratePawnKindsExample(defaultPawnGroupMakerParms); PawnGenerationRequest request = new PawnGenerationRequest(PawnKindDefOf.SpaceRefugee, null, PawnGenerationContext.NonPlayer, -1, false, false, false, false, true, false, 20f, false, true, true, false, false, false, false); Pawn refugee = PawnGenerator.GeneratePawn(request); refugee.relations.everSeenByPlayer = true; TaggedString text = "RefugeeChasedInitial".Translate(refugee.Name.ToStringFull, refugee.story.Title, faction.def.pawnsPlural, faction.Name, refugee.ageTracker.AgeBiologicalYears, PawnUtility.PawnKindsToCommaList(pawnKinds, true), refugee.Named("PAWN")); text = text.AdjustedFor(refugee, "PAWN"); PawnRelationUtility.TryAppendRelationsWithColonistsInfo(ref text, refugee); DiaNode diaNode = new DiaNode(text); DiaOption diaOption = new DiaOption("RefugeeChasedInitial_Accept".Translate()); diaOption.action = delegate() { GenSpawn.Spawn(refugee, spawnSpot, map, WipeMode.Vanish); refugee.SetFaction(Faction.OfPlayer, null); CameraJumper.TryJump(refugee); QueuedIncident qi = new QueuedIncident(new FiringIncident(IncidentDefOf.RaidEnemy, null, raidParms), Find.TickManager.TicksGame + IncidentWorker_RefugeeChased.RaidDelay.RandomInRange, 0); Find.Storyteller.incidentQueue.Add(qi); }; diaOption.resolveTree = true; diaNode.options.Add(diaOption); string text2 = "RefugeeChasedRejected".Translate(refugee.LabelShort, refugee); DiaNode diaNode2 = new DiaNode(text2); DiaOption diaOption2 = new DiaOption("OK".Translate()); diaOption2.resolveTree = true; diaNode2.options.Add(diaOption2); DiaOption diaOption3 = new DiaOption("RefugeeChasedInitial_Reject".Translate()); diaOption3.action = delegate() { Find.WorldPawns.PassToWorld(refugee, PawnDiscardDecideMode.Decide); }; diaOption3.link = diaNode2; diaNode.options.Add(diaOption3); string title = "RefugeeChasedTitle".Translate(map.Parent.Label); Find.WindowStack.Add(new Dialog_NodeTreeWithFactionInfo(diaNode, faction, true, true, title)); Find.Archive.Add(new ArchivedDialog(diaNode.text, title, faction)); return(true); }