43 lines
1.3 KiB
Lua
43 lines
1.3 KiB
Lua
-- Star Wars Empire at War: Secrets of a Fallen Empire
|
|
-- Lua Script: //Scripts/GameObject/SecondaryMerchantDock.lua
|
|
-- Author: Galyana
|
|
-- Updated: 3 February, 2026
|
|
|
|
require("PGStateMachine")
|
|
|
|
-- Once this object has fully transitioned to a playable side it spits out units for its owner
|
|
|
|
function Definitions()
|
|
Define_State("State_Waiting_For_Control", State_Waiting_For_Control);
|
|
Define_State("State_Controlled", State_Controlled);
|
|
end
|
|
|
|
function State_Waiting_For_Control(message)
|
|
if message == OnEnter then
|
|
Object.Set_Garrison_Spawn(false)
|
|
elseif message == OnUpdate then
|
|
faction = Object.Get_Owner().Get_Faction_Name()
|
|
if faction == "REBEL" or faction == "EMPIRE" or faction == "UNDERWORLD" or faction == "HUTTS" or faction == "PIRATES" then
|
|
Set_Next_State("State_Controlled")
|
|
end
|
|
end
|
|
end
|
|
|
|
-- Now disabling capture permanently after controlled
|
|
|
|
function State_Controlled(message)
|
|
if message == OnEnter then
|
|
Object.Set_Garrison_Spawn(true)
|
|
Object.Disable_Capture(true)
|
|
ScriptExit()
|
|
|
|
-- Sleep(15)
|
|
-- Object.Disable_Capture(false)
|
|
-- Loop back to initial state if control is lost
|
|
-- elseif message == OnUpdate then
|
|
-- faction = Object.Get_Owner().Get_Faction_Name()
|
|
-- if faction == "NEUTRAL" then
|
|
-- Set_Next_State("State_Waiting_For_Control")
|
|
-- end
|
|
end
|
|
end |