Statistics: Posted by Hawkei — 09 Apr 2014, 07:50
Statistics: Posted by Hawkei — 09 Apr 2014, 02:59
Statistics: Posted by IceDreamer — 09 Apr 2014, 02:04
#****************************************************************************
#**
#** File : /cdimage/units/UES0203/UES0203_script.lua
#** Author(s): John Comes, David Tomandl, Jessica St. Croix
#**
#** Summary : UEF Attack Sub Script
#**
#** Copyright © 2005 Gas Powered Games, Inc. All rights reserved.
#** Modified by Hawkei 2014
#****************************************************************************
local TSubUnit = import('/lua/terranunits.lua').TSubUnit
local TANTorpedoAngler = import('/lua/terranweapons.lua').TANTorpedoAngler
local TDFLightPlasmaCannonWeapon = import('/lua/terranweapons.lua').TDFLightPlasmaCannonWeapon
UES0203 = Class(TSubUnit) {
PlayDestructionEffects = true,
DeathThreadDestructionWaitTime = 0,
Weapons = {
Torpedo01 = Class(TANTorpedoAngler) {
OnWeaponFired = function(self, target)
SDFPhasicAutoGunWeapon.OnWeaponFired(self, target)
ChangeState( self.unit, self.unit.VisibleState )
end,
OnLostTarget = function(self)
SDFPhasicAutoGunWeapon.OnLostTarget(self)
if self.unit:IsIdleState() then
ChangeState( self.unit, self.unit.InvisState )
end
end,},
PlasmaGun = Class(TDFLightPlasmaCannonWeapon) {}
},
OnStopBeingBuilt = function(self, builder, layer)
#These start enabled, so before going to InvisState, disabled them.. they'll be reenabled shortly
self:DisableUnitIntel('SonarStealth')
self.Stealthed = false
ChangeState( self, self.InvisState ) # If spawned in we want the unit to be invis, normally the unit will immediately start moving
end,
InvisState = State() {
Main = function(self)
self.Stealthed = false
local bp = self:GetBlueprint()
if bp.Intel.StealthWaitTime then
WaitSeconds( bp.Intel.StealthWaitTime )
end
self:EnableUnitIntel('SonarStealth')
self.Stealthed = true
end,
OnMotionHorzEventChange = function(self, new, old)
if new != 'Stopped' then
ChangeState( self, self.VisibleState )
end
},
VisibleState = State() {
Main = function(self)
if self.Cloaked then
self:DisableUnitIntel('SonarStealth')
end
end,
OnMotionHorzEventChange = function(self, new, old)
if new == 'Stopped' then
ChangeState( self, self.InvisState )
end
},
}
TypeClass = UES0203
Statistics: Posted by Hawkei — 09 Apr 2014, 02:00