// Use this for initialization void Start() { CombatScript = CombatManager.GetComponent <CombatManagerScript>(); int temp = EnemyType + 1; this.myEnemy.SelectEnemyType(temp); startingPos = this.transform.position; startAttackAnim = false; addDamage = false; enemyAttack = false; vel = Vector3.zero; }
public static void IvAction() { if (CombatManagerScript.ivAttacks) { // First spell // If player pulls their hand back first if (MarkerManagerScript.wasSmaller) { ivCondition1[0] = true; } if (ivCondition1[0]) { // If player then moves hand close to the webcam if (Input.GetKeyDown(KeyCode.N)) { ivCondition1[1] = true; } // If player instead moves hand back to a resting position else if (Input.GetKeyDown(KeyCode.M)) { ivCondition1[0] = false; } } // Second spell // If the player is right-handed if (GameManagerScript.rightHanded) { // If player starts by placing their hand in the middle-right corner if (MarkerManagerScript.currentLocation == 6) { ivCondition2[0] = true; } if (ivCondition2[0] && !ivCondition2[1]) { Debug.Log("Point 1"); // If player then places their their hand in the middle-left corner if (Input.GetKeyDown(KeyCode.A)) { ivCondition2[1] = true; } // If player instead places their hand in any other corner if (!ivCondition2[1]) { if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.C)) { ivCondition2[0] = false; } } } } // If the player is left-handed else { // If player starts by placing their hand in the middle-left corner if (MarkerManagerScript.currentLocation == 4) { ivCondition2[0] = true; } if (ivCondition2[0] && !ivCondition2[1]) { Debug.Log("Point 1"); // If player then places their their hand in the middle-right corner if (Input.GetKeyDown(KeyCode.D)) { ivCondition2[1] = true; } // If player instead places their hand in any other corner if (!ivCondition2[1]) { if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.C)) { ivCondition2[0] = false; } } } } // If player has completed the first two moves if (ivCondition2[1] && !ivCondition2[2]) { Debug.Log("Point 2"); // If player then places their their hand in the top-middle corner if (Input.GetKeyDown(KeyCode.W)) { ivCondition2[2] = true; } // If player instead places their hand in any other corner if (!ivCondition2[2]) { if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.C)) { ivCondition2[0] = false; ivCondition2[1] = false; } } } // If player has then placed hand in the top-middle corner if (ivCondition2[2] && !ivCondition2[3]) { Debug.Log("Point 3"); // If player then places their their hand in the bottom-middle corner if (Input.GetKeyDown(KeyCode.X)) { Debug.Log("Point 4"); // The player has successfully made the pattern ivCondition2[3] = true; } // If player instead places their hand in any other corner if (!ivCondition2[3]) { if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.C)) { ivCondition2[0] = false; ivCondition2[1] = false; ivCondition2[2] = false; } } } // Third spell // If player starts to rotate their hand first if (GameManagerScript.rightHanded) { if (Input.GetKeyDown(KeyCode.K)) { ivCondition3[0] = true; } } else { if (Input.GetKeyDown(KeyCode.J)) { ivCondition3[0] = true; } } if (ivCondition3[0]) { // If player then rotates hand to desired location and locks in their choice if (Input.GetKeyDown(KeyCode.V)) { ivCondition3[1] = true; } // If player then rotates hand to the first or second zone if (Input.GetKeyDown(KeyCode.L) || Input.GetKeyDown(KeyCode.G)) { ivRotation = 1; } // If player then rotates hand to the third or fourth zone if (Input.GetKeyDown(KeyCode.B) || Input.GetKeyDown(KeyCode.T)) { ivRotation = 2; } // If player then rotates hand to the fifth zone if (Input.GetKeyDown(KeyCode.R)) { ivRotation = 3; } } // Check to see if the player decided to move for their turn instead if (MarkerManagerScript.goMarker) { if (Input.GetKeyDown(KeyCode.V)) { ivCondition4[0] = true; } } if (ivCondition4[0]) { // If the player decides to move Folkvar to the left if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.Z)) { if (CharacterManagerScript.MoveIv(1) == 1) { ivCondition4[1] = true; } // If they cannot move in that direction if (CharacterManagerScript.MoveIv(1) == 2) { print("Choose another direction to move in"); ivCondition4[0] = false; } } // If the player decides to move Folkvar to the right if (Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.C)) { if (CharacterManagerScript.MoveIv(2) == 1) { ivCondition4[2] = true; } // If they cannot move in that direction if (CharacterManagerScript.MoveIv(2) == 2) { print("Choose another direction to move in"); ivCondition4[0] = false; } } } else { ivCondition4[1] = false; ivCondition4[2] = false; } // check to see if Iv can perform any actions CombatManagerScript.IvTeamSupport(); // Reset variables if an action is canceled if (MarkerManagerScript.undoMarker) { if (Input.GetKeyDown(KeyCode.U)) { ResetIvVariables(); } } } }
private void Awake() { Instance = this; enabled = false; }
public static void NetrixiAttack() { if (CombatManagerScript.netrixiAttacks) { // First spell // If player pulls their hand back first if (MarkerManagerScript.wasSmaller) { netrixiCondition1[0] = true; } if (netrixiCondition1[0]) { // If player then moves hand close to the webcam if (Input.GetKeyDown(KeyCode.N)) { netrixiCondition1[1] = true; } // If player instead moves hand back to a resting position else if (Input.GetKeyDown(KeyCode.M)) { netrixiCondition1[0] = false; } } // Second spell // If player starts to rotate their hand first if (GameManagerScript.rightHanded) { if (Input.GetKeyDown(KeyCode.K)) { netrixiCondition2[0] = true; } } else { if (Input.GetKeyDown(KeyCode.J)) { netrixiCondition2[0] = true; } } if (netrixiCondition2[0]) { // If player then rotates hand to desired location and locks in their choice if (Input.GetKeyDown(KeyCode.V)) { netrixiCondition2[1] = true; } // If player then rotates hand to the first zone if (Input.GetKeyDown(KeyCode.L)) { netrixiRotation = 1; } // If player then rotates hand to the second zone if (Input.GetKeyDown(KeyCode.G)) { netrixiRotation = 2; } // If player then rotates hand to the third zone if (Input.GetKeyDown(KeyCode.B)) { netrixiRotation = 3; } // If player then rotates hand to the fourth zone if (Input.GetKeyDown(KeyCode.T)) { netrixiRotation = 4; } // If player then rotates hand to the fifth zone if (Input.GetKeyDown(KeyCode.R)) { netrixiRotation = 5; } } // Third spell // If the player is right-handed if (GameManagerScript.rightHanded) { // If player starts by placing their hand in the middle-right corner if (MarkerManagerScript.currentLocation == 6) { netrixiCondition3[0] = true; } if (netrixiCondition3[0] && !netrixiCondition3[1]) { Debug.Log("Point 1"); // If player then places their their hand in the bottom-middle corner if (Input.GetKeyDown(KeyCode.X)) { netrixiCondition3[1] = true; } // If player instead places their hand in any other corner if (!netrixiCondition3[1]) { if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.C)) { netrixiCondition3[0] = false; } } } // If player has then placed hand in the bottom-middle corner if (netrixiCondition3[1] && !netrixiCondition3[2]) { Debug.Log("Point 2"); // If player then places their their hand in the middle-left corner if (Input.GetKeyDown(KeyCode.A)) { netrixiCondition3[2] = true; } // If player instead places their hand in any other corner if (!netrixiCondition3[2]) { if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.C)) { netrixiCondition3[0] = false; netrixiCondition3[1] = false; } } } // If player has then placed hand in the middle-left corner if (netrixiCondition3[2] && !netrixiCondition3[3]) { Debug.Log("Point 3"); // If player then places their their hand in the top-middle corner if (Input.GetKeyDown(KeyCode.W)) { netrixiCondition3[3] = true; } // If player instead places their hand in any other corner if (!netrixiCondition3[3]) { if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.C)) { netrixiCondition3[0] = false; netrixiCondition3[1] = false; netrixiCondition3[2] = false; } } } // If the player has successfully made the pattern if (netrixiCondition3[3]) { Debug.Log("Point 4"); if (Input.GetKeyDown(KeyCode.V)) { netrixiCondition3[4] = true; } } } // if the player is left-handed else { // If player starts by placing their hand in the middle-left corner if (MarkerManagerScript.currentLocation == 4) { netrixiCondition3[0] = true; } if (netrixiCondition3[0] && !netrixiCondition3[1]) { Debug.Log("Point 1"); // If player then places their their hand in the bottom-middle corner if (Input.GetKeyDown(KeyCode.X)) { netrixiCondition3[1] = true; } // If player instead places their hand in any other corner if (!netrixiCondition3[1]) { if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.C)) { netrixiCondition3[0] = false; } } } // If player has then placed hand in the bottom-middle corner if (netrixiCondition3[1] && !netrixiCondition3[2]) { Debug.Log("Point 2"); // If player then places their their hand in the middle-right corner if (Input.GetKeyDown(KeyCode.D)) { netrixiCondition3[2] = true; } // If player instead places their hand in any other corner if (!netrixiCondition3[2]) { if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.C)) { netrixiCondition3[0] = false; netrixiCondition3[1] = false; } } } // If player has then placed hand in the middle-right corner if (netrixiCondition3[2] && !netrixiCondition3[3]) { Debug.Log("Point 3"); // If player then places their their hand in the top-middle corner if (Input.GetKeyDown(KeyCode.W)) { netrixiCondition3[3] = true; } // If player instead places their hand in any other corner if (!netrixiCondition3[3]) { if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.C)) { netrixiCondition3[0] = false; netrixiCondition3[1] = false; netrixiCondition3[2] = false; } } } // If the player has successfully made the pattern if (netrixiCondition3[3]) { Debug.Log("Point 4"); netrixiCondition3[4] = true; } } // Check to see if the player decided to move for their turn instead if (MarkerManagerScript.goMarker) { if (Input.GetKeyDown(KeyCode.V)) { netrixiCondition4[0] = true; } } if (netrixiCondition4[0]) { // If the player decides to move Netrixi to the left if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.Z)) { if (CharacterManagerScript.MoveNetrixi(1) == 1) { netrixiCondition4[1] = true; } // If they cannot move in that direction if (CharacterManagerScript.MoveNetrixi(1) == 2) { print("Choose another direction to move in"); netrixiCondition4[0] = false; } } // If the player decides to move Netrixi to the right if (Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.C)) { if (CharacterManagerScript.MoveNetrixi(2) == 1) { netrixiCondition4[2] = true; } // If they cannot move in that direction if (CharacterManagerScript.MoveNetrixi(2) == 2) { print("Choose another direction to move in"); netrixiCondition4[0] = false; } } } else { netrixiCondition4[1] = false; netrixiCondition4[2] = false; } // Check to see if Netrixi can cast any spells CombatManagerScript.NetrixiSpellCast(); // Reset variables if a spell is canceled if (MarkerManagerScript.undoMarker) { if (Input.GetKeyDown(KeyCode.U)) { ResetNetrixiVariables(); } } } }
public static void FolkvarAttack() { if (CombatManagerScript.folkvarAttacks) { // First attack // If player first puts their hand in the top-left corner if (MarkerManagerScript.currentLocation == 1) { folkvarCondition1[0] = true; } if (folkvarCondition1[0] && !folkvarCondition1[1]) { Debug.Log("Sword at the ready"); // If player then moves hand to the bottom-right if (Input.GetKeyDown(KeyCode.C)) { folkvarCondition1[1] = true; } // If player instead places their hand in any other corner if (!folkvarCondition1[1]) { if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.X)) { folkvarCondition1[0] = false; } } } // Second attack // If player moves their hand closer to the webcam first if (MarkerManagerScript.currentLocation == 2) { folkvarCondition2[0] = true; } if (folkvarCondition2[0]) { // If player then moves hand to the upper-left section if (Input.GetKeyDown(KeyCode.E)) { folkvarCondition2[1] = true; } // If player then moves hand downwards if (folkvarCondition2[1]) { print("Sword ready to strike from the heavens"); // If player then moves hand to the bottom-middle section if (Input.GetKeyDown(KeyCode.C)) { folkvarCondition2[2] = true; } // If player instead moves hand to a different location if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.X) || Input.GetKeyDown(KeyCode.D)) { folkvarCondition2[1] = false; folkvarCondition2[0] = false; } } else { // If player instead moves hand to a different location if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.X) || Input.GetKeyDown(KeyCode.D)) { folkvarCondition2[0] = false; } } } // Third attack // If player starts by placing their hand in the bottom-left corner if (MarkerManagerScript.currentLocation == 7) { folkvarCondition3[0] = true; } if (folkvarCondition3[0] && !folkvarCondition3[1]) { Debug.Log("Point 1"); // If player then places their their hand in the top-middle corner if (Input.GetKeyDown(KeyCode.W)) { folkvarCondition3[1] = true; } print(folkvarCondition1[1]); // If player instead places their hand in any other corner if (!folkvarCondition3[1]) { if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.X)) { folkvarCondition3[0] = false; } } } // If player has then placed hand in the top-middle corner if (folkvarCondition3[1] && !folkvarCondition3[2]) { Debug.Log("Point 2"); // If player then places their their hand in the bottom-right corner if (Input.GetKeyDown(KeyCode.C)) { Debug.Log("Point 3"); // The player has successfully made the pattern folkvarCondition3[2] = true; } // If player instead places their hand in any other corner if (!folkvarCondition3[2]) { if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.X)) { folkvarCondition3[0] = false; folkvarCondition3[1] = false; } } } // Check to see if the player decided to move for their turn instead if (MarkerManagerScript.goMarker) { if (Input.GetKeyDown(KeyCode.V)) { folkvarCondition4[0] = true; } } if (folkvarCondition4[0]) { // If the player decides to move Folkvar to the left if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.Z)) { if (CharacterManagerScript.MoveFolkvar(1) == 1) { folkvarCondition4[1] = true; } // If they cannot move in that direction if (CharacterManagerScript.MoveFolkvar(1) == 2) { print("Choose another direction to move in"); folkvarCondition4[0] = false; } } // If the player decides to move Folkvar to the right if (Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.C)) { if (CharacterManagerScript.MoveFolkvar(2) == 1) { folkvarCondition4[2] = true; } // If they cannot move in that direction if (CharacterManagerScript.MoveFolkvar(2) == 2) { print("Choose another direction to move in"); folkvarCondition4[0] = false; } } } else { folkvarCondition4[1] = false; folkvarCondition4[2] = false; } // check to see if Folkvar has made any attacks CombatManagerScript.FolkvarMeleeAttack(); // Reset variables if an attack is canceled if (MarkerManagerScript.undoMarker) { if (Input.GetKeyDown(KeyCode.U)) { ResetFolkvarVariables(); } } } }