@@ -17,12 +17,15 @@ function Create(self)
17
17
18
18
self .arrow = CreateMOSRotating (" Grapple Gun Guide Arrow" );
19
19
self .detectSound = CreateSoundContainer (" Mine Activate" , " Base.rte" );
20
+ self .missile = CreateAEmitter (" Particle Coalition Missile Launcher" , " Coalition.rte" );
20
21
end
21
22
22
23
function Update (self )
23
24
local parent = self :GetRootParent ();
25
+ local sharpAimProgress = 0 ;
24
26
if parent and IsActor (parent ) then
25
27
parent = ToActor (parent );
28
+ sharpAimProgress = parent .SharpAimProgress ;
26
29
local controller = parent :GetController ();
27
30
local screen = ActivityMan :GetActivity ():ScreenOfPlayer (controller .Player );
28
31
local playerControlled = parent :IsPlayerControlled ();
@@ -85,18 +88,19 @@ function Update(self)
85
88
end
86
89
end
87
90
if self .FiredFrame then
88
- self .missile = CreateAEmitter (" Particle Coalition Missile Launcher" , " Coalition.rte" );
89
- self .missile .Pos = self .MuzzlePos ;
90
- local fireVector = Vector (self .fireVel * self .FlipFactor , 0 ):RadRotate (self .RotAngle );
91
- self .missile .Vel = self .Vel + fireVector + Vector (0 , - math.abs (math.cos (fireVector .AbsRadAngle )));
92
- self .missile .RotAngle = self .missile .Vel .AbsRadAngle ;
93
- self .missile .AngularVel = math.cos (self .missile .Vel .AbsRadAngle ) * 10 ;
94
- self .missile .Team = self .Team ;
95
- self .missile .IgnoresTeamHits = true ;
91
+ local missile = self .missile :Clone ();
92
+ missile .Pos = self .MuzzlePos ;
93
+ local shake = math.rad (self .ShakeRange * (1 - sharpAimProgress ) + self .SharpShakeRange * sharpAimProgress ) * RangeRand (- 1 , 1 );
94
+ local fireVector = Vector (self .fireVel * self .FlipFactor , 0 ):RadRotate (self .RotAngle + shake );
95
+ missile .Vel = self .Vel + fireVector + Vector (0 , - math.abs (math.cos (fireVector .AbsRadAngle )));
96
+ missile .RotAngle = missile .Vel .AbsRadAngle ;
97
+ missile .AngularVel = math.cos (missile .Vel .AbsRadAngle ) * 10 + shake ;
98
+ missile .Team = self .Team ;
99
+ missile .IgnoresTeamHits = true ;
96
100
97
101
if self .target and IsMOSRotating (self .target ) then
98
- self . missile :SetNumberValue (" TargetID" , self .target .ID );
102
+ missile :SetNumberValue (" TargetID" , self .target .ID );
99
103
end
100
- MovableMan :AddParticle (self . missile );
104
+ MovableMan :AddParticle (missile );
101
105
end
102
106
end
0 commit comments