Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 5de1085

Browse files
committed
A heap of Ronin edits
1 parent 835d152 commit 5de1085

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+115
-149
lines changed
84 Bytes
84 Bytes
84 Bytes
84 Bytes
84 Bytes

Ronin.rte/Actors/Brains/Commander/RoninCommander.ini

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ AddActor = AHuman
3232
AddToGroup = Brains
3333
Description = MultiLineText
3434
AddLine = Established Ronin Commander unit. Capable of remote-controlling units like any other commanding Brain.
35-
AddLine = Press Jump and then Crouch to perform a somersault, or double-tap Crouch to lunge out!
35+
AddLine = Double-tap the Crouch key to lunge out!
3636
Mass = 50
3737
GoldValue = 125
3838
HitsMOs = 1
@@ -109,7 +109,7 @@ AddActor = AHuman
109109
PresetName = Ronin Commander Arm FG A
110110
SpriteFile = ContentFile
111111
FilePath = Ronin.rte/Actors/Brains/Commander/ArmFGA.png
112-
JointStrength = 300
112+
JointStrength = 320
113113
ParentOffset = Vector
114114
X = -1
115115
Y = -5
@@ -119,7 +119,7 @@ AddActor = AHuman
119119
PresetName = Ronin Commander Arm BG A
120120
SpriteFile = ContentFile
121121
FilePath = Ronin.rte/Actors/Brains/Commander/ArmBGA.png
122-
JointStrength = 300
122+
JointStrength = 320
123123
ParentOffset = Vector
124124
X = 4
125125
Y = -7
@@ -137,7 +137,7 @@ AddActor = AHuman
137137
ParentOffset = Vector
138138
X = -11
139139
Y = -10
140-
JointStrength = 400
140+
JointStrength = 480
141141
ParentOffset = Vector
142142
X = 1
143143
Y = 1
@@ -154,7 +154,7 @@ AddActor = AHuman
154154
ParentOffset = Vector
155155
X = -11
156156
Y = -10
157-
JointStrength = 400
157+
JointStrength = 480
158158
ParentOffset = Vector
159159
X = 4
160160
Y = 1
@@ -180,7 +180,6 @@ AddActor = AHuman
180180
StartOffset = Vector
181181
X = 6
182182
Y = 17.5
183-
StandRotAngleTarget = -0.1
184183
WalkLimbPath = LimbPath
185184
CopyOf = Human Run Path
186185
WalkRotAngleTarget = -0.3

Ronin.rte/Actors/Brains/Commander/RoninCommander.lua

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ function Create(self)
22
self.updateTimer = Timer();
33

44
self.lungeTapDelay = 200;
5-
self.frontFlip = {input = {Controller.BODY_JUMP, Controller.BODY_CROUCH}, inputCounter = 0};
65
self.lungePower = 6;
76
self.tapTimer = Timer();
87

@@ -13,6 +12,8 @@ function Create(self)
1312
self:SetNumberValue("Identity", self.face);
1413
--Add a ponytail if we are Lara
1514
if self.face == 2 then
15+
self.DeathSound.Pitch = 1.2;
16+
self.PainSound.Pitch = 1.2;
1617
self.Head:AddAttachable(CreateAttachable("Ronin Brunette Ponytail"));
1718
end
1819
else
@@ -21,8 +22,11 @@ function Create(self)
2122
self.Head.Frame = self.face;
2223
end
2324
end
25+
self.analogSpin = 0;
26+
self.lastAnalogAngle = self:GetController().AnalogMove.AbsRadAngle;
2427
end
2528
function Update(self)
29+
self.analogSpin = self.analogSpin * 0.9;
2630
if self.updateTimer:IsPastSimMS(1000) then
2731
self.updateTimer:Reset();
2832
self.aggressive = self.Health < self.MaxHealth * 0.5;
@@ -34,49 +38,34 @@ function Update(self)
3438
end
3539
end
3640
self.Frame = (self.face == 2 and self.Vel.Y > (SceneMan.GlobalAcc.Y * 0.15)) and 3 or self.face;
37-
local crouching = self.controller:IsState(Controller.BODY_CROUCH);
3841

