Commit Graph

167 Commits

Author SHA1 Message Date
641dee39bd Fix trivial bugs (#6922) 2019-04-07 14:22:25 +02:00
f2b9bf3a17 Update headers 2019-03-30 11:07:54 -05:00
8d2bba4b35 Rewrite Medical GUI (#6831)
* Add a macro for the bloodloss scaling factor

* Adjust bloodloss threshold for red icon

* Remove bloodloss color scaling factor

The issue is actually the other way round, the factor of 20 would
instantly make bodyparts red on taking a wound.

* Implemet 10 color steps provided by ShackTac

This replaces the old method of colouring the interaction menu icons
and body image selections with a new method that has 10 distinct color
steps (matching across the icons and the body image).

* Use macros for constants

* Implement blue damage colouring

This re-adds visualisation for colouring based on damage. The case where
a limb has a tourniquet will hopefully be handled by an overlayed icon.

* Tidy up file structure

* Move patient information display to medical_ui

* Make common colour conversion code into functions

* Add tourniquet icon overlay to body image

* Fix mispelling I forgot to commit

* Update icon paths to new white cross icon

* Clean mess after rebase

* Add new medical menu gui

* Add updating injury list and body image

* Add updating treatment category buttons

* Update onMenuClose function

* Delete unused functions

* Add action buttons and triage card to menu

* Move medical menu PFH to separate function

* Move setTriageStatus to treatment

* Add triage select dropdown

* Add toggle button action

* Fix mouse moving randomly when opening

* Add logs list update and remove unused functions

* Hide tourniquet icons by default

* Remove CfgInGameUI (already in feedback)

* Update patient info display

* Update triage card display

* Add settings to control interact menu actions

* Cleanup files/paths

* Move triage status update to common function

* Add icons for interact menu actions

* Modify icon color for interact menu actions

* Update canOpenMenu for new setting

* Hide pain information for unconscious

* Stringtable cleanup

* Use switch for pain text

* Change minor triage status to minimal

* Fix injury list to use new stringtable entry names

* Fix medical actions check when disabled

* Skip distance check in same vehicle

* More cleanup

* Fix CI error

* Requested changes

* Fix INJURIES string

* Fix include after comment block

* Fix missing ;

Co-Authored-By: mharis001 <34453221+mharis001@users.noreply.github.com>
2019-03-24 18:17:48 -04:00
15036d7fd8 Fixes to unconsciousness and damageTypes systems (#6589)
* Fixes BleedingCoef having impact on bloodloss KO
Fixes incorrect var in setUnconscious

* Changes method for checking if typeOfDamage is valid
Adds check for if typeOfDamage is valid to extension version of woundsHandler

* Changes collision wound location select to a weighted system to make it more lethal at faster collisions
Adds collision and drowning damage types to config (drowning has no related wounds to prevent wounds being added while drowning).

* Fixes unneeded space

* Fixes minor mistake (body damage chance should go from 1 to 0 without ever becoming negative)
2019-03-21 19:33:51 +01:00
cc11ad051d Formatting. Lazy eval 2019-03-21 14:34:51 +01:00
89927a8b94 Missing privates. Lazy evaluation. 2019-03-17 21:26:15 +01:00
11547d7ff8 Fix environmental damage sources (#6515)
* Tidy handle damage code
* Fix environmental damage conditions

- Vehicle damage would never occur because it doesn't fire all the
hitpoints
- Missing sanity check on fall damage to check that unit isn't in a
vehicle
- Getting hit by a vehicle while on foot can be detected by checking for
a shooter

* Improve collision handling

- All collisions have a `_shooter` so we simply first check for that because burning doesn't and it could happen at any velocity
- We don't actually care what caused the collision because they should all cause the same type of wounding
- The exception is fall damage because we want to prioritise wounding the legs, we assume if the `_unit` had downward velocity and `_shooter == _unit` that it was fall damage (not necessarily always true, but almost always is and there doesn't look to be a more specific way to check).
2018-08-15 07:57:11 +01:00
a182336880 Ignore playable logic hitpoints (#6517) 2018-08-12 12:21:06 +01:00
7a0a00ea09 Cleanup using SQFLint (#6485)
* Use private
* Fix wrong spacing
* Fix wrong variable being used
* Cleanup empty line after header
* ace_common_fnc_getCountOfItem
* Remove useless _return variable
* Naming
2018-08-02 15:02:10 +01:00
6bd8542eed Move #includes before function headers (#6484) 2018-07-30 10:22:14 +01:00
c9ad92e92d Disable debugging (#6482) 2018-07-30 00:07:30 +02:00
36f2c5fcc9 Minor code clean up (#6474)
* Minor code clean up
* refactor(medical): shorten some code
* refactor(medical): use macros for tourniquets
* refactor(medical): pull cache expiry values into script_macros_medical
2018-07-29 22:43:14 +01:00
2ea7c349ca Add possibility for lethal organ damage (#6277)
* Change fatal injury to emulate lethal organ damage
2018-07-29 21:19:04 +01:00
873ed90cc1 Introduce bleedout condition and fix IV hemorrhage (#6470)
* Introduce bleedout condition and fix IV hemorrhage
* Update patient info display hemorrhage values
* Update UI info hemorrhage values
2018-07-25 11:40:37 +01:00
39b1d144e1 Vary time taken to bandage based on circumstances (#6467) 2018-07-25 09:35:04 +01:00
78ee7d4677 simplify animations config 2018-07-21 09:16:05 +02:00
cde22a675a Fix ladder dismount animation bug (#6454)
Not sure of the original reason we interpolate to this ACE unconscious
animation, but removing it seemingly has no effect and fixes all the
other animations that were broken by it.
2018-07-20 22:48:48 +02:00
0e50aca9d8 Add support to toggle allowDamage (#6266) 2018-07-18 19:31:29 +01:00
34eb5553ea Move scream and moan sounds to medical feedback (#6438)
* Move scream and moan sounds to medical feedback
* Move vanilla feedback overrides to medical feedback
* Update all function calls
* Use events to avoid a dependency
2018-07-18 19:21:27 +01:00
4466f9e785 Strip medical component (#6442)
* Move litter to `treatment`
* Move eden object attributes to `treatment`
* Move treatment items to `treatment`
* Move bodybag handling to `treatment`
* Move state conditions to `statemachine`
* Move radio addon handling to `feedback`
* Move medical macros to `engine`
* Move medical extension to `damage`
* Fix texture and material paths after move
* Remove duplicate medical menu config
* Remove old faction class
* Remove a bunch of old code
2018-07-18 19:13:25 +01:00
e566cbf35a Fixes damage redirection issues (#6231)
Units accumulate damage in the local variables
"ACE_Medical_Engine_$HitXXXX", but these are never reset. The way these
vars are used is as a single-damage-event tracker, and the end result of
not resetting their value when they're done being used is that a
specific $HitXXXX can accumulate enough damage to cause the "select
wound with highest damage" code to always select _it_ for the next wound
event, even if it wasn't the primary target of the last wound event.

I.E. I get shot in the right leg badly. If I then get winged in the left
arm, that wound will end up on my right leg, because when the code runs,
it finds QGVAR($HitRightLeg) > QGVAR($HitLeftArm), and so it applies the
wound to the right leg.
2018-07-16 23:49:06 +02:00
6576e5d014 Fix linting error 2018-07-15 16:28:39 +02:00
9d2e76e67a More component name fixes and small clean up 2018-07-15 16:24:04 +02:00
306c449986 implement pr #5385 2018-01-02 16:36:17 +01:00
6520fdb624 implement pr #5385 2018-01-02 16:34:13 +01:00
6aa32ce811 Fix setUnconsciousAnim error 2017-09-23 11:46:48 -05:00
382028e662 Fix updating body part visuals (#5141) 2017-06-08 13:50:38 -05:00
f369ffaa04 Med rw handle fire damage (#5100)
* Bundle fire damage into bigger chunks

Redo #4223

* Use same values

* Decrease combine cuttoff to 0.1
2017-06-05 11:42:00 -05:00
e3af1b55a5 Merge branch 'medical-rewrite' into medical-rewrite-effects 2017-03-18 09:56:42 -05:00
d403f20d71 Adjust addDamageToUnit for rewrite 2017-03-06 15:06:01 -06:00
97ec22bd9a Switch heartbeat to waitAndExec, allow switching pain settings 2017-02-18 22:11:40 -06:00
b87bdfe14a Fix body-bag action / cleanup 2016-12-09 21:03:52 -06:00
c431a7d236 Ignore UAV AI hitpoints 2016-12-08 15:53:52 -06:00
78bfc0c26d Simplified damage storage 2016-12-08 11:38:43 +01:00
45aa80bed7 Fix leg damage always counted as #vehiclecrash 2016-12-07 16:39:22 +01:00
a5ce5b4a34 Medical Rewrite - Continued (#4744) 2016-12-05 21:34:20 +01:00
347be3c222 handle vehicle crashes and add wounds for fall damage 2016-10-20 15:02:24 +02:00
0370a34672 remove some debug 2016-10-20 12:43:57 +02:00
f2dfc6dc0e fixes, tweaks 2016-10-13 20:17:21 +02:00
5965326ca1 merge basic and adv. bandage actions 2016-10-13 09:47:52 +02:00
fd6e46b622 make waking up rocket soldier kneel not stand 2016-10-13 01:42:32 +02:00
71884778dd animation fixes 2016-10-13 01:16:51 +02:00
e38845bf45 add ace_kill event handler 2016-10-12 23:20:22 +02:00
a5d070f829 blood and unconsciousness fixes 2016-10-12 21:59:32 +02:00
3521bca00b change blood texture threshold 2016-10-10 15:22:59 +02:00
b0c0156d75 reduce some overhead 2016-10-07 05:10:43 +02:00
4bc1c1db56 handle blood visuals 2016-10-07 04:21:01 +02:00
56c77fed94 prep for new pain aim sway method 2016-10-06 23:44:14 +02:00
e9586ebccc use common header file for medical components 2016-10-06 22:40:36 +02:00
5613ec5d5a treatment functions and unconsciousness rework 2016-10-06 00:54:57 +02:00