/* * --------------------------------------------------------- * -------------------Character Abilities------------------- * --------------------------------------------------------- */ //TODO: At the beginning of each of these, add an energy check to see if suitable public void EN_Main_StrongAttack() { if (statusDict[battleState].currEnergy >= 20) { playerStatusHUD.LoseEN(statusDict[battleState].placement, statusDict[battleState], 20); choicesPanel.gameObject.SetActive(false); StartCoroutine(STRATK(playerDebuggerList[statusDict[battleState].placement], statusDict[battleState], E1Status, 0)); } }
IEnumerator E1Turn() { yield return(new WaitForSeconds(0.5f)); SetSidePanel(false, false, false, false, false, false, false); int DMG = statusDict[battleState].updateStatuses(); if (DMG > 0) { enemyStatusHUD.LoseHP(0, statusDict[battleState], DMG, new Color(1, 0.7f, 0, 1)); yield return(new WaitForSeconds(0.6f)); if (statusDict[battleState].currHealth <= 0) { yield return(StartCoroutine(IsMainEnemyDead())); yield break; } } if (statusDict[battleState].DoT_Turns > 0) { enemyStatusHUD.Debuff(statusDict[battleState].placement, true); } else { enemyStatusHUD.Debuff(statusDict[battleState].placement, false); } float chance = UnityEngine.Random.Range(0f, 1f); //Additional check to determine if the enemy can use a special move if ((statusDict[BattleState.P2TURN] != null || statusDict[BattleState.P3TURN] != null) && statusDict[battleState].currEnergy >= 20 && chance <= 0.3f) { enemyStatusHUD.LoseEN(statusDict[battleState].placement, statusDict[battleState], 20); yield return(StartCoroutine(EnemyDoesAttackAll(enemy1Debug, E1Status))); } else { (CharacterStatus, int, GameObject)toAttack = EChooseTarget(); yield return(StartCoroutine(EnemyDoesAttack(enemy1Debug, E1Status, toAttack.Item3, toAttack.Item1, toAttack.Item2))); } }