/*
     * Function: OnGemChanged
     * Parameters: newItem, oldItem
     * Description: when a new gem is equiped, the stats for the given skill are updated
     * and the stats for the old gem are removed if one was equiped.
     */
    public void OnGemChanged(Equipment newItem, Equipment oldItem)
    {
        if (newItem != null)
        {
            Damage.AddModifier(newItem.damageModifier);
            //armor.AddModifier(newItem.armorModifier);
            RageCost.AddModifier(newItem.rageModifier);
            //AttackSpeed.AddModifier(newItem.attackspeedModifier);
            Cooldown.AddModifier(newItem.cooldownModifier);
            Lifesteal.AddModifier(newItem.lifestealModifier);
            Radius.AddModifier(newItem.radiusModifier);
            LastTime.AddModifier(newItem.lastTimeModifier);
        }

        if (oldItem != null)
        {
            //armor.RemoveModifier(oldItem.armorModifier);
            Damage.RemoveModifier(oldItem.damageModifier);
            RageCost.RemoveModifier(oldItem.rageModifier);
            //AttackSpeed.RemoveModifier(oldItem.attackspeedModifier);
            Cooldown.RemoveModifier(oldItem.cooldownModifier);
            Lifesteal.RemoveModifier(oldItem.lifestealModifier);
            Radius.RemoveModifier(oldItem.radiusModifier);
            LastTime.RemoveModifier(oldItem.lastTimeModifier);
        }
    }
Beispiel #2
0
    void LoadAttribute(int ID)
    {
        try
        {
            EnemyStat stat = new EnemyStat();
            stat = EnemyManager.instance.GetEnemyAttribute(ID);
            if (stat != null)
            {
                Name = stat.Name;

                Heath.Value = stat.Heath.Value;
                Heath.AddModifier(stat.Heath.Value * stat.Level);
                CurrentHeath = Heath.GetValue();

                Damage.Value = stat.Damage.Value;
                Damage.AddModifier(stat.Damage.Value * stat.Level);

                Defense.Value = stat.Defense.Value;
                Defense.AddModifier(stat.Defense.Value * stat.Level);

                Crit.Value = stat.Crit.Value;

                if (IsRetransform)
                {
                    transform.parent.transform.position   = stat.Position;
                    transform.parent.transform.rotation   = Quaternion.Euler(stat.Rotation);
                    transform.parent.transform.localScale = stat.Scale;
                }
            }
        }
        catch (Exception ex)
        {
            Logs.LogE("Can't load emeny ID " + ID + " : " + ex.ToString());
        }
    }
    /*
     * Function: OnGemChanged
     * Parameters: newItem, oldItem
     * Description: when a new gem is equiped, the stats for the given skill are updated
     * and the stats for the old gem are removed if one was equiped.
     */
    public void OnGemChanged(Equipment newItem, Equipment oldItem)
    {
        if (newItem != null)
        {
            Damage.AddModifier(newItem.damageModifier);
            //armor.AddModifier(newItem.armorModifier);
            RageCost.AddModifier(newItem.rageModifier);
            //AttackSpeed.AddModifier(newItem.attackspeedModifier);
            Cooldown.AddModifier(newItem.cooldownModifier);
            Lifesteal.AddModifier(newItem.lifestealModifier);
            //MagicResist.AddModifier(newItem.magicResistModifer);
            // Health.AddModifier(newItem.healthModifier);
        }

        if (oldItem != null)
        {
            //armor.RemoveModifier(oldItem.armorModifier);
            Damage.RemoveModifier(oldItem.damageModifier);
            RageCost.RemoveModifier(oldItem.rageModifier);
            //AttackSpeed.RemoveModifier(oldItem.attackspeedModifier);
            Cooldown.RemoveModifier(oldItem.cooldownModifier);
            Lifesteal.RemoveModifier(oldItem.lifestealModifier);
            //MagicResist.RemoveModifier(oldItem.magicResistModifer);
            //Health.RemoveModifier(oldItem.healthModifier);
        }
    }
    void OnEquipmentChanged(Equipment newItem, Equipment oldItem)
    {
        if (newItem != null)
        {
            Armor.AddModifier(newItem.ArmorModifier);
            Damage.AddModifier(newItem.DamageModifier);
        }

        if (oldItem != null)
        {
            Armor.RemoveModifier(oldItem.ArmorModifier);
            Damage.RemoveModifier(oldItem.DamageModifier);
        }
    }
Beispiel #5
0
    public void OnEquipmentChanged(EquipmentScript ItemToAdd, EquipmentScript ItemToRemove)
    {
        if (ItemToAdd != null)
        {
            Defence.AddModifier(ItemToAdd.defenceModifier);

            Damage.AddModifier(ItemToAdd.damageModifier);

            Agility.AddModifier(ItemToAdd.agilityModifier);
        }

        if (ItemToRemove != null)
        {
            Defence.RemoveModifier(ItemToRemove.defenceModifier);

            Damage.RemoveModifier(ItemToRemove.damageModifier);

            Agility.RemoveModifier(ItemToRemove.agilityModifier);
        }
    }