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());
        }
Exemple #2
0
 public override void InternalChooseBestTarget(ColossoFighter User)
 {
     if (effects.Count > 0)
     {
         targetNr = effects[0].ChooseBestTarget(OnEnemy ? User.GetEnemies() : User.GetTeam());
     }
     else
     {
         targetNr = 0;
     }
 }
Exemple #3
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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
 protected override bool InternalValidSelection(ColossoFighter user)
 {
     return(!user.GetEnemies().All(s => s.HasCondition(Condition)));
 }