static void Postfix(CompQuality __instance, QualityCategory q, ArtGenerationContext source) { // Can we be infused? CompInfusion compInfusion = __instance.parent.TryGetComp <CompInfusion> (); if (compInfusion != null) { var thing = __instance.parent; var def = __instance.parent.def; // Get those Infusions rolling var prefix = roll(thing, q); var suffix = roll(thing, q); var tierMult = def.techLevel < TechLevel.Industrial ? 3 : 1; if (prefix) { compInfusion.InitializeInfusionPrefix(GenInfusion.GetTier(q, tierMult)); } if (suffix) { compInfusion.InitializeInfusionSuffix(GenInfusion.GetTier(q, tierMult)); } if (prefix || suffix) { __instance.parent.HitPoints = __instance.parent.MaxHitPoints; } } }
public static void DeRegister(CompInfusion compInfusion) { Drawee.Remove(compInfusion); }
public static void Register(CompInfusion compInfusion) { Drawee.Add(compInfusion); }