private DecorCellManager() { brokenFlag = Traverse.Create(typeof(BuildingHP.States)). GetField <Operational.Flag>("healthyFlag"); happinessAttribute = Db.Get().CritterAttributes.Happiness; size = Grid.CellCount; noCritterDecor = DecorReimaginedPatches.Options.AllCrittersZeroDecor; decorGrid = new DecorCell[size]; provInfo = new Dictionary <DecorProvider, DecorSplatNew>(1024); }
public override void Update() { var attributes = check; // Avoid recreating this every update if (attributes == null) { var dbAttr = Db.Get().Attributes; check = attributes = new Klei.AI.Attribute[] { dbAttr.Art, dbAttr.Athletics, dbAttr.Botanist, dbAttr.Caring, dbAttr.Construction, dbAttr.Cooking, dbAttr.Digging, dbAttr.Learning, dbAttr.Machinery, dbAttr.Ranching, dbAttr.Strength }; } // Check each duplicant foreach (var duplicant in Components.LiveMinionIdentities.Items) { if (duplicant != null) { bool ok = true; // All attributes must be over the threshold foreach (var attribute in attributes) { if ((attribute.Lookup(duplicant)?.GetTotalValue() ?? 0.0f) < required) { ok = false; break; } } if (ok) { achieved = true; break; } } } }
public static void Prefix(ref string id, ref string name, ref string description, ref Klei.AI.Attribute attribute, ref float multiplier, ref float base_value, ref IAttributeFormatter formatter) { //IDs to ignore //id: ImmuneLevelBoost //id: TemperatureInsulation //id: SeedHarvestChance if (id != "ImmuneLevelBoost" && id != "TemperatureInsulation" && id != "SeedHarvestChance") { Debug.Log(" === Attribute " + id + " boosted === "); multiplier = 1000.0f; base_value = 1000.0f; } /*Debug.Log("id: " + id.ToString()); * Debug.Log("name: " + name.ToString()); * Debug.Log("description: " + description.ToString()); * Debug.Log("attribute: " + attribute.ToString()); * Debug.Log("multiplier: " + multiplier.ToString()); * Debug.Log("base_value: " + base_value.ToString()); * Debug.Log("formatter: " + formatter.ToString()); * Debug.Log(" === MaxAttributes END === ");*/ }
public static bool Prefix(Database.AttributeConverters __instance, string id, string name, string description, Klei.AI.Attribute attribute, ref float multiplier, float base_value, IAttributeFormatter formatter) { float research_speed = config.GetProperty <float>("research_speed"); if (id.Equals("ResearchSpeed")) { multiplier = research_speed; } return(true); }