public StatModifier(float value, StatModifierType type, int order, object source) { Value = value; Type = type; Order = order; Source = source; }
public void Remove(StatController stat, StatModifierType modifierType) { for (int i = 0; i < Stats.Count; i++) { Stats[i].RemoveStatModifier(stat.Stats[i].StatValue, modifierType); } }
/// <summary> /// Constructor. Takes 4 arguments. /// </summary> /// <param name="value"></param> /// <param name="type"></param> /// <param name="order"></param> /// <param name="source"></param> public StatModifier(float value, StatModifierType type, int order, object source) { this.Value = value; this.Type = type; this.Order = order; this.Source = source; }
public StatModifier(StatType statType, StatModifierType modType, float value, object source) { StatType = statType; ModType = modType; _value = value; // if set with Value, will get null pointer since Updated handler has nothing registered yet Source = source; }
public StatModifier(float pValue, StatModifierType pType, int pOrder, object pSource) { _value = pValue; _type = pType; _order = pOrder; _source = pSource; }
/// <summary> /// Registers an gear stats modifier. Can be used to change how one or more pieces of gear's stats are calculated. /// </summary> /// <param name="modifier"></param> /// <param name="type"></param> public static void RegisterStatModifier(StatModifier modifier, StatModifierType type) { if (!statModifiers.ContainsKey(type)) { statModifiers.Add(type, new List <StatModifier>()); } statModifiers[type].Add(modifier); }
public void RemoveStat(StatController stat, StatModifierType addType) { /*if (stat.statModel != statController.statModel) { Debug.Log("Les deux stats n'ont pas le même modèle, l'opération n'est pas optimisé"); // faire l'opération pas optimisé }*/ statController.Remove(stat, addType); if (OnStatChanged != null) OnStatChanged.Invoke(this); }
override public void Init(Stat ParentStat, float ParentPercent, StatModifierType ModType) { round = false; isDirty = true; parentStat = ParentStat; parentPercent = ParentPercent; modType = ModType; parentStat.onStatChangedCallback += ParentChanged; }
public void RemoveStat(Stat stat, StatModifierType modifierType) { for (int i = 0; i < Stats.Count; i++) { if (Stats[i].StatName.Equals(stat.StatName)) { Stats[i].RemoveStatModifier(stat.StatValue, modifierType); return; } } }
public float this[StatModifierType modType] { get { return(modifiers[modType]); } set { modifiers[modType] = value; isCurrent = false; } }
public void RemoveStatModifier(float value, StatModifierType modifier) { switch (modifier) { case StatModifierType.Flat: statBonusFlat -= value; break; case StatModifierType.Multiplier: statBonusMultiplier -= value; break; } CalculateFinalValue(); }
public StatModifier(float Value, StatModifierType Type) { type = Type; value = Value; }
public StatMod(CharStat stat, float value, StatModifierType type = StatModifierType.SUM) { Stat = stat; Value = value; Type = type; }
public StatModifier(StatType statType, StatModifierType modType, float value) : this(statType, modType, value, null) { }
public StatModifier(float pValue, StatModifierType pType) : this(pValue, pType, (int)pType, null) { }
public StatModifier(StatType statType, StatModifierType modType, float value) { this.statType = statType; this.modType = modType; this.value = value; }
public Modifier(PlayerStatModifier statToModify, StatModifierType modifierType, float value) { this.statToModify = statToModify; this.modifierType = modifierType; this.value = value; }
public StatModifier(float value, StatModifierType type) { this.value = value; this.type = type; }
public StatModifier(float pValue, StatModifierType pType, int pOrder) : this(pValue, pType, pOrder, null) { }
public StatModifier(float pValue, StatModifierType pType, object pSource) : this(pValue, pType, (int)pType, pSource) { }
public StatModifier(StatModifierType modifierType, float modifierValue) { this.ModifierType = modifierType; this.ModifierValue = modifierValue; }
public StatModifier(float value, object source, StatModifierType statType) { this.value = value; this.source = source; this.statType = statType; }
public void AddModifier(float modifier, object source, StatModifierType statType) { modifiers.Add(new StatModifier(modifier, source, statType)); }
public void AddModifier(float modifier, StatModifierType statType) { modifiers.Add(new StatModifier(modifier, null, statType)); }
public void RemoveStat(string statName, float statValue, StatModifierType addType) { statController.RemoveStat(new Stat(statName, statValue), addType); if (OnStatChanged != null) OnStatChanged.Invoke(this); }
virtual public void Init(Stat ParentStat, float ParentPercent, StatModifierType ModType) { }
public StatModifier(float value, StatModifierType type) : this(value, type, (int)type, null) { }
public StatModifier(StatModifierType modifierType, int valueChange) { this.modifierType = modifierType; this.valueChange = valueChange; }
public StatModifier(float value, StatModifierType type, int order) : this(value, type, order, null) { }
public StatModifier(float value, StatModifierType type) { Value = value; Type = type; }
public StatModifier(float value, StatModifierType type, object source) : this(value, type, (int)type, source) { }