public static void Attract(Vector2 position, float radius, int layerMask) { var toRemove = new List <Epicenter>(); for (int i = 0; i < epicenters.Count; i++) { Epicenter epicenter = epicenters[i]; if (epicenter.isExpired) { toRemove.Add(epicenter); continue; } if (epicenter.IsClose(position)) { return; } } foreach (var e in toRemove) { epicenters.Remove(e); } epicenters.Add(new Epicenter(position, Time.time)); DoAttractNow(position, radius, layerMask); }
public SandKing(Unit9 owner, MultiSleeper abilitySleeper, Sleeper orbwalkSleeper, ControllableUnitMenu menu) : base(owner, abilitySleeper, orbwalkSleeper, menu) { this.ComboAbilities = new Dictionary <AbilityId, Func <ActiveAbility, UsableAbility> > { { AbilityId.sandking_burrowstrike, x => this.burrow = new Burrowstrike(x) }, { AbilityId.sandking_sand_storm, x => this.sandstorm = new UntargetableAbility(x) }, { AbilityId.sandking_epicenter, x => this.epicenter = new Epicenter(x) }, { AbilityId.item_veil_of_discord, x => this.veil = new DebuffAbility(x) }, { AbilityId.item_blink, x => this.blink = new BlinkAbility(x) }, { AbilityId.item_force_staff, x => this.force = new ForceStaff(x) }, { AbilityId.item_shivas_guard, x => this.shiva = new DebuffAbility(x) }, { AbilityId.item_sheepstick, x => this.hex = new DisableAbility(x) }, }; this.MoveComboAbilities.Add(AbilityId.sandking_burrowstrike, x => this.burrowBlink = new BlinkAbility(x)); }