Example #1
0
        public static int GetStatIndex(StatsType stat)
        {
            switch (stat)
            {
            case StatsType.MaximumHP:
                return(0);

            case StatsType.MaximumMP:
                return(1);

            case StatsType.Attack:
                return(2);

            case StatsType.Defense:
                return(3);

            case StatsType.Speed:
                return(4);

            case StatsType.Dexterity:
                return(5);

            case StatsType.Vitality:
                return(6);

            case StatsType.Wisdom:
                return(7);

            default:
                return(-1);
            }
        }
Example #2
0
        public SV(Entity e, StatsType type, T value, bool updateSelfOnly = false, Func <T, T> transform = null)
        {
            _owner          = e;
            _type           = type;
            _updateSelfOnly = updateSelfOnly;
            _transform      = transform;

            _value  = value;
            _tValue = Transform(value);
        }
Example #3
0
        private void IncrementBoost(StatsType stat, int amount)
        {
            var i = StatsManager.GetStatIndex(stat);

            if (_parent.Base[i] + amount < 1)
            {
                amount = (i == 0) ? -_parent.Base[i] + 1 : -_parent.Base[i];
            }
            _boost[i] += amount;
        }
Example #4
0
        public static int GetStatIndex(StatsType stat)
        {
            switch (stat)
            {
            case StatsType.MaximumHP:
                return(0);

            case StatsType.MaximumMP:
                return(1);

            case StatsType.Attack:
                return(2);

            case StatsType.Defense:
                return(3);

            case StatsType.Speed:
                return(4);

            case StatsType.Dexterity:
                return(5);

            case StatsType.Vitality:
                return(6);

            case StatsType.Wisdom:
                return(7);

            case StatsType.Might:
                return(8);

            case StatsType.Luck:
                return(9);

            case StatsType.Restoration:
                return(10);

            case StatsType.Protection:
                return(11);

            case StatsType.DamageMin:
                return(12);

            case StatsType.DamageMax:
                return(13);

            case StatsType.Fortune:
                return(14);

            default:
                return(-1);
            }
        }
Example #5
0
 protected virtual void ImportStats(StatsType stats, object val)
 {
     if (stats == StatsType.Name)
     {
         Name = (string)val;
     }
     else if (stats == StatsType.Size)
     {
         Size = (int)val;
     }
     else if (stats == StatsType.Effects)
     {
         ConditionEffects = (ConditionEffects)(int)val;
     }
 }
Example #6
0
        protected virtual void ImportStats(StatsType stats, object val)
        {
            switch (stats)
            {
            case StatsType.Name:
                Name = (string)val;
                break;

            case StatsType.Size:
                Size = (int)val;
                break;

            case StatsType.Effects:
                ConditionEffects = (ConditionEffects)(int)val;
                break;
            }
        }
Example #7
0
 public StatChangedEventArgs(StatsType stat, object value, bool updateSelfOnly = false)
 {
     Stat           = stat;
     Value          = value;
     UpdateSelfOnly = updateSelfOnly;
 }
Example #8
0
 public void InvokeStatChange(StatsType t, object val, bool updateSelfOnly = false)
 {
     StatChanged?.Invoke(this, new StatChangedEventArgs(t, val, updateSelfOnly));
 }
Example #9
0
 protected virtual void ImportStats(StatsType stats, object val)
 {
     if (stats == StatsType.Name) Name = (string)val;
     else if (stats == StatsType.Size) Size = (int)val;
     else if (stats == StatsType.Effects) ConditionEffects = (ConditionEffects)(int)val;
 }
Example #10
0
        private void FixedStat(StatsType stat, int value)
        {
            var i = StatsManager.GetStatIndex(stat);

            _boost[i] = value - _parent.Base[i];
        }