Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Copyright © 2019 Skirmish_, A3LUK.
- * All Rights Reserved.
- */
- #include "..\..\..\UI\macros.inc"
- //--- Overrides
- params [
- [ "_unit", objNull, [objNull] ],
- [ "_part", "", [""] ],
- [ "_damage", 0, [0] ],
- [ "_source", objNull, [objNull] ],
- [ "_projectile", "", [""] ],
- [ "_index", 0, [0] ]
- ];
- //--- Exit if incapacitated
- if ( _unit getVariable [ "Incapacitated", false ] ) exitWith {};
- _unit setvariable [ "A3LUK_Damage", _damage, true ];
- //--- Police Tazer
- if ( !( isNull _source ) ) then {
- if ( _source != _unit ) then {
- _police_tazer_weapons = getArray ( missionConfigFile >> "A3LUK_CfgInit" >> "A3LUK_InitPolice" >> "TazerWeapons" );
- _police_tazer_projectile = getArray ( missionConfigFile >> "A3LUK_CfgInit" >> "A3LUK_InitPolice" >> "TazerProjectile" );
- if (
- currentWeapon _source in _police_tazer_weapons &&
- _projectile in _police_tazer_projectile
- ) then {
- if ( [ _source ] call A3LUK_fnc_isPolice ) then {
- _damage = 0;
- if (
- alive _unit &&
- { !( _unit getVariable [ "A3LUK_restrained", false ] ) } &&
- { !( _unit getVariable [ "onDuty", true ] ) }
- ) then {
- private _distance = if ( _projectile == "B_9x21_Ball" ) then { 100 } else { 35 };
- if ( _unit distance _source < _distance ) then {
- //--- Target in vehicle
- if !( isnull objectparent _unit ) then {
- _unit action [ "Eject", vehicle _unit ];
- [ _unit, _source ] spawn A3LUK_fnc_tazed;
- } else {
- [ _unit, _source ] spawn A3LUK_fnc_tazed;
- };
- };
- };
- };
- };
- };
- };
- //--- VDM
- private _VDM = switch true do {
- case ( vehicle _source isKindOf "Ship" && _projectile == "" ): { true };
- case ( vehicle _source isKindOf "Air" && _projectile == "" ): { true };
- case ( vehicle _source isKindOf "LandVehicle" && _projectile == "" ): { true };
- default { false };
- };
- if ( _VDM ) then {
- if(_source != _unit AND {alive _unit}) then {
- _unit allowDamage false;
- _unit spawn {
- sleep 2;
- _this allowDamage true;
- };
- };
- };
- //--- Seat Belt
- if ( [ vehicle _unit, "LandVehicle" ] call A3LUK_fnc_isKindOf && ( isNull _source || _source isEqualTo _unit ) ) then { _damage = if ( A3LUK_seatbelt ) then { _damage / 2 } else { _damage }; };
- //--- Handle bleedout system
- switch true do {
- case !( _unit getVariable [ 'Incapacitated', false ] ): {
- private _fallToBleedout = switch true do {
- case ( ( _index isEqualTo 0 ) AND (_damage >= 0.90 ) ): { true };
- case ( ( _index isEqualTo 5 ) AND (_damage >= 0.90 ) ): { true };
- case ( ( _index isEqualTo 11 ) AND (_damage >= 0.90 ) ): { true };
- case ( ( _index isEqualTo -1 ) AND (_damage >= 0.90 ) ): { true };
- case ( count ( ( ( getAllHitPointsDamage _unit ) select 2 ) select { _x < 0.9 } ) < 11 ): { true };
- default { false };
- };
- if ( _fallToBleedout ) then { [ _unit, _source ] call A3LUK_fnc_reviveInit };
- _damage = _damage min 0.90;
- };
- };
- [] spawn A3LUK_fnc_hudUpdate;
- _damage;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement