public void chooseAction() { //record action chosen by the AI myAttack.Attacker = enemy.name; myAttack.AttackGameObject = this.gameObject; myAttack.AttackTarget = CSM.PlayerInBattle[Random.Range(0, CSM.PlayerInBattle.Count)]; while (myAttack.AttackTarget == myAttack.AttackGameObject) { myAttack.AttackTarget = CSM.PlayerInBattle[Random.Range(0, CSM.PlayerInBattle.Count)]; } //myAttack.AttackTarget = CSM.PlayerInBattle[0]; myAttack.LeftAttackType = HandleTurn.randomJanken(); myAttack.RightAttackType = HandleTurn.randomJanken(); //myAttack.skill = HandleTurn.randomSkill(); Debug.Log(enemy.name + " is ready for battle"); CSM.CollectActions(myAttack); count++; }
public void chooseAction() { //record action chosen by the AI myAttack.Attacker = enemy.name; myAttack.AttackGameObject = this.gameObject; myAttack.AttackTarget = CSM.PlayerInBattle[Random.Range(0, CSM.PlayerInBattle.Count)]; while (myAttack.AttackTarget == myAttack.AttackGameObject) { myAttack.AttackTarget = CSM.PlayerInBattle[Random.Range(0, CSM.PlayerInBattle.Count)]; } //myAttack.AttackTarget = CSM.PlayerInBattle[0]; myAttack.LeftAttackType = HandleTurn.randomJanken(); myAttack.RightAttackType = HandleTurn.randomJanken(); if (enemy.name == "e3") { if (myAttack.LeftAttackType == HandleTurn.janken.ROCK) { ani.SetBool("lr", true); } else if (myAttack.LeftAttackType == HandleTurn.janken.SCISSORS) { ani.SetBool("ls", true); } else if (myAttack.LeftAttackType == HandleTurn.janken.PAPER) { ani.SetBool("lp", true); } if (myAttack.RightAttackType == HandleTurn.janken.ROCK) { ani.SetBool("rr", true); } else if (myAttack.RightAttackType == HandleTurn.janken.SCISSORS) { ani.SetBool("rs", true); } else if (myAttack.RightAttackType == HandleTurn.janken.PAPER) { ani.SetBool("rp", true); } } else if (enemy.name == "e1") { if (myAttack.LeftAttackType == HandleTurn.janken.ROCK) { ani.SetBool("lr", true); } else if (myAttack.LeftAttackType == HandleTurn.janken.SCISSORS) { ani.SetBool("ls", true); } else if (myAttack.LeftAttackType == HandleTurn.janken.PAPER) { ani.SetBool("lp", true); } if (myAttack.RightAttackType == HandleTurn.janken.ROCK) { ani.SetBool("rr", true); } else if (myAttack.RightAttackType == HandleTurn.janken.SCISSORS) { ani.SetBool("rs", true); } else if (myAttack.RightAttackType == HandleTurn.janken.PAPER) { ani.SetBool("rp", true); } } else if (enemy.name == "e2") { if (myAttack.LeftAttackType == HandleTurn.janken.ROCK) { ani.SetBool("lr", true); } else if (myAttack.LeftAttackType == HandleTurn.janken.SCISSORS) { ani.SetBool("ls", true); } else if (myAttack.LeftAttackType == HandleTurn.janken.PAPER) { ani.SetBool("lp", true); } if (myAttack.RightAttackType == HandleTurn.janken.ROCK) { ani.SetBool("rr", true); } else if (myAttack.RightAttackType == HandleTurn.janken.SCISSORS) { ani.SetBool("rs", true); } else if (myAttack.RightAttackType == HandleTurn.janken.PAPER) { ani.SetBool("rp", true); } } Debug.Log(enemy.name + " is ready for battle"); CSM.CollectActions(myAttack); }