mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
HitReactions - Don't do when mounted, add setting
This commit is contained in:
parent
3a2fd9dc08
commit
e2217220eb
7
addons/hitreactions/ACE_Settings.hpp
Normal file
7
addons/hitreactions/ACE_Settings.hpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
class ACE_Settings {
|
||||||
|
class GVAR(minDamageToTrigger) {
|
||||||
|
//Minimum mamage needed to trigger falling down while moving. Set to -1 to disable completely.
|
||||||
|
typeName = "SCALAR";
|
||||||
|
value = 0.1;
|
||||||
|
};
|
||||||
|
};
|
@ -12,4 +12,5 @@ class CfgPatches {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#include "ACE_Settings.hpp"
|
||||||
#include "CfgEventHandlers.hpp"
|
#include "CfgEventHandlers.hpp"
|
||||||
|
@ -10,6 +10,9 @@ _damage = _this select 2;
|
|||||||
// don't fall on collision damage
|
// don't fall on collision damage
|
||||||
if (_unit == _firer) exitWith {};
|
if (_unit == _firer) exitWith {};
|
||||||
|
|
||||||
|
//Exit if system disabled:
|
||||||
|
if (GVAR(minDamageToTrigger) == -1) exitWith {};
|
||||||
|
|
||||||
// cam shake for player
|
// cam shake for player
|
||||||
if (_unit == ACE_player) then {
|
if (_unit == ACE_player) then {
|
||||||
addCamShake [3, 5, _damage + random 10];
|
addCamShake [3, 5, _damage + random 10];
|
||||||
@ -27,13 +30,16 @@ if (_vehicle isKindOf "StaticWeapon") exitwith {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// don't fall after minor damage
|
// don't fall after minor damage
|
||||||
if (_damage < 0.1) exitWith {};
|
if (_damage < GVAR(minDamageToTrigger)) exitWith {};
|
||||||
|
|
||||||
// play sound
|
// play sound
|
||||||
if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then {
|
if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then {
|
||||||
[_unit] call EFUNC(medical,playInjuredSound);
|
[_unit] call EFUNC(medical,playInjuredSound);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//Don't do animations if in a vehicle (looks weird and animations never reset):
|
||||||
|
if (_vehicle != _unit) exitWith {};
|
||||||
|
|
||||||
// this checks most things, so it doesn't mess with being inside vehicles or while dragging etc.
|
// this checks most things, so it doesn't mess with being inside vehicles or while dragging etc.
|
||||||
if !([_unit, _vehicle] call EFUNC(common,canInteractWith)) exitWith {};
|
if !([_unit, _vehicle] call EFUNC(common,canInteractWith)) exitWith {};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user