public override void InternalChooseBestTarget(ColossoFighter User) { var aliveEnemies = User.GetEnemies().Where(f => f.IsAlive).ToList(); if (aliveEnemies.Count == 0) { TargetNr = 0; return; } TargetNr = User.GetEnemies().IndexOf(aliveEnemies.Random()); }
public override void InternalChooseBestTarget(ColossoFighter User) { if (effects.Count > 0) { targetNr = effects[0].ChooseBestTarget(OnEnemy ? User.GetEnemies() : User.GetTeam()); } else { targetNr = 0; } }
public List <ColossoFighter> GetTarget(ColossoFighter user) { List <ColossoFighter> targets = new List <ColossoFighter>(); var playerCount = user.battle.GetTeam(user.party).Count - 1; var enemyCount = user.battle.GetTeam(user.enemies).Count - 1; switch (TargetType) { case Target.self: targets.Add(user); break; case Target.ownAll: TargetNr = Math.Min(TargetNr, playerCount); targets.AddRange(user.battle.GetTeam(user.party)); break; case Target.ownSingle: TargetNr = Math.Min(TargetNr, playerCount); targets.Add(user.battle.GetTeam(user.party)[TargetNr]); break; case Target.otherAll: targets.AddRange(user.GetEnemies()); break; case Target.otherSingle: TargetNr = Math.Min(TargetNr, enemyCount); targets.Add(user.battle.GetTeam(user.enemies)[TargetNr]); break; case Target.otherRange: TargetNr = Math.Min(TargetNr, enemyCount); var targetTeam = user.battle.GetTeam(user.enemies); for (int i = -(int)Range + 1; i <= Range - 1; i++) { if (TargetNr + i >= 0 && TargetNr + i < targetTeam.Count()) { targets.Add(targetTeam[TargetNr + i]); } } break; } return(targets); }
protected override List <string> InternalUse(ColossoFighter User) { List <string> log = new List <string>(); //Get enemies and targeted enemies List <ColossoFighter> targets = GetTarget(User); foreach (var t in targets) { if (PPCost > 1 && User.GetEnemies().Contains(t) && t.IsImmuneToPsynergy) { log.Add($"{t.name} protects themselves with a magical barrier."); return(log); } effects.ForEach(e => log.AddRange(e.Apply(User, t))); if (User is PlayerFighter) { ((PlayerFighter)User).battleStats.Supported++; } } return(log); }
protected override bool InternalValidSelection(ColossoFighter user) { return(!user.GetEnemies().All(s => s.HasCondition(Condition))); }