Skip to content

Commit ed18d50

Browse files
committed
Data changes to move from Actor-centric jetpack handling to jetpacks handling themselves
1 parent ce0970d commit ed18d50

File tree

34 files changed

+96
-96
lines changed

34 files changed

+96
-96
lines changed

Data/Base.rte/AI/HumanBehaviors.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
12461246

12471247
if AI.refuel and Owner.Jetpack then
12481248
-- if jetpack is full or we are falling we can stop refuelling
1249-
if Owner.JetTimeLeft > Owner.JetTimeTotal * 0.98 or (AI.flying and Owner.Vel.Y < -3 and Owner.JetTimeLeft > AI.minBurstTime*2) then
1249+
if Owner.Jetpack.JetTimeLeft > Owner.Jetpack.JetTimeTotal * 0.98 or (AI.flying and Owner.Vel.Y < -3 and Owner.Jetpack.JetTimeLeft > AI.minBurstTime*2) then
12501250
AI.refuel = false;
12511251
elseif not AI.flying then
12521252
AI.jump = false;
@@ -1264,7 +1264,7 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
12641264
WptList = nil; -- update the path
12651265
elseif StuckTimer:IsPastSimTimeLimit() then -- dislodge
12661266
if AI.jump then
1267-
if Owner.Jetpack and Owner.JetTimeLeft < AI.minBurstTime then -- out of fuel
1267+
if Owner.Jetpack and Owner.Jetpack.JetTimeLeft < AI.minBurstTime then -- out of fuel
12681268
AI.jump = false;
12691269
AI.refuel = true;
12701270
nextLatMove = Actor.LAT_STILL;
@@ -1291,7 +1291,7 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
12911291
end
12921292

12931293
-- refuelling done
1294-
if AI.refuel and Owner.Jetpack and Owner.JetTimeLeft >= Owner.JetTimeTotal * 0.99 then
1294+
if AI.refuel and Owner.Jetpack and Owner.Jetpack.JetTimeLeft >= Owner.Jetpack.JetTimeTotal * 0.99 then
12951295
AI.jump = true;
12961296
end
12971297
end
@@ -1747,7 +1747,7 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
17471747
end
17481748

17491749
if Owner.Jetpack and Owner.Head and Owner.Head:IsAttached() then
1750-
if Owner.JetTimeLeft < AI.minBurstTime then
1750+
if Owner.Jetpack.JetTimeLeft < AI.minBurstTime then
17511751
AI.jump = false; -- not enough fuel left, no point in jumping yet
17521752
if not AI.flying or Owner.Vel.Y > 1 then
17531753
AI.refuel = true;
@@ -1759,13 +1759,13 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
17591759
if AI.flying then
17601760
-- predict jetpack movement when jumping and there is a target (check one direction)
17611761
local jetStrength = AI.jetImpulseFactor / Owner.Mass;
1762-
local t = math.min(0.4, Owner.JetTimeLeft*0.001);
1762+
local t = math.min(0.4, Owner.Jetpack.JetTimeLeft*0.001);
17631763
local PixelVel = Owner.Vel * (GetPPM() * t);
17641764
local Accel = SceneMan.GlobalAcc * GetPPM();
17651765

17661766
-- a burst use 10x more fuel
17671767
if Owner.Jetpack:CanTriggerBurst() then
1768-
t = math.max(math.min(0.4, Owner.JetTimeLeft*0.001-TimerMan.AIDeltaTimeSecs*10), TimerMan.AIDeltaTimeSecs);
1768+
t = math.max(math.min(0.4, Owner.Jetpack.JetTimeLeft*0.001-TimerMan.AIDeltaTimeSecs*10), TimerMan.AIDeltaTimeSecs);
17691769
end
17701770

17711771
-- test jumping
@@ -1819,13 +1819,13 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
18191819

18201820
-- predict jetpack movement...
18211821
local jetStrength = AI.jetImpulseFactor / Owner.Mass;
1822-
local t = math.min(0.4, Owner.JetTimeLeft*0.001);
1822+
local t = math.min(0.4, Owner.Jetpack.JetTimeLeft*0.001);
18231823
local PixelVel = Owner.Vel * (GetPPM() * t);
18241824
local Accel = SceneMan.GlobalAcc * GetPPM();
18251825

