mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
cc414de8d1
* Initial commit advanced fatigue * Added animation changes * Fixes, rewrites * Broadcast 3den attribute and fix UBC * Further animation tweaks * Added Eden attribute and CBA settings * Switch to CBA events * Add beautified component name * Rewrites, fixes, tweaks * Move setVars to GVARs * Add setting to disable * Switch to status effect handler for sprint and jog blocking * Add component name * Failsafe for early unit player EH * Removed raised weapon penalty for pistols * Added respawn compatibility * Tweaked side jog animation speed * Added support for virtual load * Added stamina bar * Remove debug flags * Added custom duty factor functions and values * Added structural comments * Disabled CBA settings, added ACE settings * Fixed config * Added readme * Remove leftover debug diag_logs * Improved stringtable
57 lines
1.2 KiB
Plaintext
57 lines
1.2 KiB
Plaintext
/*
|
|
* Author: BaerMitUmlaut
|
|
* Calculates the duty of the current animation.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
* 1: Animation name <STRING>
|
|
*
|
|
* Return Value:
|
|
* Duty <NUMBER>
|
|
*
|
|
* Example:
|
|
* [player, "AidlPercMstpSlowWrflDnon_G05"] call ace_advanced_fatigue_fnc_getAnimDuty
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
params ["_unit", "_animName"];
|
|
|
|
private _duty = 1;
|
|
private _animType = _animName select [1, 3];
|
|
|
|
GVAR(isSwimming) = false;
|
|
|
|
if (_animType in ["idl", "mov"]) then {
|
|
switch (_animName select [5, 3]) do {
|
|
case ("knl"): {
|
|
_duty = 1.5;
|
|
};
|
|
case ("pne"): {
|
|
_duty = 12;
|
|
};
|
|
default {
|
|
_duty = 1;
|
|
};
|
|
};
|
|
|
|
if (currentWeapon _unit != handgunWeapon _unit) then {
|
|
if (_animName select [13, 3] == "ras") then {
|
|
// low ready jog
|
|
_duty = _duty * 1.2;
|
|
if (_animName select [9, 3] == "tac") then {
|
|
// high ready jog/walk
|
|
_duty = _duty * 1.5;
|
|
};
|
|
};
|
|
};
|
|
} else {
|
|
// swimming and diving
|
|
if (_animType in ["swm", "ssw", "bsw", "dve", "sdv", "bdv"]) then {
|
|
_duty = 5;
|
|
GVAR(isSwimming) = true;
|
|
};
|
|
};
|
|
|
|
_duty
|