/// <summary> /// Método Update responsavél pelos updates de todos os ciclos dos efeitos, atribuindo seus valores a cada componente. /// </summary> /// <param name="_attributes"></param> /// <param name="_damage"></param> /// <param name="_armor"></param> /// <param name="_life"></param> /// <param name="deltaTime"></param> public void update(Attributes _attributes, Damage _damage, Armor _armor, Life _life, float deltaTime) { this.c_cooldown += deltaTime; if (this.c_cooldown < this.cooldown) { for (int i = 0; i < effects.Count; i++) { _EffectsRemove __effect = this.effects[i].effectsRemove; if( __effect == _EffectsRemove.Strength || __effect == _EffectsRemove.Agility || __effect == _EffectsRemove.Stamina || __effect == _EffectsRemove.Intelligence) { this.effects[i].update(_attributes, deltaTime); } else if ( __effect == _EffectsRemove.Dark || __effect == _EffectsRemove.Fire || __effect == _EffectsRemove.Frost || __effect == _EffectsRemove.Nature || __effect == _EffectsRemove.Armor || __effect == _EffectsRemove.Parry) { this.effects[i].update(_armor, deltaTime); } else if ( __effect == _EffectsRemove.Damage || __effect == _EffectsRemove.CriticalDamage || __effect == _EffectsRemove.ElementalDamage) { this.effects[i].update(_damage, deltaTime); } else if (__effect == _EffectsRemove.Life) { this.effects[i].update(_life, deltaTime); } } } else { for (int i = 0; i < effects.Count; i++) { _EffectsRemove __effect = this.effects[i].effectsRemove; if (__effect == _EffectsRemove.Strength || __effect == _EffectsRemove.Agility || __effect == _EffectsRemove.Stamina || __effect == _EffectsRemove.Intelligence) { this.effects[i].restoreValue(_attributes); } else if (__effect == _EffectsRemove.Dark || __effect == _EffectsRemove.Fire || __effect == _EffectsRemove.Frost || __effect == _EffectsRemove.Nature || __effect == _EffectsRemove.Armor || __effect == _EffectsRemove.Parry) { this.effects[i].restoreValue(_armor); } else if (__effect == _EffectsRemove.Damage || __effect == _EffectsRemove.CriticalDamage || __effect == _EffectsRemove.ElementalDamage) { this.effects[i].restoreValue(_damage); } } } }
/// <summary> /// Método Update Do Life, responsavél por remover ou atribuir efeitos do Life /// </summary> /// <param name="_life"></param> /// <param name="deltaTime"></param> public void update(Life _life, float deltaTime) { if (!instante) { if (c_cooldownEffects >= cooldownEffects) { this.c_cooldownEffects = 0f; _life.removeEffects(effectsRemove, value); this.reservedValue += value; } c_cooldownEffects += deltaTime; } else { if (c_instante) { _life.removeEffects(effectsRemove, value); this.reservedValue += value; c_instante = false; } } }
public Life (Life _life) { this.currentLife = _life.currentLife; this.life = _life.life; }
/// <summary> /// Método Update responsavél pelos updates de todos os ciclos dos efeitos, atribuindo seus valores a cada componente. /// </summary> /// <param name="_attributes"></param> /// <param name="_damage"></param> /// <param name="_armor"></param> /// <param name="_life"></param> /// <param name="deltaTime"></param> public void update(Attributes _attributes, Damage _damage, Armor _armor, Life _life, float deltaTime) { this.c_cooldown += deltaTime; if (this.c_cooldown < this.cooldown) { for (int i = 0; i < effects.Count; i++) { _EffectsRemove __effect = this.effects[i].effectsRemove; if (__effect == _EffectsRemove.Strength || __effect == _EffectsRemove.Agility || __effect == _EffectsRemove.Stamina || __effect == _EffectsRemove.Intelligence) { this.effects[i].update(_attributes, deltaTime); } else if (__effect == _EffectsRemove.Dark || __effect == _EffectsRemove.Fire || __effect == _EffectsRemove.Frost || __effect == _EffectsRemove.Nature || __effect == _EffectsRemove.Armor || __effect == _EffectsRemove.Parry) { this.effects[i].update(_armor, deltaTime); } else if (__effect == _EffectsRemove.Damage || __effect == _EffectsRemove.CriticalDamage || __effect == _EffectsRemove.ElementalDamage) { this.effects[i].update(_damage, deltaTime); } else if (__effect == _EffectsRemove.Life) { this.effects[i].update(_life, deltaTime); } } } else { for (int i = 0; i < effects.Count; i++) { _EffectsRemove __effect = this.effects[i].effectsRemove; if (__effect == _EffectsRemove.Strength || __effect == _EffectsRemove.Agility || __effect == _EffectsRemove.Stamina || __effect == _EffectsRemove.Intelligence) { this.effects[i].restoreValue(_attributes); } else if (__effect == _EffectsRemove.Dark || __effect == _EffectsRemove.Fire || __effect == _EffectsRemove.Frost || __effect == _EffectsRemove.Nature || __effect == _EffectsRemove.Armor || __effect == _EffectsRemove.Parry) { this.effects[i].restoreValue(_armor); } else if (__effect == _EffectsRemove.Damage || __effect == _EffectsRemove.CriticalDamage || __effect == _EffectsRemove.ElementalDamage) { this.effects[i].restoreValue(_damage); } } } }
public Life(Life _life) { this.currentLife = _life.currentLife; this.life = _life.life; }