public void Target(int index) { targetIndex = index; target = turnOrder[index].GetComponent <EnemyBody>(); ClearEnemyColor(); target.GetComponent <Image>().color = Color.blue; StartCoroutine(PrepareAttack()); }
public override List <EnemyBody> GetAnyRequiredEnemies(Level level) { var spawnLoc = GetBossSpawnLocation(); Boss = EnemySpawner.SpawnBoss(spawnLoc).GetComponent <EnemyBody>(); Boss.xPos = spawnLoc.x; Boss.zPos = spawnLoc.y; (Boss.AI as BossBrain).BossRoom = this; return(new List <EnemyBody> { Boss.GetComponent <EnemyBody>() }); }
IEnumerator EnemyTurn() { activeEnemy.GetComponent <Image>().color = Color.red; yield return(new WaitForSeconds(1)); //just for pacing for now but could become ATB system int damage = CalculateDamage(activeEnemy.atk, _hero.data.Def); // //TODO: calculate dodge Debug.Log( activeEnemy._name + "attacked " + _hero.data.Name + " for " + damage ); // //extract this out to hero class _hero.TakeDamage(damage); RotateOrder(); }
private void ColliderSetActive(bool active) { _body.GetComponent <Collider2D>().enabled = active; }