public static List <GameObject> FindTarget(behaviour_AI behaviour, EnemyStats enemy, List <EnemyStats> all_enemy, PlayerStats player) { behaviour.currentCoolDown = behaviour.cooldown; List <GameObject> targets = new List <GameObject>(); switch (behaviour.behaviour) { case AI_behaviour.Attack: targets.Add(behabiour_Attack(player)); break; case AI_behaviour.on_self: targets.Add(behabiour_on_self(enemy)); break; case AI_behaviour.on_low_health_allie: targets.Add(behabiour_on_low_health_allie(all_enemy)); break; case AI_behaviour.on_random_allie: targets.Add(behabiour_on_random_allie(all_enemy)); break; case AI_behaviour.on_all_allies: behaviour_on_all_allies(targets, all_enemy); break; case AI_behaviour.summon: //behaviour_summon(behaviour.B_Value1, behaviour.B_Value2); return(null);; } return(targets); }
public static bool CheckCondition(behaviour_AI condition, EnemyStats enemy, List <EnemyStats> all_enemy) { if (condition.currentCoolDown > 0) { return(false); } switch (condition.condition) { case AI_condition.nothing: return(condition_nothing(condition.probability)); case AI_condition.low_health: return(condition_low_health(condition.C_Value1, enemy, condition.probability)); case AI_condition.low_allie_health: return(condition_low_allie_health(condition.C_Value1, all_enemy, condition.probability)); case AI_condition.enemyCount: return(condition_enemyCount(condition.C_Value1, all_enemy, condition.probability)); } return(true); }