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

Commit 53ff223

Browse files
committed
Implemented ThrowStrength across all arms,
removed device-side throw velocities from most grenades, tweaked Masses and ThrowOffsets accordingly, added `StrikerLever` particle to a few grenades a a demo
1 parent 3a90887 commit 53ff223

File tree

42 files changed

+144
-175
lines changed

Some content is hidden

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

42 files changed

+144
-175
lines changed

Base.rte/Actors/Brains/Brainbot/Brainbot.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ AddActor = Arm
356356
Hand = ContentFile
357357
FilePath = Base.rte/Actors/Brains/Brainbot/HandFG.png
358358
GripStrength = 100
359+
ThrowStrength = 25
359360
MaxLength = 13
360361
IdleOffset = Vector
361362
X = 7

Base.rte/Actors/Infantry/GreenDummy/GreenDummy.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ AddActor = Arm
377377
Hand = ContentFile
378378
FilePath = Base.rte/Actors/Infantry/GreenDummy/HandFGA.png
379379
GripStrength = 100
380+
ThrowStrength = 30
380381
MaxLength = 12
381382
IdleOffset = Vector
382383
X = 5

Base.rte/Devices/Explosives/AntiPersonnelMine/AntiPersonnelMine.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ AddDevice = TDExplosive
208208
Y = 4
209209
StartThrowOffset = Vector
210210
X = 9
211-
Y = -2
211+
Y = 1
212212
EndThrowOffset = Vector
213-
X = 4
214-
Y = 4
213+
X = 8
214+
Y = -1
215215
MinThrowVel = 1
216216
MaxThrowVel = 10
217217
TriggerDelay = 10000000

Base.rte/Devices/Explosives/ClusterMineBomb/ClusterMineBomb.ini

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,10 @@ AddDevice = TDExplosive
136136
Y = 4
137137
StartThrowOffset = Vector
138138
X = 6
139-
Y = -7
139+
Y = -4
140140
EndThrowOffset = Vector
141-
X = 4
142-
Y = 4
143-
MinThrowVel = 1
144-
MaxThrowVel = 8
141+
X = 6
142+
Y = -1
145143
TriggerDelay = 5000
146144
ActivatesWhenReleased = 1
147145
AddGib = Gib

Base.rte/Devices/Explosives/FragGrenade/FragGrenade.ini

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
1-
///////////////////////////////////////////////////////////////////////
2-
// Frag Grenade Effects
3-
4-
5-
AddAmmo = MOSParticle
6-
PresetName = Frag Grenade Pin
7-
Mass = 0.05
8-
HitsMOs = 0
9-
GetsHitByMOs = 0
10-
RestThreshold = 1000
11-
SpriteFile = ContentFile
12-
FilePath = Base.rte/Devices/Explosives/FragGrenade/FragGrenadePin.png
13-
FrameCount = 8
14-
SpriteAnimMode = 7
15-
SpriteOffset = Vector
16-
X = -2
17-
Y = -2
18-
AngularVel = 6
19-
Atom = Atom
20-
Material = Material
21-
PresetName = Scrap Metal
22-
TrailLength = 0
23-
24-
251
///////////////////////////////////////////////////////////////////////
262
// Frag Grenade
273

@@ -30,14 +6,14 @@ AddDevice = TDExplosive
306
PresetName = Frag Grenade
317
AddToGroup = Bombs - Grenades
328
AddToGroup = Bombs
33-
Mass = 1
9+
Mass = 1.3
3410
RestThreshold = -500
3511
HitsMOs = 1
3612
GetsHitByMOs = 1
37-
ScriptPath = Base.rte/Devices/Explosives/FragGrenade/FragGrenade.lua
3813
SpriteFile = ContentFile
3914
FilePath = Base.rte/Devices/Explosives/FragGrenade/FragGrenade.png
4015
FrameCount = 2
16+
SpriteAnimMode = 0
4117
SpriteOffset = Vector
4218
X = -3
4319
Y = -4
@@ -75,15 +51,15 @@ AddDevice = TDExplosive
7551
X = -12
7652
Y = -5
7753
StartThrowOffset = Vector
78-
X = -12
79-
Y = -5
54+
X = -11
55+
Y = -3
8056
EndThrowOffset = Vector
81-
X = -12
82-
Y = -5
83-
MinThrowVel = 5
84-
MaxThrowVel = 20
57+
X = 11
58+
Y = -3
8559
TriggerDelay = 2500
8660
ActivatesWhenReleased = 1
61+
StrikerLever = MOSParticle
62+
CopyOf = Frag Grenade Pin
8763
AddGib = Gib
8864
GibParticle = MOPixel
8965
CopyOf = Glow Explosion Big

Base.rte/Devices/Explosives/FragGrenade/FragGrenade.lua

Lines changed: 0 additions & 11 deletions
This file was deleted.

Base.rte/Devices/Explosives/NapalmBomb/NapalmBomb.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ AddDevice = TDExplosive
173173
EndThrowOffset = Vector
174174
X = 4
175175
Y = 4
176-
MinThrowVel = 1
177-
MaxThrowVel = 8
178176
TriggerDelay = 5000
179177
ActivatesWhenReleased = 1
180178
AddGib = Gib

