ACE3/addons/goggles/functions/fnc_getExplosionIndex.sqf
2015-01-18 23:50:45 +02:00

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