Пример #1
0
    public void ItemEvent(Stats pStats)
    {
        playerStats = pStats;

        #region Damage or Heal
        if(isHeal)
            playerStats.AdjustHealth(healAmount);

        if(isDamage)
            playerStats.ApplyDamage(damageAmount);
        #endregion

        #region Health Containers
        if(addHealthContainers)
        {
            for(int i = 0; i < healthToAdd; i++)
            {
                playerStats.AddHealth();
            }
        }

        if(subHealthContainers)
        {
            for(int i = 0; i < healthToSub; i++)
            {
                playerStats.SubHealth();
            }
        }
        #endregion

        #region Shields
        if(addShields)
        {
            for(int i = 0; i < shieldsToAdd; i++)
            {
                playerStats.AddShield();
            }
        }

        if(subShields)
        {
            for(int i = 0; i < shieldsToSub; i++)
            {
                playerStats.SubShield();
            }
        }
        #endregion

        #region MovementSpeed
        if(addMovementSpeed)
        {
            for(int i = 0; i < movementSpeedToAdd; i++)
            {
                playerStats.AddMovementSpeed();
            }
        }

        if(subMovementSpeed)
        {
            for(int i = 0; i < movementSpeedToSub; i++)
            {
                playerStats.SubMovementSpeed();
            }
        }
        #endregion

        #region Damage
        if(addDamage)
        {
            for(int i = 0; i < damageToAdd; i++)
            {
                playerStats.AddDamage();
            }
        }

        if(subDamage)
        {
            for(int i = 0; i < damageToSub; i++)
            {
                playerStats.SubDamage();
            }
        }
        #endregion

        #region ProjectileSpeed
        if(addProjectileSpeed)
        {
            for(int i = 0; i < projectileSpeedToAdd; i++)
            {
                playerStats.AddProjectileSpeed();
            }
        }

        if(subProjectileSpeed)
        {
            for(int i = 0; i < projectileSpeedtoSub; i++)
            {
                playerStats.SubProjectileSpeed();
            }
        }
        #endregion

        #region Range
        if(addRange)
        {
            for(int i = 0; i < rangeToAdd; i++)
            {
                playerStats.AddRange();
            }
        }

        if(subShields)
        {
            for(int i = 0; i < rangeToSub; i++)
            {
                playerStats.SubRange();
            }
        }
        #endregion

        #region Attack Speed
        if(addAttackSpeed)
        {
            for(int i = 0; i < attackSpeedToAdd; i++)
            {
                playerStats.AddAttackSpeed();
            }
        }

        if(subAttackSpeed)
        {
            for(int i = 0; i < attackSpeedToSub; i++)
            {
                playerStats.SubAttackSpeed();
            }
        }
        #endregion

        #region Penetration
        if(addPenetration)
        {
            for(int i = 0; i < penetrationToAdd; i++)
            {
                playerStats.AddPenetration();
            }
        }

        if(subPenetration)
        {
            for(int i = 0; i < penetrationToSub; i++)
            {
                playerStats.SubPenetration();
            }
        }
        #endregion

        #region Coins
        if(addCoins)
        {
            playerStats.AddCoins(coinsToAdd);
        }

        if(subCoins)
        {
            playerStats.SubCoins(coinsToSub);
        }
        #endregion

        #region Keys
        if(addKeys)
        {
            for(int i = 0; i < keysToAdd; i++)
            {
                playerStats.AddKey();
            }
        }

        if(subKeys)
        {
            for(int i = 0; i < keysToSub; i++)
            {
                playerStats.SubKey();
            }
        }
        #endregion
        playerStats.UpdateLabels();
    }