public static bool CheckIfCarePackageIsOnCooldown(string username, bool separateChannel = false) { if (!ToolkitSettings.MaxEvents) { return(false); } Store_Component component = Current.Game.GetComponent <Store_Component>(); StoreIncidentVariables incident = DefDatabase <StoreIncidentVariables> .GetNamed("Item"); if (component.IncidentsInLogOf(incident.abbreviation) >= ToolkitSettings.MaxCarePackagesPerInterval) { float daysTill = component.DaysTillIncidentIsPurchaseable(incident); Toolkit.client.SendMessage($"@{username} care packages are on cooldown, wait " + daysTill + $" day{(daysTill != 1 ? "s" : "")}.", separateChannel); return(true); } return(false); }
public static bool CheckIfIncidentIsOnCooldown(StoreIncident incident, string username, bool separateChannel = false) { if (!ToolkitSettings.EventsHaveCooldowns) { return(false); } Store_Component component = Current.Game.GetComponent <Store_Component>(); bool maxed = component.IncidentsInLogOf(incident.abbreviation) >= incident.eventCap; if (maxed) { float days = component.DaysTillIncidentIsPurchaseable(incident); Toolkit.client.SendMessage($"@{username} {incident.label.CapitalizeFirst()} is maxed, wait " + days + $" day{(days != 1 ? "s" : "")} to purchase.", separateChannel); } return(maxed); }
public static bool CheckIfKarmaTypeIsMaxed(StoreIncident incident, string username, bool separateChannel = false) { bool maxed = CheckTimesKarmaTypeHasBeenUsedRecently(incident); if (maxed) { Store_Component component = Current.Game.GetComponent <Store_Component>(); Toolkit.client.SendMessage($"@{username} {incident.label.CapitalizeFirst()} is maxed from karmatype, wait " + component.DaysTillIncidentIsPurchaseable(incident) + " days to purchase.", separateChannel); } return(maxed); }