#****************************************************************************
#**
#**  Author(s):  William Holmes
#**
#**  Summary  :  Seraphim Buttraper Script
#**
#**  Copyright © 2008 OVER NINE THOUSAND!  All rights reserved.
#****************************************************************************
local SHoverLandUnit = import('/lua/seraphimunits.lua').SHoverLandUnit
local SDFUnstablePhasonBeam = import('/lua/seraphimweapons.lua').SDFUnstablePhasonBeam

USLX301 = Class(SHoverLandUnit) {
	Effects = {'/Mods/TGC/Units/USLX301/USLX301_Emit.bp'},
	EffectsBones = {'Exhaust','Engine01','Engine02'},

    Weapons = {
        PhasonBeam = Class(SDFUnstablePhasonBeam) {
        FxMuzzleFlash = {'/Effects/Emitters/seraphim_experimental_phasonproj_muzzle_flash_01_emit.bp','/Effects/Emitters/seraphim_experimental_phasonproj_muzzle_flash_02_emit.bp','/Effects/Emitters/seraphim_experimental_phasonproj_muzzle_flash_03_emit.bp','/Effects/Emitters/seraphim_experimental_phasonproj_muzzle_flash_04_emit.bp','/Effects/Emitters/seraphim_experimental_phasonproj_muzzle_flash_05_emit.bp','/Effects/Emitters/seraphim_experimental_phasonproj_muzzle_flash_06_emit.bp','/Mods/TGC/Units/USLX301/USLX301_Electricity_Emit.bp'},
		#FxMuzzleFlash = {'/Effects/Emitters/energy_stream_01_emit.bp','/Effects/Emitters/energy_stream_02_emit.bp','/Effects/Emitters/energy_stream_03_emit.bp','/Effects/Emitters/energy_stream_04_emit.bp','/Effects/Emitters/energy_stream_05_emit.bp','/Effects/Emitters/energy_stream_sparks_01_emit.bp'},
		FxChargeMuzzleFlash = {'/Effects/Emitters/seraphim_experimental_phasonproj_muzzle_charge_01_emit.bp','/Effects/Emitters/seraphim_experimental_phasonproj_muzzle_charge_02_emit.bp','/Effects/Emitters/seraphim_experimental_phasonproj_muzzle_charge_03_emit.bp'},
        FxUpackingChargeEffects = {'/Effects/Emitters/seraphim_experimental_phasonproj_muzzle_charge_01_emit.bp','/Effects/Emitters/seraphim_experimental_phasonproj_muzzle_charge_02_emit.bp','/Effects/Emitters/seraphim_experimental_phasonproj_muzzle_charge_03_emit.bp'},
        },
    },
    
    OnStopBeingBuilt = function(self,builder,layer)
        SHoverLandUnit.OnStopBeingBuilt(self,builder,layer)
        self.EffectsBag = {}
        local effects = {}
        local bones = {}
        local scale = 1
        effects = self.Effects
        bones = self.EffectsBones
        scale = 1.0
        for keys,values in effects do
                for keysbones,valuesbones in bones do
                    table.insert(self.EffectsBag, CreateAttachedEmitter(self,valuesbones,self:GetArmy(), values):ScaleEmitter(scale):OffsetEmitter(0,0,0))
                end
            end
    end,
    
    OnKilled = function(self, instigator, type, overkillRatio)
		SHoverLandUnit.OnKilled(self, instigator, type, overkillRatio)
		CreateAttachedEmitter( self, 'Exhaust', self:GetArmy(), '/effects/emitters/geyser_smoke_01_emit.bp')
    end, 
}
TypeClass = USLX301