39-
if self:IsPlayerControlled() and self.Status < Actor.DYING and self.FGLeg and self.BGLeg then
42+
if self:IsPlayerControlled() and self.Status < Actor.INACTIVE and self.FGLeg and self.BGLeg then
43+
local crouching = self.controller:IsState(Controller.BODY_CROUCH);
4044
if self.Status == Actor.UNSTABLE then
41-
if not crouching then
42-
local motion = self.Vel.Magnitude * 0.5 + math.abs(self.AngularVel);
43-
if motion > 1 then
44-
self.AngularVel = self.AngularVel * (1 - 0.1/motion);
45-
end
46-
if self.tapTimer:IsPastSimMS(500) and math.cos(self.RotAngle) > 0.9 and motion < 20 then
45+
local motion = (self.Vel.Magnitude * 0.5 + math.abs(self.AngularVel));
46+
local stillness = 1/(1 + motion);
47+
if crouching then
48+
self.AngularVel = self.AngularVel * (1 - stillness) - (self.RotAngle - (self:GetAimAngle(false) - math.pi * 0.5) * self.FlipFactor) * 2 * stillness;
49+
end
50+
elseif crouching then
51+
if not self.crouchHeld then
52+
if not self.tapTimer:IsPastSimMS(self.lungeTapDelay) and SceneMan.Scene.GlobalAcc.Magnitude > 10 then
53+
Lunge(self, 3);
54+
else
4755
self.tapTimer:Reset();
48-
self.Status = Actor.STABLE;
49-
self.AngularVel = self.AngularVel * 0.5;
50-
end
56+
end
57+
self.controller:SetState(Controller.BODY_CROUCH, false);
5158
end
5259
else
53-
--Track the key combo input (jump -> crouch) to trigger frontflip
54-
if self.controller:IsState(self.frontFlip.input[self.frontFlip.inputCounter + 1]) then
55-
if (self.frontFlip.inputCounter == 0 or not self.tapTimer:IsPastSimMS(self.lungeTapDelay)) then
56-
self.frontFlip.inputCounter = self.frontFlip.inputCounter + 1;
57-
if self.frontFlip.inputCounter == #self.frontFlip.input then
58-
Lunge(self, 8);
59-
self.frontFlip.inputCounter = 0;
60-
--AudioMan:PlaySound("Ronin.rte/Actors/Brains/Commander/Sounds/Jump.flac", self.Pos);
61-
end
62-
self.tapTimer:Reset();
63-
else
64-
self.frontFlip.inputCounter = 0;
65-
end
66-
elseif crouching then
67-
if not self.keyHeld then
68-
if not self.tapTimer:IsPastSimMS(self.lungeTapDelay) and SceneMan.Scene.GlobalAcc.Magnitude > 10 then
69-
Lunge(self, 0);
70-
else
71-
self.tapTimer:Reset();
72-
end
73-
end
74-
self.keyHeld = true;
75-
else
76-
self.keyHeld = false;
60+
self.analogSpin = self.analogSpin + math.sin(self.controller.AnalogMove.AbsRadAngle - self.lastAnalogAngle);
61+
if math.abs(self.analogSpin) > 2 then
62+
Lunge(self, 12);
63+
self.analogSpin = 0;
7764
end
7865
end
66+
self.crouchHeld = crouching;
7967
end
68+
self.lastAnalogAngle = self.controller.AnalogMove.AbsRadAngle;
8069
end
8170

8271
function Lunge(self, spin)
@@ -87,8 +76,8 @@ function Lunge(self, spin)
8776
flip = -1;
8877
end
8978
--Different factors that affect the lunge
90-
local vel = (self.Vel.Magnitude^2) * 0.0005 + 1;
91-
local ang = math.abs(self.AngularVel * 0.05) + 1;
79+
local angVel = math.abs(self.AngularVel * 0.1) + 1;
80+
local vel = (self.Vel.Magnitude + angVel)^2 * 0.0005 + 1;
9281
local mass = math.abs(self.Mass * 0.005) + 1;
9382
local aimAng = self:GetAimAngle(false);
9483
local vertical = math.abs(math.cos(aimAng))/vel;
@@ -97,7 +86,7 @@ function Lunge(self, spin)
9786
local jumpVec = Vector((self.lungePower + strength/vel) * flip, -(self.lungePower * 0.5 + (strength * 0.3)) * vertical):RadRotate(aimAng * self.FlipFactor);
9887

9988
self.Vel = self.Vel + jumpVec/mass;
100-
self.AngularVel = self.AngularVel - (2/ang * vertical + spin) * flip;
89+
self.AngularVel = self.AngularVel - (spin/angVel * vertical) * flip * math.cos(self.RotAngle);
10190
self.Status = Actor.UNSTABLE;
10291
self.tapTimer:Reset();
10392
end
975 Bytes
980 Bytes
976 Bytes

0 commit comments

Comments
 (0)