public void attemptToAssignSquad(SettlementFC settlement, MilSquadFC squad) { if (FactionColonies.calculateMilitaryLevelPoints(settlement.settlementMilitaryLevel) >= squad.equipmentTotalCost) { if (squadExists(settlement)) { settlement.militarySquad.OutfitSquad(squad); } else { //create new squad createMercenarySquad(settlement); settlement.militarySquad.OutfitSquad(squad); } Messages.Message(squad.name + "'s loadout has been assigned to " + settlement.name, MessageTypeDefOf.TaskCompletion); } else { Messages.Message("That squad exceeds the settlement's max allotted cost", MessageTypeDefOf.RejectInput); } }
public override void DrawTab(Rect rect) { Rect SettlementBox = new Rect(5, 45, 535, settlementHeight); Rect SettlementName = new Rect(SettlementBox.x + 5, SettlementBox.y + 5, 250, 25); Rect MilitaryLevel = new Rect(SettlementName.x, SettlementName.y + 30, 250, 25); Rect AssignedSquad = new Rect(MilitaryLevel.x, MilitaryLevel.y + 30, 250, 25); Rect isBusy = new Rect(AssignedSquad.x, AssignedSquad.y + 30, 250, 25); Rect buttonSetSquad = new Rect(SettlementBox.x + SettlementBox.width - 265, SettlementBox.y + 5, 100, 25); Rect buttonViewSquad = new Rect(buttonSetSquad.x, buttonSetSquad.y + 3 + buttonSetSquad.height, buttonSetSquad.width, buttonSetSquad.height); Rect buttonDeploySquad = new Rect(buttonViewSquad.x, buttonViewSquad.y + 3 + buttonViewSquad.height, buttonSetSquad.width, buttonSetSquad.height); Rect buttonResetPawns = new Rect(buttonDeploySquad.x, buttonDeploySquad.y + 3 + buttonDeploySquad.height, buttonSetSquad.width, buttonSetSquad.height); Rect buttonOrderFireSupport = new Rect(buttonSetSquad.x + 125 + 5, SettlementBox.y + 5, 125, 25); //set text anchor and font GameFont fontBefore = Text.Font; TextAnchor anchorBefore = Text.Anchor; int count = 0; foreach (SettlementFC settlement in Find.World.GetComponent <FactionFC>().settlements) { Text.Font = GameFont.Small; Widgets.DrawMenuSection(new Rect(SettlementBox.x, SettlementBox.y + (SettlementBox.height + settlementYSpacing) * count + scroll, SettlementBox.width, SettlementBox.height)); //click on settlement name if (Widgets.ButtonTextSubtle( new Rect(SettlementName.x, SettlementName.y + (SettlementBox.height + settlementYSpacing) * count + scroll, SettlementName.width, SettlementName.height), settlement.name)) { Find.WindowStack.Add(new SettlementWindowFc(settlement)); } Widgets.Label( new Rect(MilitaryLevel.x, MilitaryLevel.y + (SettlementBox.height + settlementYSpacing) * count + scroll, MilitaryLevel.width, MilitaryLevel.height * 2), "Mil Level: " + settlement.settlementMilitaryLevel + " - Max Squad Cost: " + FactionColonies.calculateMilitaryLevelPoints(settlement.settlementMilitaryLevel)); if (settlement.militarySquad != null) { if (settlement.militarySquad.outfit != null) { Widgets.Label( new Rect(AssignedSquad.x, AssignedSquad.y + (SettlementBox.height + settlementYSpacing) * count + scroll, AssignedSquad.width, AssignedSquad.height), "Assigned Squad: " + settlement.militarySquad.outfit.name); //settlement.militarySquad.name); } else { Widgets.Label( new Rect(AssignedSquad.x, AssignedSquad.y + (SettlementBox.height + settlementYSpacing) * count + scroll, AssignedSquad.width, AssignedSquad.height), "No assigned Squad"); //settlement.militarySquad.name); } } else { Widgets.Label( new Rect(AssignedSquad.x, AssignedSquad.y + (SettlementBox.height + settlementYSpacing) * count + scroll, AssignedSquad.width, AssignedSquad.height), "No assigned Squad"); } Widgets.Label( new Rect(isBusy.x, isBusy.y + (SettlementBox.height + settlementYSpacing) * count + scroll, isBusy.width, isBusy.height), "Available: " + (!settlement.isMilitaryBusySilent())); Text.Font = GameFont.Tiny; //Set Squad Button if (Widgets.ButtonText( new Rect(buttonSetSquad.x, buttonSetSquad.y + (SettlementBox.height + settlementYSpacing) * count + scroll, buttonSetSquad.width, buttonSetSquad.height), "Set Squad")) { //check null if (util.squads == null) { util.resetSquads(); } List <FloatMenuOption> squads = new List <FloatMenuOption>(); squads.AddRange(util.squads .Select(squad => new FloatMenuOption(squad.name + " - Total Equipment Cost: " + squad.equipmentTotalCost, delegate { //Unit is selected util.attemptToAssignSquad(settlement, squad); }))); if (!squads.Any()) { squads.Add(new FloatMenuOption("No Available Squads", null)); } FloatMenu selection = new FloatMenuSearchable(squads); Find.WindowStack.Add(selection); } //View Squad if (Widgets.ButtonText( new Rect(buttonViewSquad.x, buttonViewSquad.y + (SettlementBox.height + settlementYSpacing) * count + scroll, buttonViewSquad.width, buttonViewSquad.height), "View Squad")) { Messages.Message("This is currently not implemented.", MessageTypeDefOf.RejectInput); } //Deploy Squad if (Widgets.ButtonText( new Rect(buttonDeploySquad.x, buttonDeploySquad.y + (SettlementBox.height + settlementYSpacing) * count + scroll, buttonDeploySquad.width, buttonDeploySquad.height), "Deploy Squad")) { if (!(settlement.isMilitaryBusy()) && settlement.isMilitarySquadValid()) { Find.WindowStack.Add(new FloatMenu(DeploymentOptions(settlement))); } else if (settlement.isMilitaryBusy() && settlement.isMilitarySquadValid() && faction.hasPolicy(FCPolicyDefOf.militaristic)) { if ((faction.traitMilitaristicTickLastUsedExtraSquad + GenDate.TicksPerDay * 5) <= Find.TickManager.TicksGame) { int cost = (int)Math.Round(settlement.militarySquad.outfit.updateEquipmentTotalCost() * .2); List <FloatMenuOption> options = new List <FloatMenuOption>(); options.Add(new FloatMenuOption("Deploy Secondary Squad - $" + cost + " silver", delegate { if (PaymentUtil.getSilver() >= cost) { List <FloatMenuOption> deploymentOptions = new List <FloatMenuOption>(); deploymentOptions.Add(new FloatMenuOption("Walk into map", delegate { FactionColonies.CallinAlliedForces(settlement, false, cost); Find.WindowStack.currentlyDrawnWindow.Close(); })); //check if medieval only bool medievalOnly = LoadedModManager.GetMod <FactionColoniesMod>() .GetSettings <FactionColonies>().medievalTechOnly; if (!medievalOnly && (DefDatabase <ResearchProjectDef> .GetNamed("TransportPod", false)?.IsFinished ?? false)) { deploymentOptions.Add(new FloatMenuOption("Drop-Pod", delegate { FactionColonies.CallinAlliedForces(settlement, true, cost); Find.WindowStack.currentlyDrawnWindow.Close(); })); } Find.WindowStack.Add(new FloatMenu(deploymentOptions)); } else { Messages.Message("NotEnoughSilverToDeploySquad".Translate(), MessageTypeDefOf.RejectInput); } })); Find.WindowStack.Add(new FloatMenu(options)); } else { Messages.Message( "XDaysToRedeploy".Translate(Math.Round( ((faction.traitMilitaristicTickLastUsedExtraSquad + GenDate.TicksPerDay * 5) - Find.TickManager.TicksGame).TicksToDays(), 1)), MessageTypeDefOf.RejectInput); } } } //Reset Squad if (Widgets.ButtonText( new Rect(buttonResetPawns.x, buttonResetPawns.y + (SettlementBox.height + settlementYSpacing) * count + scroll, buttonResetPawns.width, buttonResetPawns.height), "Reset Pawns")) { FloatMenuOption confirm = new FloatMenuOption("Are you sure? Click to confirm", delegate { if (settlement.militarySquad != null) { Messages.Message("Pawns have been regenerated for the squad", MessageTypeDefOf.NeutralEvent); settlement.militarySquad.initiateSquad(); } else { Messages.Message("There is no pawns to reset. Assign a squad first.", MessageTypeDefOf.RejectInput); } }); List <FloatMenuOption> list = new List <FloatMenuOption>(); list.Add(confirm); Find.WindowStack.Add(new FloatMenu(list)); } //Order Fire Support if (Widgets.ButtonText( new Rect(buttonOrderFireSupport.x, buttonOrderFireSupport.y + (SettlementBox.height + settlementYSpacing) * count + scroll, buttonOrderFireSupport.width, buttonOrderFireSupport.height), "Order Fire Support")) { List <FloatMenuOption> list = new List <FloatMenuOption>(); foreach (MilitaryFireSupport support in util.fireSupportDefs) { float cost = support.returnTotalCost(); FloatMenuOption option = new FloatMenuOption(support.name + " - $" + cost, delegate { if (support.returnTotalCost() <= FactionColonies.calculateMilitaryLevelPoints(settlement.settlementMilitaryLevel)) { if (settlement.buildings.Contains(BuildingFCDefOf.artilleryOutpost)) { if (settlement.artilleryTimer <= Find.TickManager.TicksGame) { if (PaymentUtil.getSilver() >= cost) { FactionColonies.FireSupport(settlement, support); Find.WindowStack.TryRemove(typeof(MilitaryCustomizationWindowFc)); } else { Messages.Message( "You lack the required amount of silver to use that firesupport option!", MessageTypeDefOf.RejectInput); } } else { Messages.Message( "That firesupport option is on cooldown for another " + (settlement.artilleryTimer - Find.TickManager.TicksGame) .ToStringTicksToDays(), MessageTypeDefOf.RejectInput); } } else { Messages.Message( "The settlement requires an artillery outpost to be built to use that firesupport option", MessageTypeDefOf.RejectInput); } } else { Messages.Message( "The settlement requires a higher military level to use that fire support!", MessageTypeDefOf.RejectInput); } }); list.Add(option); } if (!list.Any()) { list.Add(new FloatMenuOption("No fire supports currently made. Make one", delegate { })); } FloatMenu menu = new FloatMenuSearchable(list); Find.WindowStack.Add(menu); } count++; } //Reset Text anchor and font Text.Font = fontBefore; Text.Anchor = anchorBefore; if (Event.current.type == EventType.ScrollWheel) { scrollWindow(Event.current.delta.y, settlementMaxScroll); } }
public override void DrawTab(Rect rect) { //set text anchor and font GameFont fontBefore = Text.Font; TextAnchor anchorBefore = Text.Anchor; float projectileBoxHeight = 30; Rect SelectionBar = new Rect(5, 45, 200, 30); Rect nameTextField = new Rect(5, 90, 250, 30); Rect floatRangeAccuracyLabel = new Rect(nameTextField.x, nameTextField.y + nameTextField.height + 5, nameTextField.width, (float)(nameTextField.height * 1.5)); Rect floatRangeAccuracy = new Rect(floatRangeAccuracyLabel.x, floatRangeAccuracyLabel.y + floatRangeAccuracyLabel.height + 5, floatRangeAccuracyLabel.width, floatRangeAccuracyLabel.height); Rect UnitStandBase = new Rect(140, 200, 50, 30); Rect TotalCost = new Rect(325, 50, 450, 20); Rect numberProjectiles = new Rect(TotalCost.x, TotalCost.y + TotalCost.height + 5, TotalCost.width, TotalCost.height); Rect duration = new Rect(numberProjectiles.x, numberProjectiles.y + numberProjectiles.height + 5, numberProjectiles.width, numberProjectiles.height); Rect ResetButton = new Rect(700 - 2, 100, 100, 30); Rect DeleteButton = new Rect(ResetButton.x, ResetButton.y + ResetButton.height + 5, ResetButton.width, ResetButton.height); Rect PointRefButton = new Rect(DeleteButton.x, DeleteButton.y + DeleteButton.height + 5, DeleteButton.width, DeleteButton.height); //Up here to make sure it goes behind other layers if (selectedSupport != null) { DrawFireSupportBox(10, 230, 30); } Widgets.DrawMenuSection(new Rect(0, 0, 800, 225)); //If firesupport is not selected if (Widgets.CustomButtonText(ref SelectionBar, selectedText, Color.gray, Color.white, Color.black)) { List <FloatMenuOption> supports = new List <FloatMenuOption>(); //Option to create new firesupport supports.Add(new FloatMenuOption("Create New Fire Support", delegate { MilitaryFireSupport newFireSupport = new MilitaryFireSupport(); newFireSupport.name = "New Fire Support " + (util.fireSupportDefs.Count + 1); newFireSupport.setLoadID(); newFireSupport.projectiles = new List <ThingDef>(); selectedText = newFireSupport.name; selectedSupport = newFireSupport; util.fireSupportDefs.Add(newFireSupport); })); //Create list of selectable firesupports foreach (MilitaryFireSupport support in util.fireSupportDefs) { supports.Add(new FloatMenuOption(support.name, delegate { //Unit is selected selectedText = support.name; selectedSupport = support; })); } FloatMenu selection = new FloatMenuSearchable(supports); Find.WindowStack.Add(selection); } //if firesupport is selected if (selectedSupport != null) { //Need to adjust fireSupportMaxScroll = selectedSupport.projectiles.Count * projectileBoxHeight - 10 * projectileBoxHeight; Text.Anchor = TextAnchor.MiddleLeft; Text.Font = GameFont.Small; if (settlementPointReference != null) { Widgets.Label(TotalCost, "Total Fire Support Silver Cost: " + selectedSupport.returnTotalCost() + " / " + FactionColonies.calculateMilitaryLevelPoints(settlementPointReference .settlementMilitaryLevel) + " (Max Cost)"); } else { Widgets.Label(TotalCost, "Total Fire Support Silver Cost: " + selectedSupport.returnTotalCost() + " / " + "No Reference"); } Widgets.Label(numberProjectiles, "Number of Projectiles: " + selectedSupport.projectiles.Count); Widgets.Label(duration, "Duration of fire support: " + Math.Round(selectedSupport.projectiles.Count * .25, 2) + " seconds"); Widgets.Label(floatRangeAccuracyLabel, selectedSupport.accuracy + " = Accuracy of fire support (In tiles radius): Affecting cost by : " + selectedSupport.returnAccuracyCostPercentage() + "%"); selectedSupport.accuracy = Widgets.HorizontalSlider(floatRangeAccuracy, selectedSupport.accuracy, Math.Max(3, (15 - Find.World.GetComponent <FactionFC>().returnHighestMilitaryLevel())), 30, roundTo: 1); Text.Font = GameFont.Tiny; Text.Anchor = TextAnchor.UpperCenter; //Unit Name selectedSupport.name = Widgets.TextField(nameTextField, selectedSupport.name); if (Widgets.ButtonText(ResetButton, "Reset to Default")) { selectedSupport.projectiles = new List <ThingDef>(); } if (Widgets.ButtonText(DeleteButton, "Delete Support")) { selectedSupport.delete(); util.checkMilitaryUtilForErrors(); selectedSupport = null; selectedText = "Select A Fire Support"; //Reset Text anchor and font Text.Font = fontBefore; Text.Anchor = anchorBefore; return; } if (Widgets.ButtonText(PointRefButton, "Set Point Ref")) { List <FloatMenuOption> settlementList = new List <FloatMenuOption>(); foreach (SettlementFC settlement in Find.World.GetComponent <FactionFC>().settlements) { settlementList.Add(new FloatMenuOption( settlement.name + " - Military Level : " + settlement.settlementMilitaryLevel, delegate { //set points settlementPointReference = settlement; })); } if (!settlementList.Any()) { settlementList.Add(new FloatMenuOption("No Valid Settlements", null)); } FloatMenu floatMenu = new FloatMenu(settlementList); Find.WindowStack.Add(floatMenu); } //Reset Text anchor and font Text.Font = fontBefore; Text.Anchor = anchorBefore; } if (Event.current.type == EventType.ScrollWheel) { scrollWindow(Event.current.delta.y, fireSupportMaxScroll); } //Reset Text anchor and font Text.Font = fontBefore; Text.Anchor = anchorBefore; }
public override void DrawTab(Rect rect) { //set text anchor and font GameFont fontBefore = Text.Font; TextAnchor anchorBefore = Text.Anchor; Rect SelectionBar = new Rect(5, 45, 200, 30); Rect importButton = new Rect(5, SelectionBar.y + SelectionBar.height + 10, 200, 30); Rect nameTextField = new Rect(5, importButton.y + importButton.height + 10, 250, 30); Rect isTrader = new Rect(5, nameTextField.y + nameTextField.height + 10, 130, 30); Rect UnitStandBase = new Rect(170, 220, 50, 30); Rect EquipmentTotalCost = new Rect(350, 50, 450, 40); Rect ResetButton = new Rect(700, 100, 100, 30); Rect DeleteButton = new Rect(ResetButton.x, ResetButton.y + ResetButton.height + 5, ResetButton.width, ResetButton.height); Rect PointRefButton = new Rect(DeleteButton.x, DeleteButton.y + DeleteButton.height + 5, DeleteButton.width, DeleteButton.height); Rect SaveSquadButton = new Rect(DeleteButton.x, PointRefButton.y + DeleteButton.height + 5, DeleteButton.width, DeleteButton.height); //If squad is not selected if (Widgets.CustomButtonText(ref SelectionBar, selectedText, Color.gray, Color.white, Color.black)) { //check null if (util.squads == null) { util.resetSquads(); } List <FloatMenuOption> squads = new List <FloatMenuOption> { new FloatMenuOption("Create New Squad", delegate { MilSquadFC newSquad = new MilSquadFC(true) { name = $"New Squad {(util.squads.Count + 1).ToString()}" }; selectedText = newSquad.name; selectedSquad = newSquad; selectedSquad.newSquad(); util.squads.Add(newSquad); }) }; //Create list of selectable units squads.AddRange(util.squads.Select(squad => new FloatMenuOption(squad.name, delegate { //Unit is selected selectedText = squad.name; selectedSquad = squad; selectedSquad.updateEquipmentTotalCost(); }))); FloatMenu selection = new Searchable_FloatMenu(squads); Find.WindowStack.Add(selection); } if (Widgets.ButtonText(importButton, "Import Squad")) { Find.WindowStack.Add(new Dialog_ManageSquadExportsFC( FactionColoniesMilitary.SavedSquads.ToList())); } //if squad is selected if (selectedSquad != null) { Text.Anchor = TextAnchor.MiddleLeft; Text.Font = GameFont.Small; if (settlementPointReference != null) { Widgets.Label(EquipmentTotalCost, "Total Squad Equipment Cost: " + selectedSquad.equipmentTotalCost + " / " + FactionColonies .calculateMilitaryLevelPoints(settlementPointReference .settlementMilitaryLevel) + " (Max Cost)"); } else { Widgets.Label(EquipmentTotalCost, "Total Squad Equipment Cost: " + selectedSquad.equipmentTotalCost + " / " + "No Reference"); } Text.Font = GameFont.Tiny; Text.Anchor = TextAnchor.UpperCenter; Widgets.CheckboxLabeled(isTrader, "is Trader Caravan", ref selectedSquad.isTraderCaravan); selectedSquad.setTraderCaravan(selectedSquad.isTraderCaravan); //Unit Name selectedSquad.name = Widgets.TextField(nameTextField, selectedSquad.name); if (Widgets.ButtonText(ResetButton, "Reset to Default")) { selectedSquad.newSquad(); } if (Widgets.ButtonText(DeleteButton, "Delete Squad")) { selectedSquad.deleteSquad(); util.checkMilitaryUtilForErrors(); selectedSquad = null; selectedText = "Select A Squad"; //Reset Text anchor and font Text.Font = fontBefore; Text.Anchor = anchorBefore; return; } if (Widgets.ButtonText(PointRefButton, "Set Point Ref")) { List <FloatMenuOption> settlementList = Find.World.GetComponent <FactionFC>() .settlements.Select(settlement => new FloatMenuOption(settlement.name + " - Military Level : " + settlement.settlementMilitaryLevel, delegate { //set points settlementPointReference = settlement; })) .ToList(); if (!settlementList.Any()) { settlementList.Add(new FloatMenuOption("No Valid Settlements", null)); } FloatMenu floatMenu = new FloatMenu(settlementList) { vanishIfMouseDistant = true }; Find.WindowStack.Add(floatMenu); } if (Widgets.ButtonText(SaveSquadButton, "Export Squad")) { // TODO: Confirm if squad with name already exists FactionColoniesMilitary.SaveSquad(new SavedSquadFC(selectedSquad)); Messages.Message("ExportSquad".Translate(), MessageTypeDefOf.TaskCompletion); } //for (int k = 0; k < 30; k++) //{ // Widgets.ButtonImage(new Rect(UnitStandBase.x + (k * 15), UnitStandBase.y + ((k % 5) * 70), 50, 20), texLoad.unitCircle); //} for (int k = 0; k < 30; k++) { if (Widgets.ButtonImage(new Rect(UnitStandBase.x + k % 6 * 80, UnitStandBase.y + (k - k % 6) / 5 * 70, 50, 20), TexLoad.unitCircle)) { int click = k; //Option to clear unit slot List <FloatMenuOption> units = new List <FloatMenuOption> { new FloatMenuOption("clearUnitSlot".Translate(), delegate { //Log.Message(selectedSquad.units.Count().ToString()); //Log.Message(click.ToString()); selectedSquad.units[click] = new MilUnitFC(true); selectedSquad.updateEquipmentTotalCost(); selectedSquad.ChangeTick(); }) }; //Create list of selectable units units.AddRange(util.units.Select(unit => new FloatMenuOption(unit.name + " - Cost: " + unit.equipmentTotalCost, delegate { //Unit is selected selectedSquad.units[click] = unit; selectedSquad.updateEquipmentTotalCost(); selectedSquad.ChangeTick(); }))); FloatMenu selection = new Searchable_FloatMenu(units); Find.WindowStack.Add(selection); } if (selectedSquad.units[k].isBlank) { continue; } if (selectedSquad.units.ElementAt(k).animal != null) { Widgets.ButtonImage( new Rect(UnitStandBase.x + 15 + ((k % 6) * 80), UnitStandBase.y - 45 + (k - k % 6) / 5 * 70, 60, 60), selectedSquad.units.ElementAt(k).animal.race.uiIcon); } Widgets.ThingIcon( new Rect(UnitStandBase.x - 5 + ((k % 6) * 80), UnitStandBase.y - 45 + (k - k % 6) / 5 * 70, 60, 60), selectedSquad.units.ElementAt(k).defaultPawn); if (selectedSquad.units.ElementAt(k).defaultPawn.equipment.AllEquipmentListForReading.Count > 0) { Widgets.ThingIcon( new Rect(UnitStandBase.x - 5 + ((k % 6) * 80), UnitStandBase.y - 15 + (k - k % 6) / 5 * 70, 40, 40), selectedSquad.units.ElementAt(k).defaultPawn.equipment.AllEquipmentListForReading[0]); } Widgets.Label( new Rect(UnitStandBase.x - 15 + ((k % 6) * 80), UnitStandBase.y - 65 + (k - k % 6) / 5 * 70, 80, 60), selectedSquad.units.ElementAt(k).name); } //Reset Text anchor and font Text.Font = fontBefore; Text.Anchor = anchorBefore; } //Reset Text anchor and font Text.Font = fontBefore; Text.Anchor = anchorBefore; }
public void checkMilitaryUtilForErrors() { if (blankUnit == null) { blankUnit = new MilUnitFC(true); } //Log.Message("checking for errors" + Find.TickManager.TicksGame); foreach (MilSquadFC squad in squads) { bool changed = false; for (int count = 0; count < 30; count++) { if (squad.units[count] != null && (units.Contains(squad.units[count]) || squad.units[count] == blankUnit)) { continue; } squad.units[count] = blankUnit; changed = true; } if (!changed) { continue; } foreach (var squadMerc in mercenarySquads.Where(squadMerc => squadMerc.outfit != null && squadMerc.outfit == squad)) { squadMerc.OutfitSquad(squad); } } foreach (MercenarySquadFC squad in mercenarySquads) { if (squad.outfit == null || squads.Contains(squad.outfit) == false) { squad.StripSquad(); squad.outfit = null; } else { int settlementMilLevel = 0; if (squad.settlement != null) { settlementMilLevel = squad.settlement.settlementMilitaryLevel; } if (squad.outfit == null || !(squad.outfit.equipmentTotalCost > FactionColonies.calculateMilitaryLevelPoints(settlementMilLevel))) { continue; } if (squad.settlement != null) { Messages.Message( "The max allowed equipment cost for the squad assigned to " + squad.settlement.name + " has been exceeded. Thus, the settlement's squad has been unassigned.", MessageTypeDefOf.RejectInput); } squad.outfit = null; squad.StripSquad(); } } if (tickChanged >= GETLatestChange) { return; } foreach (var merc in mercenarySquads.Where(merc => merc.outfit != null)) { merc.OutfitSquad(merc.outfit); } }