Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--------------------------------------------------------------------------------------------------
- // AIWaveMain
- //--------------------------------------------------------------------------------------------------
- void AIWaveMain (int player, wave w) {
- unit obstruction = null;
- int count = AIWaveUnitCount(w);
- int state = AIWaveState(w);
- int attackState = AIState(player, e_attackState);
- if (count >= 5 && PlayerBeaconIsSet(player, c_beaconArmy)) {
- AIWaveMerge(player, c_waveMain, c_waveAttack);
- // return;
- }
- if (AIDefenseThreat(c_dtAnyThreat, player, w)) {
- AIDefendSelfWithWave(player, w);
- // return;
- }
- else if (AIAnyAllyNeedsDefending(player, w)) {
- AIDefendAllyWithWave(player, w);
- // return;
- }
- // if (AIWaveAttackDefend(player, w, state)) {
- // AIDefaultMeleeSplitArmyToDefend(player, w, c_waveDefend);
- // }
- // if (AIWaveIsInCombat(w)) {
- // return;
- // }
- if (count >= 6 && AIGetFlag(player, e_flagsTimeout)) {
- if (attackState != e_attackState_DropAttack && attackState != e_attackState_DropRetreat) {
- AIWaveMerge(player, c_waveMain, c_waveAttack);
- // return;
- }
- }
- if (state != c_waveStateIdle) {
- DebugAIPlayerWave(player, "main2 set main = idle at gather offense");
- // AIWaveSetType(w, c_waveStateIdle, AIWaveTargetGatherMelee(player));
- AIWaveSetType(w, c_waveStateAttack, AIWaveTargetMelee(player));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement