Skip to content

Commit

Permalink
Merge branch 'dev-Tomcat' into unneededNot
Browse files Browse the repository at this point in the history
  • Loading branch information
MiszczuZPolski committed Jan 5, 2025
2 parents 8e02a6f + 6962473 commit 608f67a
Show file tree
Hide file tree
Showing 29 changed files with 473 additions and 172 deletions.
10 changes: 10 additions & 0 deletions addons/breathing/ACE_Medical_Injuries.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class ACE_Medical_Injuries {
class damageTypes {
class woundHandlers;
class bullet {
class woundHandlers: woundHandlers {
GVAR(pulmoHit) = QFUNC(woundsHandlerPulmoHit);
};
};
};
};
13 changes: 13 additions & 0 deletions addons/breathing/CfgGlasses.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class CfgGlasses
{
class G_RegulatorMask_F;
class kat_mask_solr: G_RegulatorMask_F
{
author = "MrAdrianPL + KJW";
displayname = "SOLR Oxygen Mask";
model = QPATHTOF(models\solr\kat_mask_solr.p3d);
picture = QPATHTOF(ui\maskSOLR.paa);
identityTypes[] = {};
mass = 4;
};
};
4 changes: 2 additions & 2 deletions addons/breathing/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ PREP(gui_updateInjuryListWounds);
PREP(handleBreathing);
PREP(handleBreathingConditions);
PREP(handlePneumothoraxDeterioration);
PREP(handlePulmoHit);
PREP(handleRespawn);
PREP(hasBVM);
PREP(hasOxygenTank);
Expand All @@ -37,4 +36,5 @@ PREP(treatmentAdvanced_removeNasalCannulaLocal);
PREP(treatmentAdvanced_removePulseoximeter);
PREP(treatmentAdvanced_tensionpneumothorax);
PREP(treatmentAdvanced_tensionpneumothoraxLocal);
PREP(useBVM);
PREP(useBVM);
PREP(woundsHandlerPulmoHit);
2 changes: 1 addition & 1 deletion addons/breathing/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PREP_RECOMPILE_END;
"EDITBOX",
[LLSTRING(SETTING_AVAIL_OXYMASK), LLSTRING(SETTING_AVAIL_OXYMASK_DISC)],
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)],
"'G_AirPurifyingRespirator_01_F'",
"'kat_mask_solr'",
1,
{
private _array = [_this, "CfgGlasses"] call EFUNC(chemical,getList);
Expand Down
2 changes: 2 additions & 0 deletions addons/breathing/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@ class CfgPatches {
#include "CfgMagazines.hpp"
#include "CfgMoves.hpp"
#include "CfgVehicles.hpp"
#include "ACE_Medical_Injuries.hpp"
#include "ACE_Medical_Treatment_Actions.hpp"
#include "CfgSounds.hpp"
#include "CfgGlasses.hpp"
111 changes: 0 additions & 111 deletions addons/breathing/functions/fnc_handlePulmoHit.sqf

This file was deleted.

129 changes: 129 additions & 0 deletions addons/breathing/functions/fnc_woundsHandlerPulmoHit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
#include "..\script_component.hpp"
/*
* Author: Katalam, LinkIsGrim
* Called when a unit is damaged.
*
* Arguments:
* 0: Unit That Was Hit <OBJECT>
* 1: Damage done to each body part <ARRAY>
* 0: Engine damage <NUMBER>
* 1: Body part <STRING>
* 2: Real damage <NUMBER>
* 2: Damage type (unused) <STRING>
* 3: Ammo (unused) <STRING>
*
* Return Value:
* None
*
* Example:
* [cursorTarget, [1, "Body", 2], "bullet", "B_556x45_Ball"] call kat_breathing_fnc_woundsHandlerPulmoHit
*
* Public: No
*/

params ["_unit", "_allDamages"];
(_allDamages select 0) params ["_engineDamage", "_bodyPart"]; // selection-specific

if !(GVAR(enable) && _bodyPart == "body") exitWith {_this};

//Other mods can utilise KAT_Pneumothorax_Exclusion variable to prevent Pneumothorax from happening
if (_engineDamage < GVAR(pneumothoraxDamageThreshold) || _unit getVariable ["KAT_Pneumothorax_Exlusion", false]) exitWith {_this};

private _chanceIncrease = 0;
if (GVAR(pneumothoraxDamageThreshold_TakenDamage)) then {
_chanceIncrease = linearConversion [GVAR(pneumothoraxDamageThreshold), 3, _engineDamage, 0, 30, true];
};

// Damage threshold passed & pneumothorax given
if (floor (random 100) < (GVAR(pneumothoraxChance) + _chanceIncrease)) exitWith {
private _hasTensionPneumothorax = _unit getVariable [QGVAR(tensionpneumothorax), false];
private _initialPneumothorax = (_unit getVariable [QGVAR(pneumothorax), 0]) == 0;

switch (true) do {
case (_hasTensionPneumothorax): { // fully deteriorate pneumothorax
_unit setVariable [QGVAR(pneumothorax), 4, true];
_unit setVariable [QGVAR(activeChestSeal), false, true];
};
case (_initialPneumothorax): {
// Set pain to at least 0.2
[_unit, 0.2] call ACEFUNC(medical_status,adjustPainLevel);

// add breathing sound
_unit setVariable [QGVAR(pneumothorax), 1, true];
_unit setVariable [QGVAR(deepPenetratingInjury), true, true];
_unit setVariable [QGVAR(activeChestSeal), false, true];

// Start deteriorating after delay
[_unit, _chanceIncrease] call FUNC(handlePneumothoraxDeterioration);
};

case (GVAR(advPtxEnable)): {
// Roll chance to get advanced pneumothorax while afflicted with early stage of pneumothorax
[_unit, _chanceIncrease] call FUNC(inflictAdvancedPneumothorax);
};
};

_this // return
};

// Damage threshold was passed but no pneumothorax given, try to just give injury instead

// No injury
if (floor (random 100) >= GVAR(deepPenetratingInjuryChance)) exitWith {_this};

_unit setVariable [QGVAR(deepPenetratingInjury), true, true];
_unit setVariable [QGVAR(activeChestSeal), false, true];

// Check for tamponade

// Unit already has it or got lucky
if ((_unit getVariable [QEGVAR(circulation,effusion), 0]) != 0 || floor (random 100) > EGVAR(circulation,tamponadeChance)) exitWith {_this};

_unit setVariable [QEGVAR(circulation,effusion), 1, true];

[{
params ["_unit"];

if (_unit getVariable [QEGVAR(circulation,effusion), 0] > 0) then {
// Try to deteriorate at set interval
[{
params ["_args", "_idPFH"];
_args params ["_unit"];

private _effusion = _unit getVariable [QEGVAR(circulation,effusion), 0];

// If patient is dead, already treated or has already deteriorated into full tamponade, kill the PFH
if ((_effusion == 0) || !(alive _unit) || (_effusion == 4)) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;
};

if (floor (random 100) <= EGVAR(circulation,deterioratingTamponade_chance)) then {
private _effusionTarget = _effusion + 1;

// Once deteriorated far enough try to inflict tamponade
if (_effusionTarget == 4) exitWith {
private _ht = _unit getVariable [QEGVAR(circulation,ht), []];

if ((_ht findIf {_x isEqualTo "tamponade"}) == -1) then {
_ht pushBack "tamponade";

if (_unit getVariable [QEGVAR(circulation,cardiacArrestType), 0] == 0) then {
[QACEGVAR(medical,FatalVitals), _unit] call CBA_fnc_localEvent;
};

_unit setVariable [QEGVAR(circulation,ht), _ht, true];
};

[_idPFH] call CBA_fnc_removePerFrameHandler;
};

_unit setVariable [QEGVAR(circulation,effusion), _effusionTarget, true];
[_unit, 0.5 * (_effusionTarget / 4)] call ACEFUNC(medical_status,adjustPainLevel); // Adjust pain based on severity
[_unit, -10, -10, "cardiac_tension"] call EFUNC(circulation,updateBloodPressureChange); // Emulate low blood pressure and low heart rate caused by tamponade
};

}, EGVAR(circulation,deterioratingTamponade_interval), [_unit]] call CBA_fnc_addPerFrameHandler;
};
}, [_unit], EGVAR(circulation,deterioratingTamponade_interval)] call CBA_fnc_waitAndExecute;

_this // return
72 changes: 72 additions & 0 deletions addons/breathing/models/solr/camo1.rvmat
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
ambient[] = { 1, 1, 1, 1 };
diffuse[] = { 1, 1, 1, 1 };
forcedDiffuse[] = { 0, 0, 0, 1 };
emmisive[] = { 0, 0, 0, 1 };
specular[] = { 0.2, 0.2, 0.2, 0.1 };
specularPower = 30;
PixelShaderID = "Super";
VertexShaderID = "Super";
class Stage1 {
texture = "x\kat\addons\breathing\models\solr\camo1_nohq.paa";
uvSource = "tex";
class uvTransform {
aside[] = { 1, 0, 0 };
up[] = { 0, 1, 0 };
dir[] = { 0, 0, 0 };
pos[] = { 0, 0, 0 };
};
};
class Stage2 {
texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)";
uvSource = "tex";
class uvTransform {
aside[] = { 1, 1, 0 };
up[] = { 0, 1, 0 };
dir[] = { 0, 0, 0 };
pos[] = { 0, 0, 0 };
};
};
class Stage3 {
texture = "#(argb,8,8,3)color(0,0,0,0,mc)";
uvSource = "tex";
class uvTransform {
aside[] = { 1, 0, 0 };
up[] = { 0, 1, 0 };
dir[] = { 0, 0, 0 };
pos[] = { 0, 0, 0 };
};
};
class Stage4 {
texture = "x\kat\addons\breathing\models\solr\camo1_as.paa";
uvSource = "tex";
class uvTransform {
aside[] = { 1, 0, 0 };
up[] = { 0, 1, 0 };
dir[] = { 0, 0, 1 };
pos[] = { 0, 0, 1 };
};
};
class Stage5 {
texture = "x\kat\addons\breathing\models\solr\camo1_smdi.paa";
uvSource = "tex";
class uvTransform {
aside[] = { 1, 0, 0 };
up[] = { 0, 1, 0 };
dir[] = { 0, 0, 0 };
pos[] = { 0, 0, 0 };
};
};
class Stage6 {
texture = "#(ai,64,64,1)fresnel(0.4,0.1)";
uvSource = "tex";
class uvTransform {
aside[] = { 1, 0, 0 };
up[] = { 0, 1, 0 };
dir[] = { 0, 0, 1 };
pos[] = { 0, 0, 0 };
};
};

class StageTI {
texture = "a3\data_f\default_vehicle_ti_ca.paa";
};
Binary file added addons/breathing/models/solr/camo1_as.paa
Binary file not shown.
Binary file added addons/breathing/models/solr/camo1_co.paa
Binary file not shown.
Binary file added addons/breathing/models/solr/camo1_nohq.paa
Binary file not shown.
Binary file added addons/breathing/models/solr/camo1_smdi.paa
Binary file not shown.
Binary file added addons/breathing/models/solr/kat_mask_solr.p3d
Binary file not shown.
Loading

0 comments on commit 608f67a

Please sign in to comment.