protected override AbilityCastMode GetECastMode() => AbilityCastMode.UnCastable();
protected override AbilityCastMode GetRCastMode() => AbilityCastMode.Instant(6000, 1, AbilityCastMode.Normal());
protected override AbilityCastMode GetQCastMode() => AbilityCastMode.Normal();
protected override AbilityCastMode GetWCastMode() => AbilityCastMode.Instant(6000, 1);
private void DoCastLogicForAbility(AbilityKey key, bool keyUp) { if (keyUp && SelectedAbility != key) { return; // keyUp event shouldn't trigger anything if the ability is not selected. } if (!CanCastAbility(key)) { return; } AbilityCastMode castMode = AbilityCastModes[key]; //Debug.WriteLine(key + " " + (keyUp ? "up" : "down")); if (castMode.HasRecast && AbilitiesOnRecast[key] > 0) { //Debug.WriteLine(castMode); if (castMode.RecastMode.IsInstant) { RecastAbility(key); return; } if (PreferredCastMode == AbilityCastPreference.Normal) { if (castMode.RecastMode.IsNormal) { SelectedAbility = key; // RECAST SELECTED } if (castMode.RecastMode.RecastOnKeyUp && !keyUp) { RecastAbility(key); } return; } if (PreferredCastMode == AbilityCastPreference.Quick) { RecastAbility(key); return; } if (PreferredCastMode == AbilityCastPreference.QuickWithIndicator) { if (castMode.RecastMode.RecastOnKeyUp && keyUp && SelectedAbility == key) { RecastAbility(key); } if (castMode.RecastMode.IsNormal) { SelectedAbility = key; // RECAST SELECTED } if (castMode.RecastMode.IsNormal && keyUp && SelectedAbility == key) { if (CanCastAbility(key)) { RecastAbility(key); } } return; } return; } if (castMode.IsInstant) // ability is cast with just pressing down the key { CastAbility(key); return; } if (castMode.IsNormal) // ability has normal cast { if (PreferredCastMode == AbilityCastPreference.Normal) { SelectedAbility = key; return; } if (PreferredCastMode == AbilityCastPreference.Quick) { CastAbility(key); return; } if (PreferredCastMode == AbilityCastPreference.QuickWithIndicator) { if (keyUp && SelectedAbility == key) // Key released, so CAST IT if it's selected { CastAbility(key); } else // Key down, so select it { SelectedAbility = key; } } } }
protected override AbilityCastMode GetRCastMode() => AbilityCastMode.Instant(2300);
private void DoCastLogicForAbility(AbilityKey key, bool keyUp) { if (keyUp && SelectedAbility != key) { return; // keyUp event shouldn't trigger anything if the ability is not selected. } AbilityCastMode castMode = AbilityCastModes[key]; //Console.WriteLine(key + " " + (keyUp ? "up" : "down")); if (castMode.HasRecast && AbilitiesOnRecast[key] > 0) { //Console.WriteLine(castMode); if (castMode.RecastMode.IsInstant) { if (CanCastAbility(key)) // We must check if CanCastAbility is true. Players can't recast abilities if they're dead or in zhonyas. { RecastAbility(key); } return; } if (PreferredCastMode == AbilityCastPreference.Normal) { if (castMode.RecastMode.IsNormal) { if (CanCastAbility(key)) { SelectedAbility = key; // RECAST SELECTED } } if (castMode.RecastMode.RecastOnKeyUp && !keyUp) { if (CanCastAbility(key)) { RecastAbility(key); } } return; } if (PreferredCastMode == AbilityCastPreference.Quick) { if (CanCastAbility(key)) { RecastAbility(key); } return; } if (PreferredCastMode == AbilityCastPreference.QuickWithIndicator) { if (castMode.RecastMode.RecastOnKeyUp && keyUp && SelectedAbility == key) { if (CanCastAbility(key)) { RecastAbility(key); } } if (castMode.RecastMode.IsNormal) { if (CanCastAbility(key)) { SelectedAbility = key; // RECAST SELECTED } } if (castMode.RecastMode.IsNormal && keyUp && SelectedAbility == key) { if (CanCastAbility(key)) { RecastAbility(key); } } return; } /*if (castMode.RecastMode.IsInstant || PreferredCastMode == AbilityCastPreference.Quick || (PreferredCastMode == AbilityCastPreference.QuickWithIndicator && keyUp && SelectedAbility == key) || ((PreferredCastMode == AbilityCastPreference.Quick || PreferredCastMode == AbilityCastPreference.QuickWithIndicator) && keyUp && castMode.RecastMode.RecastOnKeyUp)) || { || if (CanCastAbility(key)) || { || RecastAbility(key); || } || return; || } || if (PreferredCastMode == AbilityCastPreference.Normal || PreferredCastMode == AbilityCastPreference.QuickWithIndicator) || { || if (CanCastAbility(key)) || { || SelectedAbility = key; || // RECAST SELECTED || } || }*/ return; } if (castMode.IsInstant) // ability is cast with just pressing down the key { if (CanCastAbility(key)) { CastAbility(key); } return; } if (castMode.IsNormal) // ability has normal cast { if (PreferredCastMode == AbilityCastPreference.Normal) { if (CanCastAbility(key)) // normal press & click cast, typical { SelectedAbility = key; } return; } if (PreferredCastMode == AbilityCastPreference.Quick) { if (CanCastAbility(key)) { CastAbility(key); } return; } if (PreferredCastMode == AbilityCastPreference.QuickWithIndicator) { if (CanCastAbility(key)) { if (keyUp && SelectedAbility == key) // Key released, so CAST IT if it's selected { if (CanCastAbility(key)) { CastAbility(key); } } else // Key down, so select it { if (CanCastAbility(key)) { SelectedAbility = key; } } } } } }
protected override AbilityCastMode GetItemCastMode() => AbilityCastMode.Instant();
private void DoCastLogicForAbility(AbilityKey key, bool keyUp) { if (keyUp && SelectedAbility != key) { return; // keyUp event shouldn't trigger anything if the ability is not selected. } AbilityCastMode castMode = AbilityCastModes[key]; if (castMode.HasRecast && AbilitiesOnRecast[key] > 0) { if (CanCastAbility(key)) // We must check if CanCastAbility is true. Players can't recast abilities if they're dead or in zhonyas. { RecastAbility(key); } return; } if (castMode.IsInstant) // ability is cast with just pressing down the key { if (CanCastAbility(key)) { CastAbility(key); } return; } if (castMode.IsNormal) // ability has normal cast { if (PreferredCastMode == AbilityCastPreference.Normal) { if (CanCastAbility(key)) // normal press & click cast, typical { SelectedAbility = key; } return; } if (PreferredCastMode == AbilityCastPreference.Quick) { if (CanCastAbility(key)) { CastAbility(key); } return; } if (PreferredCastMode == AbilityCastPreference.QuickWithIndicator) { if (CanCastAbility(key)) { if (keyUp && SelectedAbility == key) // Key released, so CAST IT if it's selected { if (CanCastAbility(key)) { CastAbility(key); } } else // Key down, so select it { if (CanCastAbility(key)) { SelectedAbility = key; } } } } } }
protected override AbilityCastMode GetQCastMode() => AbilityCastMode.PointAndClick();
protected override AbilityCastMode GetRCastMode() => AbilityCastMode.Instant(10000, 2);
protected override AbilityCastMode GetQCastMode() => AbilityCastMode.Instant(3500, 1, AbilityCastMode.KeyUpRecast());
/// <summary> /// Returns an instant cast mode. /// </summary> /// <param name="recastTime">Max time the player has to recast the ability</param> /// <param name="maxRecasts">Max number of times the ability can be recast (e.g. for Ahri R it's 3, for most it's just 1)</param> /// <param name="recastMode">Cast mode for the ability recast. If <paramref name="recastMode"/> is null, by default the recast is on Instant mode.</param> public static AbilityCastMode Instant(int recastTime = -1, int maxRecasts = 1, AbilityCastMode recastMode = null) { return(new AbilityCastMode() { IsInstant = true, HasRecast = recastTime > 0, RecastMode = recastTime > 0 ? recastMode ?? AbilityCastMode.Instant() : null, RecastTime = recastTime, MaxRecasts = maxRecasts }); }