1
0

clientAI.cpp 563 B

1234567891011121314151617181920212223242526272829
  1. #include "clientAI.h"
  2. #include <cstdlib>
  3. #include <ctime>
  4. using namespace std;
  5. int randNum[100000];
  6. int cntRand;
  7. void init(int totalSet) {
  8. srand(time(0) % 12345);
  9. cntRand = 0;
  10. for (int i = 0; i < 100000; i ++)
  11. randNum[i] = rand();
  12. }
  13. void beginSet(int cntSet) {
  14. }
  15. void endSet(int result) {
  16. }
  17. ACTION getAction(int cntRound, int myMP, int myState, int opMP, int opState, ACTION opAction) {
  18. int t = randNum[cntRand ++] % 3;
  19. if (t == 0 && myMP > 0) return ATTACK_1;
  20. else if (t == 1) return DEFEND_1;
  21. else return RESTORE;
  22. }