private HeraldEyeModule(int ledCount, GameState gameState, int itemID, int itemSlot, LightingMode preferredLightMode, AbilityCastPreference preferredCastMode) : base(itemID, itemSlot, gameState, preferredLightMode) { // Initialization for the item module occurs here. PreferredCastMode = preferredCastMode; ItemCast += OnItemActivated; GameStateUpdated += OnGameStateUpdated; ItemCastMode = AbilityCastMode.Instant(); ItemCooldownController.SetCooldown(ITEM_ID, 240000); // Preload all the animations you'll want to use. MAKE SURE that each animation file // has its Build Action set to "Content" and "Copy to Output Directory" is set to "Always". animator = AnimationModule.Create(ledCount); animator.NewFrameReady += (_, ls, mode) => DispatchNewFrame(ls, mode); animator.PreloadAnimation(ITEM_ANIMATION_PATH + "HeraldEye/anim_1.txt"); animator.PreloadAnimation(ITEM_ANIMATION_PATH + "HeraldEye/anim_2.txt"); animator.PreloadAnimation(ITEM_ANIMATION_PATH + "HeraldEye/anim_3.txt"); animator.PreloadAnimation(ITEM_ANIMATION_PATH + "HeraldEye/anim_4.txt"); }
// Cooldown public HeraldEyeModule(GameState gameState, int itemSlot, AbilityCastPreference preferredCastMode) : base(ITEM_ID, ITEM_NAME, itemSlot, gameState, preferredCastMode, true) { // Initialization for the item module occurs here. ItemCooldownController.SetCooldown(ITEM_ID, 240000); }
private WardingTotemModule(int ledCount, GameState gameState, int itemID, int itemSlot, LightingMode preferredLightMode, AbilityCastPreference preferredCastMode) : base(itemID, itemSlot, gameState, preferredLightMode) { // Initialization for the item module occurs here. // Set preferred cast mode. It's a player choice (Quick cast, Quick cast with indicator, or Normal cast) PreferredCastMode = preferredCastMode; ItemCast += OnItemActivated; /*GameStateUpdated += OnGameStateUpdated; * OnGameStateUpdated(gameState);*/ // Set item cast mode. // For Oracle Lens, for example: // It's Instant Cast (press it, and the trinket activates) // For a ward, it's normal cast (press & click) ItemCastMode = AbilityCastMode.Normal(); // TODO: This is because of a game bug, IT WILL GET FIXED and this will have to be changed ItemCooldownController.SetCooldown(this.ItemID, GetCooldownPerCharge(gameState)); // Preload all the animations you'll want to use. MAKE SURE that each animation file // has its Build Action set to "Content" and "Copy to Output Directory" is set to "Always". animator = AnimationModule.Create(ledCount); animator.NewFrameReady += (_, ls, mode) => DispatchNewFrame(ls, mode); }
private RedemptionModule(int ledCount, GameState gameState, int itemID, int itemSlot, LightingMode preferredLightMode, AbilityCastPreference preferredCastMode) : base(itemID, itemSlot, gameState, preferredLightMode) { // Initialization for the item module occurs here. // Set preferred cast mode. It's a player choice (Quick cast, Quick cast with indicator, or Normal cast) this.PreferredCastMode = preferredCastMode; ItemCast += OnItemActivated; GameStateUpdated += OnGameStateUpdated; // Set item cast mode. // For Oracle Lens, for example: // It's Instant Cast (press it, and the trinket activates) // For a ward, it's normal cast (press & click) ItemCastMode = AbilityCastMode.Normal(); ItemCooldownController.SetCooldown(ITEM_ID, 0); WaitForItemInfo(); // Preload all the animations you'll want to use. MAKE SURE that each animation file // has its Build Action set to "Content" and "Copy to Output Directory" is set to "Always". animator = AnimationModule.Create(ledCount); animator.NewFrameReady += (_, ls, mode) => DispatchNewFrame(ls, mode); animator.PreloadAnimation(ITEM_ANIMATION_PATH + "Redemption/start.txt"); animator.PreloadAnimation(ITEM_ANIMATION_PATH + "Redemption/impact.txt"); }
// Variables // Cooldown public RedemptionModule(GameState gameState, int itemSlot, AbilityCastPreference preferredCastMode) : base(ITEM_ID, ITEM_NAME, itemSlot, gameState, preferredCastMode, true) { // Initialization for the item module occurs here. ItemCooldownController.SetCooldown(ITEM_ID, 0); WaitForItemInfo(); }
public WardingTotemModule(GameState gameState, int itemSlot, AbilityCastPreference preferredCastMode) : base(ITEM_ID, ITEM_NAME, itemSlot, gameState, preferredCastMode, true) { // Initialization for the item module occurs here. // TODO: This is because of a game bug, IT WILL GET FIXED and this will have to be changed ItemCooldownController.SetCooldown(this.ItemID, GetCooldownPerCharge()); }
protected override void OnItemActivated(object s, EventArgs e) // TODO: Redemption can be used when dead! { if (!ItemCooldownController.IsOnCooldown(ITEM_ID)) { // Play relevant animations here RunAnimationOnce("start", LightZone.Keyboard, timeScale: 0.08f); RunAnimationOnce("impact", LightZone.Keyboard, 0.05f); ItemCooldownController.SetCooldown(ITEM_ID, CooldownDuration); } }
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)); }
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)); }
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)); }
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)); }
private void OnItemActivated(object s, EventArgs e) // TODO: Redemption can be used when dead! { if (!ItemCooldownController.IsOnCooldown(ITEM_ID)) { // Play relevant animations here Task.Run(async () => { await animator.RunAnimationOnce(ITEM_ANIMATION_PATH + "Redemption/start.txt", true, timeScale: 0.08f); _ = animator.RunAnimationOnce(ITEM_ANIMATION_PATH + "Redemption/impact.txt", false, 0.05f); }); ItemCooldownController.SetCooldown(ITEM_ID, CooldownDuration); } }
private WardingTotemModule(int ledCount, GameState gameState, int itemID, int itemSlot, LightingMode preferredLightMode, AbilityCastPreference preferredCastMode) : base(itemID, itemSlot, gameState, preferredLightMode) { // Initialization for the item module occurs here. // Set preferred cast mode. It's a player choice (Quick cast, Quick cast with indicator, or Normal cast) PreferredCastMode = preferredCastMode; ItemCast += OnItemActivated; /*GameStateUpdated += OnGameStateUpdated; * OnGameStateUpdated(gameState);*/ // Set item cast mode. // For Oracle Lens, for example: // It's Instant Cast (press it, and the trinket activates) // For a ward, it's normal cast (press & click) ItemCastMode = AbilityCastMode.Normal(); ItemCooldownController.SetCooldown(this.ItemID, GetCooldownPerCharge(gameState)); // Game bug? Set the cooldown to 0, because everytime // Since it's a ward trinket, setup ward recharging /*Task.Run(async () => * { * while (true) * { * if (wardCharges < 2) * { * await Task.Delay(cooldownPerCharge); * wardCharges++; * } else * { * await Task.Delay(300); * } * } * * });*/ // Preload all the animations you'll want to use. MAKE SURE that each animation file // has its Build Action set to "Content" and "Copy to Output Directory" is set to "Always". animator = AnimationModule.Create(ledCount); animator.NewFrameReady += (_, ls, mode) => DispatchNewFrame(ls, mode); }
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--; } }