#**************************************************************************** #** #** File : /Supreme Mech Commander/units/SRORO/FSROMMEL_script.lua #** Author(s): John Comes, David Tomandl, Jessica St. Croix, Kami, FuegoTigre #** #** Summary : Clan Snow Raven Oro Heavy Tank HAG #** #** Copyright © 2005 Gas Powered Games, Inc. All rights reserved. #**************************************************************************** local TLandUnit = import('/lua/terranunits.lua').TLandUnit local TDFHeavyPlasmaCannonWeapon = import('/lua/terranweapons.lua').TDFHeavyPlasmaGatlingCannonWeapon local CDFParticleCannonWeapon = import('/lua/cybranweapons.lua').CDFParticleCannonWeapon local EffectUtils = import('/lua/effectutilities.lua') local Effects = import('/lua/effecttemplates.lua') SROROHAG = Class(TLandUnit) { Weapons = { CLPL = Class(CDFParticleCannonWeapon) { SetOnTransport = function(self, transportstate) CDFParticleCannonWeapon.SetOnTransport(self, transportstate) self.unit:SetScriptBit('RULEUTC_WeaponToggle', false) end, }, AAGun = Class(TDFHeavyPlasmaCannonWeapon) { PlayFxWeaponPackSequence = function(self) if self.SpinManip then self.SpinManip:SetTargetSpeed(0) end self.ExhaustEffects = EffectUtils.CreateBoneEffects( self.unit, 'Exhaust', self.unit:GetArmy(), Effects.WeaponSteam01 ) TDFHeavyPlasmaCannonWeapon.PlayFxWeaponPackSequence(self) end, PlayFxRackSalvoChargeSequence = function(self) if not self.SpinManip then self.SpinManip = CreateRotator(self.unit, 'Gun_Barrel', 'z', nil, 270, 180, 60) self.unit.Trash:Add(self.SpinManip) end if self.SpinManip then self.SpinManip:SetTargetSpeed(500) end TDFHeavyPlasmaCannonWeapon.PlayFxRackSalvoChargeSequence(self) end, PlayFxRackSalvoReloadSequence = function(self) if self.SpinManip then self.SpinManip:SetTargetSpeed(200) end self.ExhaustEffects = EffectUtils.CreateBoneEffects( self.unit, 'Exhaust', self.unit:GetArmy(), Effects.WeaponSteam01 ) TDFHeavyPlasmaCannonWeapon.PlayFxRackSalvoChargeSequence(self) end, }, GroundGun = Class(TDFHeavyPlasmaCannonWeapon) { SetOnTransport = function(self, transportstate) TDFHeavyPlasmaCannonWeapon.SetOnTransport(self, transportstate) self.unit:SetScriptBit('RULEUTC_WeaponToggle', false) end, PlayFxWeaponPackSequence = function(self) if self.SpinManip then self.SpinManip:SetTargetSpeed(0) end self.ExhaustEffects = EffectUtils.CreateBoneEffects( self.unit, 'Exhaust', self.unit:GetArmy(), Effects.WeaponSteam01 ) TDFHeavyPlasmaCannonWeapon.PlayFxWeaponPackSequence(self) end, PlayFxRackSalvoChargeSequence = function(self) if not self.SpinManip then self.SpinManip = CreateRotator(self.unit, 'Gun_Barrel', 'z', nil, 270, 180, 60) self.unit.Trash:Add(self.SpinManip) end if self.SpinManip then self.SpinManip:SetTargetSpeed(500) end TDFHeavyPlasmaCannonWeapon.PlayFxRackSalvoChargeSequence(self) end, PlayFxRackSalvoReloadSequence = function(self) if self.SpinManip then self.SpinManip:SetTargetSpeed(200) end self.ExhaustEffects = EffectUtils.CreateBoneEffects( self.unit, 'Exhaust', self.unit:GetArmy(), Effects.WeaponSteam01 ) TDFHeavyPlasmaCannonWeapon.PlayFxRackSalvoChargeSequence(self) end, }, }, OnCreate = function(self) TLandUnit.OnCreate(self) self:SetWeaponEnabledByLabel('CLPL', false) self:SetWeaponEnabledByLabel('GroundGun', false) end, OnScriptBitSet = function(self, bit) TLandUnit.OnScriptBitSet(self, bit) if bit == 1 then self:SetWeaponEnabledByLabel('GroundGun', true) self:SetWeaponEnabledByLabel('AAGun', false) self:SetWeaponEnabledByLabel('CLPL', true) self:GetWeaponManipulatorByLabel('GroundGun'):SetHeadingPitch( self:GetWeaponManipulatorByLabel('AAGun'):GetHeadingPitch() ) end end, OnScriptBitClear = function(self, bit) TLandUnit.OnScriptBitClear(self, bit) if bit == 1 then self:SetWeaponEnabledByLabel('GroundGun', false) self:SetWeaponEnabledByLabel('AAGun', true) self:SetWeaponEnabledByLabel('CLPL', false) self:GetWeaponManipulatorByLabel('AAGun'):SetHeadingPitch( self:GetWeaponManipulatorByLabel('GroundGun'):GetHeadingPitch() ) end end, } TypeClass = SROROHAG