| 17 | DWORD dwCount = 0; |
| 18 | |
| 19 | void BWScriptEmulator::onStart() |
| 20 | { |
| 21 | // enable stuff |
| 22 | bw->enableFlag(Flag::UserInput); |
| 23 | bw->enableFlag(Flag::CompleteMapInformation); |
| 24 | farcasting = true; |
| 25 | |
| 26 | // Save some BW info locally for easier access |
| 27 | self = bw->self(); |
| 28 | mapW = bw->mapWidth(); |
| 29 | mapH = bw->mapHeight(); |
| 30 | |
| 31 | // Access full map just like the normal AI |
| 32 | if ( !bw->isMultiplayer() ) |
| 33 | bw->sendText("black sheep wall"); |
| 34 | |
| 35 | if ( !self ) |
| 36 | return; |
| 37 | |
| 38 | if ( !LoadAIBinary("bwapi-data\\AISCRIPT.BIN") ) |
| 39 | Broodwar << Text::Red << "Failed to load AISCRIPT binary!" << std::endl; |
| 40 | |
| 41 | Race selfRace(self->getRace()); |
| 42 | Position sLoc(self->getStartLocation()); |
| 43 | |
| 44 | srand(GetTickCount()); |
| 45 | |
| 46 | /* |
| 47 | // Run default melee script |
| 48 | if ( selfRace == Races::Zerg ) |
| 49 | AICreateThread("ZMCx", sLoc ); |
| 50 | else if ( selfRace == Races::Protoss ) |
| 51 | AICreateThread("PMCx", sLoc ); |
| 52 | else // ( selfRace == Races::Terran ) |
| 53 | AICreateThread("TMCx", sLoc ); |
| 54 | */ |
| 55 | |
| 56 | // Run map test script if it has a 4-letter title |
| 57 | std::string title = Broodwar->mapName(); |
| 58 | if ( title.size() == 4 ) |
| 59 | AICreateThread(title.c_str(), sLoc); |
| 60 | } |
| 61 | |
| 62 | void BWScriptEmulator::onEnd(bool isWinner) |
| 63 | { |
nothing calls this directly
no test coverage detected