public override void Action(object info = null) { base.Action(info); List <object> allies = new List <object>(); allies.AddRange(GetOpponentOverlord().BoardCards); allies.Add(GetOpponentOverlord()); allies = InternalTools.GetRandomElementsFromList(allies, 1); for (int i = 0; i < allies.Count; i++) { if (allies[i] is Player) { BattleController.AttackPlayerByAbility(GetCaller(), AbilityData, allies[i] as Player); CreateVfx((allies[i] as Player).AvatarObject.transform.position, true, 5f, true); } else if (allies[i] is BoardUnit) { BattleController.AttackUnitByAbility(GetCaller(), AbilityData, allies[i] as BoardUnit); CreateVfx((allies[i] as BoardUnit).Transform.position, true, 5f); } } }
public override void Action(object info = null) { base.Action(info); List <object> allies = new List <object>(); allies.AddRange(PlayerCallerOfAbility.BoardCards); allies.Remove(AbilityUnitOwner); allies.Add(PlayerCallerOfAbility); allies = InternalTools.GetRandomElementsFromList(allies, Value); for (int i = 0; i < allies.Count; i++) { switch (allies[i]) { case Player player: player.Stun(Enumerators.StunType.FREEZE, Turns); CreateVfx(player.AvatarObject.transform.position, true, 5f); break; case BoardUnit unit: unit.Stun(Enumerators.StunType.FREEZE, Turns); CreateVfx(unit.Transform.position, true, 5f); break; } } }
private void BuffRandomAlly(List <BoardUnit> units, int count, List <Enumerators.BuffType> buffTypes) { if (_tutorialManager.IsTutorial) { // need for attacking by Poizom's units = units.FindAll(x => x.UnitCanBeUsable()); } units = InternalTools.GetRandomElementsFromList(units, count); foreach (Enumerators.BuffType buff in buffTypes) { foreach (BoardUnit unit in units) { unit.ApplyBuff(buff); } } }