private IEnumerator StandardAttack() { animationController.Play("Attack Animation"); yield return(new WaitForSeconds(1)); if (turnController.GetForestConversion()) { damageText.text = "FOREST CONVERSION"; damageText.enabled = true; yield return(new WaitForSeconds(1)); StartCoroutine(TakeDamage(Random.Range(attackPower - (attackPower / 2), attackPower + (attackPower / 2)), false)); yield return(new WaitForSeconds(1)); damageText.enabled = false; turnController.SetForestConversion(true); } else { chance = Random.Range(1, 3); switch (chance) { case 1: paladinController.StartCoroutine(paladinController.TakeDamage(Random.Range(attackPower - (attackPower / 2), attackPower + (attackPower / 2)))); break; case 2: valkyrieController.StartCoroutine(valkyrieController.TakeDamage(Random.Range(attackPower - (attackPower / 2), attackPower + (attackPower / 2)))); break; case 3: sageController.StartCoroutine(sageController.TakeDamage(Random.Range(attackPower - (attackPower / 2), attackPower + (attackPower / 2)))); break; } } }
private IEnumerator ExecuteSpecial() { blueButton.enabled = false; greenButton.enabled = false; orangeButton.enabled = false; redButton.enabled = false; blueButtonImage.enabled = false; greenButtonImage.enabled = false; orangeButtonImage.enabled = false; redButtonImage.enabled = false; specialText.enabled = false; specialImage.enabled = false; spriteImage.material.color = clear; if (selectedOrder.Count == 4 && CheckMatch()) { valkyrieController.StartCoroutine(valkyrieController.AddToHealth(6500)); yield return(new WaitForSeconds(1)); valkyrieController.StartCoroutine(valkyrieController.AddToMagic(2000)); yield return(new WaitForSeconds(1)); paladinController.StartCoroutine(paladinController.AddToHealth(8000)); yield return(new WaitForSeconds(1)); paladinController.StartCoroutine(paladinController.AddToMagic(2000)); yield return(new WaitForSeconds(1)); StartCoroutine(AddToHealth(5000)); yield return(new WaitForSeconds(1)); StartCoroutine(AddToMagic(8000)); yield return(new WaitForSeconds(1)); } else { valkyrieController.StartCoroutine(valkyrieController.AddToHealth(1625)); yield return(new WaitForSeconds(1)); valkyrieController.StartCoroutine(valkyrieController.AddToMagic(500)); yield return(new WaitForSeconds(1)); paladinController.StartCoroutine(paladinController.AddToHealth(2000)); yield return(new WaitForSeconds(1)); paladinController.StartCoroutine(paladinController.AddToMagic(500)); yield return(new WaitForSeconds(1)); StartCoroutine(AddToHealth(1250)); yield return(new WaitForSeconds(1)); StartCoroutine(AddToMagic(2000)); yield return(new WaitForSeconds(1)); } yield return(new WaitForSeconds(1)); if (b_isWounded) { spriteImage.material.color = transparent; woundedImage.enabled = true; } turnController.UpdateTurn(); }
public void UpdateTurn() { currentTurn++; rounds++; if (currentTurn == Turn.TOTAL_TURNS) { currentTurn = Turn.PALADIN; } magicButtonSelected = false; potionButtonSelected = false; manaButtonSelected = false; if (paladinController.IsGuardUp()) { paladinController.setGuardUpImage(false); } if (valkyrieController.IsGuardUp()) { valkyrieController.setGuardUpImage(false); } if (sageController.IsGuardUp()) { sageController.setGuardUpImage(false); } if (currentTurn == Turn.PALADIN) { if (paladinController.isDead()) { paladinController.StartCoroutine(paladinController.OnDead()); } if (paladinController.GetIsPetrified()) { EnableAllButtons(false); StartCoroutine(ShowPetrificationStatus(1)); } if (paladinController.IsGuardUp()) { paladinController.setGuardUpImage(true); } } if (currentTurn == Turn.VALKYRIE) { if (valkyrieController.isDead()) { valkyrieController.StartCoroutine(valkyrieController.OnDead()); } if (valkyrieController.GetIsPetrified()) { EnableAllButtons(false); StartCoroutine(ShowPetrificationStatus(2)); } if (valkyrieController.IsGuardUp()) { valkyrieController.setGuardUpImage(true); } } if (currentTurn == Turn.SAGE) { if (sageController.isDead()) { sageController.StartCoroutine(sageController.OnDead()); } if (sageController.GetIsPetrified()) { EnableAllButtons(false); StartCoroutine(ShowPetrificationStatus(3)); } if (sageController.IsGuardUp()) { sageController.setGuardUpImage(true); } } EnableAllButtons(true); switch (currentTurn) { case Turn.PALADIN: { stateText.text = "PALADIN'S TURN"; paladinPortraitRenderer.enabled = true; valkyriePortraitRenderer.enabled = false; sagePortraitRenderer.enabled = false; } break; case Turn.VALKYRIE: { stateText.text = "VALKYRIE'S TURN"; paladinPortraitRenderer.enabled = false; valkyriePortraitRenderer.enabled = true; sagePortraitRenderer.enabled = false; } break; case Turn.SAGE: { stateText.text = "SAGE'S TURN"; paladinPortraitRenderer.enabled = false; valkyriePortraitRenderer.enabled = false; sagePortraitRenderer.enabled = true; } break; case Turn.ENEMY: { stateText.text = "CYCLOP'S TURN"; paladinPortraitRenderer.enabled = false; valkyriePortraitRenderer.enabled = false; sagePortraitRenderer.enabled = false; EnableAllButtons(false); enemyController.StartCoroutine(enemyController.DecideAction()); } break; } if (FAST_PLAY) { FastPlay(); } if (enemyController.GetHealth() <= 0) { EndGame(); } }