Exemplo n.º 1
0
        private 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
            animator.RunAnimationInLoop(ITEM_ANIMATION_PATH + "OracleLens/activation.txt", 8500);

            double avgChampLevel = ItemCooldownController.GetAverageChampionLevel(GameState);

            ItemCooldownController.SetCooldown(ITEM_ID, GetCooldownDuration(avgChampLevel));
            ItemCooldownController.SetCooldown(FarsightAlterationModule.ITEM_ID,
                                               FarsightAlterationModule.GetCooldownDuration(avgChampLevel));
        }
Exemplo n.º 2
0
        private void OnItemActivated(object s, EventArgs e)
        {
            int wardCharges           = 0;
            int cd                    = ItemCooldownController.GetCooldownRemaining(this.ItemID);
            int cdpercharge           = GetCooldownPerCharge(GameState);
            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(GameState) + 1800); // Warding small 2s cooldown
                }
                else
                {
                    // some magic here regarding trinket cooldowns to handle edge cases when you swap trinkets.
                    ItemCooldownController.SetCooldown(ITEM_ID, GetCooldownPerCharge(GameState) * 2 - rechargedSecondCharge - 100);
                    ItemCooldownController // this trinket affects the other trinket cooldowns
                    .SetCooldown(
                        FarsightAlterationModule.ITEM_ID,
                        FarsightAlterationModule.GetCooldownDuration(ItemCooldownController.GetAverageChampionLevel(GameState)) - rechargedSecondCharge - 100);
                    ItemCooldownController
                    .SetCooldown(
                        OracleLensModule.ITEM_ID,
                        OracleLensModule.GetCooldownDuration(ItemCooldownController.GetAverageChampionLevel(GameState)) - rechargedSecondCharge - 100);

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