diff --git a/lua/defaultcomponents.lua b/lua/defaultcomponents.lua index 2cc8478fed..c5846314da 100644 --- a/lua/defaultcomponents.lua +++ b/lua/defaultcomponents.lua @@ -19,8 +19,7 @@ ShieldEffectsComponent = ClassSimple { OnShieldEnabled = function(self) self.ShieldEffectsBag:Destroy() for _, v in self.ShieldEffects do - self.ShieldEffectsBag:Add(CreateAttachedEmitter(self, self.ShieldEffectsBone, self.Army, v):ScaleEmitter(self - .ShieldEffectsScale)) + self.ShieldEffectsBag:Add(CreateAttachedEmitter(self, self.ShieldEffectsBone, self.Army, v):ScaleEmitter(self.ShieldEffectsScale)) end end, diff --git a/lua/system/blueprints-units.lua b/lua/system/blueprints-units.lua index 31e0c54fe3..27b3dac552 100644 --- a/lua/system/blueprints-units.lua +++ b/lua/system/blueprints-units.lua @@ -275,7 +275,6 @@ local function PostProcessUnit(unit) -- check if we have any intel if table.empty(status.AllIntel) and table.empty(status.AllIntelMaintenanceFree) and not enhancementBlueprints then - LOG("No intel for: " .. unit.BlueprintId) return end diff --git a/units/UEL0307/UEL0307_script.lua b/units/UEL0307/UEL0307_script.lua index 3e70ff7a88..893365842d 100644 --- a/units/UEL0307/UEL0307_script.lua +++ b/units/UEL0307/UEL0307_script.lua @@ -15,10 +15,11 @@ local DefaultProjectileWeapon = import("/lua/sim/defaultweapons.lua").DefaultPro ---@class UEL0307 : TShieldLandUnit UEL0307 = ClassUnit(TShieldLandUnit, ShieldEffectsComponent) { - Weapons = { + Weapons = { TargetPointer = ClassWeapon(DefaultProjectileWeapon) {}, }, + ShieldEffectsBone = 0, ShieldEffects = { '/effects/emitters/terran_shield_generator_mobile_01_emit.bp', '/effects/emitters/terran_shield_generator_mobile_02_emit.bp', @@ -28,32 +29,32 @@ UEL0307 = ClassUnit(TShieldLandUnit, ShieldEffectsComponent) { TShieldLandUnit.OnCreate(self) ShieldEffectsComponent.OnCreate(self) end, - - OnStopBeingBuilt = function(self,builder,layer) - TShieldLandUnit.OnStopBeingBuilt(self,builder,layer) - + + OnStopBeingBuilt = function(self, builder, layer) + TShieldLandUnit.OnStopBeingBuilt(self, builder, layer) + self.TargetPointer = self:GetWeapon(1) --save the pointer weapon for later - this is extra clever since the pointer weapon has to be first! self.TargetLayerCaps = self:GetBlueprint().Weapon[1].FireTargetLayerCapsTable --we save this to the unit table so dont have to call every time. self.PointerEnabled = true --a flag to let our thread know whether we should turn on our pointer. end, - + OnShieldEnabled = function(self) TShieldLandUnit.OnShieldEnabled(self) - ShieldEffectsComponent.OnShieldDisabled(self) + ShieldEffectsComponent.OnShieldEnabled(self) - KillThread( self.DestroyManipulatorsThread ) + KillThread(self.DestroyManipulatorsThread) if not self.RotatorManipulator then - self.RotatorManipulator = CreateRotator( self, 'Spinner', 'y' ) - self.Trash:Add( self.RotatorManipulator ) + self.RotatorManipulator = CreateRotator(self, 'Spinner', 'y') + self.Trash:Add(self.RotatorManipulator) end - self.RotatorManipulator:SetAccel( 5 ) - self.RotatorManipulator:SetTargetSpeed( 30 ) + self.RotatorManipulator:SetAccel(5) + self.RotatorManipulator:SetTargetSpeed(30) if not self.AnimationManipulator then local myBlueprint = self:GetBlueprint() --LOG( 'it is ', repr(myBlueprint.Display.AnimationOpen) ) self.AnimationManipulator = CreateAnimator(self) - self.AnimationManipulator:PlayAnim( myBlueprint.Display.AnimationOpen ) - self.Trash:Add( self.AnimationManipulator ) + self.AnimationManipulator:PlayAnim(myBlueprint.Display.AnimationOpen) + self.Trash:Add(self.AnimationManipulator) end self.AnimationManipulator:SetRate(1) end, @@ -61,14 +62,14 @@ UEL0307 = ClassUnit(TShieldLandUnit, ShieldEffectsComponent) { OnShieldDisabled = function(self) TShieldLandUnit.OnShieldDisabled(self) ShieldEffectsComponent.OnShieldDisabled(self) - KillThread( self.DestroyManipulatorsThread ) - self.DestroyManipulatorsThread = self:ForkThread( self.DestroyManipulators ) + KillThread(self.DestroyManipulatorsThread) + self.DestroyManipulatorsThread = self:ForkThread(self.DestroyManipulators) end, DestroyManipulators = function(self) if self.RotatorManipulator then - self.RotatorManipulator:SetAccel( 10 ) - self.RotatorManipulator:SetTargetSpeed( 0 ) + self.RotatorManipulator:SetAccel(10) + self.RotatorManipulator:SetTargetSpeed(0) -- Unless it goes smoothly back to its original position, -- it will snap there when the manipulator is destroyed. -- So for now, we'll just keep it on. @@ -78,17 +79,17 @@ UEL0307 = ClassUnit(TShieldLandUnit, ShieldEffectsComponent) { end if self.AnimationManipulator then self.AnimationManipulator:SetRate(-1) - WaitFor( self.AnimationManipulator ) + WaitFor(self.AnimationManipulator) self.AnimationManipulator:Destroy() self.AnimationManipulator = nil end end, - + DisablePointer = function(self) self.TargetPointer:SetFireTargetLayerCaps('None') --this disables the stop feature - note that its reset on layer change! - self.PointerRestartThread = self:ForkThread( self.PointerRestart ) + self.PointerRestartThread = self:ForkThread(self.PointerRestart) end, - + PointerRestart = function(self) --sadly i couldnt find some way of doing this without a thread. dont know where to check if its still assisting other than this. while not self.PointerEnabled do @@ -96,8 +97,8 @@ UEL0307 = ClassUnit(TShieldLandUnit, ShieldEffectsComponent) { WaitSeconds(1) -- break if we're a gooner - if IsDestroyed(self) or IsDestroyed(self.TargetPointer) then - break + if IsDestroyed(self) or IsDestroyed(self.TargetPointer) then + break end -- if not gooner, check whether we need to enable our weapon to keep reasonable distance @@ -107,11 +108,11 @@ UEL0307 = ClassUnit(TShieldLandUnit, ShieldEffectsComponent) { end end end, - + OnLayerChange = function(self, new, old) TShieldLandUnit.OnLayerChange(self, new, old) - - if not IsDestroyed(self) then + + if not IsDestroyed(self) then if self.PointerEnabled == false then self.TargetPointer:SetFireTargetLayerCaps('None') --since its reset on layer change we need to do this. unfortunate. end @@ -119,4 +120,4 @@ UEL0307 = ClassUnit(TShieldLandUnit, ShieldEffectsComponent) { end, } -TypeClass = UEL0307 \ No newline at end of file +TypeClass = UEL0307