waste

» Блог Diaboliko
((код
Those are not even optimisations. I just decided to waste time doing that.
#define <InitCustomTeams takes nothing returns nothing> = {
InitCus##tomTeams takes nothing returns nothing
local integer i = 0
local integer i2
loop
call SetPla##yerTeam(Pla##yer(i), 0)
call SetPla##yerState(Pla##yer(i), PLAYER_STATE_ALLIED_VICTORY, 1)
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(10), ALLIANCE_PASSIVE, true)
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(10), ALLIANCE_SHARED_VISION, true)
call SetPla##yerAlliance(Pla##yer(10), Pla##yer(i), ALLIANCE_PASSIVE, true)
call SetPla##yerAlliance(Pla##yer(10), Pla##yer(i), ALLIANCE_SHARED_VISION, true)
set i2 = 0
loop
if ( i2 != i ) then
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_PASSIVE, true)
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_SHARED_VISION, true)
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_HELP_REQUEST, true)
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_HELP_RESPONSE, true)
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_SHARED_XP, true)
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_SHARED_SPELLS, true)
endif
if ( i2 != i ) then
set i2 = i2 + 1
else
set i2 = i2 + 2
endif
exitwhen i2 >= 5
endloop
exitwhen i == 4
set i = i + 1
endloop
set i = 5
loop
call SetPla##yerTeam(Pla##yer(i), 1)
call SetPla##yerState(Pla##yer(i), PLAYER_STATE_ALLIED_VICTORY, 1)
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(11), ALLIANCE_PASSIVE, true)
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(11), ALLIANCE_SHARED_VISION, true)
call SetPla##yerAlliance(Pla##yer(11), Pla##yer(i), ALLIANCE_PASSIVE, true)
call SetPla##yerAlliance(Pla##yer(11), Pla##yer(i), ALLIANCE_SHARED_VISION, true)
set i2 = 5
loop
if ( i2 != i ) then
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_PASSIVE, true)
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_SHARED_VISION, true)
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_HELP_REQUEST, true)
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_HELP_RESPONSE, true)
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_SHARED_XP, true)
call SetPla##yerAlliance(Pla##yer(i), Pla##yer(i2), ALLIANCE_SHARED_SPELLS, true)
endif
if ( i2 != i ) then
set i2 = i2 + 1
else
set i2 = i2 + 2
endif
exitwhen i2 >= 10
endloop
exitwhen i == 9
set i = i + 1
endloop
}

Читать далее...