View difference between Paste ID: kSbyBSvE and EzYz3tQX
SHOW: | | - or go back to the newest paste.
1
#****************************************************************************
2
#**
3
#**  File     :  /cdimage/units/UAL0101/UAL0101_script.lua
4
#**  Author(s):  John Comes, David Tomandl, Jessica St. Croix
5
#**
6
#**  Summary  :  Aeon Land Scout Script
7
#**
8
#**  Copyright © 2005 Gas Powered Games, Inc.  All rights reserved.
9
#****************************************************************************
10
11
local AHoverLandUnit = import('/lua/aeonunits.lua').AHoverLandUnit
12
local ADFLaserLightWeapon = import('/lua/aeonweapons.lua').ADFLaserLightWeapon
13
14
UAL0101 = Class(AHoverLandUnit) {
15
    Weapons = {
16
        LaserTurret = Class(ADFLaserLightWeapon) {}
17
    },
18
}
19
20
TypeClass = UAL0101
21
OnToggleEnable = function(self)
22
if true: set selection priority = 0
23-
if false: set selection priority = 1
23+
if false: set selection priority = 1
24
25
    CreateState = State {
26
        Main = function(self)
27
            self:HideBone('UEB1104', true)              #   This units default position is open,
28
            self.SliderManip:SetGoal(0,-1,0)            #   so we have to hide the bone, close the unit,
29
            self.SliderManip:SetSpeed(-1)               #   and then show the bone once its in its closed position.
30
            WaitFor(self.SliderManip)
31
            self:ShowBone('UEB1104', true)
32
            self.Closed = true
33
            if self.GoToActive == true then
34
                ChangeState(self, self.ActiveState)
35
            end
36
        end,
37
    },
38
    ActiveState = State {
39
        Main = function(self)
40
            local myBlueprint = self:GetBlueprint()
41
42
            # Play the "activate" sound
43
            if myBlueprint.Audio.Activate then
44
                self:PlaySound(myBlueprint.Audio.Activate)
45
            end
46
47
            # Initiate the unit's ambient movement sound
48
            self:PlayUnitAmbientSound( 'ActiveLoop' )
49
50
            self.SliderManip:SetGoal(0,0,0)
51
            self.SliderManip:SetSpeed(3)
52
            WaitFor(self.SliderManip)
53
        end,
54
55
        #   User deactivates unit.
56
        OnConsumptionInActive = function(self)
57
            TMassFabricationUnit.OnConsumptionInActive(self)
58
            ChangeState(self, self.InactiveState)
59
        end,
60
    },
61
62
    InactiveState = State {
63
        Main = function(self)
64
            self:StopUnitAmbientSound( 'ActiveLoop' )
65
66
            self.SliderManip:SetGoal(0,-1,0)
67
            self.SliderManip:SetSpeed(3)
68
            WaitFor(self.SliderManip)
69
        end,
70
71
        #   User activates unit.
72
        OnConsumptionActive = function(self)
73
            TMassFabricationUnit.OnConsumptionActive(self)
74
            ChangeState(self, self.ActiveState)
75
        end,
76
    },
77
}