public double returnLowestCost() { double minimum = filter.AllowedThingDefs.Aggregate <ThingDef, double>(999999, (current, thing) => Math.Min(thing?.BaseMarketValue ?? 100, current)); //Log.Message(minimum.ToString()); taxMinimumToTithe = minimum + FactionColonies.Settings().productionTitheMod + TraitUtilsFC.cycleTraits("taxBaseRandomModifier", Find.World.GetComponent <FactionFC>().traits, Operation.Addition) + TraitUtilsFC.cycleTraits("taxBaseRandomModifier", settlement.traits, Operation.Addition); return(minimum); }
public static TaxDeliveryMode TaxDeliveryModeForSettlement(bool canUseShuttle) { if (FactionColonies.Settings().forcedTaxDeliveryMode != default) { return(FactionColonies.Settings().forcedTaxDeliveryMode); } if (DefDatabase <ResearchProjectDef> .GetNamed("TransportPod").IsFinished) { if (ModsConfig.RoyaltyActive && canUseShuttle) { return(TaxDeliveryMode.Shuttle); } return(TaxDeliveryMode.DropPod); } return(TaxDeliveryMode.Caravan); }
static bool Prefix(Pawn __instance) { if (__instance.IsMercenary()) { if (__instance.Faction != FactionColonies.getPlayerColonyFaction()) { __instance.SetFaction(FactionColonies.getPlayerColonyFaction()); } MercenarySquadFC squad = Find.World.GetComponent <FactionFC>().militaryCustomizationUtil.returnSquadFromUnit(__instance); if (squad != null) { Mercenary merc = Find.World.GetComponent <FactionFC>().militaryCustomizationUtil.returnMercenaryFromUnit(__instance, squad); if (merc != null) { if (squad.settlement != null) { if (FactionColonies.Settings().deadPawnsIncreaseMilitaryCooldown) { squad.dead += 1; } squad.settlement.happiness -= 1; } squad.PassPawnToDeadMercenaries(merc); } squad.removeDroppedEquipment(); } else { Log.Message("Mercenary Errored out. Did not find squad."); } __instance.equipment?.DestroyAllEquipment(); __instance.apparel?.DestroyAll(); //__instance.Destroy(); return(true); } return(true); }
public FCOptionWindow(FCEventDef evt, FCEvent parentEvent) { this.forcePause = !FactionColonies.Settings().disableForcedPausingDuringEvents; this.draggable = true; this.doCloseX = false; this.preventCameraMotion = false; this.header = evt.label; this.options = evt.options; if (evt.optionDescription == "") { this.desc = evt.desc; } else { this.desc = evt.optionDescription; } this.closeOnAccept = false; this.closeOnCancel = false; this.closeOnClickedOutside = false; this.parentEvent = parentEvent; }