Example #1
0
 public void addWeapon(Weapon _weapon)
 {
     this.element = _weapon.element;
     this.typeWeapon = _weapon.typeWeapon;
     this.damage += _weapon.damage;
     this.attributes += _weapon.attributes;
     //this.damage.addDamage(_weapon.damage);
     //this.attributes.addAttributes(_weapon.attributes);
 }
Example #2
0
        public void removeDamage(Damage damage)
        {
            this.damage -= damage.damage;
            this.criticalDamage -= damage.criticalDamage;
            this.elementalDamage -= damage.elementalDamage;

            if (this.damage < 0) this.damage = 0;
            if (this.criticalDamage < 0) this.criticalDamage = 0;
            if (this.elementalDamage < 0) this.elementalDamage = 0;
        }
Example #3
0
        public static Damage operator +(Damage _damage1, Damage _damage2)
        {
            Damage _damage = new Damage();

            _damage.damage = _damage1.damage + _damage2.damage;
            _damage.criticalDamage = _damage1.criticalDamage + _damage2.criticalDamage;
            _damage.elementalDamage = _damage1.elementalDamage + _damage2.elementalDamage;

            return _damage;
        }
Example #4
0
        public void removeWeapon(Weapon _weapon)
        {
            this.element = _Element.Null;
            this.typeWeapon = _Weapon.Null;

            this.damage -= _weapon.damage;
            this.attributes -= _weapon.attributes;

            /*
            this.damage.removeDamage(_weapon.damage);
            this.attributes.removeAttributes(_weapon.attributes);*/
        }
Example #5
0
        public Weapon(Weapon _weapon)
        {
            this.id = _weapon.id;
            this.amount = _weapon.amount;
            this.image = _weapon.image;
            this.name = _weapon.name;
            this.typeItem = _weapon.typeItem;

            this.element = _weapon.element;
            this.typeWeapon = _weapon.typeWeapon;
            this.damage = new Damage(_weapon.damage);
            this.attributes = new Attributes(_weapon.attributes);
        }
Example #6
0
        public Weapon()
        {
            this.id = 0;
            this.amount = 0;
            this.image = "";
            this.name = "";
            this.typeItem = _Item.Null;

            this.element = _Element.Null;
            this.typeWeapon = _Weapon.Null;
            this.damage = new Damage();
            this.attributes = new Attributes();
        }
Example #7
0
        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;
	    }
Example #8
0
	    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;
	    }
Example #9
0
        public static Damage operator -(Damage _damage1, Damage _damage2)
        {
            Damage _damage = new Damage();

            _damage.damage = _damage1.damage - _damage2.damage;
            _damage.criticalDamage = _damage1.criticalDamage - _damage2.criticalDamage;
            _damage.elementalDamage = _damage1.elementalDamage - _damage2.elementalDamage;

            if (_damage.damage < 0) _damage.damage = 0;
            if (_damage.criticalDamage < 0) _damage.criticalDamage = 0;
            if (_damage.elementalDamage < 0) _damage.elementalDamage = 0;

            return _damage;
        }
Example #10
0
 /// <summary>
 /// Método de sobrecarga para reverter os valores do Damage
 /// </summary>
 /// <param name="_damage"></param>
 public void restoreValue(Damage _damage)
 {
     _damage.reverseEffects(effectsRemove, reservedValue);
 }
Example #11
0
        /// <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);
                    }
                }
            }
        }
Example #12
0
 /// <summary>
 /// Método Update Do Damage, responsavél por remover ou atribuiir efeitos do Damage
 /// </summary>
 /// <param name="_damage"></param>
 /// <param name="deltaTime"></param>
 public void update(Damage _damage, float deltaTime)
 {
     if (!instante)
     {
         if (c_cooldownEffects >= cooldownEffects)
         {
             this.c_cooldownEffects = 0f;
             _damage.removeEffects(effectsRemove, value);
             this.reservedValue += value;
         }
         c_cooldownEffects += deltaTime;
     }
     else
     {
         if (c_instante)
         {
             _damage.removeEffects(effectsRemove, value);
             this.reservedValue += value;
             c_instante = false;
         }
     }
 }
Example #13
0
 public void addDamage(Damage damage)
 {
     this.damage += damage.damage;
     this.criticalDamage += damage.criticalDamage;
     this.elementalDamage += damage.elementalDamage;
 }
Example #14
0
 public Damage(Damage damage)
 {
     this.damage = damage.damage;
     this.criticalDamage = damage.criticalDamage;
     this.elementalDamage = damage.elementalDamage;
 }