Ejemplo n.º 1
0
    protected IEnumerator AttackCoroutine()
    {
        currentAttack = GetRandomAttack();
        if (currentAttack != null)
        {
            SendMessage("OnAttackStart", currentAttack);
            StartCoroutine("ImpulsesCoroutine", currentAttack.impulses);

            curAttackState = AttackState.Casting;
            yield return(new WaitForSeconds(currentAttack.castTime));

            curAttackState = AttackState.Attacking;
            try
            {
                GameObject   o  = Instantiate(currentAttack.attackModel, Body.position, Visual.rotation, transform);
                AttackObject ao = o.GetComponent <AttackObject>();
                ao.Initialize(new HitInfos(EB, currentAttack));
            }
            catch { Debug.LogError("No Prefab Found !"); }

            currentAttack.lastAttackTime = Time.time;

            yield return(new WaitForSeconds(currentAttack.attackTime));

            curAttackState = AttackState.Recover;
            yield return(new WaitForSeconds(currentAttack.recoverTime));

            SendMessage("OnAttackStop", currentAttack);
            currentAttack  = null;
            curAttackState = AttackState.Normal;
        }
    }
Ejemplo n.º 2
0
    private void PlayerStartTurn()
    {
        if (enemy1Alive)
        {
            enemyIntentionsUI1.SetActive(true); // isso serve pro player conseguir ver o que o inimigo pretende fazer
            enemyAttack1 = enemyManager1.EnemySkillDecider();
        }

        if (enemiesAmount >= 2 && enemy2Alive)
        {
            enemyIntentionsUI2.SetActive(true);
            enemyAttack2 = enemyManager2.EnemySkillDecider();
        }


        yourTurnText.SetActive(false);
        playerManagerScript.ShieldManager(-999); // isso é pra resetar o shield do player todo fim de turno
        playerTurn = true;
        moveCardToHandScript.move = true;        // isso é pra dar draw
    }
Ejemplo n.º 3
0
 public HitInfos(LivingBeing Attacker, EnemyAttackStats AttackStats) : this(Attacker, (AttackStats)AttackStats)
 {
     EnemyAttackStats = AttackStats;
 }