2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2016-09-04 19:33:07 +00:00
|
|
|
/*
|
|
|
|
* Author: BaerMitUmlaut
|
2024-06-22 17:53:08 +00:00
|
|
|
* Calculates the duty ('postureWeight') of the current animation.
|
2016-09-04 19:33:07 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Animation name <STRING>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Duty <NUMBER>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, "AidlPercMstpSlowWrflDnon_G05"] call ace_advanced_fatigue_fnc_getAnimDuty
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
params ["_unit", "_animName"];
|
|
|
|
|
|
|
|
private _duty = 1;
|
|
|
|
private _animType = _animName select [1, 3];
|
|
|
|
|
|
|
|
GVAR(isSwimming) = false;
|
2017-03-15 15:12:07 +00:00
|
|
|
GVAR(isProne) = (stance _unit) == "PRONE";
|
2016-09-04 19:33:07 +00:00
|
|
|
|
2016-11-14 18:24:21 +00:00
|
|
|
if (_animType in ["idl", "mov", "adj"]) then {
|
2016-09-04 19:33:07 +00:00
|
|
|
switch (_animName select [5, 3]) do {
|
|
|
|
case ("knl"): {
|
|
|
|
_duty = 1.5;
|
|
|
|
};
|
|
|
|
case ("pne"): {
|
2016-11-14 20:54:51 +00:00
|
|
|
_duty = 10;
|
2017-03-15 15:12:07 +00:00
|
|
|
GVAR(isProne) = true; // #4880 - Unarmed sprint->prone has wrong `stance`
|
2016-09-04 19:33:07 +00:00
|
|
|
};
|
|
|
|
default {
|
|
|
|
_duty = 1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-06-27 16:40:07 +00:00
|
|
|
if (currentWeapon _unit != "") then {
|
2016-09-04 19:33:07 +00:00
|
|
|
if (_animName select [13, 3] == "ras") then {
|
|
|
|
if (_animName select [9, 3] == "tac") then {
|
|
|
|
// high ready jog/walk
|
2023-06-27 16:40:07 +00:00
|
|
|
_duty = _duty * (1 + 0.8*GVAR(inertia));
|
|
|
|
} else {
|
|
|
|
// low ready jog
|
|
|
|
_duty = _duty * (1 + 0.2*GVAR(inertia));
|
2016-09-04 19:33:07 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
// swimming and diving
|
2016-11-14 20:55:26 +00:00
|
|
|
switch (true) do {
|
|
|
|
case (_animType in ["swm", "ssw", "bsw"]): {
|
|
|
|
_duty = 6.5;
|
|
|
|
GVAR(isSwimming) = true;
|
|
|
|
};
|
|
|
|
case (_animType in ["dve", "sdv", "bdv"]): {
|
|
|
|
_duty = 2.5;
|
|
|
|
GVAR(isSwimming) = true;
|
|
|
|
};
|
2016-09-04 19:33:07 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
_duty
|