public void addArmor(Armor armor) { this.armor += armor.armor; this.parry += armor.parry; this.resistance += armor.resistance; //this.resistance.addResistence(armor.resistance); }
public Armor(Armor armor) { this.armor = armor.armor; this.parry = armor.parry; this.resistance = new Resistance( armor.resistance); }
public void removeCloths(Clothes _cloths) { this.armor -= _cloths.armor; this.attributes -= _cloths.attributes; //this.armor.removeArmor(_cloths.armor); //this.attributes.removeAttributes(_cloths.attributes); }
public static Armor operator + (Armor _armor1, Armor _armor2) { Armor _armor = new Armor(); _armor.armor = _armor1.armor + _armor2.armor; _armor.parry = _armor1.parry + _armor2.parry; _armor.resistance = _armor1.resistance + _armor2.resistance; return _armor; }
public void addCloth(Clothes _cloths) { this.armor += _cloths.armor; this.attributes += _cloths.attributes; this.typeCloths = _cloths.typeCloths; //this.armor.addArmor(_cloths.armor); //this.attributes.addAttributes(_cloths.attributes); }
public void removeArmor(Armor armor) { this.armor -= armor.armor; this.parry -= armor.parry; if (this.armor <= 0) this.armor = 0; if (this.parry <= 0) this.parry = 0; this.resistance -= armor.resistance; //this.resistance.removeResistence(armor.resistance); }
public Clothes(Clothes _cloths) { this.id = _cloths.id; this.amount = _cloths.amount; this.image = _cloths.image; this.name = _cloths.name; this.typeItem = _cloths.typeItem; this.armor = new Armor(_cloths.armor); this.attributes = new Attributes(_cloths.attributes); this.typeCloths = _cloths.typeCloths; }
public Clothes() { this.id = 0; this.amount = 0; this.image = ""; this.name = ""; this.typeItem = _Item.Null; this.armor = new Armor(); this.attributes = new Attributes(); this.typeCloths = _Cloths.Null; }
public Ability ( Ability _ability) { this.id = _ability.id; this.image = _ability.image; this.name = _ability.name; this.desc = _ability.desc; this.cooldown = _ability.cooldown; this.cost = _ability.cost; this.damage = _ability.damage; this.armor = _ability.armor; this.attributes = _ability.attributes; this.effects = _ability.effects; this.element = _ability.element; }
public Ability() { this.id = 0; this.image = ""; this.name = ""; this.desc = ""; this.cooldown = 0F; this.cost = 0; this.damage = new Damage(); this.armor = new Armor(); this.attributes = new Attributes(); this.effects = new Effect[0]; this.element = _Element.Null; }
public static Armor operator - (Armor _armor1, Armor _armor2) { Armor _armor = new Armor(); _armor.armor = _armor1.armor - _armor2.armor; _armor.parry = _armor1.parry - _armor2.parry; if (_armor.armor <= 0) _armor.armor = 0; if (_armor.parry <= 0) _armor.parry = 0; _armor.resistance = _armor1.resistance + _armor2.resistance; return _armor; }
/// <summary> /// Método de sobrecarga para reverter os valores do Armor /// </summary> /// <param name="_armor"></param> public void restoreValue(Armor _armor) { _armor.reverseEffects(effectsRemove, reservedValue); }
/// <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 Armor, responsavél por remover ou atribuir efeitos do Armor /// </summary> /// <param name="_armor"></param> /// <param name="deltaTime"></param> public void update(Armor _armor, float deltaTime) { if (!instante) { if (c_cooldownEffects >= cooldownEffects) { this.c_cooldownEffects = 0f; _armor.removeEffects(effectsRemove, value); this.reservedValue += value; } c_cooldownEffects += deltaTime; } else { if (c_instante) { _armor.removeEffects(effectsRemove, value); this.reservedValue += value; c_instante = false; } } }
/// <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); } } } }