コード例 #1
0
        public static bool Prefix(ref float __result, ShipStatus __instance, [HarmonyArgument(0)] GameData.OFKOJOKOOAK player)
        {
            ISystemType systemType = __instance.Systems.ContainsKey(SystemTypes.Electrical) ? __instance.Systems[SystemTypes.Electrical] : null;

            if (systemType == null)
            {
                return(true);
            }
            SwitchSystem switchSystem = systemType.TryCast <SwitchSystem>();

            if (switchSystem == null)
            {
                return(true);
            }

            float num = (float)switchSystem.OBNIGODIBIO / 255f;

            if (player == null || player.FGNJJFABIHJ)
            {
                __result = __instance.MaxLightRadius;
            }
            else if (player.CIDDOFDJHJH)
            {
                __result = __instance.MaxLightRadius * PlayerControl.GameOptions.AFGNADFLBDB;
            }
            else if (Lighter.lighter != null && Lighter.lighter.PlayerId == player.GMBAIPNOKLP && Lighter.lighterTimer > 0f)
            {
                __result = Mathf.Lerp(__instance.MaxLightRadius * Lighter.lighterModeLightsOffVision, __instance.MaxLightRadius * Lighter.lighterModeLightsOnVision, num);
            }
            else
            {
                __result = Mathf.Lerp(__instance.MinLightRadius, __instance.MaxLightRadius, num) * PlayerControl.GameOptions.OJCJDCMDKKC;
            }
            return(false);
        }
コード例 #2
0
        private static bool CheckAndEndGameForSabotageWin(ShipStatus __instance)
        {
            if (__instance.Systems == null)
            {
                return(false);
            }
            ISystemType systemType = __instance.Systems.ContainsKey(SystemTypes.LifeSupp) ? __instance.Systems[SystemTypes.LifeSupp] : null;

            if (systemType != null)
            {
                LifeSuppSystemType lifeSuppSystemType = systemType.TryCast <LifeSuppSystemType>();
                if (lifeSuppSystemType != null && lifeSuppSystemType.DFAOAPHABEF < 0f)
                {
                    EndGameForSabotage(__instance);
                    lifeSuppSystemType.DFAOAPHABEF = 10000f;
                    return(true);
                }
            }
            ISystemType systemType2 = __instance.Systems.ContainsKey(SystemTypes.Reactor) ? __instance.Systems[SystemTypes.Reactor] : null;

            if (systemType2 == null)
            {
                systemType2 = __instance.Systems.ContainsKey(SystemTypes.Laboratory) ? __instance.Systems[SystemTypes.Laboratory] : null;
            }
            if (systemType2 != null)
            {
                ICriticalSabotage criticalSystem = systemType2.TryCast <ICriticalSabotage>();
                if (criticalSystem != null && criticalSystem.DFAOAPHABEF < 0f)
                {
                    EndGameForSabotage(__instance);
                    criticalSystem.ClearSabotage();
                    return(true);
                }
            }
            return(false);
        }