public override void Arrived(int tile) { LongEventHandler.QueueLongEvent(delegate() { Map map = GetOrGenerateMapUtility.GetOrGenerateMap(tile, null); //MAP INDEX BUG TaggedString label = "LetterLabelCaravanEnteredEnemyBase".Translate(); TaggedString text = "LetterTransportPodsLandedInEnemyBase".Translate(parent.Label).CapitalizeFirst(); if (parent is Settlement settlement) { SettlementUtility.AffectRelationsOnAttacked(settlement, ref text); } if (!parent.HasMap) { Find.TickManager.Notify_GeneratedPotentiallyHostileMap(); PawnRelationUtility.Notify_PawnsSeenByPlayer_Letter(map.mapPawns.AllPawns, ref label, ref text, "LetterRelatedPawnsInMapWherePlayerLanded".Translate(Faction.OfPlayer.def.pawnsPlural), true, true); } AerialVehicleInFlight aerialVehicle = vehicle.GetAerialVehicle(); CameraJumper.TryJump(map.Center, map); StrafeTargeter.Instance.BeginTargeting(vehicle, vehicle.CompVehicleLauncher.launchProtocol, delegate(IntVec3 start, IntVec3 end) { VehicleSkyfaller_FlyOver skyfaller = VehicleSkyfallerMaker.MakeSkyfallerFlyOver(vehicle.CompVehicleLauncher.Props.skyfallerStrafing, vehicle, start, end); skyfaller.aerialVehicle = aerialVehicle; Thing thing = GenSpawn.Spawn(skyfaller, start, parent.Map, Rot8.North); //REDO - Other rotations? }, null, null, null, true); aerialVehicle.Destroy(); }, "GeneratingMap", false, null, true); }
private static void SendAttackLetter(Caravan caravan, Settlement settlement) { TaggedString letterLabel = "LetterLabelCaravanEnteredEnemyBase".Translate(); TaggedString letterText = "LetterCaravanEnteredEnemyBase".Translate(caravan.Label, settlement.Label.ApplyTag(TagType.Settlement, settlement.Faction.GetUniqueLoadID())).CapitalizeFirst(); SettlementUtility.AffectRelationsOnAttacked(settlement, ref letterText); if (settlement.HasMap) { PawnRelationUtility.Notify_PawnsSeenByPlayer_Letter(settlement.Map.mapPawns.AllPawns, ref letterLabel, ref letterText, "LetterRelatedPawnsSettlement".Translate(Faction.OfPlayer.def.pawnsPlural), true); } Find.LetterStack.ReceiveLetter(letterLabel, letterText, LetterDefOf.NeutralEvent, caravan.PawnsListForReading, settlement.Faction, null, null, null); }
public override void Arrived(List <ActiveDropPodInfo> pods, int tile) { Thing lookTarget = ByakheeArrivalActionUtility.GetLookTarget(pods); bool flag = !this.settlement.HasMap; Map orGenerateMap = GetOrGenerateMapUtility.GetOrGenerateMap(this.settlement.Tile, null); TaggedString label = "LetterLabelCaravanEnteredEnemyBase".Translate(); TaggedString text = "LetterTransportPodsLandedInEnemyBase".Translate(this.settlement.Label).CapitalizeFirst(); SettlementUtility.AffectRelationsOnAttacked(this.settlement, ref text); if (flag) { Find.TickManager.Notify_GeneratedPotentiallyHostileMap(); PawnRelationUtility.Notify_PawnsSeenByPlayer_Letter(orGenerateMap.mapPawns.AllPawns, ref label, ref text, "LetterRelatedPawnsInMapWherePlayerLanded".Translate(Faction.OfPlayer.def.pawnsPlural), true, true); } Find.LetterStack.ReceiveLetter(label, text, LetterDefOf.NeutralEvent, lookTarget, this.settlement.Faction, null, null, null); this.arrivalMode.Worker.TravelingTransportPodsArrived(pods, orGenerateMap); }
public override void Arrived(int tile) { LongEventHandler.QueueLongEvent(delegate() { Map map = GetOrGenerateMapUtility.GetOrGenerateMap(tile, null); TaggedString label = "LetterLabelCaravanEnteredEnemyBase".Translate(); TaggedString text = "LetterTransportPodsLandedInEnemyBase".Translate(settlement.Label).CapitalizeFirst(); SettlementUtility.AffectRelationsOnAttacked(settlement, ref text); if (!settlement.HasMap) { Find.TickManager.Notify_GeneratedPotentiallyHostileMap(); PawnRelationUtility.Notify_PawnsSeenByPlayer_Letter(map.mapPawns.AllPawns, ref label, ref text, "LetterRelatedPawnsInMapWherePlayerLanded".Translate(Faction.OfPlayer.def.pawnsPlural), true, true); } Find.LetterStack.ReceiveLetter(label, text, LetterDefOf.NeutralEvent, vehicle, settlement.Faction, null, null, null); AerialVehicleInFlight aerialVehicle = vehicle.GetAerialVehicle(); arrivalModeDef.Worker.VehicleArrived(aerialVehicle, launchProtocol, settlement.Map); aerialVehicle.Destroy(); }, "GeneratingMap", false, null, true); }
public void GenerateMapForRecon(int tile) { if (flightPath.InRecon && Find.WorldObjects.MapParentAt(tile) is MapParent mapParent && !mapParent.HasMap) { LongEventHandler.QueueLongEvent(delegate() { Map map = GetOrGenerateMapUtility.GetOrGenerateMap(tile, null); TaggedString label = "LetterLabelCaravanEnteredEnemyBase".Translate(); TaggedString text = "LetterTransportPodsLandedInEnemyBase".Translate(mapParent.Label).CapitalizeFirst(); if (mapParent is Settlement settlement) { SettlementUtility.AffectRelationsOnAttacked(settlement, ref text); } if (!mapParent.HasMap) { Find.TickManager.Notify_GeneratedPotentiallyHostileMap(); PawnRelationUtility.Notify_PawnsSeenByPlayer_Letter(map.mapPawns.AllPawns, ref label, ref text, "LetterRelatedPawnsInMapWherePlayerLanded".Translate(Faction.OfPlayer.def.pawnsPlural), true, true); } Find.LetterStack.ReceiveLetter(label, text, LetterDefOf.NeutralEvent, vehicle, mapParent.Faction, null, null, null); Current.Game.CurrentMap = map; CameraJumper.TryHideWorld(); }, "GeneratingMap", false, null, true); } }