protected override void OnItemActivated(object s, EventArgs e) { // Play relevant animations here RunAnimationOnce("activation", LightZone.Keyboard, 3f); double avgChampLevel = GameState.AverageChampionLevel; ItemCooldownController.SetCooldown(ITEM_ID, GetCooldownDuration(avgChampLevel)); ItemCooldownController.SetCooldown(OracleLensModule.ITEM_ID, OracleLensModule.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; } } }
protected override void OnGameStateUpdated(GameState state) // TODO: Handle when player buys a different trinket and cooldown gets transferred over { // Normally you wouldn't need to do this, but since some trinket cooldowns depend on // average champion level, we need to contemplate this. CooldownDuration = OracleLensModule.GetCooldownDuration(state.AverageChampionLevel); }