public void TakeTurn(UnitStackBase unit, BattleManager battleManager) { this.battleManager = battleManager; actingUnit = unit; healAbility = unit.GetComponentInChildren <HealAbility>(); if (healAbility == null) { Debug.LogError($"Unit doesn't have healing ability. Enemy strategy: HealThenAttackRandom. Enemy: {unit}."); AttackRandom(); } else { TryToHeal(); } }
public void TakeTurn(UnitStackBase unit, BattleManager battleManager) { this.actingUnit = unit; this.battleManager = battleManager; defendAbility = actingUnit.GetComponentInChildren <DefendAbility>(); if (defendAbility == null) { Debug.LogError($"Unit doesn't have defending ability. Enemy strategy: DefenderStrategy. Enemy: {unit}."); AttackRandom(); return; } if (defendAbility.CanBeUsed()) { TryToUseDefend(); } else { AttackRandom(); } }
public void TakeTurn(UnitStackBase actingUnit, BattleManager battleManager) { this.actingUnit = actingUnit; this.battleManager = battleManager; this.ability = actingUnit.GetComponentInChildren <BuffDamageAbility>(); if (ability == null) { Debug.LogError($"Unit doesn't have buffing ability. Enemy strategy: SpecialCasterStrat. Enemy: {actingUnit}."); AttackRandom(); return; } if (ability.CanBeUsed()) { TryToBuffPyro(); } else { AttackRandom(); } }
public void TakeTurn(UnitStackBase actingUnit, BattleManager battleManager) { this.actingUnit = actingUnit; this.battleManager = battleManager; this.ability = actingUnit.GetComponentInChildren <SmallmageddonAbility>(); if (ability == null) { Debug.LogError($"Unit doesn't have smallmageddon ability. Enemy strategy: PyroStrategy. Enemy: {actingUnit}."); AttackRandom(); return; } if (ability.CanBeUsed()) { ability.GetActiatedByAi(actingUnit, battleManager); battleManager.EndTurn(); } else { AttackRandom(); } }