forked from FAForever/fa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUAB4201_script.lua
55 lines (44 loc) · 2.05 KB
/
UAB4201_script.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--****************************************************************************
--**
--** File : /cdimage/units/UAB4201/UAB4201_script.lua
--** Author(s): John Comes, David Tomandl
--**
--** Summary : Aeon Phalanx Gun Script
--**
--** Copyright © 2005 Gas Powered Games, Inc. All rights reserved.
--****************************************************************************
local AStructureUnit = import("/lua/aeonunits.lua").AStructureUnit
local AAMWillOWisp = import("/lua/aeonweapons.lua").AAMWillOWisp
-- upvalue for perfomance
local CreateRotator = CreateRotator
local TrashBagAdd = TrashBag.Add
---@class UAB4201 : AStructureUnit
UAB4201 = ClassUnit(AStructureUnit) {
Weapons = {
AntiMissile = ClassWeapon(AAMWillOWisp) {
PlayRackRecoil = function(self, rackList)
AAMWillOWisp.PlayRackRecoil(self, rackList)
local unit = self.unit
local rotatorManipulator = self.RotatorManipulator
--CreateRotator(unit, bone, axis, [goal], [speed], [accel], [goalspeed])
if not rotatorManipulator then
rotatorManipulator = CreateRotator(unit, 'Dome', 'z', 20, 40, 40, 40)
rotatorManipulator:SetGoal(45)
self.RotatorManipulatorCounter = 1
else
self.RotatorManipulatorCounter = self.RotatorManipulatorCounter + 1
rotatorManipulator:SetGoal(45 * self.RotatorManipulatorCounter)
end
self.unit.Trash:Add(self.RotatorManipulator)
end,
PlayRackRecoilReturn = function(self, rackList)
AAMWillOWisp.PlayRackRecoilReturn(self, rackList)
if self.RotatorManipulatorCounter == 8 then
self.RotatorManipulator:Destroy()
self.RotatorManipulator = nil
end
end,
},
},
}
TypeClass = UAB4201