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); } }
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); }
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; }
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); } }
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; } }
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; } }
public StatChangedEventArgs(StatsType stat, object value, bool updateSelfOnly = false) { Stat = stat; Value = value; UpdateSelfOnly = updateSelfOnly; }
public void InvokeStatChange(StatsType t, object val, bool updateSelfOnly = false) { StatChanged?.Invoke(this, new StatChangedEventArgs(t, val, updateSelfOnly)); }
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; }
private void FixedStat(StatsType stat, int value) { var i = StatsManager.GetStatIndex(stat); _boost[i] = value - _parent.Base[i]; }