18261826
-- a burst use 10x more fuel
18271827
if Owner.Jetpack:CanTriggerBurst() then
1828-
t = math.max(math.min(0.4, Owner.JetTimeLeft*0.001-TimerMan.AIDeltaTimeSecs*10), TimerMan.AIDeltaTimeSecs);
1828+
t = math.max(math.min(0.4, Owner.Jetpack.JetTimeLeft*0.001-TimerMan.AIDeltaTimeSecs*10), TimerMan.AIDeltaTimeSecs);
18291829
end
18301830

18311831
-- when jumping (check four directions)

Data/Base.rte/AI/NativeHumanAI.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function NativeHumanAI:Create(Owner)
5858

5959
Members.jetImpulseFactor = Owner.Jetpack:EstimateImpulse(false) * GetPPM() / TimerMan.DeltaTimeSecs;
6060
Members.jetBurstFactor = (Owner.Jetpack:EstimateImpulse(true) * GetPPM() / TimerMan.DeltaTimeSecs - Members.jetImpulseFactor) * math.pow(TimerMan.DeltaTimeSecs, 2) * 0.5;
61-
Members.minBurstTime = math.min(Owner.Jetpack.BurstSpacing*2, Owner.JetTimeTotal*0.99); -- in milliseconds
61+
Members.minBurstTime = math.min(Owner.Jetpack.BurstSpacing*2, Owner.Jetpack.JetTimeTotal*0.99); -- in milliseconds
6262
end
6363

6464
setmetatable(Members, self);
@@ -582,7 +582,7 @@ function NativeHumanAI:Update(Owner)
582582
if (not self.jump and Owner.Vel.Y > 18) then
583583
self.jump = true;
584584
end
585-
if self.jump and Owner.JetTimeLeft > TimerMan.AIDeltaTimeMS then
585+
if self.jump and Owner.Jetpack.JetTimeLeft > TimerMan.AIDeltaTimeMS then
586586
if self.jumpState == AHuman.PREJUMP then
587587
self.jumpState = AHuman.UPJUMP;
588588
elseif self.jumpState ~= AHuman.UPJUMP then -- the jetpack is off

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,14 +636,14 @@ AddActor = AHuman
636636
X = 1
637637
Y = -5
638638
LookToAimRatio = 0.2
639-
Jetpack = AEmitter
639+
Jetpack = AEJetpack
640640
CopyOf = Jetpack Robot
641641
ParentOffset = Vector
642642
X = -4
643643
Y = 6
644644
DrawAfterParent = 0
645-
JumpTime = 2.5
646-
JumpReplenishRate = 1.5
645+
JumpTime = 2.5
646+
JumpReplenishRate = 1.5
647647
FGArm = Arm
648648
CopyOf = Brainbot Arm FG
649649
ParentOffset = Vector

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -664,15 +664,15 @@ AddActor = AHuman
664664
ParentOffset = Vector
665665
X = -1
666666
Y = -13
667-
Jetpack = AEmitter
667+
Jetpack = AEJetpack
668668
CopyOf = Jetpack
669669
ParentOffset = Vector
670670
X = -6
671671
Y = -1
672672
ParticlesPerMinute = 8400
673-
JumpTime = 1.5
674-
JumpReplenishRate = 1.5
675-
JumpAngleRange = 0.2
673+
JumpTime = 1.5
674+
JumpReplenishRate = 1.5
675+
JumpAngleRange = 0.2
676676
FGArm = Arm
677677
CopyOf = Green Dummy Arm FG
678678
ParentOffset = Vector

Data/Base.rte/Actors/Mecha/AIBox/AIBox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,14 @@ AddActor = ACrab
234234
ParentOffset = Vector
235235
X = 0
236236
Y = -5
237-
Jetpack = AEmitter
237+
Jetpack = AEJetpack
238238
CopyOf = Jump Light
239239
BurstSpacing = 1100
240240
ParentOffset = Vector
241241
X = 0
242242
Y = 0
243243
DrawAfterParent = 0
244-
JumpTime = 1
244+
JumpTime = 1
245245
LFGLeg = Leg
246246
CopyOf = AI Box Leg FG
247247
ParentOffset = Vector

