Exemplo n.º 1
0
    public void Target(int index)
    {
        targetIndex = index;
        target      = turnOrder[index].GetComponent <EnemyBody>();

        ClearEnemyColor();
        target.GetComponent <Image>().color = Color.blue;

        StartCoroutine(PrepareAttack());
    }
Exemplo n.º 2
0
    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>()
        });
    }
Exemplo n.º 3
0
    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();
    }
Exemplo n.º 4
0
 private void ColliderSetActive(bool active)
 {
     _body.GetComponent <Collider2D>().enabled = active;
 }