Medical - Disable blood spurts for fire, burn and drown damage types (#9001)

This commit is contained in:
Filip Maciejewski 2022-08-25 19:05:50 +02:00 committed by GitHub
parent 438a90b63d
commit ecb7721c77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 4 deletions

View File

@ -8,6 +8,9 @@ PREP_RECOMPILE_END;
#include "initSettings.sqf" #include "initSettings.sqf"
// Damage types which do not cause blood spurts
GVAR(noBloodDamageTypes) = createHashMapFromArray (call (uiNamespace getVariable QGVAR(noBloodDamageTypes)));
// blood object model namespace // blood object model namespace
GVAR(models) = [] call CBA_fnc_createNamespace; GVAR(models) = [] call CBA_fnc_createNamespace;

View File

@ -1,3 +1,10 @@
#include "script_component.hpp" #include "script_component.hpp"
#include "XEH_PREP.hpp" #include "XEH_PREP.hpp"
// Damage types which do not cause blood spurts
private _noBloodDamageTypes = "getNumber (_x >> 'noBlood') == 1" configClasses (configFile >> "ACE_Medical_Injuries" >> "damageTypes");
uiNamespace setVariable [
QGVAR(noBloodDamageTypes),
compileFinal str (_noBloodDamageTypes apply {[configName _x, nil]})
];

View File

@ -18,8 +18,11 @@
* Public: No * Public: No
*/ */
params ["_unit", "_allDamages", "_shooter"]; params ["_unit", "_allDamages", "_shooter", "_damageType"];
(_allDamages select 0) params ["_damage", ""]; (_allDamages select 0) params ["_damage"];
// Don't bleed if damage type does not cause bleeding
if (_damageType in GVAR(noBloodDamageTypes)) exitWith {};
// Don't bleed when players only and a non-player unit is wounded // Don't bleed when players only and a non-player unit is wounded
if (GVAR(enabledFor) == BLOOD_ONLY_PLAYERS && {!isPlayer _unit && {_unit != ACE_player}}) exitWith {}; if (GVAR(enabledFor) == BLOOD_ONLY_PLAYERS && {!isPlayer _unit && {_unit != ACE_player}}) exitWith {};

View File

@ -268,6 +268,7 @@ class ACE_Medical_Injuries {
class ropeburn { class ropeburn {
thresholds[] = {{0.1, 1}, {0.1, 0}}; thresholds[] = {{0.1, 1}, {0.1, 0}};
selectionSpecific = 1; selectionSpecific = 1;
noBlood = 1;
class Abrasion { class Abrasion {
weighting[] = {{0.30, 1}}; weighting[] = {{0.30, 1}};
}; };
@ -275,9 +276,11 @@ class ACE_Medical_Injuries {
class drowning { class drowning {
//No related wounds as drowning should not cause wounds/bleeding. Can be extended for internal injuries if they are added. //No related wounds as drowning should not cause wounds/bleeding. Can be extended for internal injuries if they are added.
thresholds[] = {{0, 0}}; thresholds[] = {{0, 0}};
noBlood = 1;
class woundHandlers {}; class woundHandlers {};
}; };
class fire { class fire {
noBlood = 1;
// custom handling for environmental fire sources // custom handling for environmental fire sources
// passes damage to "burn" so doesn't need its own wound stats // passes damage to "burn" so doesn't need its own wound stats
class woundHandlers { class woundHandlers {
@ -287,6 +290,7 @@ class ACE_Medical_Injuries {
class burn { class burn {
thresholds[] = {{0, 1}}; thresholds[] = {{0, 1}};
selectionSpecific = 0; selectionSpecific = 0;
noBlood = 1;
class ThermalBurn { class ThermalBurn {
weighting[] = {{0, 1}}; weighting[] = {{0, 1}};
}; };

View File

@ -171,6 +171,9 @@ class ACE_Medical_Injuries {
// if 1, wounds are only applied to the most-damaged body part. if 0, wounds are applied to all damaged parts // if 1, wounds are only applied to the most-damaged body part. if 0, wounds are applied to all damaged parts
selectionSpecific = 1; selectionSpecific = 1;
// if 1, wounds do not produce blood spurts
noBlood = 0;
// custom handling for this damage type // custom handling for this damage type
// inherits from the default handlers - the function(s) defined here will be called first, then the default one(s) // inherits from the default handlers - the function(s) defined here will be called first, then the default one(s)
class woundHandlers: woundHandlers { class woundHandlers: woundHandlers {