void OnTriggerEnter(Collider col) { //コリジョン判定かつエンターキーが押された場合 if (Input.GetKey(KeyCode.Return)) { //どのスキルオブジェクトか? var name = this.objChoiceSkill.name; switch (name) { case "Skill1CursorObject_SkillChooseWindow": GameManager.SkillNoFlg = "1"; GameManager.CommandFlg = "パワーショット"; break; case "Skill2CursorObject_SkillChooseWindow": GameManager.SkillNoFlg = "2"; GameManager.CommandFlg = "チャージショット"; break; case "Skill3CursorObject_SkillChooseWindow": GameManager.SkillNoFlg = "3"; GameManager.CommandFlg = "ジャックポット"; break; case "Skill4CursorObject_SkillChooseWindow": GameManager.SkillNoFlg = "4"; GameManager.CommandFlg = "リロード"; break; case "Skill5CursorObject_SkillChooseWindow": GameManager.SkillNoFlg = "5"; GameManager.CommandFlg = "プラズマキャノン"; break; case "Skill6CursorObject_SkillChooseWindow": GameManager.SkillNoFlg = "6"; GameManager.CommandFlg = "向日葵システム"; break; case "Skill7CursorObject_SkillChooseWindow": GameManager.SkillNoFlg = "7"; GameManager.CommandFlg = "自己再生"; break; case "Skill8CursorObject_SkillChooseWindow": GameManager.SkillNoFlg = "8"; GameManager.CommandFlg = "ユグドラシルバスター"; break; } //残弾数チェックで半透明になっていたらリターン switch (GameManager.CommandFlg) { case "1": if (GameManager.TextSkill1_SkillChooseWindow.color.a == 0.25f) { return; } break; case "2": if (GameManager.TextSkill2_SkillChooseWindow.color.a == 0.25f) { return; } break; case "3": if (GameManager.TextSkill3_SkillChooseWindow.color.a == 0.25f) { return; } break; default: break; } //スキルの攻撃範囲を取得し、行動パターンを分岐する switch (OperatePlayerSkill.GetPlayerSkillData(GetXMLQueryKey_PlayerSkill.PlayerSkill_TargetFlg(int.Parse(GameManager.SkillNoFlg)), int.Parse(GameManager.SkillNoFlg))) { //Singleの時単体攻撃 case "Single": VisibleUIManage.ManageStart_AfterSkillCommandClick(); break; //Multipleの時全体攻撃 case "Multiple": switch (GameManager.CommandFlg) { case "ジャックポット": if (ComparerParameter.SpeedComparer() == true) { //自分のターン MyTurn_Juckpot(); //敵のターン EnemyTurn.StartEnemyTurn(); } else { //敵のターン EnemyTurn.StartEnemyTurn(); MyTurn_Juckpot(); } break; default: break; } break; //その他補助技など default: switch (GameManager.CommandFlg) { case "リロード": VisibleUIManage.ManageStart_AfterSkillClick_NonTarget(); if (ComparerParameter.SpeedComparer() == true) { //自分のターン MyTurn_Reload(); //敵のターン EnemyTurn.StartEnemyTurn(); } else { //敵のターン EnemyTurn.StartEnemyTurn(); MyTurn_Reload(); } break; } break; } GameManager.Text_MainWindow.text = ""; CheckTurnEnd.Setting(); } else if (Input.GetKey(KeyCode.Escape)) { VisibleUIManage.ManageStart_AfterSkillCommandClick(); } }
private void Awake() { startCombatState = new StartCombat(this); playerTurnState = new PlayerTurn(this); enemyTurnState = new EnemyTurn(this); battleLostState = new BattleLost(this); battleWonState = new BattleWon(this); blankState = new BlankState(this); currentState = blankState; missionButtonArray = GameObject.FindGameObjectsWithTag("MissionButton"); }
void OnTriggerEnter(Collider col) { //コリジョン判定かつエンターキーが押された場合 if (Input.GetKey(KeyCode.Return)) { //ターゲットを確定する var name = this.TargetEnemy.name; switch (name) { case "Target1CursorObject_EnemyTargetWindow": GameManager.TargetFlg = "1"; break; case "Target2CursorObject_EnemyTargetWindow": GameManager.TargetFlg = "2"; break; case "Target3CursorObject_EnemyTargetWindow": GameManager.TargetFlg = "3"; break; } VisibleUIManage.ManageStart_BeforeCommandClick(); switch (GameManager.CommandFlg) { case "Attack": if (ComparerParameter.SpeedComparer() == true) { //自分のターン MyTurn_NormalAttack(); //敵のターン EnemyTurn.StartEnemyTurn(); } else { //敵のターン EnemyTurn.StartEnemyTurn(); //自分のターン MyTurn_NormalAttack(); } break; case "パワーショット": if (ComparerParameter.SpeedComparer() == true) { //自分のターン MyTurn_PowerShot(); //敵のターン EnemyTurn.StartEnemyTurn(); } else { //敵のターン EnemyTurn.StartEnemyTurn(); //自分のターン MyTurn_PowerShot(); } break; } GameManager.Text_MainWindow.text = ""; CheckTurnEnd.Setting(); } else if (Input.GetKey(KeyCode.Escape)) { //敵選択を閉じる VisibleUIManage.ManageStart_AfterCommandClick(); } }
void Awake() { instance = this; }
static void Main(string[] args) // Change to Main2() when testing { // ----------- INITIALIZATION ------------- Player p = new Player(); BlackKnight bk = new BlackKnight(); Screen s = new Screen(p, bk); CombatException e = new CombatException(s); Match m = new Match(s); PlayerTurn pt = new PlayerTurn(m, s, p, bk, e); EnemyTurn et = new EnemyTurn(m, s, p, bk); m.SetUpFight(p, bk); // Used for setting up opponents and Screen class for the combat // ------------ FIRST CHOICE -------------- int startingChoice = 0; while (startingChoice != 1 && startingChoice != 2) // Locks the player until he/she chooses a valid option { Console.Clear(); s.Encounter(); // Make it possible to fight other opponents later try { startingChoice = int.Parse(Console.ReadLine()); switch (startingChoice) { case 1: Console.Clear(); s.PrepareFight(); Thread.Sleep(4000); break; case 2: Console.Clear(); s.Flee(); break; default: e.InvalidChoice(); break; } } catch { e.InvalidChoice(); } } // ---------------- TURNS ------------------- while (startingChoice == 1 && m.MatchInProgress) { // ----- Player Turn ----- pt.Turn(); // ----- Enemy Turn ----- et.Turn(); } }
private void PlayTurn(GameObject enemyHand, Card cardToPlay) { EnemyTurn.PlaceCardOnBoard(enemyHand, cardToPlay); stateMachine.turnState.currentState = Classes.EnumClasses.BattleState.PlayerTurn; }
private void PassTurn() { EnemyTurn.PassTurn(); }