Наследование: UnityEngine.MonoBehaviour
Пример #1
0
        public float GetEfficiencyBonus()
        {
            var bodyId   = vessel.mainBody.flightGlobalsIndex;
            var geoBonus = KolonizationManager.GetGeologyResearchBonus(bodyId);

            return(geoBonus * GetEfficiencyPartsBonus() * GetPlanetaryBonus());
        }
Пример #2
0
        private void StatScreen()
        {
            _scrollPos = GUILayout.BeginScrollView(_scrollPos, _scrollStyle, GUILayout.Width(680), GUILayout.Height(380));
            GUILayout.BeginVertical();

            GUILayout.BeginHorizontal();
            GUILayout.Label(String.Format("Body Name"), _labelStyle, GUILayout.Width(135));
            GUILayout.Label(String.Format("Geology"), _labelStyle, GUILayout.Width(80));
            GUILayout.Label(String.Format("Botany"), _labelStyle, GUILayout.Width(80));
            GUILayout.Label(String.Format("Kolonization"), _labelStyle, GUILayout.Width(80));
            GUILayout.EndHorizontal();

            var focusedPlanet = GetFocusedPlanet();
            var planetList    = KolonizationManager.Instance.KolonizationInfo.Select(p => p.BodyIndex).Distinct().OrderByDescending(pId => pId == focusedPlanet);

            foreach (var p in planetList)
            {
                var body = FlightGlobals.Bodies[p];
                var geo  = KolonizationManager.GetGeologyResearchBonus(p);
                var kol  = KolonizationManager.GetKolonizationResearchBonus(p);
                var bot  = KolonizationManager.GetBotanyResearchBonus(p);
                GUILayout.BeginHorizontal();
                GUILayout.Label(String.Format("<color=#FFFFFF>{0}</color>", body.bodyName), _labelStyle, GUILayout.Width(135));
                GUILayout.Label(String.Format("<color=#FFD900>{0:n3}%</color>", geo * 100d), _labelStyle, GUILayout.Width(80));
                GUILayout.Label(String.Format("<color=#FFD900>{0:n3}%</color>", bot * 100d), _labelStyle, GUILayout.Width(80));
                GUILayout.Label(String.Format("<color=#FFD900>{0:n3}%</color>", kol * 100d), _labelStyle, GUILayout.Width(80));
                GUILayout.EndHorizontal();
            }

            GUILayout.EndVertical();
            GUILayout.EndScrollView();
        }
Пример #3
0
        private float GetPlanetaryBonus()
        {
            var bodyId = vessel.mainBody.flightGlobalsIndex;

            switch (BonusEffect)
            {
            case "RepBoost":
                return(KolonizationManager.GetKolonizationResearchBonus(bodyId));

            case "ScienceBoost":
                return(KolonizationManager.GetBotanyResearchBonus(bodyId));

            default:
                return(KolonizationManager.GetGeologyResearchBonus(bodyId));
            }
        }
Пример #4
0
        private float GetPlanetaryBonus()
        {
            var bodyId = vessel.mainBody.flightGlobalsIndex;

            if (BonusEffect == "RepBoost")
            {
                return(KolonizationManager.GetKolonizationResearchBonus(bodyId));
            }
            else if (BonusEffect == "ScienceBoost")
            {
                return(KolonizationManager.GetBotanyResearchBonus(bodyId));
            }
            else
            {
                return(KolonizationManager.GetGeologyResearchBonus(bodyId));
            }
        }
Пример #5
0
        public Dictionary <string, float> GetEfficiencyBonuses()
        {
            var bodyId         = vessel.mainBody.flightGlobalsIndex;
            var geoBonus       = KolonizationManager.GetGeologyResearchBonus(bodyId);
            var planetaryBonus = GetPlanetaryBonus();

            var bonuses = new Dictionary <string, float>();

            if (_bonusTags != null && _bonusTags.Any())
            {
                for (int i = 0; i < _bonusTags.Count; i++)
                {
                    var tag        = _bonusTags[i];
                    var bonusValue = geoBonus * planetaryBonus * GetEfficiencyPartsBonus(tag);

                    bonuses.Add(tag, bonusValue);
                }
            }

            return(bonuses);
        }