IEnumerator Recombination(int who) { yield return(new WaitForSeconds(0.5f)); //Hide UI playerStatusHUD.setUIVisible(who, false); //Remove buffs/debuffs //TODO: This could be the spot to do buff passing and exponentiality playerStatusHUD.Buff(statusDict[battleState].placement, false); playerStatusHUD.Debuff(statusDict[battleState].placement, false); //Re-combine P1Status.ReturnToMain(statusDict[battleState]); statusDict[battleState] = null; //Disable the Debug model if (who == 1) { player2Debug.SetActive(false); } else //2 { player3Debug.SetActive(false); } //Update Main UI playerStatusHUD.SetStatusHUD(0, P1Status); yield return(StartCoroutine(WhoGoesNext())); }
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))); } }