mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Added a getTypeOfDamage function.
This commit is contained in:
parent
79aa8d1c7a
commit
a50276ddaf
31
addons/medical/functions/fnc_getTypeOfDamage.sqf
Normal file
31
addons/medical/functions/fnc_getTypeOfDamage.sqf
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/**
|
||||||
|
* fn_getTypeOfDamage.sqf
|
||||||
|
* @Descr: N/A
|
||||||
|
* @Author: Glowbal
|
||||||
|
*
|
||||||
|
* @Arguments: []
|
||||||
|
* @Return:
|
||||||
|
* @PublicAPI: false
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
private ["_typeOfProjectile","_typeOfInjury"];
|
||||||
|
_typeOfProjectile = _this select 0;
|
||||||
|
_typeOfInjury = switch (true) do {
|
||||||
|
case (_typeOfProjectile isKindOf "Backblast"): {"backblast"};
|
||||||
|
case (_typeOfProjectile iskindof "BulletBase"): {"Bullet"};
|
||||||
|
case (_typeOfProjectile iskindof "GrenadeCore"): {"Grenade"};
|
||||||
|
case (_typeOfProjectile iskindof "TimeBombCore"): {"Explosive"};
|
||||||
|
case (_typeOfProjectile iskindof "MineCore"): {"Explosive"};
|
||||||
|
case (_typeOfProjectile iskindof "FuelExplosion"): {"Explosive"};
|
||||||
|
case (_typeOfProjectile iskindof "ShellBase"): {"Shell"};
|
||||||
|
case (_typeOfProjectile iskindof "RocketBase"): {"Explosive"};
|
||||||
|
case (_typeOfProjectile iskindof "MissileBase"): {"Explosive"};
|
||||||
|
case (_typeOfProjectile iskindof "LaserBombCore"): {"Explosive"};
|
||||||
|
case (_typeOfProjectile iskindof "BombCore"): {"Explosive"};
|
||||||
|
case (_typeOfProjectile iskindof "Grenade"): {"Grenade"};
|
||||||
|
case (_typeOfProjectile == "VehicleCrash"): {"VehicleCrash"};
|
||||||
|
default {"Unknown"};
|
||||||
|
};
|
||||||
|
_typeOfInjury
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_damageReturn"];
|
private ["_damageReturn", "_typeOfDamage"];
|
||||||
|
|
||||||
if !(local (_this select 0)) exitWith {nil};
|
if !(local (_this select 0)) exitWith {nil};
|
||||||
|
|
||||||
@ -25,19 +25,17 @@ if (typeName (_this select 4) == "OBJECT") then {
|
|||||||
_this set [4, typeOf (_this select 4)];
|
_this set [4, typeOf (_this select 4)];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
_damageReturn = (_this select 2);
|
_damageReturn = (_this select 2);
|
||||||
|
_typeOfDamage = [_this select 4] call FUNC(getTypeOfDamage)
|
||||||
if (GVAR(level) >= 0) then {
|
if (GVAR(level) >= 0) then {
|
||||||
_damageReturn = (_this + [_damageReturn]) call FUNC(handleDamage_basic);
|
_damageReturn = (_this + [_damageReturn, _typeOfDamage]) call FUNC(handleDamage_basic);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (GVAR(level) >= 1) then {
|
if (GVAR(level) >= 1) then {
|
||||||
_damageReturn = (_this + [_damageReturn]) call FUNC(handleDamage_medium);
|
_damageReturn = (_this + [_damageReturn, _typeOfDamage]) call FUNC(handleDamage_medium);
|
||||||
};
|
|
||||||
|
|
||||||
if (GVAR(level) >= 2) then {
|
if (GVAR(level) >= 2) then {
|
||||||
_damageReturn = (_this + [_damageReturn]) call FUNC(handleDamage_advanced);
|
_damageReturn = (_this + [_damageReturn, _typeOfDamage]) call FUNC(handleDamage_advanced);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_damageReturn
|
_damageReturn
|
||||||
|
Loading…
Reference in New Issue
Block a user