//at the end of every attack after executed (or canceled call this) public void ResetAttack() { if (team == Team.ENEMY) { trackingTickObject.GetComponent <EnemyTickController>().state = EnemyTickController.GaugeState.RESET; DoneComboing = true; } if (team == Team.PLAYER) { if (playerTickController == null) { playerTickController = GameObject.FindGameObjectWithTag("PlayerTick").GetComponent <PlayerTickController>(); } playerHand.GetComponent <PlayerHandController>().state = PlayerHandController.State.IDLE; playerTickController.ChangeState(PlayerTickController.GaugeState.INCREASING); userController.IsUsersTurn = false; BC.HideCombatUI(); } chargeDuration = 0.0f; chargeTimer = 0.0f; currentSpeed = 0.0f; isChargingToAttack = false; monsterState = State.WAITING; done = false; stunCheckFinish = false; }
void CreateProgressTickFor(GameObject monster) { if (monster == player) { GameObject tickObj = Instantiate(playerTickPrefab, this.transform); PlayerTickController playerTickController = tickObj.GetComponent <PlayerTickController>(); playerTickController.TrackedMonster = monster; //add tick object to our monster controller so we can reference it in the future MonsterController monsterController = monster.GetComponent <MonsterController>(); monsterController.trackingTickObject = tickObj; } else { GameObject tickObj = Instantiate(enemyTickPrefab, this.transform); EnemyTickController enemyTickController = tickObj.GetComponent <EnemyTickController>(); enemyTickController.TrackedMonster = monster; //add tick object to our monster controller so we can reference it in the future MonsterController monsterController = monster.GetComponent <MonsterController>(); monsterController.trackingTickObject = tickObj; } }
//user clicks this to end their turn public void EndTurn() { userController.IsUsersTurn = false; BC.PauseSpeedsForAllMonsters(false); if (playerController == null) { playerController = BC.playerController; } //this will ensure that if we have something like a combo card it will execute it if (playerController.actions.Count == 0) { playerController.ResetAttack(); } else { playerController.monsterState = MonsterController.State.CHARGING; PlayerTickController playerTickController = GameObject.FindGameObjectWithTag("PlayerTick").GetComponent <PlayerTickController>(); playerTickController.ChangeState(PlayerTickController.GaugeState.CHARGING); } }
// check to ensure if we can chain another card and wait for user to play a card that doesnt chain or end their turn void CheckComboChaining() { // Well add the chain card's charge duration if (isChainCombo) { playerController.AddDuration = chargeTime; return; } // end the users turn and begin charging up for the combo attack else { // hiding the Combat UI is last (otherwise it wont catch our early return when using comboes in Single and Determine Attack methods battleController.HideCombatUI(); userController.IsUsersTurn = false; battleController.PauseSpeedsForAllMonsters(false); // Begin charging for player //playerController.monsterState = MonsterController.State.CHARGING; playerController.ChangeState(MonsterController.State.CHARGING); playerController.chargeDuration = chargeTime; PlayerTickController playerTickController = GameObject.FindGameObjectWithTag("PlayerTick").GetComponent <PlayerTickController>(); playerTickController.ChangeState(PlayerTickController.GaugeState.CHARGING); } }