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

Commit 0276ada

Browse files
authored
Merge pull request #193 from cortex-command-community/impulse-damage
Impulse damage relative to max health instead of a constant 0->100
2 parents 5d05e5c + 7da83c9 commit 0276ada

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

CHANGELOG.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
9393
`PrimitiveMan:DrawBitmapPrimitive(pos, entity, rotAngle, frame, bool hFlipped, bool vFlipped)`
9494
`PrimitiveMan:DrawBitmapPrimitive(player, pos, entity, rotAngle, frame, bool hFlipped, bool vFlipped)`
9595
Original bindings with no flip arguments are untouched and can be called as they were.
96-
96+
9797
- Added new primitive drawing functions to `PrimitiveMan`:
9898
```
9999
-- Arc
100100
PrimitiveMan:DrawArcPrimitive(Vector pos, startAngle, endAngle, radius, color)
101101
PrimitiveMan:DrawArcPrimitive(player, Vector pos, startAngle, endAngle, radius, color)
102-
102+
103103
PrimitiveMan:DrawArcPrimitive(Vector pos, startAngle, endAngle, radius, color, thickness)
104104
PrimitiveMan:DrawArcPrimitive(player, Vector pos, startAngle, endAngle, radius, color, thickness)
105105

@@ -110,29 +110,29 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
110110
-- Box with rounded corners
111111
PrimitiveMan:DrawRoundedBoxPrimitive(Vector upperLeftCorner, Vector bottomRightCorner, cornerRadius, color)
112112
PrimitiveMan:DrawRoundedBoxPrimitive(player, Vector upperLeftCorner, Vector bottomRightCorner, cornerRadius, color)
113-
113+
114114
PrimitiveMan:DrawRoundedBoxFillPrimitive(Vector upperLeftCorner, Vector bottomRightCorner, cornerRadius, color)
115115
PrimitiveMan:DrawRoundedBoxFillPrimitive(player, Vector upperLeftCorner, Vector bottomRightCorner, cornerRadius, color)
116116

117117
-- Triangle
118118
PrimitiveMan:DrawTrianglePrimitive(Vector pointA, Vector pointB, Vector pointC, color)
119119
PrimitiveMan:DrawTrianglePrimitive(player, Vector pointA, Vector pointB, Vector pointC, color)
120-
120+
121121
PrimitiveMan:DrawTriangleFillPrimitive(Vector pointA, Vector pointB, Vector pointC, color)
122122
PrimitiveMan:DrawTriangleFillPrimitive(player, Vector pointA, Vector pointB, Vector pointC, color)
123123

124124
-- Ellipse
125125
PrimitiveMan:DrawEllipsePrimitive(Vector pos, horizRadius, vertRadius, color)
126126
PrimitiveMan:DrawEllipsePrimitive(player, Vector pos, horizRadius, vertRadius, color)
127-
127+
128128
PrimitiveMan:DrawEllipseFillPrimitive(Vector pos, short horizRadius, short vertRadius, color)
129129
PrimitiveMan:DrawEllipseFillPrimitive(player, Vector pos, horizRadius, vertRadius, color)
130130
```
131-
131+
132132
- Added log for non-fatal loading errors. This log will show image files that have been loaded with incorrect extensions (has no side effects but should be addressed) and audio files that failed loading entirely and will not be audible.
133133
If errors are present the console will be forced open to notify the player (only when loading into main menu).
134134
Log will be automatically deleted if warnings are no longer present to avoid polluting the root directory.
135-
135+
136136
- Game window resolution can now be changed without restarting the game.
137137

138138
### Changed
@@ -187,8 +187,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
187187

