This repository was archived by the owner on Jan 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +8
-2
lines changed
Ronin.rte/Actors/Brains/Commander Expand file tree Collapse file tree 4 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,9 @@ AddActor = AHuman
82
82
HolsterOffset = Vector
83
83
X = -6
84
84
Y = -4
85
+ StableVelocityThreshold = Vector
86
+ X = 12
87
+ Y = 20
85
88
Head = Attachable
86
89
CopyOf = Ronin Commander Head
87
90
ParentOffset = Vector
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ function Create(self)
23
23
self .Head .Frame = self .face ;
24
24
end
25
25
end
26
+ self .stableVel = self :GetStableVelocityThreshold ();
26
27
end
27
28
function Update (self )
28
29
if self .updateTimer :IsPastSimMS (1000 ) then
@@ -36,9 +37,9 @@ function Update(self)
36
37
end
37
38
end
38
39
self .Frame = (self .face == 2 and self .Vel .Y > (SceneMan .GlobalAcc .Y * 0.15 )) and 3 or self .face ;
39
-
40
+ local crouching = false ;
40
41
if self :IsPlayerControlled () and self .Status < Actor .INACTIVE and self .FGLeg and self .BGLeg then
41
- local crouching = self .controller :IsState (Controller .BODY_CROUCH );
42
+ crouching = self .controller :IsState (Controller .BODY_CROUCH );
42
43
if self .Status == Actor .UNSTABLE then
43
44
if self .dir == self .FlipFactor then
44
45
local motion = (self .Vel .Magnitude * 0.5 + math.abs (self .AngularVel ));
@@ -49,6 +50,7 @@ function Update(self)
49
50
else
50
51
self .dir = 0 ;
51
52
end
53
+ crouching = false ;
52
54
elseif crouching then
53
55
if not self .crouchHeld then
54
56
if not self .tapTimer :IsPastSimMS (self .lungeTapDelay ) and SceneMan .Scene .GlobalAcc .Magnitude > 10 then
@@ -60,4 +62,5 @@ function Update(self)
60
62
end
61
63
self .crouchHeld = crouching ;
62
64
end
65
+ self :SetStableVelocityThreshold (crouching and self .stableVel * (1 + math.cos (self .RotAngle )) or self .stableVel )
63
66
end
You can’t perform that action at this time.
0 commit comments