Ejemplo n.º 1
0
        private void OnKctPadConstructionComplete(PadConstruction data, KCT_LaunchPad lp)
        {
            if (CareerEventScope.ShouldIgnore)
            {
                return;
            }

            AddFacilityConstructionEvent(SpaceCenterFacility.LaunchPad, lp.fractionalLevel, data.Cost, ConstructionState.Completed);
        }
Ejemplo n.º 2
0
        private void UpdateKCTRates()
        {
            Profiler.BeginSample("RP0Maintenance UpdateKCTRates");
            KCTPadLevels.Clear();
            for (int i = KCTPadCounts.Length; i-- > 0;)
            {
                KCTPadCounts[i] = 0;
            }

            foreach (KSCItem ksc in KCTGameStates.KSCs)
            {
                double buildRate = 0d;

                for (int i = ksc.VABRates.Count; i-- > 0;)
                {
                    buildRate += Math.Max(0d, ksc.VABRates[i] + BuildRateOffset);
                }

                for (int i = ksc.SPHRates.Count; i-- > 0;)
                {
                    buildRate += Math.Max(0d, ksc.SPHRates[i] + BuildRateOffset);
                }

                if (buildRate < 0.01d)
                {
                    continue;
                }

                KCTBuildRates[ksc.KSCName] = buildRate;

                for (int i = ksc.LaunchPads.Count; i-- > 0;)
                {
                    KCT_LaunchPad pad           = ksc.LaunchPads[i];
                    int           roundedPadLvl = (int)Math.Round(pad.fractionalLevel);
                    if (pad.isOperational && roundedPadLvl < PadLevelCount)
                    {
                        ++KCTPadCounts[roundedPadLvl];
                        KCTPadLevels.Add(pad.fractionalLevel);
                    }
                }
            }

            KCTResearchRate = MathParser.ParseNodeRateFormula(10);
            Profiler.EndSample();
        }