Added initial medium wounds.

Fixed merge conflict.
This commit is contained in:
Glowbal 2015-02-07 23:48:24 +01:00
parent 35386f19d6
commit 26527489d6
3 changed files with 81 additions and 20 deletions

View File

@ -17,12 +17,7 @@
#include "script_component.hpp"
<<<<<<< HEAD
private ["_unit", "_selection", "_damage", "_shooter", "_projectile", "_damageReturn", "_hitPoints"];
=======
private ["_damageReturn", "_typeOfDamage"];
>>>>>>> 596d018f45d34ae8f713efcd3c0c3c2e3156af07
private ["_unit", "_selection", "_damage", "_shooter", "_projectile", "_damageReturn", "_hitPoints", "_typeOfDamage"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
@ -38,7 +33,6 @@ if (typeName _projectile == "OBJECT") then {
_this set [4, _projectile];
};
<<<<<<< HEAD
// If the damage is being weird, we just tell it to fuck off.
_hitSelections = ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"];
if !(_selection in (_hitSelections + [""])) exitWith {0};
@ -50,28 +44,20 @@ if (isNil QGVAR(level)) then {
GVAR(level) = 0;
};
=======
_damageReturn = (_this select 2);
_typeOfDamage = [_this select 4] call FUNC(getTypeOfDamage)
>>>>>>> 596d018f45d34ae8f713efcd3c0c3c2e3156af07
_typeOfDamage = [_this select 4] call FUNC(getTypeOfDamage);
if (GVAR(level) >= 0) then {
_damageReturn = (_this + [_damageReturn, _typeOfDamage]) call FUNC(handleDamage_basic);
};
if (GVAR(level) >= 1) then {
<<<<<<< HEAD
_damageReturn = (_this + [_damageReturn]) call FUNC(handleDamage_medium);
};
if (GVAR(level) >= 2) then {
_damageReturn = (_this + [_damageReturn]) call FUNC(handleDamage_advanced);
};
if (_damageReturn < 0.01) exitWith {0};
=======
_damageReturn = (_this + [_damageReturn, _typeOfDamage]) call FUNC(handleDamage_medium);
if (GVAR(level) >= 1) then {
_damageReturn = (_this + [_damageReturn, _typeOfDamage]) call FUNC(handleDamage_medium);
if (GVAR(level) >= 2) then {
_damageReturn = (_this + [_damageReturn, _typeOfDamage]) call FUNC(handleDamage_advanced);
};
};
>>>>>>> 596d018f45d34ae8f713efcd3c0c3c2e3156af07
_damageReturn

View File

@ -0,0 +1,17 @@
#include "script_component.hpp"
private ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile","_typeOfDamage"];
_unit = _this select 0;
_selectionName = _this select 1;
_amountOfDamage = _this select 2;
_sourceOfDamage = _this select 3;
_typeOfProjectile = _this select 4;
_returnDamage = _this select 5;
_typeOfDamage = _this select 6; //[_typeOfProjectile] call FUNC(getTypeOfDamage);
if (GVAR(enableAirway)) then {
[_unit,_selectionName,_amountOfDamage,_sourceOfDamage, _typeOfDamage] call FUNC(handleDamage_wounds);
};
_returnDamage;

View File

@ -0,0 +1,58 @@
#include "script_component.hpp"
private ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage", "_bodyPartn", "_woundType"];
_unit = _this select 0;
_selectionName = _this select 1;
_amountOfDamage = _this select 2;
_sourceOfDamage = _this select 3;
_typeOfDamage = _this select 4;
_bodyPartn = [_selectionName] call FUNC(selectionNameToNumber);
_woundType = 1;
if (_amountOfDamage > 0.05) then {
// TODO specify openWounds based off typeOfInjury details better.
switch (_typeOfDamage) do {
case "Bullet": {
_woundType = round(random(2));
};
case "Grenade": {
_woundType = round(random(2));
if (_woundType < 1) then {
_woundType = 1;
};
};
case "Explosive": {
_woundType = round(random(2));
if (_woundType < 1) then {
_woundType = 1;
};
};
case "Shell": {
_woundType = round(random(2));
if (_woundType < 1) then {
_woundType = 1;
};
};
case "Unknown": {
_woundType = round(random(1));
};
case "VehicleCrash": {
_woundType = round(random(0));
};
default {
_woundType = round(random(1));
};
};
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];
};