Files
supreme-mech-commander-2/units/FSGENT1/FSGENT1_script.lua
T
2026-09-18 05:35:15 -04:00

43 lines
1.3 KiB
Lua

#****************************************************************************
#**
#** File : /cdimage/units/UEB1101/UEB1101_script.lua
#** Author(s): John Comes, David Tomandl, FuegoTigre, Kamisama, Squall
#**
#** Summary : Federated Suns T1 Generator Script
#**
#** Copyright © 2005 Gas Powered Games, Inc. All rights reserved.
#****************************************************************************
local TEnergyCreationUnit = import('/lua/terranunits.lua').TEnergyCreationUnit
FSGENT1 = Class(TEnergyCreationUnit) {
OnStopBeingBuilt = function(self,builder,layer)
TEnergyCreationUnit.OnStopBeingBuilt(self,builder,layer)
ChangeState(self, self.ActiveState)
end,
ActiveState = State {
Main = function(self)
# Play the "Activate" sound
local myBlueprint = self:GetBlueprint()
if myBlueprint.Audio.Activate then
self:PlaySound(myBlueprint.Audio.Activate)
end
end,
OnInActive = function(self)
ChangeState(self, self.InActiveState)
end,
},
InActiveState = State {
Main = function(self)
end,
OnActive = function(self)
ChangeState(self, self.ActiveState)
end,
},
}
TypeClass = FSGENT1