Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private _actions = [
// Dummy statement so it's not collapsed when there's no available actions
true
},
{[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotHandcuffed", "isNotSitting", "isNotOnLadder", "isNotRefueling"]] call EFUNC(common,canInteractWith)},
{[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotHandcuffed", "isNotSitting", "isNotOnLadder", "isNotRefueling", "isNotDazed"]] call EFUNC(common,canInteractWith)},
{},
{},
"Spine3",
Expand Down
2 changes: 1 addition & 1 deletion addons/interact_menu/functions/fnc_keyDown.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (_isTextEditing) then {
if (
_isTextEditing ||
{(isNull curatorCamera) && {
!([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotHandcuffed", "isNotSitting", "isNotOnLadder", "isNotRefueling"]] call EFUNC(common,canInteractWith))
!([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotHandcuffed", "isNotSitting", "isNotOnLadder", "isNotRefueling", "isNotDazed"]] call EFUNC(common,canInteractWith))
}
}) exitWith {false};

Expand Down
2 changes: 2 additions & 0 deletions addons/medical/functions/fnc_serializeState.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ _state setVariable [VAR_MEDICATIONS, _medications];

// Medical statemachine state
private _currentState = [_unit, GVAR(STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState;
// simplify dazed back to unconscious
if (_currentState == "Dazed") then { _currentState = "Unconscious"; };
_state setVariable [QGVAR(statemachineState), _currentState];

// Serialize & return
Expand Down
9 changes: 9 additions & 0 deletions addons/medical/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,12 @@
[1, 30, 1.5, 1],
true
] call CBA_fnc_addSetting;

[
QGVAR(dazedChance),
"SLIDER",
[LSTRING(dazedChance_DisplayName), LSTRING(dazedChance_Description)],
LSTRING(Category),
[0, 1, 0, 2, true],
true
] call CBA_fnc_addSetting;
6 changes: 6 additions & 0 deletions addons/medical/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,12 @@
<Turkish>Kapalı Gözkapağı</Turkish>
<Ukrainian>Закрити кришку</Ukrainian>
</Key>
<Key ID="STR_ACE_Medical_dazedChance_Description">
<English>The probability that a person with stable vitals will enter a dazed state from unconscious (checked every 10 seconds).</English>
</Key>
<Key ID="STR_ACE_Medical_dazedChance_DisplayName">
<English>Dazed Chance</English>
</Key>
<Key ID="STR_ACE_Medical_openLid">
<English>Open lid</English>
<Czech>Otevřít víko</Czech>
Expand Down
169 changes: 167 additions & 2 deletions addons/medical_engine/CfgMoves.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,128 @@
class CfgMovesBasic;
class CfgMovesBasic {
class Actions {
class CivilProneActions;
class ACE_Dazed: CivilProneActions {
stop = QGVAR(dazed_AmovPpneMstpSnonWnonDnon);
StopRelaxed = QGVAR(dazed_AmovPpneMstpSnonWnonDnon);
default = QGVAR(dazed_AmovPpneMstpSnonWnonDnon);

WalkF = QGVAR(dazed_AmovPpneMrunSnonWnonDf);
LimpF = QGVAR(dazed_AmovPpneMrunSnonWnonDf);
PlayerWalkF = QGVAR(dazed_AmovPpneMrunSnonWnonDf);
SlowF = QGVAR(dazed_AmovPpneMrunSnonWnonDf);
PlayerSlowF = QGVAR(dazed_AmovPpneMrunSnonWnonDf);
TactF = QGVAR(dazed_AmovPpneMrunSnonWnonDf);
PlayerTactF = QGVAR(dazed_AmovPpneMrunSnonWnonDf);

turnL = QGVAR(dazed_AmovPpneMstpSnonWnonDnon_turnL);
turnLRelaxed = QGVAR(dazed_AmovPpneMstpSnonWnonDnon_turnL);

turnR = QGVAR(dazed_AmovPpneMstpSnonWnonDnon_turnR);
turnRRelaxed = QGVAR(dazed_AmovPpneMstpSnonWnonDnon_turnR);
PutDown = "";
getOver = "";
throwPrepare = "";
throwGrenade = "";
LimpLF = "";
LimpRF = "";
LimpL = "";
LimpR = "";
LimpB = "";
LimpLB = "";
LimpRB = "";
reloadMagazine = "";
reloadMGun = "";
reloadMortar = "";
WalkLF = "";
WalkRF = "";
WalkL = "";
WalkR = "";
WalkLB = "";
WalkRB = "";
WalkB = "";
PlayerWalkLF = "";
PlayerWalkRF = "";
PlayerWalkL = "";
PlayerWalkR = "";
PlayerWalkLB = "";
PlayerWalkRB = "";
PlayerWalkB = "";
SlowLF = "";
SlowRF = "";
SlowL = "";
SlowR = "";
SlowLB = "";
SlowRB = "";
SlowB = "";
PlayerSlowLF = "";
PlayerSlowRF = "";
PlayerSlowL = "";
PlayerSlowR = "";
PlayerSlowLB = "";
PlayerSlowRB = "";
PlayerSlowB = "";
FastF = "";
FastLF = "";
FastRF = "";
FastL = "";
FastR = "";
FastLB = "";
FastRB = "";
FastB = "";
TactLF = "";
TactRF = "";
TactL = "";
TactR = "";
TactLB = "";
TactRB = "";
TactB = "";
PlayerTactLF = "";
PlayerTactRF = "";
PlayerTactL = "";
PlayerTactR = "";
PlayerTactLB = "";
PlayerTactRB = "";
PlayerTactB = "";
EvasiveLeft = "";
EvasiveRight = "";
down = "";
weaponOn = "";
weaponOff = "";
binocOff = "";
handGunOn = "";
takeFlag = "";
treated = "";
Lying = "";
Crouch = "";
CanNotMove = "";
FireNotPossible = "";
strokeGun = "";
PlayerStand = "";
Relax = "";
PrimaryWeapon = "";
SecondaryWeapon = "";
Binoculars = "";
Up = "";
PlayerCrouch = "";
PlayerProne = "";
Combat = "";
Stand = "";
Civil = "";
CivilLying = "";
GetInLow = "";
GetInMedium = "";
GetInHigh = "";
GetInSDV = "";
Surrender = "";
saluteOff = "";
grabDrag = "";
dooraction = "";
agonyStop = "";
gear = "";
};
};
};

class CfgMovesMaleSdr: CfgMovesBasic {
class States {
// fixes hand being stuck at rifle which is on the back
Expand Down Expand Up @@ -93,7 +217,10 @@ class CfgMovesMaleSdr: CfgMovesBasic {

class UNCON_ANIM(faceUp): Unconscious {};

class AmovPpneMstpSnonWnonDnon;
class AmovPercMstpSnonWnonDnon;
class AmovPpneMstpSnonWnonDnon: AmovPercMstpSnonWnonDnon {
ConnectTo[] += {QGVAR(dazed_AmovPpneMstpSnonWnonDnon),0.1};
};
class ACE_UnconsciousOutProne: AmovPpneMstpSnonWnonDnon {
//file = "\A3\anims_f\Data\Anim\Sdr\dth\pne\stp\ras\Rfl\AdthPpneMstpSrasWrflDnon_1";
looped = 0;
Expand All @@ -108,5 +235,43 @@ class CfgMovesMaleSdr: CfgMovesBasic {
ConnectTo[] = {"AmovPpneMstpSnonWnonDnon",0.2};
speed = 100;
};

class GVAR(dazed_AmovPpneMstpSnonWnonDnon): AmovPpneMstpSnonWnonDnon {
actions = "ACE_Dazed";
speed = 0.5;
ConnectTo[] = {QGVAR(dazed_AmovPpneMstpSnonWnonDnon),0.1};
InterpolateTo[] = {
QGVAR(dazed_AmovPpneMrunSnonWnonDf),0.02,
QGVAR(dazed_AmovPpneMstpSnonWnonDnon_turnL),0.02,
QGVAR(dazed_AmovPpneMstpSnonWnonDnon_turnR),0.02,
"Unconscious",0.02
};
variantsPlayer[] = {};
disableWeapons = 1;
};
class AmovPpneMrunSnonWnonDf;
class GVAR(dazed_AmovPpneMrunSnonWnonDf): AmovPpneMrunSnonWnonDf {
actions = "ACE_Dazed";
speed = 0.5;
InterpolateTo[] = {QGVAR(dazed_AmovPpneMstpSnonWnonDnon),0.02, "Unconscious",0.02};
variantsPlayer[] = {};
disableWeapons = 1;
};
class AmovPpneMstpSnonWnonDnon_turnL;
class GVAR(dazed_AmovPpneMstpSnonWnonDnon_turnL): AmovPpneMstpSnonWnonDnon_turnL {
actions = "ACE_Dazed";
speed = 0.5;
InterpolateTo[] = {QGVAR(dazed_AmovPpneMstpSnonWnonDnon),0.02, "Unconscious",0.02};
variantsPlayer[] = {};
disableWeapons = 1;
};
class AmovPpneMstpSnonWnonDnon_turnR;
class GVAR(dazed_AmovPpneMstpSnonWnonDnon_turnR): AmovPpneMstpSnonWnonDnon_turnR {
actions = "ACE_Dazed";
speed = 0.5;
InterpolateTo[] = {QGVAR(dazed_AmovPpneMstpSnonWnonDnon),0.02, "Unconscious",0.02};
variantsPlayer[] = {};
disableWeapons = 1;
};
};
};
2 changes: 2 additions & 0 deletions addons/medical_engine/script_macros_medical.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
#define VAR_PAIN_SUPP QEGVAR(medical,painSuppress)
#define VAR_PERIPH_RES QEGVAR(medical,peripheralResistance)
#define VAR_UNCON "ACE_isUnconscious"
#define VAR_DAZED "ACE_isDazed"
#define VAR_OPEN_WOUNDS QEGVAR(medical,openWounds)
#define VAR_BANDAGED_WOUNDS QEGVAR(medical,bandagedWounds)
#define VAR_STITCHED_WOUNDS QEGVAR(medical,stitchedWounds)
Expand Down Expand Up @@ -202,6 +203,7 @@
#define IS_BLEEDING(unit) (GET_WOUND_BLEEDING(unit) > 0)
#define IS_IN_PAIN(unit) (unit getVariable [VAR_IN_PAIN, false])
#define IS_UNCONSCIOUS(unit) (unit getVariable [VAR_UNCON, false])
#define IS_DAZED(unit) (unit getVariable [VAR_DAZED, false])
#define GET_OPEN_WOUNDS(unit) (unit getVariable [VAR_OPEN_WOUNDS, createHashMap])
#define GET_BANDAGED_WOUNDS(unit) (unit getVariable [VAR_BANDAGED_WOUNDS, createHashMap])
#define GET_STITCHED_WOUNDS(unit) (unit getVariable [VAR_STITCHED_WOUNDS, createHashMap])
Expand Down
1 change: 1 addition & 0 deletions addons/medical_feedback/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PREP(effectBleeding);
PREP(effectBloodVolume);
PREP(effectBloodVolumeIcon);
PREP(effectDazed);
PREP(effectHeartBeat);
PREP(effectIncapacitated);
PREP(effectPain);
Expand Down
9 changes: 9 additions & 0 deletions addons/medical_feedback/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ GVAR(bloodTickCounter) = 0;
["unconscious", _unconscious] call EFUNC(common,setDisableUserInputStatus);
}] call CBA_fnc_addEventHandler;

["ace_medical_dazed", {
params ["_unit", "_dazed"];

if (_unit != ACE_player) exitWith {};
TRACE_1("player dazed eh",_dazed);

[true] call FUNC(handleEffects);
}] call CBA_fnc_addEventHandler;

// Reset volume upon death for spectators
[QEGVAR(medical,death), {
params ["_unit"];
Expand Down
20 changes: 20 additions & 0 deletions addons/medical_feedback/functions/fnc_effectDazed.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include "..\script_component.hpp"
/*
* Author: PabstMirror
* Triggers the dazed effect.
*
* Arguments:
* 0: Enable <BOOL>
*
* Return Value:
* None
*
* Example:
* [true] call ace_medical_feedback_fnc_effectDazed
*
* Public: No
*/

params ["_enable"];

GVAR(ppDazedDOF) ppEffectEnable _enable;
2 changes: 2 additions & 0 deletions addons/medical_feedback/functions/fnc_handleEffects.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ BEGIN_COUNTER(handleEffects);
private _bleedingStrength = GET_BLOOD_LOSS(ACE_player);
private _bloodVolume = GET_BLOOD_VOLUME(ACE_player);
private _unconscious = IS_UNCONSCIOUS(ACE_player);
private _dazed = IS_DAZED(ACE_player);
private _heartRate = GET_HEART_RATE(ACE_player);
private _pain = GET_PAIN_PERCEIVED(ACE_player);

Expand All @@ -42,6 +43,7 @@ if ((!GVAR(heartBeatEffectRunning)) && {_heartRate != 0} && {(_heartRate > 160)

// - Visual effects -----------------------------------------------------------
[_unconscious, 2] call FUNC(effectUnconscious);
[_dazed] call FUNC(effectDazed);
[
true,
linearConversion [BLOOD_VOLUME_CLASS_2_HEMORRHAGE, BLOOD_VOLUME_CLASS_4_HEMORRHAGE, _bloodVolume, 0, 1, true]
Expand Down
7 changes: 7 additions & 0 deletions addons/medical_feedback/functions/fnc_initEffects.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ GVAR(ppUnconsciousBlackout) = [
[1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
] call _fnc_createEffect;

// - Dazed --------------------------------------------------------------
GVAR(ppDazedDOF) = [
"DepthOfField",
817, // weird if over ~2000
[8, 5, 8]
] call _fnc_createEffect;

// - Incapacitation -----------------------------------------------------------
GVAR(ppIncapacitationGlare) = [
"ColorCorrections",
Expand Down
35 changes: 35 additions & 0 deletions addons/medical_statemachine/Statemachine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,41 @@ class ACE_Medical_StateMachine {
targetState = "FatalInjury";
events[] = {QEGVAR(medical,FatalInjury)};
};
class DazedStart {
targetState = "Dazed";
condition = QUOTE([ARR_2(_this,true)]call FUNC(conditionDazedShift));
onTransition = QUOTE([ARR_2(_this,false)] call EFUNC(medical_status,setUnconsciousState));
};
};
class Dazed {
onState = QUOTE(call FUNC(handleStateDazed));
onStateEntered = QUOTE(call FUNC(enteredStateDazed));
onStateLeaving = QUOTE(call FUNC(leftStateDazed));
class FullHeal {
targetState = "Default";
events[] = {QEGVAR(medical,FullHeal)};
};
class WakeUp {
targetState = "Injured";
condition = QEFUNC(medical_status,hasStableVitals);
events[] = {QEGVAR(medical,WakeUp)};
};
class DazedStop {
targetState = "Unconscious";
condition = QUOTE([ARR_2(_this,false)]call FUNC(conditionDazedShift));
};
class CriticalInjuryOrVitals {
targetState = "Unconscious";
events[] = {QEGVAR(medical,CriticalInjury), QEGVAR(medical,CriticalVitals), QEGVAR(medical,knockOut)};
};
class FatalTransitions {
targetState = "CardiacArrest";
events[] = {QEGVAR(medical,FatalVitals), QEGVAR(medical,Bleedout)};
};
class FatalInjury {
targetState = "FatalInjury";
events[] = {QEGVAR(medical,FatalInjury)};
};
};
class FatalInjury {
// Transition state for handling instant death from fatal injuries
Expand Down
4 changes: 4 additions & 0 deletions addons/medical_statemachine/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
PREP(conditionCardiacArrestTimer);
PREP(conditionDazedShift);
PREP(conditionExecutionDeath);
PREP(conditionSecondChance);
PREP(enteredStateCardiacArrest);
PREP(enteredStateDazed);
PREP(enteredStateDeath);
PREP(enteredStateFatalInjury);
PREP(enteredStateUnconscious);
PREP(handleStateCardiacArrest);
PREP(handleStateDazed);
PREP(handleStateDefault);
PREP(handleStateInjured);
PREP(handleStateUnconscious);
PREP(leftStateCardiacArrest);
PREP(leftStateDazed);
PREP(localityChangedEH);
PREP(resetStateDefault);
PREP(transitionSecondChance);
Loading
Loading