public static void CalculateColonyTithes(CorruptionStoryTracker tracker) { Log.Message("Calculating Tithes"); float wealthInt = 0f; List <Map> maps = Find.Maps; for (int i = 0; i < maps.Count; i++) { if (maps[i].IsPlayerHome) { wealthInt += maps[i].wealthWatcher.WealthTotal; } } float calc = 0f; float totalAmount = TitheUtilities.TaxCalculation(wealthInt); float baseAmount = totalAmount / DefDatabase <TitheDef> .AllDefsListForReading.Count; foreach (TitheDef current in DefDatabase <TitheDef> .AllDefsListForReading) { if (!tracker.currentTithes.Any(x => x.titheDef == current)) { if (calc <= totalAmount) { calc += baseAmount; float num = baseAmount * current.wealthFactor; TitheEntryGlobal entry = new TitheEntryGlobal(current, num); tracker.currentTithes.Add(entry); } } } tracker.DaysToTitheCollection = 60; tracker.TitheCollectionActive = false; }
public static void PerformRefusedTitheEvaluation() { CorruptionStoryTracker tracker = CorruptionStoryTrackerUtilities.currentStoryTracker; tracker.ResetIoMAcknowledgement(); int num = tracker.PlanetaryGovernor.skills.GetSkill(SkillDefOf.Social).levelInt + Rand.Range(10, 15); if (num > 27) { return; } else if (num > 20) { CorruptionStoryTrackerUtilities.InitiateGovernorArrestEvent(tracker.PlanetaryGovernor.Map); } else { } }
public Window_RefusedTithePayment(CorruptionStoryTracker tracker) { this.tracker = tracker; }
public Window_IoMTitheDue(CorruptionStoryTracker tracker) { this.tracker = tracker; }
public override void PostMake() { this.storyTracker = CorruptionStoryTrackerUtilities.currentStoryTracker; base.contentsKnown = true; base.PostMake(); }