Base.rte/Devices/Explosives/StandardBomb/StandardBomb.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ AddDevice = TDExplosive
5656
EndThrowOffset = Vector
5757
X = 4
5858
Y = 4
59-
MinThrowVel = 1
60-
MaxThrowVel = 10
6159
TriggerDelay = 5000
6260
ActivatesWhenReleased = 1
6361
AddGib = Gib

Base.rte/Devices/Shared/Scripts/TrajectoryGuide.lua

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ function Create(self)
44
self.laserTimer:SetSimTimeLimitMS(10);
55
self.guideTable = {};
66

7-
self.projectileVel = 30;
8-
97
if IsThrownDevice(self) then
108
self.isThrownDevice = true;
11-
self.projectileVel = self.MaxThrowVel;
12-
self.projectileVelMin = self.MinThrowVel;
9+
if self.MaxThrowVel > 0 then
10+
self.projectileVelMax = self.MaxThrowVel;
11+
self.projectileVelMin = self.MinThrowVel;
12+
end
1313
self.projectileGravity = self.GlobalAccScalar;
1414
self.projectileAirResistance = self.AirResistance;
1515
self.projectileAirThreshold = self.AirThreshold;
@@ -46,18 +46,21 @@ function Update(self)
4646
if controller:IsState(Controller.AIM_SHARP) or self.isThrownDevice and controller:IsState(Controller.WEAPON_FIRE) then
4747
if self.laserTimer:IsPastSimTimeLimit() then
4848

49-
local guideParPos, gudeParVel;
49+
local guideParPos, guideParVel;
5050

5151
if self.isThrownDevice and IsAHuman(actor) then
5252
--Display detonation point if a scripted fuze is active
5353
if self.fuze and self.fuzeDelay then
5454
self.maxTrajectoryPars = (self.fuzeDelay - self.fuze.ElapsedSimTimeMS - self.laserTimer.ElapsedSimTimeMS)/TimerMan.DeltaTimeMS * rte.PxTravelledPerFrame;
5555
end
5656
actor = ToAHuman(actor);
57+
local rotationThisFrame = actor.AngularVel * TimerMan.DeltaTimeSecs;
58+
local maxVel = self.projectileVelMax or (actor.FGArm.ThrowStrength + math.abs(actor.AngularVel * 0.5) * math.cos(actor.RotAngle + rotationThisFrame))/math.sqrt(math.abs(self.Mass) + 1);
59+
local minVel = self.projectileVelMin or maxVel * 0.2;
5760
--The following offset is as found in the source code (To-do: expose and utilize EndThrowOffset properly instead)
58-
guideParPos = actor.Pos + Vector((actor.FGArm.ParentOffset.X + 15) * actor.FlipFactor, actor.FGArm.ParentOffset.Y - 8);
59-
local projectileVel = self.throwTimer and self.projectileVelMin + (self.projectileVel - self.projectileVelMin) * math.min(self.throwTimer.ElapsedSimTimeMS, actor.ThrowPrepTime)/actor.ThrowPrepTime or self.projectileVel;
60-
guideParVel = Vector(projectileVel, 0):RadRotate(actor.RotAngle + actor:GetAimAngle(true));
61+
guideParPos = actor.Pos + actor.Vel * rte.PxTravelledPerFrame + Vector((actor.FGArm.ParentOffset.X + actor.FGArm.MaxLength) * actor.FlipFactor, actor.FGArm.ParentOffset.Y - 6):RadRotate(actor:GetAimAngle(false) * actor.FlipFactor);
62+
local projectileVel = self.throwTimer and minVel + (maxVel - minVel) * math.min(self.throwTimer.ElapsedSimTimeMS, actor.ThrowPrepTime)/actor.ThrowPrepTime or maxVel;
63+
guideParVel = Vector(projectileVel, 0):RadRotate(actor.RotAngle + actor:GetAimAngle(true) + rotationThisFrame);
6164
else
6265
guideParPos = self.MuzzlePos;
6366
guideParVel = Vector(self.projectileVel, 0):RadRotate(actor:GetAimAngle(true));

Base.rte/Effects/Casings.ini

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
///////////////////////////////////////////////////////////////////////
2-
//// Casings and Shells
2+
//// Casings, Shells and Pins
33

44

55
AddAmmo = MOSParticle
@@ -174,4 +174,24 @@ AddAmmo = AEmitter
174174
AngularVel = 3
175175
EmissionOffset = Vector
176176
X = -2
177-
Y = 0
177+
Y = 0
178+
179+
180+
AddAmmo = MOSParticle
181+
PresetName = Frag Grenade Pin
182+
Mass = 0.05
183+
HitsMOs = 0
184+
GetsHitByMOs = 0
185+
RestThreshold = 1000
186+
SpriteFile = ContentFile
187+
FilePath = Base.rte/Devices/Explosives/FragGrenade/FragGrenadePin.png
188+
FrameCount = 8
189+
SpriteAnimMode = 7
190+
SpriteOffset = Vector
191+
X = -2
192+
Y = -2
193+
AngularVel = 6
194+
Atom = Atom
195+
Material = Material
196+
PresetName = Scrap Metal
197+
TrailLength = 0

0 commit comments

Comments
 (0)