public void DoStrike() { string str = string.Empty; List <Pawn> pawns = new List <Pawn>(); if (!Droppers.NullOrEmpty()) { str += str == string.Empty ? DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.Drop) : ", " + DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.Drop); pawns.AddRange(Droppers); ArriveDropPod(Droppers); } if (!Flyers.NullOrEmpty()) { str += str == string.Empty ? DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.Fly) : ", " + DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.Fly); pawns.AddRange(Flyers); ArriveFly(Flyers); } if (!Teleporters.NullOrEmpty()) { str += str == string.Empty ? DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.Teleport) : ", " + DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.Teleport); pawns.AddRange(Teleporters); ArriveTeleport(Teleporters); } if (!Tunnellers.NullOrEmpty()) { str += str == string.Empty ? DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.Tunnel) : ", " + DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.Tunnel); pawns.AddRange(Tunnellers); ArriveTunnel(Tunnellers); } Find.LetterStack.ReceiveLetter("AMA_DeepStrike_Incomming".Translate(pawns.Find(x => x.Faction != null).Faction.def.pawnSingular), "AMA_DeepStrike_Incomming_Letter".Translate(pawns.Find(x => x.Faction != null).Faction.def.pawnsPlural, str), LetterDefOf.ThreatBig, pawns, pawns.Find(x => x.Faction != null).Faction, null); }
public void DoStrike(DeepStrike strike) { string str = string.Empty; foreach (var item in strike.Members) { switch (item.DeepStrike().pawnsArrivalMode) { case DeepStrikeType.DropPod: Droppers.Add(item); break; case DeepStrikeType.DropPara: break; case DeepStrikeType.DropShip: break; case DeepStrikeType.Fly: Flyers.Add(item); break; case DeepStrikeType.Teleport: Teleporters.Add(item); break; case DeepStrikeType.Tunnel: Tunnellers.Add(item); break; default: break; } } List <Pawn> pawns = new List <Pawn>(); if (!Droppers.NullOrEmpty()) { str += str == string.Empty ? DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.DropPod) : ", " + DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.DropPod); pawns.AddRange(Droppers); ArriveDropPod(Droppers); Droppers.Clear(); } if (!Flyers.NullOrEmpty()) { str += str == string.Empty ? DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.Fly) : ", " + DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.Fly); pawns.AddRange(Flyers); ArriveFly(Flyers); Flyers.Clear(); } if (!Teleporters.NullOrEmpty()) { str += str == string.Empty ? DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.Teleport) : ", " + DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.Teleport); pawns.AddRange(Teleporters); ArriveTeleport(Teleporters); Teleporters.Clear(); } if (!Tunnellers.NullOrEmpty()) { str += str == string.Empty ? DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.Tunnel) : ", " + DeepStrikeUtility.DeepstrikeArrivalmode(DeepStrikeType.Tunnel); pawns.AddRange(Tunnellers); ArriveTunnel(Tunnellers); Tunnellers.Clear(); } Find.LetterStack.ReceiveLetter("AdeptusMechanicus.DeepStrike_Incomming".Translate(pawns.Find(x => x.Faction != null).Faction.def.pawnSingular), "AdeptusMechanicus.DeepStrike_Incomming_Letter".Translate(pawns.Find(x => x.Faction != null).Faction.def.pawnsPlural, str), LetterDefOf.ThreatBig, pawns, pawns.Find(x => x.Faction != null).Faction, null); strike.struck = true; }