mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
28 lines
451 B
Plaintext
28 lines
451 B
Plaintext
|
/*
|
||
|
fnc_getExplosionIndex.sqf
|
||
|
|
||
|
Author: Garth de Wet (LH)
|
||
|
|
||
|
Description:
|
||
|
Turns 0-1 damage into a rating system of 0-3
|
||
|
|
||
|
Parameters:
|
||
|
0: NUMBER - The amount of damage
|
||
|
|
||
|
Returns:
|
||
|
NUMBER (the rating) [0-3]
|
||
|
|
||
|
Example:
|
||
|
_rating = 0.05 call FUNC(GetExplosionIndex);
|
||
|
*/
|
||
|
private ["_effectIndex"];
|
||
|
|
||
|
_effectIndex = switch true do {
|
||
|
case (_this <= 0.04): {0};
|
||
|
case (_this <= 0.06): {1};
|
||
|
case (_this <= 0.09): {2};
|
||
|
default {3};
|
||
|
};
|
||
|
|
||
|
_effectIndex
|