// ############## // # Enemy Turn # // ############## private void EnemyTurn() { if (targetingEnemy) // reset targeting enemy { targetingEnemy = false; if (currentCharacter != null) { currentCharacter.ResetAttackMode(); currentCharacter.CharacterDeselect(); currentCharacter = null; } EventManager.Instance.TargetEnemyToggle(); } // Select attacker attacker = NextEnemy(); if (attacker == null) { CheckForGameEnding(); return; } attacker.SetAttacking(true); attacker.CharacterSelect(); EventManager.Instance.SetEnemyName(enemyCharacters[currentEnemyNr].characterName); // Set UI currentAbility = attacker.SelectAttack(); if (currentAbility.hasAttackMode) // Determine whether an Attack Mode animation must play { attacker.PlayAbilityAnimation("AttackMode"); // play animation } else { attacker.PlayAbilityAnimation("Attack"); // play animation } switch (currentAbility.targets) { case "EnemyRandom": // Instant EnemyAbilityInstant(); break; case "EnemyRhythm": // Rhythm EnemyRhythm(); break; default: break; } }
// ############## // # Enemy Turn # // ############## private void EnemyTurn() { if (targetingEnemy) // reset targeting enemy { targetingEnemy = false; if (currentCharacter != null) { currentCharacter.ResetAttackMode(); currentCharacter.CharacterDeselect(); currentCharacter = null; } EventManager.Instance.TargetEnemyToggle(); } // Select attacker attacker = NextEnemy(); if (attacker == null) { CheckForGameEnding(); return; } attacker.SetAttacking(true); attacker.CharacterSelect(); EventManager.Instance.SetEnemyName(enemyCharacters[currentEnemyNr].characterName); // Set UI currentAbility = attacker.SelectAttack(); //print(currentAbility.GetName()); switch (currentAbility.targets) { case "EnemyRandom": // Instant EnemyAbilityRandom(false); break; case "EnemyRhythm": // Rhythm EnemyAbilityRhythm(); break; case "FriendlyRandom": EnemyAbilityRandom(true); break; default: break; } }