Beispiel #1
0
 public void addArmor(Armor armor)
 {
     this.armor += armor.armor;
     this.parry += armor.parry;
     this.resistance += armor.resistance;
     //this.resistance.addResistence(armor.resistance);
 }
Beispiel #2
0
        public Armor(Armor armor)
        {
            this.armor = armor.armor;
            this.parry = armor.parry;

            this.resistance = new Resistance( armor.resistance);  
        }
Beispiel #3
0
        public void removeCloths(Clothes _cloths)
        {
            this.armor -= _cloths.armor;
            this.attributes -= _cloths.attributes;

            //this.armor.removeArmor(_cloths.armor);
            //this.attributes.removeAttributes(_cloths.attributes);
        }
Beispiel #4
0
        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;
        }
Beispiel #5
0
        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);
            
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
        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;
        }
Beispiel #8
0
        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;
        }
Beispiel #9
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;
	    }
Beispiel #10
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;
	    }
Beispiel #11
0
        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;
        }
Beispiel #12
0
 /// <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);
 }
Beispiel #13
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);
                    }
                }
            }
        }
Beispiel #14
0
 /// <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;
         }
     }
 }
Beispiel #15
0
 /// <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);
 }
Beispiel #16
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);
                    }
                }
            }
        }