public EngineHandler(PowerUpgradeModuleMk2 upgradeMk2, PowerUpgradeModuleMk3 upgradeMk3, SubRoot cyclops)
            : base(BaseValue, cyclops)
        {
            TieredUpgradeHandler <int> tier1 = CreateTier(TechType.PowerUpgradeModule, 1);

            tier1.MaxCount = MaxAllowedPerTier;

            TieredUpgradeHandler <int> tier2 = CreateTier(upgradeMk2.TechType, 2);

            tier2.MaxCount = MaxAllowedPerTier;

            TieredUpgradeHandler <int> tier3 = CreateTier(upgradeMk3.TechType, 3);

            tier3.MaxCount = MaxAllowedPerTier;

            OnFinishedUpgrades = () =>
            {
                int powerIndex = this.HighestValue;

                if (lastKnownPowerIndex != powerIndex)
                {
                    lastKnownPowerIndex = powerIndex;

                    base.Cyclops.silentRunningPowerCost = SilentRunningPowerCosts[powerIndex];
                    base.Cyclops.sonarPowerCost         = SonarPowerCosts[powerIndex];
                    base.Cyclops.shieldPowerCost        = ShieldPowerCosts[powerIndex];
                    this.RatingManager.ApplyPowerRatingModifier(TechType.PowerUpgradeModule, EnginePowerRatings[powerIndex]);
                }
            };
        }
Exemplo n.º 2
0
        public static void Patch()
        {
            QuickLogger.Info($"Started patching. Version {QuickLogger.GetAssemblyVersion()}");

            var engineMk2Upgrade = new PowerUpgradeModuleMk2();
            var engineMk3Upgrade = new PowerUpgradeModuleMk3(engineMk2Upgrade);

            engineMk2Upgrade.Patch();
            engineMk3Upgrade.Patch();

            MCUServices.Register.CyclopsUpgradeHandler(engineMk3Upgrade.CreateEngineHandler);
            MCUServices.Register.PdaIconOverlay(TechType.PowerUpgradeModule, engineMk3Upgrade.CreateEngineOverlay);
            MCUServices.Register.PdaIconOverlay(engineMk2Upgrade.TechType, engineMk3Upgrade.CreateEngineOverlay);
            MCUServices.Register.PdaIconOverlay(engineMk3Upgrade.TechType, engineMk3Upgrade.CreateEngineOverlay);

            QuickLogger.Info($"Finished patching.");
        }
        public static void Patch()
        {
            MCUServices.Logger.Info($"Started patching. Version {QuickLogger.GetAssemblyVersion()}");

            var engineMk2Upgrade = new PowerUpgradeModuleMk2();
            var engineMk3Upgrade = new PowerUpgradeModuleMk3(engineMk2Upgrade);

            engineMk2Upgrade.Patch();
            engineMk3Upgrade.Patch();

            LanguageHandler.SetLanguageLine(EngineOverlay.BonusKey, "[Bonus Efficiency]");
            LanguageHandler.SetLanguageLine(EngineOverlay.TotalKey, "[Total Efficiency]");

            MCUServices.Register.CyclopsUpgradeHandler((SubRoot cyclops) =>
            {
                return(new EngineHandler(engineMk2Upgrade, engineMk3Upgrade, cyclops));
            });

            MCUServices.Register.PdaIconOverlay(TechType.PowerUpgradeModule, CreateEngineOverlay);
            MCUServices.Register.PdaIconOverlay(engineMk2Upgrade.TechType, CreateEngineOverlay);
            MCUServices.Register.PdaIconOverlay(engineMk3Upgrade.TechType, CreateEngineOverlay);

            MCUServices.Logger.Info($"Finished patching.");
        }