188188
- Input enums moved from `UInputMan` to `Constants` and are no longer accessed with the `UInputManager` prefix. These enums are now accessed with their own names as the prefix.
189189
For example: `UInputManager.DEVICE_KEYB_ONLY` is now `InputDevice.DEVICE_KEYB_ONLY`, `UInputManager.INPUT_L_UP` is now `InputElements.INPUT_L_UP` and so on.
190-
191-
- `CraftsOrbitAtTheEdge` corrected to `CraftOrbitAtTheEdge`. Applies to both ini property and lua binding.
190+
191+
- `CraftsOrbitAtTheEdge` corrected to `CraftOrbitAtTheEdge`. Applies to both ini property and lua binding.
192192

193193
- Game will now Abort with an error message when trying to load a copy of a non-existent `AtomGroup`, `Attachable` or `AEmitter` preset.
194194

@@ -200,12 +200,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
200200
The `PrintScreen` button will now take a single screenshot on key release and will not take more until the key is pressed and released again.
201201
The `Ctrl+S` key combination is unchanged and will take a single screenshot every frame while the keys are held.
202202
The `Ctrl+W` and `Alt+W` key combinations will now take a single WorldDump/ScenePreview on `W` key release (while `Ctrl/Alt` are still held) and will not take more until the key is pressed and released again.
203-
203+
204204
Additionally, all screenshots (excluding abortscreen) will now be saved into a `_Screenshots` folder (`_` so it's on top and not hiding between module folders) to avoid polluting the root directory. ([Issue #163](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/issues/163))
205205
This folder will be created automatically after modules are loaded if it is missing.
206-
206+
207207
- `ScreenDumps` and `WorldDumps` are now saved as compressed PNGs.
208-
208+
209209
- Controller deadzone setting ignores more input. Previously setting it to the maximum was just enough to eliminate stick drift.
210210

211211
- `Arm.HandPos` will now get/set the hand position as relative to the arm's joint position, instead of relative to the arm's center of mass.
@@ -214,12 +214,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
214214
Resolution multiplier button changed to `Fullscreen` button - this will set the game window resolution to match the desktop resolution. When resolution matches the desktop, this button will change to `Windowed` and will allow setting the game window resolution back to default (960x540).
215215
Added `Upscaled Fullscreen` button - this will change the resolution to half of the desktop and the multiplier to 2. The `Fullscreen` button will change to `Windowed` in this mode to return to non-upscaled mode (960x540).
216216
Selecting any resolution setting from the resolution combobox will immediately change to selected resolution. (Known bug: Clicking off the combobox without making a new selection while in `Upscaled Fullscreen` mode will change resolution to `Fullscreen`. This will be addressed later.)
217-
217+
218218
**Note:** Changing the game window resolution while an Activity is active requires ending the Activity. A dialog box will appear asking to confirm the change.
219219

220220
- Moved from C-style random number generation to C++ standard. This includes usage of an mt19937 random number generator.
221221
- For C++ coders the functions SelectRand, PosRand and RangeRand have been replaced by the function template RandomNum() and its overload RandomNum(T min, T max). The function NormalRand has been replaced by the function template RandomNormalNum(). For lua coders there is no change.
222222

223+
- Damage to actors from impulses is now relative to their max health instead of being on a scale from 0 to 100.
224+
223225
### Fixed
224226

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

Entities/Actor.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,10 +1508,8 @@ void Actor::Update()
15081508
if (m_TravelImpulse.GetMagnitude() > m_TravelImpulseDamage)
15091509
{
15101510
m_PainSound.Play(m_Pos);
1511-
// TODO: IMPROVE AND DON'T HARDCODE
1512-
//m_Health -= 10;
1513-
float impulse = m_TravelImpulse.GetMagnitude() - m_TravelImpulseDamage;
1514-
float damage = impulse / (m_GibImpulseLimit - m_TravelImpulseDamage) * 100;
1511+
const float impulse = m_TravelImpulse.GetMagnitude() - m_TravelImpulseDamage;
1512+
const float damage = impulse / (m_GibImpulseLimit - m_TravelImpulseDamage) * m_MaxHealth;
15151513
if (damage > 0)
15161514
m_Health -= damage;
15171515
if (m_Status != DYING && m_Status != DEAD)

0 commit comments

Comments
 (0)