Exemplo n.º 1
0
        protected override void OnItemActivated(object s, EventArgs e)
        {
            if (ItemCooldownController.IsOnCooldown(ITEM_ID))
            {
                return;                                               // If the item is on cooldown, nothing to do here.
            }
            // Play relevant animations here
            RunAnimationInLoop("activation", LightZone.Keyboard, 8.5f);

            double avgChampLevel = GameState.AverageChampionLevel;

            ItemCooldownController.SetCooldown(ITEM_ID, GetCooldownDuration(avgChampLevel));
            ItemCooldownController.SetCooldown(FarsightAlterationModule.ITEM_ID,
                                               FarsightAlterationModule.GetCooldownDuration(avgChampLevel));
        }
        protected override void OnItemActivated(object s, EventArgs e)
        {
            int wardCharges           = 0;
            int cd                    = ItemCooldownController.GetCooldownRemaining(this.ItemID);
            int cdpercharge           = GetCooldownPerCharge();
            int rechargedSecondCharge = -1;

            if (cd > cdpercharge)
            {
                wardCharges = 0;
            }
            else if (cd > 0)
            {
                wardCharges           = 1;
                rechargedSecondCharge = cdpercharge - cd;
            }
            else
            {
                wardCharges = 2;
            }

            if (wardCharges > 0)
            {
                if (wardCharges > 1)
                {
                    ItemCooldownController.SetCooldown(ITEM_ID, GetCooldownPerCharge() + 1800); // Warding small 2s cooldown
                }
                else
                {
                    // some magic here regarding trinket cooldowns to handle edge cases when you swap trinkets.
                    ItemCooldownController.SetCooldown(ITEM_ID, cdpercharge * 2 - rechargedSecondCharge - 100);
                    ItemCooldownController // this trinket affects the other trinket cooldowns
                    .SetCooldown(
                        FarsightAlterationModule.ITEM_ID,
                        FarsightAlterationModule.GetCooldownDuration(GameState.AverageChampionLevel) - rechargedSecondCharge - 100);
                    ItemCooldownController
                    .SetCooldown(
                        OracleLensModule.ITEM_ID,
                        OracleLensModule.GetCooldownDuration(GameState.AverageChampionLevel) - rechargedSecondCharge - 100);

                    //CooldownDuration = cooldownPerCharge - 100; // substract some duration to account for other delays;
                }
            }
        }