示例#1
0
 private bool OnSelectMove()
 {
     /*************THIS IS WHERE I  WILL TOGGLE BUTTON TO SCROLL CODE, DISABLE INPUT BESIDES ENTER,
      * disable me1,2,3,4, enable scroll text button ***********/
     if (aliveTeammateList[currentChar].checkMove(selectedMove))          //Always return true, but in what case wouldn't they be able to perform the move?  not enough mana or something
     {
         MoveMessenger messenger = aliveTeammateList[currentChar].makeMove(selectedMove);
         print(messenger.toString());
         messenger.setAttackedPlayer(attackedPlayer);              // the messenger stores the attacked player
         messenger.setIndexOfAttackedPlayer(currentTarget);
         messenger.setIndexOfMove(selectedMove);
         print("Attacked Player: " + messenger.getAttackedPlayer());
         FillMoveList(messenger);
         if (currentChar == (aliveTeammateList.Capacity - 1))
         {
             needToPrint = false;
             StartCoroutine(StartBattling());
         }
         else
         {
             currentChar++;
             print("CurrentChar after incrementation: " + currentChar);
             updateMovesForChar();
             EventSystem.current.SetSelectedGameObject(meButtons[0]);
         }
         return(true);
     }
     return(false);
 }
 //need to revamp it
 private object SelectAIMove()
 {
     System.Random rnd = new System.Random();
     for (int i = 0; i < aliveEnemyList.Capacity; i++)
     {
         print("Called SelectAIMove()");
         print("Current Enemy: " + aliveEnemyList[i].getName());
         MoveMessenger messenger = aliveEnemyList[i].makeMove(enemyMove);
         print(messenger.toString());
         int target = rnd.Next(0, aliveTeammateList.Capacity);
         print("Target is Teammate #: " + target);
         messenger.setAttackedPlayer(aliveTeammateList[target]);
         FillMoveList(messenger);
         currentChar++;
     }
     return(null);
 }