Initial commit

This commit is contained in:
2026-02-28 14:00:45 -06:00
commit 16d3170787
1134 changed files with 589134 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
-- Star Wars Empire at War: Secrets of a Fallen Empire
-- Lua Script: //Scripts/GameObject/SecondaryMerchantDock_Capturable.lua
-- Author: Galyana
-- Updated: 8 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
-- Once captured, lock the structure for X seconds to allow garrison to spawn
function State_Controlled(message)
if message == OnEnter then
Object.Set_Garrison_Spawn(true)
Object.Disable_Capture(true)
Sleep(20)
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