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; } }
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 }
public HitInfos(LivingBeing Attacker, EnemyAttackStats AttackStats) : this(Attacker, (AttackStats)AttackStats) { EnemyAttackStats = AttackStats; }