Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
7aebffe
Unbroke all the mods :P
garethyr Jul 5, 2021
1883cb2
Garbage changelog entry so it's not forgotten about
garethyr Jul 5, 2021
99a2360
Merge branch 'development' into throttle-fix
garethyr Jul 22, 2021
e54696e
Fix up cpp patrol AI and allow it to detect ledges in terrain
fourZK Aug 16, 2021
4aede17
Allowed keyboard-only controls to strafe by sharp aiming and fixed a …
fourZK Aug 16, 2021
2bfb13f
Add inactive status checks to make it work as intended + some local r…
fourZK Aug 16, 2021
e9e3290
Implemented `HDFirearm` property `Reloadable` and functions `GetRound…
fourZK Aug 17, 2021
f740eb5
Added `AHuman` HUD element that shows the name of a newly equipped de…
fourZK Aug 17, 2021
1654a0e
Toggle device pickup HUD when a viewing player is nearby (MAX: pls ad…
fourZK Aug 17, 2021
1159013
Refactored ugly HDFirearm HUD code;
fourZK Aug 17, 2021
4bd2e42
Misc `AHuman` and `ACrab` refactor and fixing
fourZK Aug 17, 2021
600b5fa
Trying to put some sense into the `FlailAsLimb` functions while refac…
fourZK Aug 17, 2021
714ff1c
Added stance offset manipulation per actual recoil. Can be disabled w…
fourZK Aug 17, 2021
322effa
`Actor` refactor;
fourZK Aug 17, 2021
70c409a
Introducing `Gib` property `SpreadMode`, stand by for changelog entry
fourZK Aug 17, 2021
30a66fc
New `MOSRotating` property `WoundCountAffectsImpulseLimitRatio` which…
fourZK Aug 17, 2021
0edf576
Exposed `ThrownDevice` specific offsets to Lua
fourZK Aug 17, 2021
4ba4c9d
New `Round` INI property `ShellVelocityVariation` which can be used t…
fourZK Aug 17, 2021
4d13e99
`HDFirearm` and `HeldDevice` related refactor;
fourZK Aug 17, 2021
1f0df50
Allow "Always allowed items" or items of a limited kind to show up in…
fourZK Aug 17, 2021
1d8fef0
Added `Entity` property `ModuleName` to eliminate the need to iterate…
fourZK Aug 17, 2021
ae9887d
Corrected misleading summary
fourZK Aug 17, 2021
0bf1196
Added data reference to a new "inventory" pie icon
fourZK Aug 17, 2021
05efd05
Update CHANGELOG.md
fourZK Aug 17, 2021
2f78fef
Fix `SPREAD_EVEN` logic
fourZK Aug 17, 2021
301c241
Fix `ACrab` only being able to reload at half capacity
fourZK Aug 17, 2021
f81d96f
Allign pickup indicator to the center
fourZK Aug 20, 2021
84391f9
Fixed minor HUD-related bug
fourZK Aug 20, 2021
65eeec8
Revert `HeldDevice` appearing under "Guns" because `HeldDevice` also …
fourZK Aug 20, 2021
77e1362
Setting `Reloadable = false` should also stop the current reloading s…
fourZK Aug 22, 2021
fd5d3fa
Review changes
fourZK Aug 25, 2021
ca55dbe
Merge branch 'development' into 4zk-content-source
fourZK Aug 26, 2021
40f1580
Fix to issue #368
fourZK Aug 26, 2021
3652403
Review changes + fix'd a little whoopsie
fourZK Aug 26, 2021
262ea7d
Review changes
fourZK Aug 29, 2021
1e00076
Misc fixes and cleanup
fourZK Aug 29, 2021
e675f85
Review changes
fourZK Aug 29, 2021
b379ae8
Implemented `Round` property `LifeVariation` and consequently fixed b…
fourZK Aug 29, 2021
fc1aab4
Changelog entry
fourZK Aug 29, 2021
1553edc
Update CHANGELOG.md
fourZK Aug 29, 2021
87d8a80
Exposed `MOSprite` property `PrevRotAngle` to Lua (R)
fourZK Sep 1, 2021
bbad820
Fixed `LifeVariation` being improperly assigned tue to wrong datatype
fourZK Sep 5, 2021
68b202e
Merge branch 'development' into 4zk-content-source
fourZK Sep 5, 2021
f013e27
Cleaned up a bunch of duplicate logic from `ACRocket` and `ACDropShip…
fourZK Sep 5, 2021
acdef80
Review changes
fourZK Sep 7, 2021
de56419
Small fix for LifeVariation distribution in multi-particle Rounds
fourZK Sep 7, 2021
e9b33e3
Comment out acquire_bitmap to match commented release
garethyr Sep 7, 2021
43847cf
Merge branch 'development' into 4zk-content-source
MaximDude Sep 9, 2021
53c58f5
Add Settings.ini and settings menu handling for UnheldItemsHUDDisplay…
MaximDude Sep 9, 2021
1670777
Changes to inventory menu to support 4zK's changes that allow not alw…
garethyr Sep 12, 2021
96c125d
Merge branch 'development' into 4zk-content-source
fourZK Sep 12, 2021
f32bd77
Merge branch 'development' into throttle-fix
garethyr Sep 14, 2021
b764b1b
Moved lua bindings into LuaBindingsEntities
garethyr Sep 14, 2021
19fb486
Undid empty line in luaman.cpp
garethyr Sep 14, 2021
1164d3f
Changed throttle logic and renamed `Min/MaxThrottleRange` as `Negativ…
fourZK Sep 19, 2021
bb4ee03
Moved `FlashScale` treatment from jetpack logic to AEmitter
fourZK Sep 19, 2021
0fc65f9
Merge branch 'development' into 4zk-content-source
fourZK Sep 19, 2021
70ea9ef
Bugfixes
fourZK Sep 19, 2021
d679a7a
Revert throttle commit
fourZK Sep 25, 2021
69b9c11
Changed throttle logic and renamed `Min/MaxThrottleRange` as `Negativ…
fourZK Sep 25, 2021
f02114e
Update CHANGELOG.md
fourZK Sep 26, 2021
c63eb03
Fixed craft scuttling after 4+ seconds of delivery time. Emitters alr…
fourZK Sep 29, 2021
015288e
Missed cleanup
fourZK Sep 30, 2021
f215efc
Missed cleanup
fourZK Sep 30, 2021
aad1053
ACRocket refactor: allow rockets to work without full set of thrusters
fourZK Oct 2, 2021
9d02719
Exposed `ACraft` property `HatchDelay` to Lua
fourZK Oct 2, 2021
09eafdc
Better stillness calculation to be used in mobility-related stuff
fourZK Oct 2, 2021
304ee6a
Better flail mechanics for limbs
fourZK Oct 2, 2021
a7da138
Update CHANGELOG.md
fourZK Oct 2, 2021
e8a47d7
Merge pull request #337 from cortex-command-community/throttle-fix
garethyr Oct 5, 2021
5b92aeb
Misc minor changes
MaximDude Oct 10, 2021
ca58568
Exposed `DataModule` property `IsFaction` to lua so that activities c…
fourZK Oct 11, 2021
fedd531
Merge branch '4zk-content-source' of https://github.com/cortex-comman…
fourZK Oct 11, 2021
ba92117
Minor cleanup
garethyr Oct 12, 2021
635d06c
More minor cleanup + a few separate changes while I was here
garethyr Oct 12, 2021
e6799ea
Some formatting changes and cleanup
fourZK Oct 17, 2021
22ceee2
Revert idle offset in ankle offset logic
fourZK Oct 17, 2021
07772be
`ParentBreakWound` should inherit `DrawAfterParent` of the attachable
fourZK Oct 17, 2021
78196e2
Fix bug related to aiming while flying
fourZK Oct 17, 2021
3ef7f21
Fix sounds playing twice in `SoundOverlapMode::RESTART`
fourZK Oct 17, 2021
7bbc4a2
Merge branch '4zk-content-source' of https://github.com/cortex-comman…
fourZK Oct 17, 2021
065a5cf
Merge branch 'development' into 4zk-content-source
fourZK Oct 17, 2021
8d60784
Important leg fix
fourZK Oct 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions Activities/GameActivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1562,8 +1562,7 @@ void GameActivity::Update()
m_ControlledActor[player]->GetController()->SetDisabled(true);

