mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
stuff from medical
This commit is contained in:
parent
cf2b7d3bfb
commit
9a0f0cb47b
@ -10,11 +10,37 @@ _damage = _this select 2;
|
|||||||
// don't fall on collision damage
|
// don't fall on collision damage
|
||||||
if (_unit == _firer) exitWith {};
|
if (_unit == _firer) exitWith {};
|
||||||
|
|
||||||
|
// cam shake for player
|
||||||
|
if (_unit == ACE_player) then {
|
||||||
|
addCamShake [3, 5, _damage + random 10];
|
||||||
|
};
|
||||||
|
|
||||||
|
private "_vehicle";
|
||||||
|
_vehicle = vehicle _unit;
|
||||||
|
|
||||||
|
// handle static weapons
|
||||||
|
if (_vehicle isKindOf "StaticWeapon") exitwith {
|
||||||
|
if (!alive _unit) then {
|
||||||
|
_unit action ["Eject", _vehicle];
|
||||||
|
unassignVehicle _unit;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
// don't fall after minor damage
|
// don't fall after minor damage
|
||||||
if (_damage < 0.1) exitWith {};
|
if (_damage < 0.1) exitWith {};
|
||||||
|
|
||||||
|
// play sound
|
||||||
|
if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then {
|
||||||
|
[_unit] call EFUNC(medical,playInjuredSound);
|
||||||
|
};
|
||||||
|
|
||||||
// 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 _unit] call EFUNC(common,canInteractWith)) exitWith {};
|
if !([_unit, _vehicle] call EFUNC(common,canInteractWith)) exitWith {};
|
||||||
|
|
||||||
|
// handle ladders
|
||||||
|
if (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState _unit >> "AGM_isLadder") == 1) exitWith {
|
||||||
|
_unit action ["LadderOff", nearestObject [position _unit, "House"]];
|
||||||
|
};
|
||||||
|
|
||||||
// only play animation when standing due to lack of animations, sry
|
// only play animation when standing due to lack of animations, sry
|
||||||
if !(stance _unit in ["CROUCH", "STAND"]) exitWith {};
|
if !(stance _unit in ["CROUCH", "STAND"]) exitWith {};
|
||||||
|
@ -59,7 +59,6 @@ PREP(onPropagateWound);
|
|||||||
PREP(onCarryObjectDropped);
|
PREP(onCarryObjectDropped);
|
||||||
PREP(parseConfigForInjuries);
|
PREP(parseConfigForInjuries);
|
||||||
PREP(playInjuredSound);
|
PREP(playInjuredSound);
|
||||||
PREP(reactionToDamage);
|
|
||||||
PREP(selectionNameToNumber);
|
PREP(selectionNameToNumber);
|
||||||
PREP(setCardiacArrest);
|
PREP(setCardiacArrest);
|
||||||
PREP(setDead);
|
PREP(setDead);
|
||||||
|
@ -57,8 +57,6 @@ _unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true];
|
|||||||
//};
|
//};
|
||||||
|
|
||||||
if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then {
|
if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then {
|
||||||
[_unit, _newDamage] call FUNC(reactionToDamage);
|
|
||||||
|
|
||||||
// If it reaches this, we can assume that the hit did not kill this unit, as this function is called 3 frames after the damage has been passed.
|
// If it reaches this, we can assume that the hit did not kill this unit, as this function is called 3 frames after the damage has been passed.
|
||||||
if ([_unit, _part, if (_part > 1) then {_newDamage * 1.3} else {_newDamage * 2}] call FUNC(determineIfFatal)) then {
|
if ([_unit, _part, if (_part > 1) then {_newDamage * 1.3} else {_newDamage * 2}] call FUNC(determineIfFatal)) then {
|
||||||
[_unit] call FUNC(setUnconscious);
|
[_unit] call FUNC(setUnconscious);
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
/**
|
|
||||||
* fn_handleReactionHit.sqf
|
|
||||||
* @Descr: triggers a reaction to being hit for a unit and spawns on screen effects.
|
|
||||||
* @Author: Glowbal
|
|
||||||
*
|
|
||||||
* @Arguments: []
|
|
||||||
* @Return:
|
|
||||||
* @PublicAPI: false
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "script_component.hpp"
|
|
||||||
|
|
||||||
private ["_unit","_amountOfDamage"];
|
|
||||||
_unit = _this select 0;
|
|
||||||
_amountOfDamage = _this select 1;
|
|
||||||
|
|
||||||
if (_amountOfDamage > 0.2) then {
|
|
||||||
|
|
||||||
[_unit] call FUNC(playInjuredSound);
|
|
||||||
if ((vehicle _unit) isKindOf "StaticWeapon") exitwith {
|
|
||||||
if (_amountOfDamage > 1) then {
|
|
||||||
_unit action ["eject", vehicle _unit];
|
|
||||||
unassignVehicle _unit;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
if (animationState _unit in ["ladderriflestatic","laddercivilstatic"]) exitwith {
|
|
||||||
_unit action ["ladderOff", (nearestBuilding _unit)];
|
|
||||||
};
|
|
||||||
|
|
||||||
if (vehicle _unit == _unit && [_unit] call EFUNC(common,isAwake)) then {
|
|
||||||
if (random(1) > 0.5) then {
|
|
||||||
_unit setDir ((getDir _unit) + 1 + random(30));
|
|
||||||
} else {
|
|
||||||
_unit setDir ((getDir _unit) - (1 + random(30)));
|
|
||||||
};
|
|
||||||
};
|
|
||||||
if (_amountOfDamage > 0.6) then {
|
|
||||||
if (random(1)>0.6) then {
|
|
||||||
[_unit] call EFUNC(common,setProne);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
if (_unit == ACE_player) then {
|
|
||||||
//76 cutRsc [QGVAR(ScreenEffectsHit),"PLAIN"];
|
|
||||||
addCamShake [3, 5, _amountOfDamage + random 10];
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
if (_amountOfDamage > 0) then {
|
|
||||||
if (_unit == ACE_player) then {
|
|
||||||
// 76 cutRsc [QGVAR(ScreenEffectsHit),"PLAIN"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
Loading…
Reference in New Issue
Block a user