1
1
function Create (self )
2
+ self .disarmTicks = 3 ;
3
+ self .disarmRange = GetPPM () * 4 ;
4
+
2
5
self .delayTimer = Timer ();
3
6
self .overallTimer = Timer ();
4
7
self .scanTimer = Timer ();
8
+
9
+ self .tickDuration = 1000 ;
10
+ self .disarmTime = self .disarmTicks * self .tickDuration ;
5
11
self .actionPhase = 0 ;
6
12
self .blink = false ;
7
-
8
- self .disarmRange = GetPPM () * 4 ;
9
13
self .MuzzleOffset = Vector (self .disarmRange * 0.5 , 0 );
10
14
self .targetTable = {};
11
15
17
21
function Update (self )
18
22
if self .Magazine then
19
23
if self :IsActivated () then
20
- self .Magazine .RoundCount = math.ceil (4000 - self .overallTimer .ElapsedSimTimeMS );
21
- if self .delayTimer :IsPastSimMS (1000 ) then
24
+ self .Magazine .RoundCount = math.ceil (self . disarmTime - self .overallTimer .ElapsedSimTimeMS );
25
+ if self .delayTimer :IsPastSimMS (self . tickDuration ) then
22
26
self .delayTimer :Reset ();
23
27
self .blink = false ;
24
28
local targetCount = 0 ;
25
29
self .actionPhase = self .actionPhase + 1 ;
26
30
for i = 1 , # self .targetTable do
27
31
if self .targetTable [i ] and IsMOSRotating (self .targetTable [i ]) and SceneMan :ShortestDistance (self .MuzzlePos , self .targetTable [i ].Pos , SceneMan .SceneWrapsX ):MagnitudeIsLessThan (self .disarmRange + 5 ) then
28
32
targetCount = targetCount + 1 ;
29
- local detectPar = CreateMOPixel (" Disarmer Detection Particle " .. (self .actionPhase == 4 and " Safe" or " Neutral" ));
33
+ local detectPar = CreateMOPixel (" Disarmer Detection Particle " .. (self .actionPhase == self . disarmTicks and " Safe" or " Neutral" ));
30
34
detectPar .Pos = self .targetTable [i ].Pos ;
31
35
MovableMan :AddParticle (detectPar );
32
36
33
- if self .actionPhase == 4 then
37
+ if self .actionPhase == self . disarmTicks then
34
38
local itemName = string.gsub (self .targetTable [i ]:GetModuleAndPresetName (), " Active" , " " );
35
39
local disarmedItem = CreateTDExplosive (itemName );
36
40
disarmedItem .Pos = self .targetTable [i ].Pos ;
@@ -46,30 +50,30 @@ function Update(self)
46
50
self .actionPhase = 0 ;
47
51
self .overallTimer :Reset ();
48
52
self .errorSound :Play (self .Pos );
49
- elseif self .actionPhase == 4 then
50
- self .ReloadTime = 1000 + (1000 * targetCount );
53
+ elseif self .actionPhase == self . disarmTicks then
54
+ self .BaseReloadTime = 1000 + (500 * targetCount );
51
55
self :Reload ();
52
56
end
53
57
end
54
- if self .actionPhase > 0 and self .actionPhase < 4 then
58
+ if self .actionPhase > 0 and self .actionPhase < self . disarmTicks then
55
59
if self .blink == false then
56
60
self .blink = true ;
57
61
local soundfx = CreateAEmitter (" Disarmer Sound Blip" );
58
62
soundfx .Pos = self .Pos ;
59
63
MovableMan :AddParticle (soundfx );
60
64
end
61
- elseif self .actionPhase == 4 then
65
+ elseif self .actionPhase == self . disarmTicks then
62
66
local soundfx = CreateAEmitter (" Disarmer Sound Disarm" );
63
67
soundfx .Pos = self .Pos ;
64
68
MovableMan :AddParticle (soundfx );
65
69
end
66
70
else
67
71
self .delayTimer :Reset ();
68
72
self .overallTimer :Reset ();
69
- self .Magazine .RoundCount = 4000 ;
73
+ self .Magazine .RoundCount = self . disarmTime ;
70
74
self .actionPhase = 0 ;
71
75
72
- if self :GetParent () and self .scanTimer :IsPastSimMS (500 ) then
76
+ if self :GetParent () and self .scanTimer :IsPastSimMS (self . tickDuration * 0.5 ) then
73
77
self .targetTable = {};
74
78
self .scanTimer :Reset ();
75
79
local alarm = false ;
0 commit comments