level 7
function Angle4 takes real x1, real y1, real x2, real y2 returns real
return bj_RADTODEG*Atan2(y2-y1, x2-x1)
endfunction
function Length4 takes real x1, real y1, real x2, real y2 returns real
local real dx = x1-x2
local real dy = y1-y2
return SquareRoot(dx*dx + dy*dy)
endfunction
function SetX takes unit u, real x returns nothing
set x = RMinBJ(x,GetRectMaxX(bj_mapInitialPlayableArea)+50)
set x = RMaxBJ(x,GetRectMinX(bj_mapInitialPlayableArea)-50)
call SetUnitX(u, x)
set u = null
endfunction
function SetY takes unit u, real y returns nothing
set y = RMinBJ(y,GetRectMaxY(bj_mapInitialPlayableArea)+50)
set y = RMaxBJ(y,GetRectMinY(bj_mapInitialPlayableArea)-50)
call SetUnitY(u, y)
set u = null
endfunction
function SetPoint takes unit u, real x, real y returns nothing
set x = RMinBJ(x,GetRectMaxX(bj_mapInitialPlayableArea)+50)
set y = RMinBJ(y,GetRectMaxY(bj_mapInitialPlayableArea)+50)
set x = RMaxBJ(x,GetRectMinX(bj_mapInitialPlayableArea)-50)
set y = RMaxBJ(y,GetRectMinY(bj_mapInitialPlayableArea)-50)
call SetUnitPosition(u, x, y)
set u = null
endfunction
2011年06月21日 02点06分