bool Wait_FinishAttack::execute(aithread &thread) const { // Debug thread.saveDebug(Text::Red, this->getOpcode()); // Check if AI is attacking // if ( AIIsAttacking ) { return thread.noretry(); } return thread.retry(); }
bool Wait_Upgrades::execute(aithread &thread) const { // Debug thread.saveDebug(Text::Green, this->getOpcode()); // If upgrades are finished, then move on to next opcode if ( MainController.getFlags() & CONTROLLER_UPGRADES_FINISHED ) return thread.noretry(); // Otherwise retry this opcode return thread.retry(); }
bool Wait_Train::execute(aithread &thread) const { // Parameters BYTE bCount; WORD wUnitType; thread.readTuple( std::tie(bCount, wUnitType) ); // Debug thread.saveDebug(Text::Green, this->getOpcode(), "%u %s", bCount, AISCRIPT::getUnitName(wUnitType) ); // Perform actions if ( GetStandardUnitCount(wUnitType) < bCount ) return thread.retry(); return thread.noretry(); }
bool Train::execute(aithread &thread) const { // Parameters BYTE bCount; WORD wUnitType; thread.readTuple( std::tie(bCount, wUnitType) ); // Debug thread.saveDebug(Text::Green, this->getOpcode(), "%u %s", bCount, AISCRIPT::getUnitName(wUnitType) ); // Perform actions if ( GetStandardUnitCount(wUnitType, this->getOpcode() != AISCRIPT::Enum::TRAIN) < bCount ) { MainController.wWaitForType = (int)wUnitType + 1; if ( this->getOpcode() != AISCRIPT::Enum::DO_MORPH ) return thread.retry(); } return thread.noretry(); }
bool Wait_Build::execute(aithread &thread) const { // Parameters BYTE bCount; WORD wType; thread.readTuple( std::tie(bCount, wType) ); // debug thread.saveDebug(Text::Red, this->getOpcode(), "%u %s", bCount, AISCRIPT::getUnitName(wType) ); // stuff if ( wType == Broodwar->self()->getRace().getWorker() ) { // TOWN STUFF } //if ( // AI_BuildSomething >= bCount ) //return thread.noretry(); // Debug and return return thread.retry(); }