Fix event name overlap and macros (#6514)

This commit is contained in:
Rutger "RedBery" Meijering 2018-08-11 12:40:06 +02:00 committed by SilentSpike
parent 88238dd0b5
commit 0a97ef3cc8
9 changed files with 12 additions and 13 deletions

View File

@ -1,6 +1,5 @@
[ [
QGVAR(enabledFor), QGVAR(enabledFor),
"CHECKBOX",
"LIST", "LIST",
[LLSTRING(enableFor_title), LLSTRING(enableFor_desc)], [LLSTRING(enableFor_title), LLSTRING(enableFor_desc)],
LLSTRING(settingCategory), LLSTRING(settingCategory),

View File

@ -74,7 +74,7 @@ if (_show == 1) then {
if (HAS_TOURNIQUET_APPLIED_ON(_target,_selectionN)) then { if (HAS_TOURNIQUET_APPLIED_ON(_target,_selectionN)) then {
_genericMessages pushback [localize ELSTRING(medical_treatment,Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]]; _genericMessages pushback [localize ELSTRING(medical_treatment,Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]];
}; };
if (GVAR(showPainInMenu) && {[ACE_player, EGVAR(medical,medicSetting_PainVisualization)] call EFUNC(medical_treatment,isMedic)}) then { if (GVAR(showPainInMenu) && {[ACE_player, GVAR(painVisualization)] call EFUNC(medical_treatment,isMedic)}) then {
private _painLevel = GET_PAIN_PERCEIVED(_target); private _painLevel = GET_PAIN_PERCEIVED(_target);
if (_painLevel > 0) then { if (_painLevel > 0) then {
private _painText = localize ELSTRING(medical_treatment,Status_Pain); private _painText = localize ELSTRING(medical_treatment,Status_Pain);
@ -119,7 +119,7 @@ if (_show == 1) then {
_allInjuryTexts pushBack [format["Partial %1", _woundDescription], [1,1,1,1]]; _allInjuryTexts pushBack [format["Partial %1", _woundDescription], [1,1,1,1]];
}; };
} else { } else {
if (!EGVAR(medical_treatment,advancedBandages) || {!EGVAR(medical,woundReopening)}) then { if (!EGVAR(medical_treatment,advancedBandages) || {!EGVAR(medical_treatment,woundReopening)}) then {
private _className = (EGVAR(medical_damage,woundsData) select _woundClassID) select 6; private _className = (EGVAR(medical_damage,woundsData) select _woundClassID) select 6;
private _postfix = ["Minor", "Medium", "Large"] select _category; private _postfix = ["Minor", "Medium", "Large"] select _category;
private _woundDescription = localize format [ELSTRING(medical_damage,%1_%2), _className, _postfix]; private _woundDescription = localize format [ELSTRING(medical_damage,%1_%2), _className, _postfix];

View File

@ -51,7 +51,7 @@ if (HAS_TOURNIQUET_APPLIED_ON(_target,_selectionN)) then {
_genericMessages pushBack [localize ELSTRING(medical_treatment,Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]]; _genericMessages pushBack [localize ELSTRING(medical_treatment,Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]];
}; };
if (GVAR(showPainInMenu) && {[ACE_player, EGVAR(medical,medicSetting_PainVisualization)] call EFUNC(medical_treatment,isMedic)}) then { if (GVAR(showPainInMenu) && {[ACE_player, GVAR(painVisualization)] call EFUNC(medical_treatment,isMedic)}) then {
private _painLevel = GET_PAIN_PERCEIVED(_target); private _painLevel = GET_PAIN_PERCEIVED(_target);
if (_painLevel > 0) then { if (_painLevel > 0) then {
private _painText = localize ELSTRING(medical_treatment,Status_Pain); private _painText = localize ELSTRING(medical_treatment,Status_Pain);
@ -97,7 +97,7 @@ private _allInjuryTexts = [];
_allInjuryTexts pushBack [format["Partial %1", _woundDescription], [1,1,1,1]]; _allInjuryTexts pushBack [format["Partial %1", _woundDescription], [1,1,1,1]];
}; };
} else { } else {
if (!EGVAR(medical_treatment,advancedBandages) || {!EGVAR(medical,woundReopening)}) then { if (!EGVAR(medical_treatment,advancedBandages) || {!EGVAR(medical_treatment,woundReopening)}) then {
private _className = (EGVAR(medical_damage,woundsData) select _woundClassID) select 6; private _className = (EGVAR(medical_damage,woundsData) select _woundClassID) select 6;
private _postfix = ["Minor", "Medium", "Large"] select _category; private _postfix = ["Minor", "Medium", "Large"] select _category;
private _woundDescription = localize format [ELSTRING(medical_damage,%1_%2), _className, _postfix]; private _woundDescription = localize format [ELSTRING(medical_damage,%1_%2), _className, _postfix];

View File

@ -8,7 +8,7 @@ class ACE_Medical_StateMachine {
onState = QFUNC(handleStateDefault); onState = QFUNC(handleStateDefault);
class Injury { class Injury {
targetState = "Injured"; targetState = "Injured";
events[] = {QEGVAR(medical,injured)}; events[] = {QEGVAR(medical,injured), QEGVAR(medical,LoweredVitals)};
}; };
class CriticalInjuryOrVitals { class CriticalInjuryOrVitals {
targetState = "Unconscious"; targetState = "Unconscious";
@ -47,7 +47,7 @@ class ACE_Medical_StateMachine {
onStateEntered = QUOTE([ARR_2(_this,(true))] call EFUNC(medical_status,setUnconsciousStatemachine)); onStateEntered = QUOTE([ARR_2(_this,(true))] call EFUNC(medical_status,setUnconsciousStatemachine));
class DeathAI { class DeathAI {
targetState = "Dead"; targetState = "Dead";
condition = QUOTE(!isPlayer _this && {EGVAR(medical,unconsciousConditionAI)}); condition = QUOTE(!isPlayer _this && {GVAR(unconsciousConditionAI)});
}; };
class WakeUp { class WakeUp {
targetState = "Injured"; targetState = "Injured";

View File

@ -15,6 +15,6 @@
params ["_unit"]; params ["_unit"];
private _startTime = _unit getVariable [QGVAR(cardiacArrestStart), CBA_missionTime]; private _startTime = _unit getVariable [QGVAR(cardiacArrestStart), CBA_missionTime];
private _lifeTime = _unit getVariable [QGVAR(cardiacArrestTime), EGVAR(medical,cardiacArrestTime)]; private _lifeTime = _unit getVariable [QGVAR(cardiacArrestTime), GVAR(cardiacArrestTime)];
(CBA_missionTime - _startTime) > _lifeTime (CBA_missionTime - _startTime) > _lifeTime

View File

@ -15,7 +15,7 @@
params ["_unit"]; params ["_unit"];
// 10% possible variance in cardiac arrest time // 10% possible variance in cardiac arrest time
private _time = EGVAR(medical,cardiacArrestTime); private _time = GVAR(cardiacArrestTime);
_time = _time + random [_time*-0.1, 0, _time*0.1]; _time = _time + random [_time*-0.1, 0, _time*0.1];
_unit setVariable [QGVAR(cardiacArrestTime), _time]; _unit setVariable [QGVAR(cardiacArrestTime), _time];

View File

@ -57,7 +57,7 @@ class Cfg3DEN {
control = "Checkbox"; control = "Checkbox";
displayName = CSTRING(AssignMedicalFacility_enabled_DisplayName); displayName = CSTRING(AssignMedicalFacility_enabled_DisplayName);
tooltip = CSTRING(AssignMedicalFacility_enabled_Description); tooltip = CSTRING(AssignMedicalFacility_enabled_Description);
expression = QUOTE(_this setVariable [ARR_3(QQEQGVAR(medical,isMedicalFacility),_value,true)];); expression = QUOTE(_this setVariable [ARR_3(QQEGVAR(medical,isMedicalFacility),_value,true)];);
typeName = "BOOL"; typeName = "BOOL";
condition = "(1 - objectBrain) * (1 - objectVehicle)"; condition = "(1 - objectBrain) * (1 - objectVehicle)";
defaultValue = "false"; defaultValue = "false";

View File

@ -39,7 +39,7 @@ _openWounds set [_woundIndex, _wound];
_target setVariable [QEGVAR(medical,openWounds), _openWounds, true]; _target setVariable [QEGVAR(medical,openWounds), _openWounds, true];
// Handle the reopening of bandaged wounds // Handle the reopening of bandaged wounds
if (_impact > 0 && {GVAR(advancedBandages) && {EGVAR(medical,woundReopening)}}) then { if (_impact > 0 && {GVAR(advancedBandages) && {GVAR(woundReopening)}}) then {
[_target, _impact, _partIndex, _woundIndex, _wound, _bandage] call FUNC(handleBandageOpening); [_target, _impact, _partIndex, _woundIndex, _wound, _bandage] call FUNC(handleBandageOpening);
}; };

View File

@ -130,10 +130,10 @@ switch (true) do {
[QEGVAR(medical,CriticalVitals), _unit] call CBA_fnc_localEvent; [QEGVAR(medical,CriticalVitals), _unit] call CBA_fnc_localEvent;
}; };
case (_bloodLoss > 0): { case (_bloodLoss > 0): {
[QEGVAR(medical,Injury), _unit] call CBA_fnc_localEvent; [QEGVAR(medical,LoweredVitals), _unit] call CBA_fnc_localEvent;
}; };
case (_inPain): { case (_inPain): {
[QEGVAR(medical,Injury), _unit] call CBA_fnc_localEvent; [QEGVAR(medical,LoweredVitals), _unit] call CBA_fnc_localEvent;
}; };
}; };