#****************************************************************************
#**
#**  File     :  /UEL0302/UEL0302.*
#**  Author(s):  Optimus Prime
#**
#**  Summary  :  UEF Heavy Walker
#**
#****************************************************************************

local TLandUnit = import('/lua/terranunits.lua').TLandUnit
local TDFGaussCannonWeapon = import('/lua/terranweapons.lua').TDFGaussCannonWeapon
local TAMPhalanxWeapon2 = import('/lua/terranweapons.lua').TAMPhalanxWeapon2
local TWalkingLandUnit = import('/lua/terranunits.lua').TWalkingLandUnit

UEL0302 = Class(TWalkingLandUnit) {
    Weapons = {
    	Riotgun1 = Class(TAMPhalanxWeapon2) {
    	            PlayFxWeaponUnpackSequence = function(self)
                    if not self.SpinManip then 
                        self.SpinManip = CreateRotator(self.unit, 'RailGunBarrelRight', 'z', nil, 270, 180, 60)
                        self.unit.Trash:Add(self.SpinManip)
                    end
                    if self.SpinManip then
                        self.SpinManip:SetTargetSpeed(1470)
                    end
                    TAMPhalanxWeapon2.PlayFxWeaponUnpackSequence(self)
                end,

                PlayFxWeaponPackSequence = function(self)
                    if self.SpinManip then
                        self.SpinManip:SetTargetSpeed(0)
                    end
                    TAMPhalanxWeapon2.PlayFxWeaponPackSequence(self)
                end,
        },
        Riotgun2 = Class(TAMPhalanxWeapon2) {
                    PlayFxWeaponUnpackSequence = function(self)
                    if not self.SpinManip then 
                        self.SpinManip = CreateRotator(self.unit, 'RailGunBarrelLeft', 'z', nil, 270, 180, 60)
                        self.unit.Trash:Add(self.SpinManip)
                    end
                    if self.SpinManip then
                        self.SpinManip:SetTargetSpeed(1470)
                    end
                    TAMPhalanxWeapon2.PlayFxWeaponUnpackSequence(self)
                end,

                PlayFxWeaponPackSequence = function(self)
                    if self.SpinManip then
                        self.SpinManip:SetTargetSpeed(0)
                    end
                    TAMPhalanxWeapon2.PlayFxWeaponPackSequence(self)
                end,
        },
        MainGun = Class(TDFGaussCannonWeapon) {},
    },
}

TypeClass = UEL0302