Merge pull request #861 from acemod/medicalImprovements

Medical improvements and fixes round 3
This commit is contained in:
Glowbal 2015-04-30 00:03:09 +02:00
commit 1218ee78cb
22 changed files with 298 additions and 154 deletions

View File

@ -398,6 +398,12 @@ class CfgVehicles {
selection = "";
distance = 10;
condition = "true";
class ACE_Passengers {
displayName = "$STR_ACE_Interaction_Passengers";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call DFUNC(addPassengersActions));
};
};
};
class ACE_SelfActions {
@ -416,6 +422,12 @@ class CfgVehicles {
selection = "";
distance = 10;
condition = "true";
class ACE_Passengers {
displayName = "$STR_ACE_Interaction_Passengers";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call DFUNC(addPassengersActions));
};
};
};
class ACE_SelfActions {
@ -436,6 +448,12 @@ class CfgVehicles {
selection = "";
distance = 10;
condition = "true";
class ACE_Passengers {
displayName = "$STR_ACE_Interaction_Passengers";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call DFUNC(addPassengersActions));
};
};
};
class ACE_SelfActions {
@ -454,6 +472,12 @@ class CfgVehicles {
selection = "";
distance = 10;
condition = "true";
class ACE_Passengers {
displayName = "$STR_ACE_Interaction_Passengers";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call DFUNC(addPassengersActions));
};
};
};
class ACE_SelfActions {
@ -483,6 +507,12 @@ class CfgVehicles {
showDisabled = 0;
priority = -1;
};
class ACE_Passengers {
displayName = "$STR_ACE_Interaction_Passengers";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call DFUNC(addPassengersActions));
};
};
};
class ACE_SelfActions {
@ -502,6 +532,12 @@ class CfgVehicles {
selection = "gunnerview";
distance = 2;
condition = "true";
class ACE_Passengers {
displayName = "$STR_ACE_Interaction_Passengers";
condition = "true";
statement = "";
insertChildren = QUOTE(_this call DFUNC(addPassengersActions));
};
};
};
class ACE_SelfActions {

View File

@ -196,7 +196,7 @@ class ACE_Medical_Actions {
};
class SurgicalKit: fieldDressing {
displayName = "";
displayNameProgress = "";
displayNameProgress = "$STR_ACE_Medical_TreatmentAction";
items[] = {"ACE_surgicalKit"};
treatmentLocations[] = {QGVAR(useLocation_SurgicalKit)};
requiredMedic = QGVAR(medicSetting_SurgicalKit);
@ -208,7 +208,7 @@ class ACE_Medical_Actions {
};
class PersonalAidKit: fieldDressing {
displayName = "";
displayNameProgress = "";
displayNameProgress = "$STR_ACE_Medical_TreatmentAction";
items[] = {"ACE_personalAidKit"};
treatmentLocations[] = {QGVAR(useLocation_PAK)};
requiredMedic = QGVAR(medicSetting_PAK);
@ -225,7 +225,7 @@ class ACE_Medical_Actions {
};
class CheckPulse: fieldDressing {
displayName = "";
displayNameProgress = "";
displayNameProgress = "$STR_ACE_MEDICAL_CHECK_PULSE_CONTENT";
treatmentLocations[] = {"All"};
requiredMedic = 0;
treatmentTime = 2;
@ -240,9 +240,11 @@ class ACE_Medical_Actions {
};
class CheckBloodPressure: CheckPulse {
callbackSuccess = QUOTE(DFUNC(actionCheckBloodPressure));
displayNameProgress = "$STR_ACE_MEDICAL_CHECK_BLOODPRESSURE_CONTENT";
};
class CheckResponse: CheckPulse {
callbackSuccess = QUOTE(DFUNC(actionCheckResponse));
displayNameProgress = "$STR_ACE_MEDICAL_CHECK_RESPONSE_CONTENT";
};
class RemoveTourniquet: CheckPulse {
treatmentTime = 2.5;

View File

@ -59,6 +59,11 @@ class ACE_Settings {
typeName = "BOOL";
value = 0;
};
class GVAR(enableRevive) {
typeName = "SCALAR";
value = 0;
values[] = {"Disabled", "Players only", "Players and AI"};
};
class GVAR(maxReviveTime) {
typeName = "SCALAR";
value = 120;

View File

@ -37,47 +37,38 @@ class CfgVehicles {
};
};
};
class enableFor {
displayName = "Enabled for";
description = "Select what units the medical system will be enabled for (Adv only)";
class medicSetting {
displayName = "Medics setting";
description = "What is the level of detail prefered for medics?";
typeName = "NUMBER";
class values {
class playableUnits {
name = "Players only.";
class disable {
name = "Disable medics";
value = 0;
};
class normal {
name = "Normal";
value = 1;
default = 1;
};
class playableUnitsAndAI {
name = "Players and AI";
value = 1;
class full {
name = "Advanced";
value = 2;
};
};
};
// TODO Disabled until the features are implemented
/*class enableAirway {
displayName = "Enable Airway";
description = "Enable Advanced medical Airway (Adv only)";
typeName = "BOOL";
defaultValue = 0;
};
class enableFractures {
displayName = "Enable Fractures";
description = "Enable Advanced medical Fractures (Adv only)";
typeName = "BOOL";
defaultValue = 0;
};*/
class enableAdvancedWounds {
displayName = "Enable Advanced wounds";
description = "Allow reopening of bandaged wounds? (Adv only)";
typeName = "BOOL";
defaultValue = 0;
};
class enableVehicleCrashes {
displayName = "Vehicle Crashes";
description = "Do units take damage from a vehicle crash?";
class allowLitterCreation {
displayName = "Enable Litter";
description = "Enable litter being created upon treatment";
typeName = "BOOL";
defaultValue = 1;
};
class litterCleanUpDelay {
displayName = "Life time of litter objects";
description = "How long should litter objects stay? In seconds. -1 is forever.";
typeName = "NUMBER";
defaultValue = 1800;
};
class enableScreams {
displayName = "Enable Screams";
description = "Enable screaming by injuried units";
@ -141,80 +132,58 @@ class CfgVehicles {
};
};
class ACE_moduleTreatmentSettings: ACE_Module {
class ACE_moduleAdvancedMedicalSettings: ACE_Module {
scope = 2;
displayName = "Treatment Settings [ACE]";
displayName = "Advanced Medical Settings [ACE]";
icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa));
category = "ACE_medical";
function = QUOTE(FUNC(moduleTreatmentConfiguration));
function = QUOTE(FUNC(moduleAdvancedMedicalSettings));
functionPriority = 10;
isGlobal = 2;
isTriggerActivated = 0;
isDisposable = 0;
author = "$STR_ACE_Common_ACETeam";
class Arguments {
class medicSetting {
displayName = "Medics setting";
description = "What is the level of detail prefered for medics?";
class enableFor {
displayName = "Enabled for";
description = "Select what units the advanced medical system will be enabled for";
typeName = "NUMBER";
class values {
class disable {
name = "Disable medics";
class playableUnits {
name = "Players only.";
value = 0;
};
class normal {
name = "Normal";
value = 1;
default = 1;
};
class full {
name = "Advanced";
value = 2;
class playableUnitsAndAI {
name = "Players and AI";
value = 1;
};
};
};
class maxReviveTime {
displayName = "Max Revive time";
description = "Max amount of seconds a unit can spend in revive state";
typeName = "NUMBER";
defaultValue = 120;
class enableAdvancedWounds {
displayName = "Enable Advanced wounds";
description = "Allow reopening of bandaged wounds?";
typeName = "BOOL";
defaultValue = 0;
};
class amountOfReviveLives {
displayName = "Max Revive lives";
description = "Max amount of lives a unit. 0 or -1 is disabled.";
typeName = "NUMBER";
defaultValue = -1;
};
class enableOverdosing {
displayName = "Enable Overdosing";
description = "Enable overdosing of medications";
class enableVehicleCrashes {
displayName = "Vehicle Crashes";
description = "Do units take damage from a vehicle crash?";
typeName = "BOOL";
defaultValue = 1;
};
class allowLitterCreation {
displayName = "Enable Litter";
description = "Enable litter being created upon treatment";
typeName = "BOOL";
defaultValue = 1;
};
class litterCleanUpDelay {
displayName = "Life time of litter objects";
description = "How long should litter objects stay? In seconds. -1 is forever.";
typeName = "NUMBER";
defaultValue = 1800;
};
class medicSetting_PAK {
displayName = "Allow PAK (Adv)";
displayName = "Allow PAK";
description = "Who can use the PAK for full heal?";
typeName = "NUMBER";
class values {
class anyone { name = "Anyone"; value = 0; };
class Medic { name = "Medics only"; value = 1; default = 1; };
class Special { name = "Doctors only (Adv)"; value = 2; };
class Special { name = "Doctors only"; value = 2; };
};
};
class consumeItem_PAK {
displayName = "Remove PAK on use (Adv)";
displayName = "Remove PAK on use";
description = "Should PAK be removed on usage?";
typeName = "NUMBER";
class values {
@ -223,7 +192,7 @@ class CfgVehicles {
};
};
class useLocation_PAK {
displayName = "Locations PAK (Adv)";
displayName = "Locations PAK";
description = "Where can the personal aid kit be used?";
typeName = "NUMBER";
class values {
@ -254,6 +223,47 @@ class CfgVehicles {
};
};
class ACE_moduleReviveSettings: ACE_Module {
scope = 2;
displayName = "Revive Settings [ACE]";
icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa));
category = "ACE_medical";
function = QUOTE(DFUNC(moduleReviveSettings));
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
author = "$STR_ACE_Common_ACETeam";
class Arguments {
class enableRevive {
displayName = "Enable Revive";
description = "Enable a basic revive system";
typeName = "NUMBER";
defaultValue = 0;
class values {
class disable { name = "Disabled"; value = 0; default = 1;};
class playerOnly { name = "Player only"; value = 1; };
class playerAndAI { name = "Player & AI"; value = 2; };
};
};
class maxReviveTime {
displayName = "Max Revive time";
description = "Max amount of seconds a unit can spend in revive state";
typeName = "NUMBER";
defaultValue = 120;
};
class amountOfReviveLives {
displayName = "Max Revive lives";
description = "Max amount of lives a unit. 0 or -1 is disabled.";
typeName = "NUMBER";
defaultValue = -1;
};
};
class ModuleDescription {
description = "Provides a medical system for both players and AI.";
sync[] = {};
};
};
class ACE_moduleAssignMedicRoles: Module_F {
scope = 2;
displayName = "Set Medic Class [ACE]";
@ -436,7 +446,7 @@ class CfgVehicles {
displayName = "$STR_ACE_MEDICAL_ACTIONS_Medical";
runOnHover = 1;
exceptions[] = {"isNotInside"};
condition = QUOTE(vehicle _target != _target);
condition = QUOTE(vehicle _target != _target && vehicle _target == vehicle _player);
statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation));
icon = PATHTOF(UI\icons\medical_cross.paa);
@ -462,7 +472,7 @@ class CfgVehicles {
showDisabled = 0;
priority = 2;
icon = PATHTOF(UI\icons\medical_cross.paa);
exceptions[] = {"isNotDragging", "isNotCarrying"};
exceptions[] = {"isNotDragging", "isNotCarrying", "isNotInside"};
};
};
};

View File

@ -266,6 +266,12 @@ if (USE_WOUND_EVENT_SYNC) then {
[ACE_player] call FUNC(itemCheck);
}] call EFUNC(common,addEventHandler);
// Networked litter
[QGVAR(createLitter), FUNC(handleCreateLitter), GVAR(litterCleanUpDelay)] call EFUNC(common,addSyncedEventHandler);
if (hasInterface) then {
["PlayerJip", {
diag_log format["[ACE] JIP Medical init for player"];
[player] call FUNC(init);
}] call FUNC(addEventHandler);
};

View File

@ -80,8 +80,10 @@ PREP(treatmentAdvanced_medication);
PREP(treatmentAdvanced_medicationLocal);
PREP(treatmentBasic_bandage);
PREP(treatmentBasic_bloodbag);
PREP(treatmentBasic_bloodbagLocal);
PREP(treatmentBasic_epipen);
PREP(treatmentBasic_morphine);
PREP(treatmentBasic_morphineLocal);
PREP(treatmentIV);
PREP(treatmentIVLocal);
PREP(treatmentTourniquet);
@ -92,10 +94,11 @@ PREP(displayPatientInformation);
PREP(displayTriageCard);
PREP(dropDownTriageCard);
PREP(moduleMedicalSettings);
PREP(moduleAdvancedMedicalSettings);
PREP(moduleReviveSettings);
PREP(moduleAssignMedicRoles);
PREP(moduleAssignMedicalVehicle);
PREP(moduleAssignMedicalFacility);
PREP(moduleTreatmentConfiguration);
PREP(copyDeadBody);
PREP(requestWoundSync);
PREP(unconsciousPFH);

View File

@ -26,8 +26,12 @@ if (alive _target) then {
} else {
_genericMessages pushback "STR_ACE_MEDICAL_diagnoseDead";
};
if (_target getvariable[QGVAR(hasLostBlood), false]) then {
_genericMessages pushback "STR_ACE_MEDICAL_lostBlood";
if (_target getvariable[QGVAR(hasLostBlood), 0] > 0) then {
if (_target getvariable[QGVAR(hasLostBlood), 0] > 1) then {
_genericMessages pushback "STR_ACE_MEDICAL_lostBloodALot";
} else {
_genericMessages pushback "STR_ACE_MEDICAL_lostBlood";
};
} else {
_genericMessages pushback "STR_ACE_MEDICAL_noBloodloss";
};

View File

@ -23,16 +23,10 @@ if ([_target] call EFUNC(common,isAwake)) exitwith {
["displayTextStructured", [_caller], [["This person (%1) is awake and cannot be loaded", [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent);
};
if ([_target] call FUNC(isBeingCarried)) then {
[_caller, _target] call FUNC(dropObject_carry);
[_caller, _target] call EFUNC(dragging,dropObject_carry);
};
if ([_target] call FUNC(isBeingDragged)) then {
[_caller, _target] call FUNC(dropObject);
[_caller, _target] call EFUNC(dragging,dropObject);
};
_vehicle = [_caller, _target] call EFUNC(common,loadPerson);
if (!isNull _vehicle) then {
if (!isnil QGVAR(DROP_ADDACTION)) then {
_caller removeAction GVAR(DROP_ADDACTION);
GVAR(DROP_ADDACTION) = nil;
};
};

View File

@ -57,7 +57,7 @@ if (_show) then {
if (_target getvariable[QGVAR(isBleeding), false]) then {
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_BLEEDING", [1, 0.1, 0.1, 1]];
};
if (_target getvariable[QGVAR(hasLostBlood), false]) then {
if (_target getvariable[QGVAR(hasLostBlood), 0] > 1) then {
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_LOST_BLOOD", [1, 0.1, 0.1, 1]];
};

View File

@ -37,46 +37,55 @@ if !(_selection in (GVAR(SELECTIONS) + [""])) exitWith {0};
_damageReturn = _damage;
if (GVAR(level) < 2) then {
_damageReturn = _this call FUNC(handleDamage_basic);
};
if (GVAR(level) >= 2) then {
} else {
if !([_unit] call FUNC(hasMedicalEnabled)) exitwith {
// Because of the config changes, we cannot properly disable the medical system for a unit.
// lets use basic for the time being..
_damageReturn = _this call FUNC(handleDamage_basic);
};
_newDamage = _this call FUNC(handleDamage_caching);
_typeOfDamage = [_projectile] call FUNC(getTypeOfDamage);
if (_damageReturn > 0.9) then {
_typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage);
_minLethalDamage = 0.01;
if (_typeIndex >= 0) then {
_minLethalDamage = GVAR(minLethalDamages) select _typeIndex;
};
_typeOfDamage = [_projectile] call FUNC(getTypeOfDamage);
_typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage);
_minLethalDamage = 0.01;
if (_typeIndex >= 0) then {
_minLethalDamage = GVAR(minLethalDamages) select _typeIndex;
if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _source} && {_projectile == ""} && {_selection == ""}) then {
if (GVAR(enableVehicleCrashes)) then {
_selection = GVAR(SELECTIONS) select (floor(random(count GVAR(SELECTIONS))));
};
};
if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _source} && {_projectile == ""} && {_selection == ""}) then {
if (GVAR(enableVehicleCrashes)) then {
_selection = GVAR(SELECTIONS) select (floor(random(count GVAR(SELECTIONS))));
};
if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)} || !alive vehicle _unit) then {
if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)])) exitwith {
_damageReturn = 0.9;
};
if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)} && {_selection in ["", "head", "body"]}) then {
if ([_unit] call FUNC(setDead)) then {
_damageReturn = 1;
} else {
_damageReturn = 0.89;
};
if ([_unit] call FUNC(setDead)) then {
_damageReturn = 1;
} else {
_damageReturn = 0.89;
_damageReturn = _damageReturn min 0.89;
};
} else {
_damageReturn = _damageReturn min 0.89;
};
};
[_unit] call FUNC(addToInjuredCollection);
if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith {
if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitWith {
if (_damageReturn >= 0.9 && {_selection in ["", "head", "body"]}) exitWith {
if (_unit getvariable ["ACE_isUnconscious", false]) exitwith {
[_unit] call FUNC(setDead);
0.89
};
[{ [_this select 0, true] call FUNC(setUnconscious); }, [_unit]] call EFUNC(common,execNextFrame);
0.89
};
_damageReturn min 0.89;
};
if (((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]) > 0) && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith {
if (vehicle _unit != _unit and {damage _vehicle >= 1}) then {
// @todo
// [_unit] call FUNC(unload);

View File

@ -33,13 +33,19 @@ _bloodVolume = _bloodVolume max 0;
_unit setvariable [QGVAR(bloodVolume), _bloodVolume, _syncValues];
// Set variables for synchronizing information across the net
if (_bloodVolume < 90) then {
if !(_unit getvariable [QGVAR(hasLostBlood), false]) then {
_unit setvariable [QGVAR(hasLostBlood), true, true];
};
if (_bloodVolume < 100) then {
if ((_bloodVolume < 90 && (GVAR(level) == 2)) || _bloodVolume <= 45) then {
if (_unit getvariable [QGVAR(hasLostBlood), 0] != 2) then {
_unit setvariable [QGVAR(hasLostBlood), 2, true];
};
} else {
if (_unit getvariable [QGVAR(hasLostBlood), 0] != 1) then {
_unit setvariable [QGVAR(hasLostBlood), 1, true];
};
}
} else {
if (_unit getvariable [QGVAR(hasLostBlood),false]) then {
_unit setvariable [QGVAR(hasLostBlood), false, true];
if (_unit getvariable [QGVAR(hasLostBlood), 0] != 0) then {
_unit setvariable [QGVAR(hasLostBlood), 0, true];
};
};
@ -66,13 +72,13 @@ if (_painStatus > 0) then {
if (GVAR(level) == 1) then {
// reduce pain
if (_unit getVariable [QGVAR(pain), 0] > 0) then {
_unit setVariable [QGVAR(pain), ((_unit getVariable QGVAR(pain)) - 0.001 * _interval) max 0, _syncValues];
if (_painStatus > 0) then {
_unit setVariable [QGVAR(pain), (_painStatus - 0.001 * _interval) max 0, _syncValues];
};
// reduce painkillers
if (_unit getVariable [QGVAR(morphine), 0] > 0) then {
_unit setVariable [QGVAR(morphine), ((_unit getVariable QGVAR(morphine)) - 0.0015 * _interval) max 0, _syncValues];
_unit setVariable [QGVAR(morphine), ((_unit getVariable [QGVAR(morphine), 0]) - 0.0015 * _interval) max 0, _syncValues];
};
// bleeding

View File

@ -60,7 +60,7 @@ _unit setvariable [QGVAR(airwayCollapsed), false];
_unit setvariable [QGVAR(addedToUnitLoop), false, true];
_unit setvariable [QGVAR(inCardiacArrest), false, true];
_unit setVariable ["ACE_isUnconscious", false, true];
_unit setvariable [QGVAR(hasLostBlood), false, true];
_unit setvariable [QGVAR(hasLostBlood), 0, true];
_unit setvariable [QGVAR(isBleeding), false, true];
_unit setvariable [QGVAR(hasPain), false, true];
_unit setvariable [QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives), true];

View File

@ -22,12 +22,11 @@ _activated = _this select 2;
if !(_activated) exitWith {};
[_logic, QGVAR(medicSetting), "medicSetting"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(maxReviveTime), "maxReviveTime"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(amountOfReviveLives), "amountOfReviveLives"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(enableOverdosing), "enableOverdosing"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(allowLitterCreation), "allowLitterCreation"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(litterCleanUpDelay), "litterCleanUpDelay"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(enableFor), "enableFor"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(enableAdvancedWounds), "enableAdvancedWounds"] call EFUNC(common,readSettingFromModule);
// TODO disabled until implemented
// [_logic, QGVAR(enableAirway), "enableAirway"] call EFUNC(common,readSettingFromModule);
// [_logic, QGVAR(enableFractures), "enableFractures"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(medicSetting_PAK), "medicSetting_PAK"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(medicSetting_SurgicalKit), "medicSetting_SurgicalKit"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(consumeItem_PAK), "consumeItem_PAK"] call EFUNC(common,readSettingFromModule);

View File

@ -23,11 +23,9 @@ _activated = _this select 2;
if !(_activated) exitWith {};
[_logic, QGVAR(level), "level"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(enableFor), "enableFor"] call EFUNC(common,readSettingFromModule);
// TODO disabled until implemented
// [_logic, QGVAR(enableAirway), "enableAirway"] call EFUNC(common,readSettingFromModule);
// [_logic, QGVAR(enableFractures), "enableFractures"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(enableAdvancedWounds), "enableAdvancedWounds"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(medicSetting), "medicSetting"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(allowLitterCreation), "allowLitterCreation"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(litterCleanUpDelay), "litterCleanUpDelay"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(enableScreams), "enableScreams"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(playerDamageThreshold), "playerDamageThreshold"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(AIDamageThreshold), "AIDamageThreshold"] call EFUNC(common,readSettingFromModule);

View File

@ -0,0 +1,27 @@
/*
* Author: Glowbal
* Module for adjusting the medical revive settings
*
* Arguments:
* 0: The module logic <LOGIC>
* 1: units <ARRAY>
* 2: activated <BOOL>
*
* Return Value:
* None <NIL>
*
* Public: No
*/
#include "script_component.hpp"
private ["_logic", "_units", "_activated"];
_logic = _this select 0;
_units = _this select 1;
_activated = _this select 2;
if !(_activated) exitWith {};
[_logic, QGVAR(maxReviveTime), "maxReviveTime"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(amountOfReviveLives), "amountOfReviveLives"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(enableRevive), "enableRevive"] call EFUNC(common,readSettingFromModule);

View File

@ -13,7 +13,7 @@
#include "script_component.hpp"
private ["_unit", "_force"];
private ["_unit", "_force", "_reviveVal"];
_unit = _this select 0;
_force = false;
if (count _this >= 2) then {
@ -26,7 +26,8 @@ if (!local _unit) exitwith {
false;
};
if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) && !_force) exitwith {
_reviveVal = _unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)];
if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == 2)) && !_force) exitwith {
if (_unit getvariable [QGVAR(inReviveState), false]) exitwith {
if (GVAR(amountOfReviveLives) > 0) then {
_lifesLeft = _unit getvariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)];

View File

@ -55,7 +55,7 @@ if (alive _target) exitwith {
_target setvariable [QGVAR(inCardiacArrest), false, true];
_target setvariable [QGVAR(inReviveState), false, true];
_target setVariable ["ACE_isUnconscious", false, true];
_target setvariable [QGVAR(hasLostBlood), false, true];
_target setvariable [QGVAR(hasLostBlood), 0, true];
_target setvariable [QGVAR(isBleeding), false, true];
_target setvariable [QGVAR(hasPain), false, true];

View File

@ -15,12 +15,9 @@
*/
#include "script_component.hpp"
#define BLOODBAGHEAL 70
private ["_caller", "_target","_className","_blood"];
private ["_caller", "_target"];
_caller = _this select 0;
_target = _this select 1;
_className = _this select 3;
_blood = ((_target getVariable [QGVAR(bloodVolume), 100]) + BLOODBAGHEAL) min 100;
_target setVariable [QGVAR(bloodVolume), _blood, true];
[[_target], QUOTE(DFUNC(treatmentBasic_bloodbagLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -0,0 +1,21 @@
/*
* Author: KoffeinFlummi
* Local callback when the bloodbag treatment is complete
*
* Arguments:
* 0: The patient <OBJECT>
*
* Return Value:
* nil
*
* Public: No
*/
#include "script_component.hpp"
#define BLOODBAGHEAL 70
private ["_target","_blood"];
_target = _this select 0;
_blood = ((_target getVariable [QGVAR(bloodVolume), 100]) + BLOODBAGHEAL) min 100;
_target setVariable [QGVAR(bloodVolume), _blood, true];

View File

@ -17,15 +17,8 @@
#include "script_component.hpp"
#define MORPHINEHEAL 0.4
private ["_caller", "_target","_className","_blood","_morphine","_pain"];
private ["_caller", "_target"];
_caller = _this select 0;
_target = _this select 1;
_className = _this select 3;
// reduce pain, pain sensitivity
_morphine = ((_target getVariable [QGVAR(morphine), 0]) + MORPHINEHEAL) min 1;
_target setVariable [QGVAR(morphine), _morphine, true];
_pain = ((_target getVariable [QGVAR(pain), 0]) - MORPHINEHEAL) max 0;
_target setVariable [QGVAR(pain), _pain, true];
// @todo overdose
[[_target], QUOTE(DFUNC(treatmentBasic_morphineLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -0,0 +1,27 @@
/*
* Author: KoffeinFlummi
* Local callback when the morphine treatment is complete
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
*
* Return Value:
* nil
*
* Public: No
*/
#include "script_component.hpp"
#define MORPHINEHEAL 0.4
private ["_target", "_morphine", "_pain"];
_target = _this select 0;
// reduce pain, pain sensitivity
_morphine = ((_target getVariable [QGVAR(morphine), 0]) + MORPHINEHEAL) min 1;
_target setVariable [QGVAR(morphine), _morphine, true];
_pain = ((_target getVariable [QGVAR(pain), 0]) - MORPHINEHEAL) max 0;
_target setVariable [QGVAR(pain), _pain, true];
// @todo overdose

View File

@ -1606,6 +1606,9 @@
<French>Il à perdu du sang</French>
<Polish>Stracił trochę krwi</Polish>
</Key>
<Key ID="STR_ACE_MEDICAL_lostBloodALot">
<English>He's lost a lot of blood</English>
</Key>
<Key ID="STR_ACE_MEDICAL_noBloodloss">
<English>He hasn't lost blood</English>
<Russian>Нет кровопотери</Russian>
@ -2202,5 +2205,8 @@
<Polish>Zkłamana kość udowa</Polish>
<French>Femur Cassé</French>
</Key>
<Key ID="STR_ACE_Medical_TreatmentAction">
<English>Treating...</English>
</Key>
</Package>
</Project>