コード例 #1
0
    //randomly select an attack in their move list
    void SelectAttack()
    {
        //if (!stunCheckFinish)
        //{
        //    ForceCheckOwnerOfStuns();
        //}

        //prevent enemies from continue attack until user does something on their turn
        if (userController.IsUsersTurn)
        {
            return;
        }

        BC.PauseSpeedsForAllMonsters(true);

        //randomly select attack from attack set for enemies
        if (team == Team.ENEMY)
        {
            int random = Random.Range(0, moveSet.Count);
            damage         = moveSet[random].damage;
            chargeDuration = moveSet[random].chargeTime;
            bool isCanceling         = moveSet[random].isCanceling;
            List <GameObject> target = new List <GameObject>();
            //will always target player unless a buff or heal
            target.Add(BC.player);
            HandleTurn turn = new HandleTurn(this.gameObject, target, moveSet[random].targetArea, moveSet[random].damage, moveSet[random].block, chargeDuration, isCanceling, stunNumberOfTurns, DrawType.NONE);
            //BC.AddTurnToQueue(turn);
            actions.Add(turn);

            //reset the current speed for measuring stuns
            currentSpeed = 0;

            //Begin charging
            EnemyTickController enemyTickController = trackingTickObject.GetComponent <EnemyTickController>();
            enemyTickController.ChangeState(EnemyTickController.GaugeState.CHARGING);
            monsterState = State.CHARGING;
            BC.PauseSpeedsForAllMonsters(false);
        }
        //wait until card controller changes users state from here
        if (team == Team.PLAYER)
        {
            userController.IsUsersTurn = true;
            //BC.PauseSpeedsForAllMonsters(false); is set in card controller
        }
    }
コード例 #2
0
 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;
     }
 }