Added medical settings module

This commit is contained in:
Glowbal 2015-03-06 22:54:44 +01:00
parent e2acb2385b
commit f322884176
14 changed files with 119 additions and 12 deletions

View File

@ -0,0 +1,17 @@
class ACE_Settings {
class GVAR(level) {
value = 1;
typeName = "SCALAR";
values[] = {"Disabled", "Basic", "Advanced"};
};
class GVAR(medicSetting) {
value = 1;
typeName = "SCALAR";
values[] = {"Disabled", "Normal", "Advanced"};
};
class GVAR(enableFor) {
value = 0;
typeName = "SCALAR";
values[] = {"Players only", "Players and AI"};
};
};

View File

@ -0,0 +1,6 @@
class CfgFactionClasses {
class NO_CATEGORY;
class ADDON: NO_CATEGORY {
displayName = "ACE Medical";
};
};

View File

@ -1,5 +1,87 @@
class CfgVehicles {
class Logic;
class Module_F: Logic {
class ArgumentsBaseUnits {
};
};
class ACE_moduleMedicalSettings: Module_F {
scope = 2;
displayName = "Medical Settings [ACE]";
icon = QUOTE(PATHTOF(data\ACE_medical_module.paa));
category = "ACE_medical";
function = QUOTE(DFUNC(moduleMedicalSettings));
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
author = "Glowbal";
class Arguments {
class level {
displayName = "Medical Level";
description = "What is the medical simulation level?";
typeName = "NUMBER";
class values {
class disable {
name = "Disabled";
value = -1;
};
class normal {
name = "Basic";
value = 0;
default = 1;
};
class full {
name = "Advanced";
value = 1;
};
};
};
class medicSetting {
displayName = "Medics setting";
description = "What is the level of detail prefered for medics?";
typeName = "NUMBER";
class values {
class disable {
name = "Disable medics";
value = -1;
};
class normal {
name = "Normal";
value = 0;
default = 1;
};
class full {
name = "Advanced";
value = 1;
};
};
};
class enableFor {
displayName = "Enabled for";
description = "Select what units the medical system will be enabled for";
typeName = "NUMBER";
class values {
class playableUnits {
name = "Players only";
value = 0;
default = 1;
};
class playableUnitsAndAI {
name = "Players and AI";
value = 1;
};
};
};
};
class ModuleDescription {
description = "Provides a medical system for both players and AI.";
sync[] = {};
};
};
#define ARM_LEG_ARMOR_DEFAULT 2
#define ARM_LEG_ARMOR_BETTER 3
#define ARM_LEG_ARMOR_CSAT 4

View File

@ -141,7 +141,7 @@ if (isNil QGVAR(level)) then {
// HEARTRATE BASED EFFECTS
[{
_heartRate = ACE_player getVariable [QGVAR(heartRate), 70];
if (GVAR(level) == 0) then {
if (GVAR(level) == 1) then {
_heartRate = 60 + 40 * (ACE_player getVariable [QGVAR(pain), 0]);
};
if (_heartRate <= 0) exitwith {};
@ -200,7 +200,7 @@ if (isNil QGVAR(level)) then {
};
};
if (GVAR(level) > 0 && {_heartRate > 0}) then {
if (GVAR(level) >= 2 && {_heartRate > 0}) then {
_minTime = 60 / _heartRate;
if (time - GVAR(lastHeartBeatSound) > _minTime) then {
GVAR(lastHeartBeatSound) = time;

View File

@ -13,8 +13,10 @@ class CfgPatches {
};
#include "CfgEventHandlers.hpp"
#include "CfgFactionClasses.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "CFgSounds.hpp"
#include "ACE_Medical_Treatments.hpp"
#include "ACE_Settings.hpp"
#include "UI\RscTitles.hpp"

View File

@ -23,7 +23,7 @@ _selectionName = _this select 2;
_className = _this select 3;
_config = (ConfigFile >> "ACE_Medical_Treatments" >> "Basic" >> _className);
if (GVAR(level)>=1) then {
if (GVAR(level)>=2) then {
_config = (ConfigFile >> "ACE_Medical_Treatments" >> "Advanced" >> _className);
};
if !(isClass _config) exitwith {false};

View File

@ -51,7 +51,7 @@ if (_show) then {
};
_selectionBloodLoss = [0,0,0,0,0,0];
if (GVAR(level) >= 1) then {
if (GVAR(level) >= 2) then {
_openWounds = _target getvariable [QGVAR(openWounds), []];
private "_amountOf";
{

View File

@ -18,7 +18,7 @@ private ["_totalBloodLoss","_tourniquets","_openWounds", "_value", "_cardiacOutp
_totalBloodLoss = 0;
// Advanced medical bloodloss handling
if (GVAR(level) >= 1) then {
if (GVAR(level) >= 2) then {
_tourniquets = _this getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
_openWounds = _this getvariable [QGVAR(openWounds), []];
//_cardiacOutput = [_this] call FUNC(getCardiacOutput);

View File

@ -16,7 +16,7 @@
private ["_unit","_return"];
_unit = _this select 0;
if (GVAR(level) == 0) exitwith {true};
if (GVAR(level) == 1) exitwith {true};
if (isnil QGVAR(unconsciousConditions)) then {
GVAR(unconsciousConditions) = [];
};

View File

@ -38,11 +38,11 @@ _hitSelections = ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"];
if !(_selection in (_hitSelections + [""])) exitWith {0};
_damageReturn = _damage;
if (GVAR(level) == 0) then {
if (GVAR(level) == 1) then {
_damageReturn = (_this + [_damageReturn]) call FUNC(handleDamage_basic);
};
if (GVAR(level) >= 1) then {
if (GVAR(level) >= 2) then {
[_unit, _selection, _damage, _source, _projectile, _damageReturn] call FUNC(handleDamage_caching);
if (_damageReturn > 0.9) then {

View File

@ -68,7 +68,7 @@ if ([_unit] call EFUNC(common,isAwake)) then {
};
// handle advanced medical, with vitals
if ((missionNamespace getvariable[QGVAR(level), 0]) > 0) exitwith {
if (GVAR(level) >= 2) exitwith {
// Set the vitals
_heartRate = (_unit getvariable [QGVAR(heartRate), 0]) + ([_unit] call FUNC(getHeartRateChange));

View File

@ -25,7 +25,7 @@ _className = _this select 3;
if !(_target isKindOf "CAManBase") exitWith {false};
_config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className);
if (GVAR(level) >= 1) then {
if (GVAR(level) >= 2) then {
_config = (configFile >> "ACE_Medical_Actions" >> "Advanced" >> _className);
};
if !(isClass _config) exitwith {false};

View File

@ -35,7 +35,7 @@ _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil];
// Record specific callback
_config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className);
if (GVAR(level) >= 1) then {
if (GVAR(level) >= 2) then {
_config = (configFile >> "ACE_Medical_Actions" >> "Advanced" >> _className);
};

View File

@ -35,7 +35,7 @@ _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil];
// Record specific callback
_config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className);
if (GVAR(level) >= 1) then {
if (GVAR(level) >= 2) then {
_config = (configFile >> "ACE_Medical_Actions" >> "Advanced" >> _className);
};