private void OnItemActivated(object s, EventArgs e)
        {
            // Play relevant animations here
            animator.RunAnimationOnce(ITEM_ANIMATION_PATH + "FarsightAlteration/activation.txt", false, 0.05f);

            double avgChampLevel = ItemCooldownController.GetAverageChampionLevel(GameState);

            ItemCooldownController.SetCooldown(ITEM_ID, GetCooldownDuration(avgChampLevel));
            ItemCooldownController.SetCooldown(OracleLensModule.ITEM_ID,
                                               OracleLensModule.GetCooldownDuration(avgChampLevel));
        }
示例#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--;
            }
        }