mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Updated open wounds injuries to newest CMS version.
This commit is contained in:
parent
aadb289962
commit
b8be7775bd
@ -1,5 +1,12 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
#define ADD_INJURY(BODYPART,TYPE,AMOUNT) _woundID = 1; \
|
||||||
|
_amountOf = count _openWounds; \
|
||||||
|
if (_amountOf > 0) then { _woundID = (_openWounds select (_amountOf - 1) select 0) + 1; }; \
|
||||||
|
for "_i" from 1 to AMOUNT /* step +1 */ do { \
|
||||||
|
_openWounds pushback [_woundID, _woundType, _bodyPartn, 1 /* percentage treated */]; \
|
||||||
|
_woundID = _woundID + 1; \
|
||||||
|
};
|
||||||
|
|
||||||
private ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage", "_bodyPartn", "_woundType"];
|
private ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage", "_bodyPartn", "_woundType"];
|
||||||
_unit = _this select 0;
|
_unit = _this select 0;
|
||||||
@ -11,48 +18,47 @@ _bodyPartn = [_selectionName] call FUNC(selectionNameToNumber);
|
|||||||
|
|
||||||
_woundType = 1;
|
_woundType = 1;
|
||||||
if (_amountOfDamage > 0.05) then {
|
if (_amountOfDamage > 0.05) then {
|
||||||
|
private ["_wounds", "_woundID", "_amountOf"];
|
||||||
|
_openWounds = _unit getvariable[QGVAR(openWounds), []];
|
||||||
// TODO specify openWounds based off typeOfInjury details better.
|
// TODO specify openWounds based off typeOfInjury details better.
|
||||||
switch (_typeOfDamage) do {
|
switch (toLower _typeOfInjury) do {
|
||||||
case "Bullet": {
|
case "bullet": {
|
||||||
_woundType = round(random(2));
|
ADD_INJURY(_bodyPartn, round(random(2)), 1);
|
||||||
};
|
};
|
||||||
case "Grenade": {
|
case "grenade": {
|
||||||
_woundType = round(random(2));
|
ADD_INJURY(_bodyPartn, round(random(2)), 1);
|
||||||
if (_woundType < 1) then {
|
for "_i" from 0 to round(random(3)) /* step +1 */ do {
|
||||||
_woundType = 1;
|
ADD_INJURY(round(random(6)), round(random(2)), 1);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
case "Explosive": {
|
case "explosive": {
|
||||||
_woundType = round(random(2));
|
ADD_INJURY(_bodyPartn, round(random(2)), 1);
|
||||||
if (_woundType < 1) then {
|
for "_i" from 0 to round(random(4)) /* step +1 */ do {
|
||||||
_woundType = 1;
|
ADD_INJURY(round(random(6)), round(random(2)), 1);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
case "Shell": {
|
case "shell": {
|
||||||
_woundType = round(random(2));
|
ADD_INJURY(_bodyPartn, round(random(2)), 1);
|
||||||
if (_woundType < 1) then {
|
for "_i" from 0 to round(random(5)) /* step +1 */ do {
|
||||||
_woundType = 1;
|
ADD_INJURY(round(random(6)), round(random(2)), 1);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
case "Unknown": {
|
case "backblast": {
|
||||||
_woundType = round(random(1));
|
if (random(1)>=0.5) then{
|
||||||
|
ADD_INJURY(_bodyPartn, round(random(2)), 1);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
case "VehicleCrash": {
|
case "unknown": {
|
||||||
_woundType = round(random(0));
|
ADD_INJURY(_bodyPartn, round(random(1)), 1);
|
||||||
|
};
|
||||||
|
case "vehiclecrash": {
|
||||||
|
if (random(1)>=0.5) then{
|
||||||
|
ADD_INJURY(_bodyPartn, round(random(1)), 1);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
default {
|
default {
|
||||||
_woundType = round(random(1));
|
ADD_INJURY(_bodyPartn, round(random(1)), 1);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
_unit setvariable [GVAR(openWounds), _openWounds, true];
|
||||||
private ["_wounds", "_woundID", "_amountOf"];
|
};
|
||||||
_wounds = _unit getvariable[QGVAR(openWounds), []];
|
|
||||||
_woundID = 1;
|
|
||||||
_amountOf = count _wounds;
|
|
||||||
if (_amountOf > 0) then {
|
|
||||||
_woundID = (_wounds select (_amountOf - 1) select 0) + 1;
|
|
||||||
};
|
|
||||||
_wounds pushback [_woundID, _woundType, _bodyPartn, 1 /* percentage treated */];
|
|
||||||
_unit setvariable [GVAR(openWounds), _wounds, true];
|
|
||||||
};
|
|
||||||
|
Loading…
Reference in New Issue
Block a user