コード例 #1
0
            private static void Postfix(Oxyfern __instance, ElementConsumer ___elementConsumer, ElementConverter ___elementConverter)
            {
                float multiplier = __instance.GetAttributes().Get(OxyfernThroughput).GetTotalValue();

                ___elementConsumer.consumptionRate *= multiplier;
                ___elementConsumer.RefreshConsumptionRate();
                ___elementConverter.SetWorkSpeedMultiplier(multiplier);
            }
コード例 #2
0
        public static bool Prefix(Oxyfern __instance, ReceptacleMonitor ___receptacleMonitor)
        {
            float oxyfernOxygenPerSecond = CustomizePlantsState.StateManager.State.OxyfernOxygenPerSecond;

            ElementConsumer elementConsumer = __instance.GetComponent <ElementConsumer>();

            if (elementConsumer != null)
            {
                if (___receptacleMonitor.Replanted)
                {
                    elementConsumer.consumptionRate = oxyfernOxygenPerSecond / 50f;
                }
                else
                {
                    elementConsumer.consumptionRate = oxyfernOxygenPerSecond / 200f;
                }
                return(false);
            }
            else
            {
                Debug.LogWarning("Oxyfern_SetConsumptionRate elementConsumer was null");
            }
            return(true);
        }