Data/Base.rte/Actors/Mecha/Medic/MedicDrone.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,14 @@ AddActor = ACrab
232232
ParentOffset = Vector
233233
X = 0
234234
Y = -3
235-
Jetpack = AEmitter
235+
Jetpack = AEJetpack
236236
CopyOf = Jump Light
237237
BurstSpacing = 1100
238238
ParentOffset = Vector
239239
X = 0
240240
Y = 0
241241
DrawAfterParent = 0
242-
JumpTime = 1
242+
JumpTime = 1
243243
LFGLeg = Leg
244244
CopyOf = Medic Drone Leg FG
245245
ParentOffset = Vector

Data/Base.rte/Actors/Shared.ini

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ AddLimbPath = LimbPath
440440
// Jetpacks
441441

442442

443-
AddEffect = AEmitter
443+
AddEffect = AEJetpack
444444
PresetName = Jetpack Nozzle
445445
Mass = 0
446446
HitsMOs = 0
@@ -521,7 +521,7 @@ AddEffect = AEmitter
521521
FlashOnlyOnBurst = 0
522522

523523

524-
AddEffect = AEmitter
524+
AddEffect = AEJetpack
525525
CopyOf = Jetpack Nozzle
526526
PresetName = Jumpjet
527527
AddEmission = Emission
@@ -542,7 +542,7 @@ AddEffect = AEmitter
542542
BurstSpacing = 900
543543

544544

545-
AddEffect = AEmitter
545+
AddEffect = AEJetpack
546546
PresetName = Jump Light
547547
Mass = 0
548548
HitsMOs = 0
@@ -572,7 +572,7 @@ AddEffect = AEmitter
572572
LoudnessOnEmit = 0.1
573573

574574

575-
AddEffect = AEmitter
575+
AddEffect = AEJetpack
576576
PresetName = Jetpack
577577
Mass = 1
578578
HitsMOs = 0
@@ -651,7 +651,7 @@ AddEffect = AEmitter
651651
FlashOnlyOnBurst = 0
652652

653653

654-
AddEffect = AEmitter
654+
AddEffect = AEJetpack
655655
CopyOf = Jetpack
656656
PresetName = Jetpack Robot
657657
AddEmission = Emission
@@ -664,7 +664,7 @@ AddEffect = AEmitter
664664
BurstSize = 5
665665

666666

667-
AddEffect = AEmitter
667+
AddEffect = AEJetpack
668668
CopyOf = Jetpack
669669
PresetName = Jetpack Heavy
670670
AddEmission = Emission
@@ -680,7 +680,7 @@ AddEffect = AEmitter
680680
BurstSpacing = 160
681681

682682

683-
AddEffect = AEmitter
683+
AddEffect = AEJetpack
684684
CopyOf = Jetpack
685685
PresetName = Jetpack Extra Heavy
686686
AddEmission = Emission

Data/Base.rte/Actors/Wildlife/Jumper/Jumper.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ AddActor = AHuman
229229
ParentOffset = Vector
230230
X = -2
231231
Y = -3
232-
Jetpack = AEmitter
232+
Jetpack = AEJetpack
233233
CopyOf = Jump Light
234234
PresetName = Jumper Hop
235235
BurstSize = 6
@@ -238,7 +238,7 @@ AddActor = AHuman
238238
X = 0
239239
Y = 0
240240
DrawAfterParent = 0
241-
JumpTime = 0.1
241+
JumpTime = 0.1
242242
HandGroup = AtomGroup
243243
CopyOf = Human Hand
244244
FGFootGroup = AtomGroup

Data/Base.rte/Actors/Wildlife/MegaCrab/MegaCrab.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ AddEffect = ACrab
146146
Perceptiveness = 0
147147
CharHeight = 50
148148
HUDVisible = 0
149-
Jetpack = AEmitter
149+
Jetpack = AEJetpack
150150
CopyOf = Jump Light
151-
JumpTime = 1
151+
JumpTime = 1
152152
LFGLeg = Leg
153153
CopyOf = Big Crab Leg FG A
154154
ParentOffset = Vector

Data/Base.rte/Scripts/Global/BiggerJetpacks.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ function BiggerJetpacksScript:BuffJetpack(actor)
2121
end
2222
if actor.Jetpack then
2323
actor:SetNumberValue("BiggerJetpacksScript", 1);
24-
actor.JetTimeTotal = actor.JetTimeTotal * self.multiplier + 100;
24+
actor.Jetpack.JetTimeTotal = actor.Jetpack.JetTimeTotal * self.multiplier + 100;
2525
end
2626
end

0 commit comments

Comments
 (0)