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

Commit 6aa0f56

Browse files
committed
AHuman jetpack throttle edits
1 parent d2bb568 commit 6aa0f56

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
281281

282282
<details><summary><b>Changed</b></summary>
283283

284+
- `AHuman`'s jetpack will now boost its throttle according to its throttle multipliers and the actor's inventory weight. This results in proportionally faster depletion of jetpack fuel.
285+
284286
- `ACrab` actors will now default to showing their `Turret` sprite as their GUI icon. If no turret is defined, the `ACrab`'s own sprite will be used.
285287
In a similar fashion, `AHuman` will now default to its torso sprite as its GUI representation if no `Head` has somehow been defined.
286288

Entities/AHuman.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3159,17 +3159,20 @@ void AHuman::Update()
31593159
if (m_JetTimeTotal > 0) {
31603160
// Jetpack throttle depletes relative to jet time, but only if throttle range values have been defined
31613161
float jetTimeRatio = std::max(m_JetTimeLeft / m_JetTimeTotal, 0.0F);
3162-
m_pJetpack->SetThrottle(jetTimeRatio * 2.0F - 1.0F);
3162+
float carriedMass = GetInventoryMass() + GetEquippedMass();
3163+
m_pJetpack->SetThrottle(jetTimeRatio * (1.0F + carriedMass / std::max(GetMass() - carriedMass, 1.0F)) - 1.0F);
31633164
}
3164-
if (m_Controller.IsState(BODY_JUMPSTART) && m_JetTimeLeft > 0 && m_Status != INACTIVE) {
3165+
float thrustCost = g_TimerMan.GetDeltaTimeMS() * m_pJetpack->GetThrottleFactor();
3166+
float burstCost = thrustCost * 10.0F;
3167+
if (m_Controller.IsState(BODY_JUMPSTART) && m_JetTimeLeft >= burstCost && m_Status != INACTIVE) {
31653168
m_pJetpack->TriggerBurst();
31663169
m_ForceDeepCheck = true;
31673170
m_pJetpack->EnableEmission(true);
3168-
m_JetTimeLeft = std::max(m_JetTimeLeft - g_TimerMan.GetDeltaTimeMS() * 10.0F, 0.0F);
3169-
} else if ((m_Controller.IsState(BODY_JUMP) || (m_MoveState == JUMP && m_Controller.IsState(PIE_MENU_ACTIVE))) && m_JetTimeLeft > 0 && m_Status != INACTIVE) {
3171+
m_JetTimeLeft -= burstCost;
3172+
} else if ((m_Controller.IsState(BODY_JUMP) || (m_MoveState == JUMP && m_Controller.IsState(PIE_MENU_ACTIVE))) && m_JetTimeLeft >= thrustCost && m_Status != INACTIVE) {
31703173
m_pJetpack->EnableEmission(true);
31713174
m_pJetpack->AlarmOnEmit(m_Team);
3172-
m_JetTimeLeft = std::max(m_JetTimeLeft - g_TimerMan.GetDeltaTimeMS(), 0.0F);
3175+
m_JetTimeLeft -= thrustCost;
31733176
m_MoveState = JUMP;
31743177
m_Paths[FGROUND][JUMP].Restart();
31753178
m_Paths[BGROUND][JUMP].Restart();

0 commit comments

Comments
 (0)