// Player is done setting waypoints
if (m_PlayerController[player].IsState(PRESS_SECONDARY))
{
if (m_PlayerController[player].IsState(PRESS_SECONDARY) || m_PlayerController[player].IsState(ACTOR_NEXT_PREP) || m_PlayerController[player].IsState(ACTOR_PREV_PREP)) {
// Stop drawing the waypoints
// m_ControlledActor[player]->DrawWaypoints(false);
// Update the player's move path now to the first waypoint set
Expand Down Expand Up @@ -1629,8 +1628,7 @@ void GameActivity::Update()
m_ControlledActor[player]->GetController()->SetDisabled(true);

// Player is done setting waypoints
if (m_PlayerController[player].IsState(PRESS_SECONDARY))
{
if (m_PlayerController[player].IsState(PRESS_SECONDARY) || m_PlayerController[player].IsState(ACTOR_NEXT_PREP) || m_PlayerController[player].IsState(ACTOR_PREV_PREP)) {
// Give player control back to actor
m_ControlledActor[player]->GetController()->SetDisabled(false);
// Switch back to normal view
Expand Down Expand Up @@ -2112,7 +2110,7 @@ void GameActivity::Update()
g_FrameMan.SetScreenText("Your order has arrived!", ScreenOfPlayer(player), 333);
m_MessageTimer[player].Reset();

pDeliveryCraft->ResetEmissionTimers(); // Reset the engine timers so they don't emit a massive burst after being added to the world
pDeliveryCraft->ResetAllTimers();
pDeliveryCraft->Update();

// Add the delivery craft to the world, TRANSFERRING OWNERSHIP
Expand Down
100 changes: 82 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

<details><summary>Added</summary>
<details><summary>**Added**</summary>

- Executable can be compiled as 64bit.

Expand Down Expand Up @@ -149,6 +149,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Added `MovableObject` Lua function `EnableOrDisableAllScripts` that allows you to enable or disable all scripts on a `MovableObject` based on the passed in value.

- Added `AEmitter` and `PEmitter` Lua (R/W) properties `NegativeThrottleMultiplier` and `PositiveThrottleMultiplier` that affect the emission rate relative to throttle.

- Added `Attachable` Lua function and INI property `InheritsFrame` which lets `Attachables` inherit their parent's frame. It is set to false by default.

- Added `MovableObject` Lua (R/W) and INI properties `ApplyWoundDamageOnCollision` and `ApplyWoundBurstDamageOnCollision` which allow `MovableObject`s to apply the `EntryWound` damage/burst damage that would occur when they penetrate another object, without actually creating a wound.
Expand Down Expand Up @@ -179,15 +181,73 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- New `Settings.ini` property `ShowEnemyHUD` which allows disabling of enemy actor HUD in its entirety.

- New `DataModule` property `IsFaction = 0/1` which determines if a module is a playable faction (in MetaGame, etc.). This replaces the need to put "Tech" in the module name. Defaults to false (0).
- New `DataModule` INI and Lua (R) property `IsFaction` which determines whether a module is a playable faction (in MetaGame, etc.). This replaces the need to put "Tech" in the module name. Defaults to false (0).

- New `MOSRotating` INI and Lua (R) property `WoundCountAffectsImpulseLimitRatio` which can be used to make objects more prone to gibbing from impulse when they have also received wounds.

- New `Gib` INI property `SpreadMode` which sports two new spread logic variants which alter the way velocity is applied to the `GibParticle`s when they spawn. This can be used to create richer explosion effects.
`SpreadMode = 0` is the default, fully randomized spread according to `MinVelocity`, `MaxVelocity` and `Spread` values. Think: a piece of grenade fragment, launching out in an arbitrary direction.
`SpreadMode = 1` is the same as the default, but with evenly spaced out angles. Think: an air blast shockwave, dispersing evenly outward from the explosion.
`SpreadMode = 2` has an entirely different behavior of its own, which utilizes the fermat spiral as means to evenly disperse the particles in a circular area, according to `MaxVelocity` and `MinVelocity`. Since this mode will always result in a full, 360-degree spread, the `Spread` property can be used to add randomization to the gib particles. Think: a cloud of smoke.

- New `Actor` INI and Lua (R/W) property `StableRecoverDelay` which determines how long it takes for an actor to regain `STABLE` status after being rendered `UNSTABLE`.

- New `AHuman` Lua (R) property `ThrowProgress` which returns the current throw chargeup progress as a scalar from 0 to 1.

- New `HDFirearm` INI and Lua (R/W) property `ShellVelVariation` which can be used to randomize the magnitude at which shells are ejected.

- New `HDFirearm` Lua (R) property `ReloadProgress` which returns the current reload progress as a scalar from 0 to 1.

- New `HDFirearm` INI and Lua (R/W) property `Reloadable` which can be used to disable the ability to reload said device.

- New `HDFirearm` Lua (R) property `RoundInMagCapacity` which returns the maximum capacity of the `Magazine` or, if there's not currently a `Magazine`, the maximum capacity of the next `Magazine`.
This means that the property will always return the maximum ammo capacity of the device, even when reloading.

- New `Entity` Lua (R) property `ModuleName` which returns the filename of the data module from which the entity originates from.

- `Arm`s will now react to the recoil of `HeldDevice`s. This is affected by the `Arm`'s `GripStrength` and the `HeldDevice`'s `RecoilTransmission`, in the same way as recoil itself.

- `HDFirearm` reload progress now shows up as a HUD element.

- New `Round` INI property `LifeVariation` which can be used to randomize the `Lifetime` of shot particles.

- Exposed `MOSprite` property `PrevRotAngle` to Lua (R).

- New `ACraft` INI and Lua (R/W) property `ScuttleOnDeath` which can be used to disable the automatic self-destruct sequence when the craft's health drops down to zero.

- New `Settings.ini` property `UnheldItemsHUDDisplayRange = numPixels` that hides the HUD of stranded items at a set distance. Default is 500 (25 meters).
Value of -1 or anything below means all HUDs will be hidden and the only indication an item can be picked up will be on the Actor's HUD when standing on top of it.
Value of 0 means there is no range limit and all items on Scene will display the pick-up HUD.
Valid range values are 1-1000, anything above will be considered as no range limit.

- Various improvements to the Buy Menu. You can now navigate tabs with the actor swap buttons, and the menu will smartly navigate when you add an `Actor` to your shop list, so you can quickly select weapons, etc..
There is also a new `Settings.ini` property, `SmartBuyMenuNavigation = 0/1`, which allows you to turn off this smart buy menu navigation, in case you prefer not to have it.

- Exposed `ACraft` property `HatchDelay` to Lua (R/W).

</details>

<details><summary>**Changed**</summary>

- `ACRocket`s can now function without a full set of thrusters. This also means that "Null Emitter" thrusters are no longer required for rockets.

- Changed `MOSprite` property `SpriteAnimMode` `Enum` `LOOPWHENMOVING` to `LOOPWHENACTIVE` as it also describes active devices.

- Changed `Activity` Lua (R) properties `Running`, `Paused` and `ActivityOver` to `IsRunning`, `IsPaused` and `IsOver` respectively. (NOTE: corresponding `ActivityMan` functions remain unchanged)

- Exposed `ThrownDevice` properties `StartThrowOffset` and `EndThrowOffset` to Lua (R/W).

<details><summary>Changed</summary>
- `HeldDevice`s can now show up as "Tools" in the buy menu, rather than just as "Shields".

- Keyboard-only controlled `AHuman`s and `ACrab`s can now strafe while sharp-aiming.

- Lowered the default `AHuman` Head damage multiplier from 5 to 4.

- "Fixed" grenades and other fast-moving objects bouncing violently off of doors and other stationary objects.

- `AEmitter` and `PEmitter` throttle logic has changed:
The properties `MinThrottleRange` and `MaxThrottleRange` have been changed to `NegativeThrottleMultiplier` and `PositiveThrottleMultiplier` respectively.
The new logic uses the multipliers to multiply the emission rate relative to the absolute throttle value. `NegativeThrottleMultiplier` is used when throttle is negative, and vice versa.

- Doors in `Team = -1` will now open up for all actors.

Expand All @@ -205,7 +265,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Craft will now automatically scuttle when opening doors at a 90° angle rather than 45°.

- `AHuman` can now aim slightly while walking, however not while reloading.
- `AHuman`s can now sharp-aim slightly while walking, however not while reloading.

- Recoil when firing weapons now affects sharp aim.

Expand Down Expand Up @@ -313,11 +373,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Placing "Tech" in a `DataModule`'s `ModuleName` no longer makes the module a playable faction (in MetaGame, etc.). The `IsFaction` property should be used instead.
The word "Tech" will also not be omitted from the module name when displayed in any faction selection dropdown list.

- Renamed Lua methods `GetRadRotated` and `GetDegRotated` to `GetRadRotatedCopy` and `GetDegRotatedCopy` for clarity.

</details>


<details><summary>Fixed</summary>
<details><summary>**Fixed**</summary>

- Fixed the logic for `Gib` and `Emission` property `LifeVariation` where it would round down to zero, giving particles infinite lifetime.

- Fixed legs going bonkers for one frame when turning around.

Expand Down Expand Up @@ -370,7 +434,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
</details>


<details><summary>Removed</summary>
<details><summary>**Removed**</summary>

- Removed obsolete graphics drivers and their `Settings.ini` properties `ForceOverlayedWindowGfxDriver` and `ForceNonOverlayedWindowGfxDriver`.

Expand Down Expand Up @@ -404,7 +468,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [0.1.0 pre-release 3.0][0.1.0-pre3.0] - 2020/12/25

<details><summary>Added</summary>
<details><summary>**Added**</summary>

- Implemented Lua Just-In-Time compilation (MoonJIT 2.2.0).

Expand Down Expand Up @@ -570,7 +634,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
</details>


<details><summary>Changed</summary>
<details><summary>**Changed**</summary>

- Codebase now uses the C++17 standard.

Expand Down Expand Up @@ -679,7 +743,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
</details>


<details><summary>Fixed</summary>
<details><summary>**Fixed**</summary>

- Fix crash when returning to `MetaGame` scenario screen after activity end.

Expand Down Expand Up @@ -710,7 +774,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
</details>


<details><summary>Removed</summary>
<details><summary>**Removed**</summary>

- Removed the ability to remove scripts from objects with Lua. This is no longer needed cause of code efficiency increases.

Expand Down Expand Up @@ -738,7 +802,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [0.1.0 pre-release 2][0.1.0-pre2] - 2020/05/08

<details><summary>Added</summary>
<details><summary>**Added**</summary>

- Lua binding for `Box::IntersectsBox(otherBox)`, that returns true if 2 boxes intersect.

Expand Down Expand Up @@ -859,7 +923,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
</details>


<details><summary>Changed</summary>
<details><summary>**Changed**</summary>

- Codebase now uses the C++14 standard.

Expand Down Expand Up @@ -916,7 +980,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
</details>


<details><summary>Fixed</summary>
<details><summary>**Fixed**</summary>

- Fixed LuaBind being all sorts of messed up. All lua bindings now work properly like they were before updating to the v141 toolset.

Expand All @@ -939,7 +1003,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
</details>


<details><summary>Removed</summary>
<details><summary>**Removed**</summary>

- Removed all Gorilla Audio and SDL Mixer related code and files.

Expand All @@ -966,7 +1030,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [0.1.0 pre-release 1][0.1.0-pre1] - 2020/01/27

<details><summary>Added</summary>
<details><summary>**Added**</summary>

- You can now run the game with command line parameters, including `-h` to see help and `-c` to send ingame console input to cout.

Expand Down Expand Up @@ -995,7 +1059,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

</details>

<details><summary>Changed</summary>
<details><summary>**Changed**</summary>

- `ACrab` aim limits now adjust to crab body rotation.

Expand All @@ -1020,7 +1084,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
</details>


<details><summary>Fixed</summary>
<details><summary>**Fixed**</summary>

- SFX slider now works properly.

Expand All @@ -1039,7 +1103,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
</details>


<details><summary>Removed</summary>
<details><summary>**Removed**</summary>

- All licensing-related code has been removed since it's no longer needed.

Expand Down
92 changes: 0 additions & 92 deletions Entities/ACDropShip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ void ACDropShip::Clear()
m_LateralControl = 0;
m_LateralControlSpeed = 6.0f;
m_AutoStabilize = 1;
m_ScuttleIfFlippedTime = 4000;
m_MaxEngineAngle = 20.0f;
}

Expand Down Expand Up @@ -106,7 +105,6 @@ int ACDropShip::Create(const ACDropShip &reference) {
m_LateralControl = reference.m_LateralControl;
m_LateralControlSpeed = reference.m_LateralControlSpeed;
m_AutoStabilize = reference.m_AutoStabilize;
m_ScuttleIfFlippedTime = reference.m_ScuttleIfFlippedTime;

m_MaxEngineAngle = reference.m_MaxEngineAngle;

Expand Down Expand Up @@ -139,8 +137,6 @@ int ACDropShip::ReadProperty(const std::string_view &propName, Reader &reader) {
reader >> m_HatchSwingRange;
} else if (propName == "AutoStabilize") {
reader >> m_AutoStabilize;
} else if (propName == "ScuttleIfFlippedTime") {
reader >> m_ScuttleIfFlippedTime;
} else if (propName == "MaxEngineAngle") {
reader >> m_MaxEngineAngle;
} else if (propName == "LateralControlSpeed") {
Expand Down Expand Up @@ -179,8 +175,6 @@ int ACDropShip::Save(Writer &writer) const
writer << m_HatchSwingRange;
writer.NewProperty("AutoStabilize");
writer << m_AutoStabilize;
writer.NewProperty("ScuttleIfFlippedTime");
writer << m_ScuttleIfFlippedTime;
writer.NewProperty("MaxEngineAngle");
writer << m_MaxEngineAngle;
writer.NewProperty("LateralControlSpeed");
Expand Down Expand Up @@ -683,69 +677,6 @@ void ACDropShip::Update()
/////////////////////////////////////////////////
// Update MovableObject, adds on the forces etc, updated viewpoint
ACraft::Update();

///////////////////////////////////
// Explosion logic

if (m_Status == DEAD)
GibThis();

////////////////////////////////////////
// Balance stuff

// Get the rotation in radians.
float rot = m_Rotation.GetRadAngle();

// Eliminate rotations over half a turn
if (std::fabs(rot) > c_PI) {
rot += (rot > 0) ? -c_TwoPI : c_TwoPI;
m_Rotation.SetRadAngle(rot);
}
// If tipped too far for too long, die
if (rot < c_HalfPI && rot > -c_HalfPI)
{
m_FlippedTimer.Reset();
}
// Start death process if tipped over for too long
else if (m_ScuttleIfFlippedTime >= 0 && m_FlippedTimer.IsPastSimMS(m_ScuttleIfFlippedTime) && m_Status != DYING) // defult is 4s
{
m_Status = DYING;
m_DeathTmr.Reset();
}

// Flash if dying, warning of impending explosion
if (m_Status == DYING)
{
if (m_DeathTmr.IsPastSimMS(500) && m_DeathTmr.AlternateSim(100))
FlashWhite(10);
}

/*
// rot = fabs(rot) < c_QuarterPI ? rot : (rot > 0 ? c_QuarterPI : -c_QuarterPI);

// Rotational balancing spring calc
if (m_Status == STABLE) {
// Break the spring if close to target angle.
if (fabs(rot) > 0.1)
m_AngularVel -= rot * fabs(rot);
else if (fabs(m_AngularVel) > 0.1)
m_AngularVel *= 0.5;
}
// Unstable, or without balance
else if (m_Status == DYING) {
// float rotTarget = rot > 0 ? c_HalfPI : -c_HalfPI;
float rotTarget = c_HalfPI;
float rotDiff = rotTarget - rot;
if (fabs(rotDiff) > 0.1)
m_AngularVel += rotDiff * rotDiff;
else
m_Status = DEAD;

// else if (fabs(m_AngularVel) > 0.1)
// m_AngularVel *= 0.5;
}
m_Rotation.SetRadAngle(rot);
*/
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -868,27 +799,4 @@ void ACDropShip::SetLeftHatch(Attachable *newHatch) {
}
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////////////
// Method: ResetEmissionTimers
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Reset the timers of all emissions so they will start/stop at the
// correct relative offsets from now.

void ACDropShip::ResetEmissionTimers()
{
if (m_pRThruster && m_pRThruster->IsAttached())
m_pRThruster->ResetEmissionTimers();

if (m_pLThruster && m_pLThruster->IsAttached())
m_pLThruster->ResetEmissionTimers();

if (m_pURThruster && m_pURThruster->IsAttached())
m_pURThruster->ResetEmissionTimers();

if (m_pULThruster && m_pULThruster->IsAttached())
m_pULThruster->ResetEmissionTimers();
}
} // namespace RTE
Loading