mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
e2ac18a05d
* advanced_ballistics * advanced_fatigue * advanced_throwing * ai * aircraft * arsenal * atragmx * attach * backpacks * ballistics * captives * cargo * chemlights * common * concertina_wire * cookoff * dagr * disarming * disposable * dogtags * dragging * explosives * fastroping * fcs * finger * frag * gestures * gforces * goggles * grenades * gunbag * hearing * hitreactions * huntir * interact_menu * interaction * inventory * kestrel4500 * laser * laserpointer * logistics_uavbattery * logistics_wirecutter * magazinerepack * map * map_gestures * maptools * markers * medical * medical_ai * medical_blood * medical_menu * microdagr * minedetector * missileguidance * missionmodules * mk6mortar * modules * movement * nametags * nightvision * nlaw * optics * optionsmenu * overheating * overpressure * parachute * pylons * quickmount * rangecard * rearm * recoil * refuel * reload * reloadlaunchers * repair * respawn * safemode * sandbag * scopes * slideshow * spectator * spottingscope * switchunits * tacticalladder * tagging * trenches * tripod * ui * vector * vehiclelock * vehicles * viewdistance * weaponselect * weather * winddeflection * yardage450 * zeus * arsenal defines.hpp * optionals * DEBUG_MODE_FULL 1 * DEBUG_MODE_FULL 2 * Manual fixes * Add SQF Validator check for #include after block comment * explosives fnc_openTimerUI * fix uniqueItems
65 lines
1.5 KiB
Plaintext
65 lines
1.5 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* 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
|
|
*/
|
|
params ["_unit", "_animName"];
|
|
|
|
private _duty = 1;
|
|
private _animType = _animName select [1, 3];
|
|
|
|
GVAR(isSwimming) = false;
|
|
GVAR(isProne) = (stance _unit) == "PRONE";
|
|
|
|
if (_animType in ["idl", "mov", "adj"]) then {
|
|
switch (_animName select [5, 3]) do {
|
|
case ("knl"): {
|
|
_duty = 1.5;
|
|
};
|
|
case ("pne"): {
|
|
_duty = 10;
|
|
GVAR(isProne) = true; // #4880 - Unarmed sprint->prone has wrong `stance`
|
|
};
|
|
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
|
|
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;
|
|
};
|
|
};
|
|
};
|
|
|
|
_duty
|