diff options
Diffstat (limited to 'Client/Module/ISIS/ISIS_Wound.sqf')
| -rw-r--r-- | Client/Module/ISIS/ISIS_Wound.sqf | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Client/Module/ISIS/ISIS_Wound.sqf b/Client/Module/ISIS/ISIS_Wound.sqf new file mode 100644 index 0000000..3638718 --- /dev/null +++ b/Client/Module/ISIS/ISIS_Wound.sqf @@ -0,0 +1,62 @@ +Private ["_damage","_damages","_isStuned","_lastWound","_type","_unit"];
+
+_unit = _this select 0;
+_type = _this select 1;
+_damages = _this select 2;
+
+if (vehicle _unit == _unit) then {
+ _isStuned = _unit getVariable "stunned";
+ _lastWound = _unit getVariable "lastWound";
+ if (isNil "_isStuned") then {_isStuned = false};
+ if (isNil "_lastWound") then {_lastWound = round(time)};
+ if (_isStuned) exitWith {
+ if (time - _lastWound > 3) then {_damages} else {false}
+ };
+
+ _unit setVariable ["lastWound",round time];
+ _damage = true;
+
+ switch (_type) do {
+ case "head_hit": {
+ if (_damages > 0.4 && _damages < 1) then {
+ if (random 100 > 40) then {_unit setVariable ['stunned',true,true];_isStuned = true};
+ };
+ if (_damages >= 1 && _damages < 5) then {
+ if (random 100 > 40) then {_unit setVariable ['stunned',true,true];_isStuned = true;_damage = false};
+ };
+ };
+ case "body": {
+ if (_damages > 0.65 && _damages < 1) then {
+ if (random 100 > 50) then {_unit setVariable ['stunned',true,true];_isStuned = true};
+ };
+ if (_damages >= 1 && _damages < 20) then {
+ if (random 100 > 40) then {_unit setVariable ['stunned',true,true];_isStuned = true;_damage = false};
+ };
+ };
+ case "hands": {
+ if (_damages > 0.76 && _damages < 1) then {
+ if (random 100 > 50) then {_unit setVariable ['stunned',true,true];_isStuned = true};
+ };
+ if (_damages >= 1 && _damages < 20) then {
+ if (random 100 > 50) then {_unit setVariable ['stunned',true,true];_isStuned = true;_damage = false};
+ };
+ };
+ case "legs": {
+ if (_damages > 0.68 && _damages < 1) then {
+ if (random 100 > 50) then {_unit setVariable ['stunned',true,true];_isStuned = true};
+ };
+ if (_damages >= 1 && _damages < 20) then {
+ if (random 100 > 50) then {_unit setVariable ['stunned',true,true];_isStuned = true;_damage = false};
+ };
+ };
+ case "": {
+ _damage = false;
+ };
+ };
+
+ if (_isStuned) then {[_unit] Spawn ISIS_Wounded};
+
+ if (_damage) then {_damages} else {false};
+} else {
+ _damages
+};
\ No newline at end of file |
