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
53 lines
1.6 KiB
Plaintext
53 lines
1.6 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Glowbal, PabstMirror
|
|
* Get the death animation for the unit at current time
|
|
*
|
|
* Arguments:
|
|
* 0: unit <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* animation <STRING>
|
|
*
|
|
* Example:
|
|
* [bob] call ace_common_fnc_getDeathAnim
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_unit"];
|
|
|
|
private _returnAnimation = "";
|
|
|
|
private _animationState = animationState _unit;
|
|
private _unitAnimationCfg = configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState;
|
|
|
|
//If we're already in a terminal animation just return current
|
|
if (getNumber (_unitAnimationCfg >> "terminal") == 1) exitWith {_animationState};
|
|
|
|
private _unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText (_unitAnimationCfg >> "actions");
|
|
|
|
TRACE_2("Animation/Action", configName _unitAnimationCfg, configName _unitActionsCfg);
|
|
|
|
if (vehicle _unit != _unit) then {
|
|
private _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo");
|
|
|
|
for "_index" from 0 to (count _interpolateArray - 1) step 2 do {
|
|
private _indexAnimation = _interpolateArray select _index;
|
|
|
|
//No guarentee that first animation will be right so scan for the first "terminal" animation
|
|
//E.G.: interpolateTo[] = {"passenger_apc_generic04still",1,"KIA_passenger_apc_generic04",1};
|
|
|
|
if (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> _indexAnimation >> "terminal") == 1) exitWith {
|
|
_returnAnimation = _indexAnimation;
|
|
};
|
|
};
|
|
} else {
|
|
_returnAnimation = getText (_unitActionsCfg >> "die");
|
|
};
|
|
|
|
//Fallback if nothing valid found:
|
|
if (_returnAnimation == "") then {_returnAnimation = "Unconscious"};
|
|
|
|
_returnAnimation
|