Ejemplo n.º 1
0
 void OnEnable()
 {
     if (CheckLevelUp && GameState.Instance.PlayerRpgState.Experience >= RpgValues.XPToNext(GameState.Instance.PlayerRpgState.Level))
     {
         DefaultLevelUpModal.PushModal(OnLevelUpDone);
     }
 }
Ejemplo n.º 2
0
 void OnEnable()
 {
     //why is this not on SignalPaint? hell if I know
     if (CheckLevelUp && !GameState.Instance.MenuGameStateLocked && GameState.Instance.PlayerRpgState.Experience >= RpgValues.XPToNext(GameState.Instance.PlayerRpgState.Level))
     {
         DefaultLevelUpModal.PushModal(OnLevelUpDone);
     }
 }
Ejemplo n.º 3
0
        public override void SignalPaint()
        {
            CharacterModel pModel = GameState.Instance.PlayerRpgState;

            //PlayerControl pControl = PlayerControl.Instance;

            //repaint
            HealthText.text = string.Format("Health: {0}/{1}", (int)pModel.Health, (int)pModel.DerivedStats.MaxHealth);
            ArmorText.text  = string.Format("Level: {0} ({1}/{2} XP)\n", pModel.Level, pModel.Experience, RpgValues.XPToNext(pModel.Level));

            string equipText = string.Format("Armor: {0}\nLH Weapon: {1}\nRH Weapon: {2}",
                                             GetNameForSlot(EquipSlot.Body, pModel), GetNameForSlot(EquipSlot.LeftWeapon, pModel), GetNameForSlot(EquipSlot.RightWeapon, pModel));

            AmmoText.text = equipText;

            LevelUpButton.interactable = !GameState.Instance.MenuGameStateLocked;

            //this is now somewhat broken because there are more choices in the struct
            string rid = pModel.Gender == Sex.Female ? "portrait_f" : "portrait_m";

            CharacterImage.texture = CoreUtils.LoadResource <Texture2D>("UI/Portraits/" + rid);
        }
Ejemplo n.º 4
0
        private void PaintStats()
        {
            StringBuilder statsSB = new StringBuilder(); //really can't guess here

            var      player       = GameState.Instance.PlayerRpgState;
            StatsSet baseStats    = player.BaseStats;
            StatsSet derivedStats = player.DerivedStats;

            //level and XP
            statsSB.AppendFormat("Level {0} ({1}/{2})\n\n", player.Level, player.Experience, RpgValues.XPToNext(player.Level));

            //base statistics
            foreach (StatType value in Enum.GetValues(typeof(StatType)))
            {
                string name = Enum.GetName(typeof(StatType), value);
                if (GameParams.HideStats.Contains(name))
                {
                    continue;
                }
                int baseValue    = baseStats.Stats[value];
                int derivedValue = derivedStats.Stats[value];
                statsSB.AppendFormat("{0}: {1} [{2}]\n", Sub.Replace(name, SubList), baseValue, derivedValue);
            }

            statsSB.AppendLine();

            //damage resistance and threshold
            foreach (int value in Enum.GetValues(typeof(DamageType)))
            {
                string name      = Enum.GetName(typeof(DamageType), value);
                float  baseDR    = baseStats.DamageResistance[(DamageType)value];
                float  baseDT    = baseStats.DamageThreshold[(DamageType)value];
                float  derivedDR = derivedStats.DamageResistance[(DamageType)value];
                float  derivedDT = derivedStats.DamageThreshold[(DamageType)value];
                statsSB.AppendFormat("{0}: DR({1:f1} [{2:f1}]) | DT({3:f1} [{4:f1}])\n", name.Substring(0, Math.Min(4, name.Length)), baseDR, derivedDR, baseDT, derivedDT);
            }

            statsSB.AppendLine();

            //max health
            statsSB.AppendFormat("Max Health: {0:f1} [{1:f1}]", baseStats.MaxHealth, derivedStats.MaxHealth);

            StatsText.text = statsSB.ToString();
        }