Initial commit
This commit is contained in:
33
DATA/SCRIPTS/GAMEOBJECT/SPECTATOR_ASTEROID_CAPTURE_RANGE.LUA
Normal file
33
DATA/SCRIPTS/GAMEOBJECT/SPECTATOR_ASTEROID_CAPTURE_RANGE.LUA
Normal file
@@ -0,0 +1,33 @@
|
||||
require("PGStateMachine")
|
||||
require("PGBase")
|
||||
|
||||
function Definitions()
|
||||
ServiceRate = 1
|
||||
Define_State("State_Init", State_Init);
|
||||
end
|
||||
|
||||
function State_Init(message)
|
||||
if message == OnEnter then
|
||||
Sleep(1)
|
||||
|
||||
-- prevent this from doing anything in galactic mode
|
||||
if Get_Game_Mode() ~= "Space" then
|
||||
ScriptExit()
|
||||
end
|
||||
|
||||
-- Don't spawn another marker after the asteroid has respawned
|
||||
if GetCurrentTime() >= 30 then
|
||||
ScriptExit()
|
||||
end
|
||||
|
||||
marker = Find_First_Object("Spectator_Reveal_Marker")
|
||||
if TestValid(marker) then
|
||||
spectator_player = marker.Get_Owner()
|
||||
indicator = Create_Generic_Object("Spectator_Range_Marker_Asteroid_Pad", Object.Get_Position(), spectator_player)
|
||||
indicator.Suspend_Locomotor(true)
|
||||
else
|
||||
ScriptExit()
|
||||
end
|
||||
end
|
||||
ScriptExit()
|
||||
end
|
||||
Reference in New Issue
Block a user