En:OnGetRandomLocation
Материал из Pocket Fallout для КПК на PDA PC PPC Mobile.
Содержание |
[править]
Syntax
function OnGetRandomLocation() : String
[править]
Description
Called before hero gets to random location on worldmap. Current function locates random location on worldmap.
[править]
Parameters
Without parameters;
[править]
Result
The procedure returns string with level name (folder name in catalog with name maps\) which is necessary to load. Current function can return null string, if hero stays on worldmap. If current function returns level name then system plays animation of lighting flash. Data type - String
[править]
Example
function OnGetRandomLocation()
// x, y - global hero location
var x = m_WorldMap.GetWorldHeroX();
var y = m_WorldMap.GetWorldHeroY();
if m_WorldMap.GetCityNameByCoords(x, y) == "" then
var lucky = Mod(Rand(), 2);
if (lucky == 0) then
return "frozen";
else
return "desert";
endif
endif
return "";
endfunction
[править]