// Starting Units for Players Whose Race is Unknown
// - 12 Sheep, placed randomly around the start location
//未知种族的起始单位
//-12只羊,随机放在起始位置周围
是说有时会刷出羊,原来是官方这段注释代码弄出来的
function MeleeStartingUnitsUnknownRace takes player whichPlayer, location startLoc, boolean doHeroes, boolean doCamera, boolean doPreload returns nothing
local integer index
if (doPreload) then
endif
set index = 0
loop
call CreateUnit(whichPlayer, 'nshe', GetLocationX(startLoc) + GetRandomReal(-256, 256), GetLocationY(startLoc) + GetRandomReal(-256, 256), GetRandomReal(0, 360))
set index = index + 1
exitwhen index == 12
endloop
if (doHeroes) then
// Give them a "free hero" token, out of pity.
call SetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_HERO_TOKENS, bj_MELEE_STARTING_HERO_TOKENS)
endif
if (doCamera) then
// Center the camera on the initial sheep.
call SetCameraPositionLocForPlayer(whichPlayer, startLoc)
call SetCameraQuickPositionLocForPlayer(whichPlayer, startLoc)
endif
endfunction