diff --git a/AUTHORS.txt b/AUTHORS.txt index f62618e359..b931d774ac 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -6,12 +6,22 @@ # request, preferably including an email address. # CORE TEAM +bux578 commy2 esteldunedain Felix Wiegand Garth "L-H" de Wet -bux578 +Giallustio +Glowbal +Janus +Kieran +NouberNou PabstMirror +Ruthberg +tpM +ViperMaul +VKing +Walter Pearce # CONTRIBUTORS 11RDP-LoupVert diff --git a/addons/attach/CfgEventHandlers.hpp b/addons/attach/CfgEventHandlers.hpp index f0a9f14d91..3daad1425a 100644 --- a/addons/attach/CfgEventHandlers.hpp +++ b/addons/attach/CfgEventHandlers.hpp @@ -1,6 +1,10 @@ - class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) ); + }; +}; diff --git a/addons/attach/CfgVehicles.hpp b/addons/attach/CfgVehicles.hpp index 15eca2fb62..ce9b1a7413 100644 --- a/addons/attach/CfgVehicles.hpp +++ b/addons/attach/CfgVehicles.hpp @@ -4,23 +4,23 @@ class ACE_MainActions { \ class GVAR(AttachVehicle) { \ displayName = "$STR_ACE_Attach_AttachDetach"; \ - condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \ - statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \ - exceptions[] = {"isNotDragging"}; \ + condition = QUOTE(_this call FUNC(canAttach)); \ + insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions)); \ + exceptions[] = {}; \ showDisabled = 0; \ priority = 0; \ icon = PATHTOF(UI\attach_ca.paa); \ - distance = 4; \ + distance = 4.5; \ }; \ class GVAR(DetachVehicle) { \ displayName = "$STR_ACE_Attach_Detach"; \ - condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \ - statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \ - exceptions[] = {"isNotDragging"}; \ + condition = QUOTE(_this call FUNC(canDetach)); \ + statement = QUOTE(_this call FUNC(detach) ); \ + exceptions[] = {}; \ showDisabled = 0; \ - priority = 0; \ + priority = 0.1; \ icon = PATHTOF(UI\detach_ca.paa); \ - distance = 4; \ + distance = 4.5; \ }; \ }; \ }; @@ -55,18 +55,18 @@ class CfgVehicles { class ACE_Equipment { class GVAR(Attach) { displayName = "$STR_ACE_Attach_AttachDetach"; - condition = QUOTE(([ARR_3(_player, _player, '')] call FUNC(canAttach))); - statement = QUOTE( [ARR_2(_player, _player)] call FUNC(openAttachUI); ); + condition = QUOTE(_this call FUNC(canAttach)); + insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions)); exceptions[] = {"isNotDragging"}; showDisabled = 0; priority = 5; icon = PATHTOF(UI\attach_ca.paa); - hotkey = "T"; + // hotkey = "T"; }; class GVAR(Detach) { displayName = "$STR_ACE_Attach_Detach"; - condition = QUOTE(([ARR_2(_player, _player)] call FUNC(canDetach))); - statement = QUOTE( [ARR_2(_player, _player)] call FUNC(detach) ); + condition = QUOTE(_this call FUNC(canDetach)); + statement = QUOTE(_this call FUNC(detach)); exceptions[] = {"isNotDragging"}; showDisabled = 0; priority = 5; diff --git a/addons/attach/XEH_clientInit.sqf b/addons/attach/XEH_clientInit.sqf new file mode 100644 index 0000000000..f7e663c2ae --- /dev/null +++ b/addons/attach/XEH_clientInit.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +//If attach placing, stop when opening menu: +["interactMenuOpened", {GVAR(placeAction) = 0;}] call EFUNC(common,addEventHandler); diff --git a/addons/attach/XEH_preInit.sqf b/addons/attach/XEH_preInit.sqf index 63eb2e8438..06c6ed1b01 100644 --- a/addons/attach/XEH_preInit.sqf +++ b/addons/attach/XEH_preInit.sqf @@ -6,8 +6,7 @@ PREP(attach); PREP(canAttach); PREP(canDetach); PREP(detach); -PREP(openAttachUI); +PREP(getChildrenAttachActions); PREP(placeApprove); -PREP(placeCancel); ADDON = true; diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 655cac598b..a8b73052dc 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -1,53 +1,54 @@ /* - * Author: eRazeri and esteldunedain + * Author: eRazeri, esteldunedain, PabstMirror * Attach an item to the unit * * Arguments: - * 0: unit doing the attach (player) - * 1: vehicle that it will be attached to (player or vehicle) - * 2: Name of the attachable item + * 0: vehicle that it will be attached to (player or vehicle) + * 1: unit doing the attach (player) + * 2: Array containing a string of the attachable item * * Return Value: * Nothing * * Example: - * Nothing + * [bob, bob, ["light"]] call ace_attach_fnc_attach; * * Public: No */ #include "script_component.hpp" -PARAMS_3(_unit,_attachToVehicle,_itemName); +private ["_itemClassname", "_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID"]; + +PARAMS_3(_attachToVehicle,_unit,_args); +_itemClassname = [_args, 0, ""] call CBA_fnc_defaultParam; //Sanity Check (_unit has item in inventory, not over attach limit) -if !([_unit, _attachToVehicle, _itemName] call FUNC(canAttach)) exitWith {ERROR("Tried to attach, but check failed");}; - -private ["_itemVehClass", "_onAtachText", "_selfAttachPosition"]; +if ((_itemClassname == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");}; _itemVehClass = ""; _onAtachText = ""; _selfAttachPosition = [_unit, [-0.05, 0, 0.12], "rightshoulder"]; switch (true) do { - case (_itemName == "ACE_IR_Strobe_Item"): { +case (_itemClassname == "ACE_IR_Strobe_Item"): { _itemVehClass = "ACE_IR_Strobe_Effect"; _onAtachText = localize "STR_ACE_Attach_IrStrobe_Attached"; //_selfAttachPosition = [_unit, [0, -0.11, 0.16], "pilot"]; //makes it attach to the head a bit better, shoulder is not good for visibility - eRazeri }; - case (_itemName == "B_IR_Grenade"): { +case (_itemClassname == "B_IR_Grenade"): { _itemVehClass = "B_IRStrobe"; _onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached"; }; - case (_itemName == "O_IR_Grenade"): { +case (_itemClassname == "O_IR_Grenade"): { _itemVehClass = "O_IRStrobe"; _onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached"; }; - case (_itemName == "I_IR_Grenade"): { +case (_itemClassname == "I_IR_Grenade"): { _itemVehClass = "I_IRStrobe"; _onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached"; }; - case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]): { - _itemVehClass = _itemName; +case (toLower _itemClassname in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]): { + _itemVehClass = _itemClassname; _onAtachText = localize "STR_ACE_Attach_Chemlight_Attached"; }; }; @@ -55,36 +56,50 @@ switch (true) do { if (_itemVehClass == "") exitWith {ERROR("no _itemVehClass for Item");}; if (_unit == _attachToVehicle) then { //Self Attachment - _unit removeItem _itemName; // Remove item + _unit removeItem _itemClassname; // Remove item _attachedItem = _itemVehClass createVehicle [0,0,0]; _attachedItem attachTo _selfAttachPosition; [_onAtachText] call EFUNC(common,displayTextStructured); _attachToVehicle setVariable [QGVAR(Objects), [_attachedItem], true]; - _attachToVehicle setVariable [QGVAR(ItemNames), [_itemName], true]; + _attachToVehicle setVariable [QGVAR(ItemNames), [_itemClassname], true]; } else { - GVAR(setupObject) = _itemVehClass createVehicleLocal [0,0,-10000]; - GVAR(setupObject) enableSimulationGlobal false; - GVAR(SetupPlacmentText) = _onAtachText; - GVAR(SetupPlacmentItem) = _itemName; - GVAR(SetupAttachVehicle) = _attachToVehicle; - GVAR(placer) = _unit; + GVAR(placeAction) = -1; + + _tempObject = _itemVehClass createVehicleLocal [0,0,-10000]; + _tempObject enableSimulationGlobal false; + [_unit, QGVAR(vehAttach), true] call EFUNC(common,setForceWalkStatus); - [QGVAR(PlacementEachFrame),"OnEachFrame", { - private "_player"; - _player = ACE_player; - //Stop if player switch or player gets to far from vehicle - if (GVAR(placer) != _player || {_player distance GVAR(SetupAttachVehicle) > 7}) exitWith { - call FUNC(placeCancel); + //MenuBack isn't working for now (localize "STR_ACE_Attach_CancelAction") + [{[localize "STR_ACE_Attach_PlaceAction", ""] call EFUNC(interaction,showMouseHint)}, [], 0, 0] call EFUNC(common,waitAndExecute); + _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = 1;}] call EFUNC(common,AddActionEventHandler)]; + // _unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {true}, {GVAR(placeAction) = 0;}] call EFUNC(common,AddActionEventHandler)]; + + _actionID = _unit addAction [format ["%1", localize "STR_ACE_Attach_CancelAction"], {GVAR(placeAction) = 0}]; + + [{ + PARAMS_2(_args,_pfID); + EXPLODE_7_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_tempObject,_onAtachText,_actionID); + + if ((GVAR(placeAction) != -1) || + {_unit != ACE_player} || + {!([_unit, _attachToVehicle, []] call EFUNC(common,canInteractWith))} || + {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) then { + + [_pfID] call CBA_fnc_removePerFrameHandler; + [_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); + [] call EFUNC(interaction,hideMouseHint); + [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); + //[_unit, "MenuBack", (_unit getVariable [QGVAR(cancelActionEH), -1])] call EFUNC(common,removeActionEventHandler); + _unit removeAction _actionID; + + if (GVAR(placeAction) == 1) then { + _startingPosition = _tempObject modelToWorld [0,0,0]; + [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _startingPosition] call FUNC(placeApprove); + }; + deleteVehicle _tempObject; + } else { + _tempObject setPosATL ((ASLtoATL eyePos _unit) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]));; }; - GVAR(pfeh_running) = true; - _pos = (ASLtoATL eyePos _player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]); - GVAR(setupObject) setPosATL _pos; - }] call BIS_fnc_addStackedEventHandler; // @todo replace with CBA PFH - - //had to delay the mouseHint, not sure why - [{[localize "STR_ACE_Attach_PlaceAction", localize "STR_ACE_Attach_CancelAction"] call EFUNC(interaction,showMouseHint)}, [], 0, 0] call EFUNC(common,waitAndExecute); - - _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {GVAR(pfeh_running) && {!isNull (GVAR(setupObject))}}, {call FUNC(placeApprove);}] call EFUNC(common,AddActionEventHandler)]; - _unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {GVAR(pfeh_running) && {!isNull (GVAR(setupObject))}}, {call FUNC(placeCancel);}] call EFUNC(common,AddActionEventHandler)]; + }, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _tempObject, _onAtachText, _actionID]] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/attach/functions/fnc_canAttach.sqf b/addons/attach/functions/fnc_canAttach.sqf index 1c33f7b112..966794b32f 100644 --- a/addons/attach/functions/fnc_canAttach.sqf +++ b/addons/attach/functions/fnc_canAttach.sqf @@ -3,25 +3,28 @@ * Check if a unit can attach a specific item. * * Arguments: - * 0: unit doing the attach (player) - * 1: vehicle that it will be attached to (player or vehicle) - * 2: Name of the attachable item + * 0: vehicle that it will be attached to (player or vehicle) + * 1: unit doing the attach (player) + * 2: Array empty or containing a string of the attachable item * * Return Value: - * Boolean + * Can Attach * * Example: - * Nothing + * [bob, bob, ["light"]] call ace_attach_fnc_canAttach; * * Public: No */ #include "script_component.hpp" -PARAMS_3(_unit,_attachToVehicle,_item); +PARAMS_3(_attachToVehicle,_player,_args); -private ["_attachLimit", "_attachedObjects"]; +private ["_itemName", "_attachLimit", "_attachedObjects"]; -_attachLimit = [10, 1] select (_unit == _attachToVehicle); +_itemName = [_args, 0, ""] call CBA_fnc_defaultParam; +_attachLimit = [6, 1] select (_player == _attachToVehicle); _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; -canStand _unit && {alive _attachToVehicle} && {count _attachedObjects < _attachLimit} && {_item in (itemsWithMagazines _unit + [""])} +_playerPos = (ACE_player modelToWorld (ACE_player selectionPosition "pilot")); + +(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])}; diff --git a/addons/attach/functions/fnc_canDetach.sqf b/addons/attach/functions/fnc_canDetach.sqf index ad2f68776c..dc335e6bb6 100644 --- a/addons/attach/functions/fnc_canDetach.sqf +++ b/addons/attach/functions/fnc_canDetach.sqf @@ -3,20 +3,20 @@ * Check if a unit has an item attached and if it can remove that item. * * Arguments: - * 0: unit doing the detaching (player) - * 1: vehicle that it will be detached from (player or vehicle) + * 0: vehicle that it will be detached from (player or vehicle) + * 1: unit doing the detaching (player) * * Return Value: - * Boolean + * Can Detach * * Example: - * Nothing + * [bob, bob] call ace_attach_fnc_canDetach; * * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_attachToVehicle); +PARAMS_2(_attachToVehicle,_unit); private ["_attachedObjects", "_inRange"]; diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index 7b0d82dec1..124e5910d6 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -3,20 +3,20 @@ * Detach an item from a unit * * Arguments: - * 0: unit doing the attaching (player) - * 1: vehicle that it will be detached from (player or vehicle) + * 0: vehicle that it will be detached from (player or vehicle) + * 1: unit doing the detaching (player) * * Return Value: * Nothing * * Example: - * Nothing + * [car, bob] call ace_attach_fnc_detach * * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_attachToVehicle); +PARAMS_2(_attachToVehicle,_unit); private ["_attachedObjects", "_attachedItems"]; @@ -74,13 +74,13 @@ _attachToVehicle setVariable [QGVAR(ItemNames), _attachedItems, true]; // Display message switch (true) do { - case (_itemName == "ACE_IR_Strobe_Item") : { +case (_itemName == "ACE_IR_Strobe_Item") : { [localize "STR_ACE_Attach_IrStrobe_Detached"] call EFUNC(common,displayTextStructured); }; - case (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) : { +case (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) : { [localize "STR_ACE_Attach_IrGrenade_Detached"] call EFUNC(common,displayTextStructured); }; - case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]) : { +case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]) : { [localize "STR_ACE_Attach_Chemlight_Detached"] call EFUNC(common,displayTextStructured); }; }; diff --git a/addons/attach/functions/fnc_getChildrenAttachActions.sqf b/addons/attach/functions/fnc_getChildrenAttachActions.sqf new file mode 100644 index 0000000000..6ff9410475 --- /dev/null +++ b/addons/attach/functions/fnc_getChildrenAttachActions.sqf @@ -0,0 +1,51 @@ +/* + * Author: Garth de Wet (LH), PabstMirror + * Show the ammo counts for a static weapon. + * Called from "insertChildren" on interact_menu + * + * Argument: + * 0: Target + * 1: Player + * + * Return value: + * ChildActiosn + * + * Example: + * [player, player] call ace_attach_fnc_getChildrenAttachActions + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_2(_target,_player); + +_listed = []; +_actions = []; + +{ + if !(_x in _listed) then { + _listed pushBack _x; + _item = ConfigFile >> "CfgMagazines" >> _x; + if (getNumber (_item >> "ACE_Attachable") == 1) then { + _displayName = getText(_item >> "displayName"); + _picture = getText(_item >> "picture"); + _action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); + _actions pushBack [_action, [], _target]; + }; + }; +} forEach (magazines _player); + +{ + if !(_x in _listed) then { + _listed pushBack _x; + _item = ConfigFile >> "CfgWeapons" >> _x; + if (getNumber (_item >> "ACE_Attachable") == 1) then { + _displayName = getText(_item >> "displayName"); + _picture = getText(_item >> "picture"); + _action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); + _actions pushBack [_action, [], _target]; + }; + }; +} forEach (items _player); + +_actions diff --git a/addons/attach/functions/fnc_openAttachUI.sqf b/addons/attach/functions/fnc_openAttachUI.sqf deleted file mode 100644 index 1b95be9b84..0000000000 --- a/addons/attach/functions/fnc_openAttachUI.sqf +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Author: Garth de Wet (LH) - * Opens the UI for attaching objects. - * - * Arguments: - * 0: unit - * 1: target - * - * Return Value: - * Nothing - * - * Example: - * Nothing - * - * Public: No - */ -#include "script_component.hpp" - -private ["_actions", "_attachables", "_item"]; - -PARAMS_2(_unit,_target); - -GVAR(attachTarget) = _target; -_listed = []; -_attachables = magazines _unit; -_actions = [localize "STR_ACE_Attach_AttachDetach", localize "STR_ACE_Attach_Attach"] call EFUNC(interaction,prepareSelectMenu); -{ - if !(_x in _listed) then { - _item = ConfigFile >> "CfgMagazines" >> _x; - if (getNumber (_item >> "ACE_Attachable") == 1) then { - _actions = [ - _actions, - getText(_item >> "displayName"), - getText(_item >> "picture"), - _x - ] call EFUNC(interaction,addSelectableItem); - }; - _listed pushBack _x; - }; -} forEach _attachables; -_attachables = items _unit; -{ - if !(_x in _listed) then { - _item = ConfigFile >> "CfgWeapons" >> _x; - if (getNumber (_item >> "ACE_Attachable") == 1) then { - _actions = [ - _actions, - getText(_item >> "displayName"), - getText(_item >> "picture"), - _x - ] call EFUNC(interaction,addSelectableItem); - }; - _listed pushBack _x; - }; -} forEach _attachables; - -[ - _actions, - { - [ACE_player, GVAR(attachTarget), _this] call FUNC(attach); - call EFUNC(interaction,hideMenu); - }, - { - call EFUNC(interaction,hideMenu); - } -] call EFUNC(interaction,openSelectMenu); diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index c6277e2961..576721cf59 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -1,69 +1,55 @@ /* * Author: Pabst Mirror (based on Explosive attach by Garth de Wet (LH)) * Approves placement of the lightObject, scans for an appropriate location and attaches + * A player can release the attachObject with it floating in mid-air. + * This will use lineIntersectsWith to scan towards the center of the vehicle to find a collision + * ArmA's collision detection is of couse terrible and often misses collisions (difference between what we see and collision LOD) + * So it does multiple scans at slighly different angles + * This is VERY computationaly intensive, but doesn't happen that often. * * Arguments: - * Nothing + * 0: Unit (player) + * 1: attachToVehicle + * 2: Item Classname (cfgWeapon/cfgMagazine) + * 3: Light Vehicle Classname + * 4: On Attach Text + * 5: Starting Pos of dummy item * * Return Value: * Nothing * * Example: - * Nothing + * No * * Public: No */ #include "script_component.hpp" -private ["_setupObject", "_setupClassname", "_itemClassname", "_placementText", "_attachToVehicle", "_placer", "_startingPosition", "_startingOffset", "_distanceFromCenter", "_closeInUnitVector", "_keepGoingCloser", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"]; +private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_setupObject", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"]; +PARAMS_6(_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition); -if (GVAR(pfeh_running)) then { - [QGVAR(PlacementEachFrame),"OnEachFrame"] call BIS_fnc_removeStackedEventHandler; - GVAR(pfeh_running) = false; -}; - -_setupObject = GVAR(setupObject); -_setupClassname = typeOf _setupObject; -_itemClassname = GVAR(SetupPlacmentItem); -_placementText = GVAR(SetupPlacmentText); -_attachToVehicle = GVAR(SetupAttachVehicle); -_placer = GVAR(placer); - -GVAR(SetupPlacmentItem) = ""; -GVAR(SetupPlacmentText) = ""; -GVAR(setupObject) = objNull; -GVAR(SetupAttachVehicle) = objNull; -GVAR(placer) = objNull; - -[_placer, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); -[_placer, "DefaultAction", _placer getVariable [QGVAR(placeActionEH), -1]] call EFUNC(common,removeActionEventHandler); -[_placer, "MenuBack", _placer getVariable [QGVAR(cancelActionEH), -1]] call EFUNC(common,removeActionEventHandler); -call EFUNC(interaction,hideMouseHint); - -//A player can release the attachObject with it floating in mid-air. -//This will use lineIntersectsWith to scan towards the center of the vehicle to find a collision -//ArmA's collision detection is of couse terrible and often misses collisions (difference between what we see and collision LOD) -//So it does multiple scans at slighly different angles -//This is VERY computationaly intensive, but doesn't happen that often. - -_startingPosition = _setupObject modelToWorld [0,0,0]; _startingOffset = _attachToVehicle worldToModel _startingPosition; -_distanceFromCenter = vectorMagnitude _startingOffset; +_startDistanceFromCenter = vectorMagnitude _startingOffset; _closeInUnitVector = vectorNormalized (_startingOffset vectorFromTo [0,0,0]); -_keepGoingCloser = true; -_closeInDistance = 0; -while {_keepGoingCloser} do { - if (_closeInDistance >= _distanceFromCenter) exitWith {}; +_closeInMax = _startDistanceFromCenter; +_closeInMin = 0; - _closeInDistance = _closeInDistance + 0.01; //10mm each step +//Delete Local Placement Object +deleteVehicle _setupObject; + +while {(_closeInMax - _closeInMin) > 0.01} do { + _closeInDistance = (_closeInMax + _closeInMin) / 2; + // systemChat format ["Trying %1 from %2 start %3", _closeInDistance, [_closeInMax, _closeInMin], _startDistanceFromCenter]; _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); _endPosTestOffset set [2, (_startingOffset select 2)]; _endPosTest = _attachToVehicle modelToWorld _endPosTestOffset; + _doesIntersect = false; { + if (_doesIntersect) exitWith {}; _startingPosShifted = _startingPosition vectorAdd _x; _startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLtoASL _startingPosShifted}; { @@ -71,33 +57,37 @@ while {_keepGoingCloser} do { _endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted}; //Uncomment to see the lazor show, and see how the scanning works: - drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]]; - - if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _placer, _setupObject]) exitWith {_keepGoingCloser = false}; + // drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]]; + if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _unit]) exitWith {_doesIntersect = true}; } forEach [[0,0,0.045], [0,0,-0.045], [0,0.045,0], [0,-0.045,0], [0.045,0,0], [-0.045,0,0]]; } forEach [[0,0,0], [0,0,0.05], [0,0,-0.05]]; + + if (_doesIntersect) then { + _closeInMax = _closeInDistance; + } else { + _closeInMin = _closeInDistance; + }; }; -//Delete Local Placement Object -deleteVehicle _setupObject; +_closeInDistance = (_closeInMax + _closeInMin) / 2; -//Checks -if ((_closeInDistance >= _distanceFromCenter) || (!([_placer,_attachToVehicle,_itemClassname] call FUNC(canAttach)))) exitWith { - TRACE_2("no valid spot found",_closeInDistance,_distanceFromCenter); +//Checks (too close to center or can't attach) +if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) exitWith { + TRACE_2("no valid spot found",_closeInDistance,_startDistanceFromCenter); [localize "STR_ACE_Attach_Failed"] call EFUNC(common,displayTextStructured); }; -//Move it out slightly, for visability sake (better to look a little funny than be embedded//sunk in the hull) +//Move it out slightly, for visability sake (better to look a little funny than be embedded//sunk in the hull and be useless) _closeInDistance = (_closeInDistance - 0.0085); //Create New 'real' Object _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); _endPosTestOffset set [2, (_startingOffset select 2)]; -_attachedObject = _setupClassname createVehicle (getPos _placer); +_attachedObject = _itemVehClass createVehicle (getPos _unit); _attachedObject attachTo [_attachToVehicle, _endPosTestOffset]; //Remove Item from inventory -_placer removeItem _itemClassname; +_unit removeItem _itemClassname; //Add Object to ACE_AttachedObjects and ACE_AttachedItemNames _currentObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; @@ -107,4 +97,4 @@ _currentItemNames = _attachToVehicle getVariable [QGVAR(ItemNames), []]; _currentItemNames pushBack _itemClassname; _attachToVehicle setVariable [QGVAR(ItemNames), _currentItemNames, true]; -[_placementText] call EFUNC(common,displayTextStructured); +[_onAtachText] call EFUNC(common,displayTextStructured); diff --git a/addons/attach/functions/fnc_placeCancel.sqf b/addons/attach/functions/fnc_placeCancel.sqf deleted file mode 100644 index 3abdf848ba..0000000000 --- a/addons/attach/functions/fnc_placeCancel.sqf +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Author: Pabst Mirror (based on Explosive attach by Garth de Wet (LH)) - * Cancels placement of the lightObject - * - * Arguments: - * Nothing - * - * Return Value: - * Nothing - * - * Example: - * Nothing - * - * Public: No - */ -#include "script_component.hpp" - -if (GVAR(pfeh_running)) then { - [QGVAR(PlacementEachFrame),"OnEachFrame"] call BIS_fnc_removeStackedEventHandler; - GVAR(pfeh_running) = false; -}; -if (!isNull (GVAR(setupObject))) then { - deleteVehicle GVAR(setupObject); -}; - -[GVAR(placer), QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); -call EFUNC(interaction,hideMouseHint); -[GVAR(placer), "DefaultAction", GVAR(placer) getVariable [QGVAR(placeActionEH), -1]] call EFUNC(common,removeActionEventHandler); -[GVAR(placer), "MenuBack", GVAR(placer) getVariable [QGVAR(cancelActionEH), -1]] call EFUNC(common,removeActionEventHandler); - -GVAR(placer) = objNull; -GVAR(SetupPlacmentItem) = ""; -GVAR(SetupPlacmentText) = ""; -GVAR(setupObject) = objNull; -GVAR(SetupAttachVehicle) = objNull; diff --git a/addons/ballistics/CfgAmmo.hpp b/addons/ballistics/CfgAmmo.hpp deleted file mode 100644 index 6e11038924..0000000000 --- a/addons/ballistics/CfgAmmo.hpp +++ /dev/null @@ -1,41 +0,0 @@ - -class CfgAmmo { - - /* 6.5x39mm Grendel */ - - class BulletBase; - class B_65x39_Caseless: BulletBase { - typicalSpeed = 724; - airFriction = -0.000915; - }; - - - /* 5.56x45mm NATO */ - - class B_556x45_Ball: BulletBase { - typicalSpeed = 911; - airFriction = -0.001335; - }; - - - /* 7.62x51mm NATO */ - - class B_762x51_Ball: BulletBase { - typicalSpeed = 853; - //airfriction = - }; - - - /* Other */ - - class B_9x21_Ball; - class B_9x19_Ball: B_9x21_Ball { - typicalSpeed = 381; - airfriction = -0.00213; - }; - - class B_45ACP_Ball: BulletBase { - typicalSpeed = 250; - airfriction = -0.0009; - }; -}; diff --git a/addons/ballistics/CfgMagazines.hpp b/addons/ballistics/CfgMagazines.hpp deleted file mode 100644 index 1c5dabacd8..0000000000 --- a/addons/ballistics/CfgMagazines.hpp +++ /dev/null @@ -1,65 +0,0 @@ - -class CfgMagazines { - - /* 6.5x39mm Grendel - MX */ - - class CA_Magazine; - class 30Rnd_65x39_caseless_mag: CA_Magazine { - initSpeed = 724; - }; - - class 100Rnd_65x39_caseless_mag: CA_Magazine { - initSpeed = 724; - }; - - - /* 6.5x39mm Grendel - Katiba */ - - class 30Rnd_65x39_caseless_green: 30Rnd_65x39_caseless_mag { - initSpeed = 724; - }; - - class 200Rnd_65x39_cased_Box: 100Rnd_65x39_caseless_mag { - initSpeed = 691; - }; - - - /* 5.56x45mm NATO */ - - class 30Rnd_556x45_Stanag: CA_Magazine { - initSpeed = 911; - }; - - - /* 7.62x51mm NATO */ - - class 20Rnd_762x51_Mag: CA_Magazine { - initSpeed = 792; // 18" M14 EBR barrel - }; - - class 150Rnd_762x51_Box: CA_Magazine { - ammo = "B_762x51_Ball"; - initSpeed = 853; // Typical MV for M240 - }; - - - /* Other */ - - class 30Rnd_9x21_Mag: CA_Magazine { - ammo = "B_9x19_Ball"; - initSpeed = 370; - }; - - class 16Rnd_9x21_Mag: 30Rnd_9x21_Mag { - ammo = "B_9x19_Ball"; - initSpeed = 381; - }; - - class 30Rnd_45ACP_Mag_SMG_01: 30Rnd_9x21_Mag { - initSpeed = 259; - }; - - class 9Rnd_45ACP_Mag: 30Rnd_45ACP_Mag_SMG_01 { - initSpeed = 250; - }; -}; diff --git a/addons/ballistics/config.cpp b/addons/ballistics/config.cpp index e94c9f4efb..c526b0f7d4 100644 --- a/addons/ballistics/config.cpp +++ b/addons/ballistics/config.cpp @@ -12,7 +12,5 @@ class CfgPatches { }; }; -#include "CfgAmmo.hpp" -#include "CfgMagazines.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" diff --git a/addons/captives/CfgEventHandlers.hpp b/addons/captives/CfgEventHandlers.hpp index 0ce09280a7..9d1a69f4fd 100644 --- a/addons/captives/CfgEventHandlers.hpp +++ b/addons/captives/CfgEventHandlers.hpp @@ -41,3 +41,11 @@ class Extended_InitPost_EventHandlers { }; }; }; +//make sure captiveNum is reset on respawn +class Extended_Respawn_EventHandlers { + class CAManBase { + class ADDON { + respawn = QUOTE(_this call FUNC(handleRespawn)); + }; + }; +}; diff --git a/addons/captives/CfgMoves.hpp b/addons/captives/CfgMoves.hpp index d60fab5a33..aa64e85e22 100644 --- a/addons/captives/CfgMoves.hpp +++ b/addons/captives/CfgMoves.hpp @@ -39,6 +39,7 @@ class CfgMovesMaleSdr: CfgMovesBasic { interpolationRestart = 2; ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; + canReload = 0; }; class ACE_AmovPercMstpScapWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon { file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease"; @@ -63,6 +64,7 @@ class CfgMovesMaleSdr: CfgMovesBasic { interpolationRestart = 2; ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; + canReload = 0; }; class ACE_AmovPercMstpSsurWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon { file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon"; @@ -80,4 +82,3 @@ class CfgMovesMaleSdr: CfgMovesBasic { }; }; }; - diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 89ab74d5bb..10b2d0285f 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -149,11 +149,6 @@ class CfgVehicles { MACRO_LOADUNLOADCAPTIVE }; - class StaticMortar; - class Mortar_01_base_F: StaticMortar { - MACRO_LOADUNLOADCAPTIVE - }; - class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf index c09f81e51b..bc6a61bc4f 100644 --- a/addons/captives/XEH_preInit.sqf +++ b/addons/captives/XEH_preInit.sqf @@ -21,6 +21,7 @@ PREP(handleGetOut); PREP(handleKilled); PREP(handleOnUnconscious); PREP(handlePlayerChanged); +PREP(handleRespawn); PREP(handleUnitInitPost); PREP(handleZeusDisplayChanged); PREP(moduleSurrender); diff --git a/addons/captives/functions/fnc_doFriskPerson.sqf b/addons/captives/functions/fnc_doFriskPerson.sqf index 14b18ffd0e..dd7cc3c675 100644 --- a/addons/captives/functions/fnc_doFriskPerson.sqf +++ b/addons/captives/functions/fnc_doFriskPerson.sqf @@ -27,7 +27,7 @@ if (_weapon == primaryWeapon _player && {_weapon != ""}) then { _listedItemClasses = []; -_actions = [localize "STR_ACE_Captives_FriskMenuHeader", localize "STR_ACE_Captives_CancelSelection"] call ACE_Interaction_fnc_prepareSelectMenu; +_actions = [localize "STR_ACE_Captives_FriskMenuHeader", ""] call ACE_Interaction_fnc_prepareSelectMenu; _allGear = []; diff --git a/addons/captives/functions/fnc_handleKilled.sqf b/addons/captives/functions/fnc_handleKilled.sqf index 9e9c5e1ac8..720bde9df7 100644 --- a/addons/captives/functions/fnc_handleKilled.sqf +++ b/addons/captives/functions/fnc_handleKilled.sqf @@ -18,7 +18,7 @@ PARAMS_1(_oldUnit); if (_oldUnit getVariable [QGVAR(isHandcuffed), false]) then { - _oldUnit setVariable [QGVAR(isHandcuffed), false, true]; + [_oldUnit, false] call FUNC(setSurrendered); }; if (_oldUnit getVariable [QGVAR(isEscorting), false]) then { @@ -26,5 +26,5 @@ if (_oldUnit getVariable [QGVAR(isEscorting), false]) then { }; if (_oldUnit getVariable [QGVAR(isSurrendering), false]) then { - _oldUnit setVariable [QGVAR(isSurrendering), false, true]; + [_oldUnit, false] call FUNC(setSurrendered); }; diff --git a/addons/captives/functions/fnc_handleOnUnconscious.sqf b/addons/captives/functions/fnc_handleOnUnconscious.sqf index 9b73d34485..1924b6bb47 100644 --- a/addons/captives/functions/fnc_handleOnUnconscious.sqf +++ b/addons/captives/functions/fnc_handleOnUnconscious.sqf @@ -16,15 +16,16 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_isUnconc); +EXPLODE_2_PVT(_this,_unit,_isUnconc); +diag_log "handleOnUnconscious"; +diag_log _this; +diag_log _unit; if (!local _unit) exitWith {}; -systemChat format ["med: %1", _this]; - if (_isUnconc) then { //Knocked out: If surrendering, stop - if (_unit getVariable [QGVAR(isSurrendering), false]) then { + if (_unit getVariable [QGVAR(isSurrendering), false]) then { [_unit, false] call FUNC(setSurrendered); }; } else { diff --git a/addons/captives/functions/fnc_handleRespawn.sqf b/addons/captives/functions/fnc_handleRespawn.sqf new file mode 100644 index 0000000000..02888c27a0 --- /dev/null +++ b/addons/captives/functions/fnc_handleRespawn.sqf @@ -0,0 +1,39 @@ +/* + * Author: commy2 PabstMirror + * Fix, because captiveNum doesn't reset properly on respawn + * + * Arguments: + * 0: Unit + * 1: Corpse + * + * Return Value: + * Nothing + * + * Example: + * [alive, body] call ACE_captives_fnc_handleRespawn; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_2(_unit,_dead); + +if (!local _unit) exitWith {}; + +//With respawn="group", we could be respawning into a unit that is handcuffed/captive +//If they are, reset and rerun the SET function +//if not, make sure to explicity disable the setCaptivityStatus, because captiveNum does not work correctly on respawn + +if (_unit getVariable [QGVAR(isHandcuffed), false]) then { + _unit setVariable [QGVAR(isHandcuffed), false]; + [_unit, true] call FUNC(setHandcuffed); +} else { + [_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus); +}; + +if (_unit getVariable [QGVAR(isSurrendering), false]) then { + _unit setVariable [QGVAR(isSurrendering), false]; + [_unit, true] call FUNC(setSurrendered); +} else { + [_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus); +}; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 3a7436abc7..73451863dd 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -75,6 +75,7 @@ if (_state) then { }; }; + if (!alive _unit) exitWith {}; if (_unit getVariable ["ACE_isUnconscious", false]) exitWith {}; //don't touch animations if unconscious //if we are in "hands up" animationState, crack it now diff --git a/addons/common/CfgVehicles.hpp b/addons/common/CfgVehicles.hpp index 45f384eaf8..eaa585691e 100644 --- a/addons/common/CfgVehicles.hpp +++ b/addons/common/CfgVehicles.hpp @@ -107,4 +107,21 @@ class CfgVehicles { class TransportItems {}; class TransportBackpacks {}; }; + + class Item_Base_F; + class ACE_bananaItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = "$STR_ACE_Common_bananaDisplayName"; + author = "$STR_ACE_Common_ACETeam"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_banana + { + name = "ACE_banana"; + count = 1; + }; + }; + }; }; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index e3d2ed9327..f09dae0eb3 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -34,6 +34,7 @@ if (hasInterface) then { }] call FUNC(addEventhandler); ["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler); +["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler); // hack to get PFH to work in briefing [QGVAR(onBriefingPFH), "onEachFrame", { @@ -155,7 +156,7 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; }; // "playerTurretChanged" event - [ACE_player] call FUNC(getTurretIndex); + _newPlayerTurret = [ACE_player] call FUNC(getTurretIndex); if !(_newPlayerTurret isEqualTo GVAR(OldPlayerTurret)) then { // Raise ACE event locally GVAR(OldPlayerTurret) = _newPlayerTurret; @@ -174,13 +175,15 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; [QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable); -["VehicleSetFuel", { -PARAMS_2(_vehicle,_fuelLevel); -_vehicle setFuel _fuelLevel; -}] call FUNC(addEventhandler); - ["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler); ["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler); ["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithCondition); -["isNotInside", {_this select 0 == _this select 1 || {vehicle (_this select 0) == _this select 0}}] call FUNC(addCanInteractWithCondition); +["isNotInside", { + // Players can always interact with himself if not boarded + vehicle (_this select 0) == (_this select 0) || + // Players can always interact with his vehicle + {vehicle (_this select 0) == (_this select 1)} || + // Players can always interact with passengers of the same vehicle + {!((_this select 0) isEqualTo (_this select 1)) && {vehicle (_this select 0) == vehicle (_this select 1)}} +}] call FUNC(addCanInteractWithCondition); diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index c23c6b1dd2..345bc7873c 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -4,13 +4,11 @@ ADDON = false; // ACE Common Function -PREP(addActionEventHandler); -PREP(addActionMenuEventHandler); + PREP(addCanInteractWithCondition); PREP(addLineToDebugDraw); -PREP(addMapMarkerCreatedEventHandler); -PREP(addScrollWheelEventHandler); PREP(addSetting); +PREP(addToInventory); PREP(adminKick); PREP(ambientBrightness); PREP(applyForceWalkStatus); @@ -55,20 +53,15 @@ PREP(fixPosition); PREP(getAllDefinedSetVariables); PREP(getAllGear); PREP(getCaptivityStatus); -PREP(getConfigCommander); -PREP(getConfigGunner); PREP(getDeathAnim); PREP(getDefaultAnim); PREP(getDefinedVariable); PREP(getDefinedVariableDefault); PREP(getDefinedVariableInfo); -PREP(getDoorTurrets); PREP(getFirstObjectIntersection); PREP(getFirstTerrainIntersection); PREP(getForceWalkStatus); PREP(getGunner); -PREP(getHitPoints); -PREP(getHitPointsWithSelections); PREP(getInPosition); PREP(getMarkerType); PREP(getName); @@ -80,23 +73,15 @@ PREP(getStringFromMissionSQM); PREP(getTargetAzimuthAndInclination); PREP(getTargetDistance); PREP(getTargetObject); -PREP(getTurretCommander); -PREP(getTurretConfigPath); -PREP(getTurretCopilot); -PREP(getTurretGunner); -PREP(getTurretIndex); -PREP(getTurrets); -PREP(getTurretsFFV); -PREP(getTurretsOther); PREP(getUavControlPosition); PREP(getVehicleCargo); PREP(getVehicleCodriver); -PREP(getVehicleCrew); PREP(getVersion); PREP(getWeaponAzimuthAndInclination); PREP(getWeaponIndex); -PREP(getWeaponType); +PREP(getWeaponState); PREP(getWindDirection); +PREP(getZoom); PREP(goKneeling); PREP(hadamardProduct); PREP(hasItem); @@ -138,11 +123,7 @@ PREP(progressBar); PREP(queueAnimation); PREP(readSettingFromModule); PREP(receiveRequest); -PREP(removeActionEventHandler); -PREP(removeActionMenuEventHandler); PREP(removeCanInteractWithCondition); -PREP(removeMapMarkerCreatedEventHandler); -PREP(removeScrollWheelEventHandler); PREP(removeSpecificMagazine); PREP(requestCallback); PREP(resetAllDefaults); @@ -185,6 +166,32 @@ PREP(useItem); PREP(useMagazine); PREP(waitAndExecute); +// config items +PREP(getConfigType); +PREP(getItemType); +PREP(getWeaponType); +PREP(getWeaponModes); +PREP(getWeaponMuzzles); + +// config objects +PREP(getConfigTypeObject); +PREP(getConfigGunner); +PREP(getConfigCommander); +PREP(getHitPoints); +PREP(getHitPointsWithSelections); +PREP(getVehicleCrew); + +// turrets +PREP(getTurrets); +PREP(getTurretIndex); +PREP(getTurretConfigPath); +PREP(getTurretGunner); +PREP(getTurretCommander); +PREP(getTurretCopilot); +PREP(getDoorTurrets); +PREP(getTurretsFFV); +PREP(getTurretsOther); + // ACE_Debug PREP(exportConfig); PREP(getChildren); @@ -192,6 +199,7 @@ PREP(getDisplayConfigName); PREP(log); PREP(logControls); PREP(logDisplays); +PREP(logModEntries); PREP(monitor); PREP(showUser); @@ -214,6 +222,17 @@ PREP(localEvent); PREP(removeEventHandler); PREP(removeAlLEventHandlers); +// other eventhandlers +PREP(addActionEventHandler); +PREP(addActionMenuEventHandler); +PREP(addScrollWheelEventHandler); +PREP(addMapMarkerCreatedEventHandler); + +PREP(removeActionEventHandler); +PREP(removeActionMenuEventHandler); +PREP(removeScrollWheelEventHandler); +PREP(removeMapMarkerCreatedEventHandler); + // hashes PREP(hashCreate); PREP(hashSet); diff --git a/addons/common/config.cpp b/addons/common/config.cpp index afd118ff1c..90309af612 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -2,7 +2,7 @@ class CfgPatches { class ADDON { - units[] = {"ACE_Box_Misc"}; + units[] = {"ACE_Box_Misc", "ACE_bananaItem"}; weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_main"}; diff --git a/addons/common/functions/fnc__handleNetEvent.sqf b/addons/common/functions/fnc__handleNetEvent.sqf index 8babbbe098..804a0ade78 100644 --- a/addons/common/functions/fnc__handleNetEvent.sqf +++ b/addons/common/functions/fnc__handleNetEvent.sqf @@ -7,7 +7,6 @@ private ["_eventType", "_event", "_eventName", "_eventArgs", "_eventNames", "_ev _eventType = _this select 0; _event = _this select 1; - if(_eventType == "ACEg") then { _eventName = _event select 0; _eventArgs = _event select 1; @@ -16,9 +15,18 @@ if(_eventType == "ACEg") then { _eventIndex = _eventNames find _eventName; if(_eventIndex != -1) then { _events = (GVAR(events) select 1) select _eventIndex; + + #ifdef DEBUG_EVENTS + diag_log text format[ARR_2("* Net Event %1",_eventName)]; + diag_log text format[ARR_2(" args=%1",_eventArgs)]; + #endif + { if(!isNil "_x") then { _eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Net Event %1 ID: %2",_eventName,_forEachIndex)]); + #ifdef DEBUG_EVENTS_CALLSTACK + diag_log text format[ARR_2(" ID: %1",_forEachIndex)]; + #endif }; } forEach _events; }; diff --git a/addons/common/functions/fnc_addToInventory.sqf b/addons/common/functions/fnc_addToInventory.sqf new file mode 100644 index 0000000000..4e088525fc --- /dev/null +++ b/addons/common/functions/fnc_addToInventory.sqf @@ -0,0 +1,101 @@ +/* + * Author: Garth 'L-H' de Wet + * Adds an item,weapon,magazine to the unit's inventory + * or places it in a weaponHolder if no space. + * + * Arguments: + * 0: Unit (OBJECT) + * 1: Classname (String) + * 2: Container (String, Optional) uniform, vest, backpack + * + * Return Value: + * Array: + * 0: Added to player (Bool) + * 1: weaponholder (OBJECT) + * + * Public: Yes + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +EXPLODE_2_PVT(_this,_unit,_classname); +private "_addedToPlayer"; +private "_container"; +private "_canAdd"; +private "_type"; + +_canAdd = false; +_addedToPlayer = true; + +if((count _this) > 2) then { + _container = _this select 2; +} else { + _container = nil; +}; + +_type = [_classname] call EFUNC(common,getItemType); + +if(!isNil "_container") then { + switch (_container) do { + case "vest": { _canAdd = _unit canAddItemToVest _classname; }; + case "backpack": { _canAdd = _unit canAddItemToBackpack _classname; }; + case "uniform": { _canAdd = _unit canAddItemToUniform _classname; }; + }; +} else { + _container = ""; + _canAdd = _unit canAdd _classname; +}; + +switch ((_type select 0)) do { + case "weapon": { + if (_canAdd) then { + switch (_container) do { + case "vest": { (vestContainer _unit) addWeaponCargoGlobal [_classname, 1]; }; + case "backpack": { (backpackContainer _unit) addWeaponCargoGlobal [_classname, 1]; }; + case "uniform": { (uniformContainer _unit) addWeaponCargoGlobal [_classname, 1]; }; + default { _unit addWeaponGlobal _classname; }; + }; + } else { + _addedToPlayer = false; + _pos = _unit modelToWorld [0,1,0.05]; + _unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"]; + _unit addWeaponCargoGlobal [_classname,1]; + _unit setPosATL _pos; + }; + }; + case "magazine": { + if (_canAdd) then { + switch (_container) do { + case "vest": { (vestContainer _unit) addMagazineCargoGlobal [_classname, 1]; }; + case "backpack": { (backpackContainer _unit) addMagazineCargoGlobal [_classname, 1]; }; + case "uniform": { (uniformContainer _unit) addMagazineCargoGlobal [_classname, 1]; }; + default { _unit addMagazineGlobal _classname; }; + }; + } else { + _addedToPlayer = false; + _pos = _unit modelToWorld [0,1,0.05]; + _unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"]; + _unit addMagazineCargoGlobal [_classname, 1]; + _unit setPosATL _pos; + }; + }; + case "item": { + if (_canAdd) then { + switch (_container) do { + case "vest": { _unit addItemToVest _classname; }; + case "backpack": { _unit addItemToBackpack _classname; }; + case "uniform": { _unit addItemToUniform _classname; }; + default { _unit addItem _classname; }; + }; + } else { + _addedToPlayer = false; + _pos = _unit modelToWorld [0,1,0.05]; + _unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"]; + _unit addItemCargoGlobal [_classname,1]; + _unit setPosATL _pos; + }; + }; + default {diag_log format ["ACE: Incorrect item type passed to %1, passed: %2",QFUNC(AddToInventory),_type];}; +}; + +[_addedToPlayer,_unit] diff --git a/addons/common/functions/fnc_doAnimation.sqf b/addons/common/functions/fnc_doAnimation.sqf index 7bf2b93969..9f683800a1 100644 --- a/addons/common/functions/fnc_doAnimation.sqf +++ b/addons/common/functions/fnc_doAnimation.sqf @@ -36,11 +36,7 @@ if (count _this > 3) then { }; // don't overwrite more important animations -if (_unit getVariable ["ACE_isUnconscious", false] && {!_force}) exitWith { - if (_animation != "Unconscious") then { - [_unit, "Unconscious", 2] call FUNC(doAnimation); - }; -}; +if (_unit getVariable ["ACE_isUnconscious", false] && {(_animation != "Unconscious")} && {!_force}) exitWith {}; // don't go unconscious if the unit isn't unconscious if (_animation == "Unconscious" && {!((_unit getVariable ["ACE_isUnconscious", false]) || (_unit getVariable ["ACE_isDead", false]))}) exitWith {}; diff --git a/addons/common/functions/fnc_dumpPerformanceCounters.sqf b/addons/common/functions/fnc_dumpPerformanceCounters.sqf index ded6514c9a..b9afb8f7eb 100644 --- a/addons/common/functions/fnc_dumpPerformanceCounters.sqf +++ b/addons/common/functions/fnc_dumpPerformanceCounters.sqf @@ -2,16 +2,16 @@ #define DEBUG_MODE_FULL #include "script_component.hpp" -/* + diag_log text format["REGISTERED ACE PFH HANDLERS"]; diag_log text format["-------------------------------------------"]; -if(!isNil "ACE_PFH") then { +if(!isNil "ACE_PFH_COUNTER") then { { private["_pfh"]; _pfh = _x select 0; diag_log text format["Registered PFH: id=%1, %1:%2", (_pfh select 0), (_pfh select 1), (_pfh select 2) ]; - } forEach ACE_PFH; -};*/ + } forEach ACE_PFH_COUNTER; +}; diag_log text format["ACE COUNTER RESULTS"]; diag_log text format["-------------------------------------------"]; diff --git a/addons/common/functions/fnc_getConfigType.sqf b/addons/common/functions/fnc_getConfigType.sqf new file mode 100644 index 0000000000..f3c21923ef --- /dev/null +++ b/addons/common/functions/fnc_getConfigType.sqf @@ -0,0 +1,24 @@ +/* + * Author: commy2 + * + * What kind of Cfg is the item. Works for CfgMagaines, CfgWeapons and CfgGlasses + * + * Argument: + * 0: A item's classname. (String) + * + * Return value: + * CfgWhatever (String) + */ +#include "script_component.hpp" + +private "_item"; + +_item = _this select 0; + +if (isClass (configFile >> "CfgWeapons" >> _item)) exitWith {"CfgWeapons"}; + +if (isClass (configFile >> "CfgMagazines" >> _item)) exitWith {"CfgMagazines"}; + +if (isClass (configFile >> "CfgGlasses" >> _item)) exitWith {"CfgGlasses"}; + +"" diff --git a/addons/common/functions/fnc_getConfigTypeObject.sqf b/addons/common/functions/fnc_getConfigTypeObject.sqf new file mode 100644 index 0000000000..35799da6b5 --- /dev/null +++ b/addons/common/functions/fnc_getConfigTypeObject.sqf @@ -0,0 +1,22 @@ +/* + * Author: commy2 + * + * What kind of Cfg is the object. Works for CfgVehicles and CfgAmmo + * + * Argument: + * 0: An object's classname. (String) + * + * Return value: + * CfgWhatever (String) + */ +#include "script_component.hpp" + +private "_object"; + +_object = _this select 0; + +if (isClass (configFile >> "CfgVehicles" >> _object)) exitWith {"CfgVehicles"}; + +if (isClass (configFile >> "CfgAmmo" >> _object)) exitWith {"CfgAmmo"}; + +"" diff --git a/addons/common/functions/fnc_getGunner.sqf b/addons/common/functions/fnc_getGunner.sqf index 71191083e0..2980246504 100644 --- a/addons/common/functions/fnc_getGunner.sqf +++ b/addons/common/functions/fnc_getGunner.sqf @@ -16,6 +16,8 @@ private ["_vehicle", "_weapon"]; _vehicle = _this select 0; _weapon = _this select 1; +if (gunner _vehicle == _vehicle && {_weapon in weapons _vehicle}) exitWith {gunner _vehicle}; + private "_gunner"; _gunner = objNull; @@ -23,6 +25,6 @@ _gunner = objNull; if (_weapon in (_vehicle weaponsTurret _x)) exitWith { _gunner = _vehicle turretUnit _x; }; -} forEach allTurrets _vehicle; +} forEach allTurrets [_vehicle, true]; _gunner diff --git a/addons/common/functions/fnc_getItemType.sqf b/addons/common/functions/fnc_getItemType.sqf new file mode 100644 index 0000000000..20d581f526 --- /dev/null +++ b/addons/common/functions/fnc_getItemType.sqf @@ -0,0 +1,83 @@ +/* + * Author: commy2 + * + * What kind of item is given classname + * + * Argument: + * 0: Classname of a item. (String) + * + * Return value: + * Item type. (Array) + * 0: "weapon", "item", "magazine" or "" (String) + * 1: A description of the item (e.g. "primary" for a weapon or "vest" for a vest item) + * + */ +#include "script_component.hpp" + +private "_item"; + +_item = _this select 0; + +_cfgType = [_item] call FUNC(getConfigType); + +if (_cfgType == "") exitWith {["",""]}; + +if (_cfgType == "CfgGlasses") exitWith {["item","glasses"]}; + +private ["_config", "_type"]; + +_config = configFile >> _cfgType >> _item; + +_type = getNumber (_config >> "type"); + +if (isNumber (_config >> "ItemInfo" >> "type")) then { + _type = getNumber (_config >> "ItemInfo" >> "type"); +}; + +private "_default"; +_default = ["item", "magazine"] select (_cfgType == "CfgMagazines"); + +switch (true) do { + case (_type == 0): {[_default,"unknown"]}; + case (_type == 2^0): {["weapon","primary"]}; + case (_type == 2^1): {["weapon","handgun"]}; + case (_type == 2^2): {["weapon","secondary"]}; + case (_type < 2^4): {["weapon","unknown"]}; + case (_type == 2^4): {["magazine","handgun"]}; // handgun + case (_type == 2^8): {["magazine","primary"]}; // rifle + case (_type == 2^9): {["magazine","secondary"]}; // rpg, mg, mines + //case (_type < 2^11): {["magazine","unknown"]}; + + case (_type == 101): {["item","muzzle"]}; + case (_type == 201): {["item","optics"]}; + case (_type == 301): {["item","flashlight"]}; + case (_type == 302): {["item","under"]}; // czech for bipod item + case (_type == 401): {["item","first_aid_kit"]}; + case (_type == 501): {["item","fins"]}; // not implemented + case (_type == 601): {["item","breathing_bomb"]}; // not implemented + case (_type == 603): {["item","goggles"]}; + case (_type == 604): {["item","scuba"]}; // not implemented + case (_type == 605): {["item","headgear"]}; + case (_type == 611): {["item","radio"]}; + case (_type == 616): {["item","hmd"]}; + case (_type == 617): {["item","binocular"]}; + case (_type == 619): {["item","medikit"]}; + case (_type == 620): {["item","toolkit"]}; + case (_type == 621): {["item","uav_terminal"]}; + case (_type == 701): {["item","vest"]}; + case (_type == 801): {["item","uniform"]}; + + case (_type == 2^12): { + switch (toLower getText (_config >> "simulation")) do { + case ("weapon"): {["weapon","binocular"]}; + case ("binocular"): {["weapon","binocular"]}; + case ("nvgoggles"): {["item","nvgoggles"]}; + case ("itemminedetector"): {["item","minedetector"]}; + default {[_default,"unknown"]}; + }; + }; + + case (_type == 2^16): {["weapon","vehicle"]}; + case (_type == 2^17): {[_default,"unknown"]}; // ??? + default {[_default,"unknown"]}; +}; diff --git a/addons/weaponselect/functions/fnc_getWeaponModes.sqf b/addons/common/functions/fnc_getWeaponModes.sqf similarity index 100% rename from addons/weaponselect/functions/fnc_getWeaponModes.sqf rename to addons/common/functions/fnc_getWeaponModes.sqf diff --git a/addons/weaponselect/functions/fnc_getWeaponMuzzles.sqf b/addons/common/functions/fnc_getWeaponMuzzles.sqf similarity index 100% rename from addons/weaponselect/functions/fnc_getWeaponMuzzles.sqf rename to addons/common/functions/fnc_getWeaponMuzzles.sqf diff --git a/addons/common/functions/fnc_getWeaponState.sqf b/addons/common/functions/fnc_getWeaponState.sqf new file mode 100644 index 0000000000..4ec54cc787 --- /dev/null +++ b/addons/common/functions/fnc_getWeaponState.sqf @@ -0,0 +1,73 @@ +/* + * Author: commy2 + * + * Return current state of the weapon. Attachments and magazines with ammo. + * + * Argument: + * 0: A unit (Object) + * 1: A weapon (String) + * + * Return value: + * Weapon info, format: [attachments, muzzles, magazines, ammo] (Array) + */ + #include "script_component.hpp" + +private ["_unit", "_weapon"]; + +_unit = _this select 0; +_weapon = _this select 1; + +private "_muzzles"; +_muzzles = [_weapon] call FUNC(getWeaponMuzzles); + +private "_weaponInfo"; +_weaponInfo = []; + +switch (_weapon) do { + case (primaryWeapon _unit): { + _weaponInfo pushBack primaryWeaponItems _unit; + + }; + + case (secondaryWeapon _unit): { + _weaponInfo pushBack secondaryWeaponItems _unit; + + }; + + case (handgunWeapon _unit): { + _weaponInfo pushBack handgunItems _unit; + + }; + + default { + _weaponInfo pushBack ["","","",""]; + + }; +}; + +// get loaded magazines and ammo +private ["_magazines", "_ammo"]; + +_magazines = []; +_ammo = []; + +{ + _magazines pushBack ""; + _ammo pushBack 0; +} forEach _muzzles; + +{ + if (_x select 2) then { + private "_index"; + _index = _muzzles find (_x select 4); + + if (_index != -1) then { + _magazines set [_index, _x select 0]; + _ammo set [_index, _x select 1]; + }; + }; +} forEach magazinesAmmoFull _unit; + +_weaponInfo append [_muzzles, _magazines, _ammo]; + +_weaponInfo diff --git a/addons/common/functions/fnc_getZoom.sqf b/addons/common/functions/fnc_getZoom.sqf new file mode 100644 index 0000000000..1f319ac768 --- /dev/null +++ b/addons/common/functions/fnc_getZoom.sqf @@ -0,0 +1,14 @@ +/* + * Author: commy2 + * + * Returns a value depending on current zoom level. + * + * Argument: + * None. + * + * Return value: + * Zoom. (Number) + */ +#include "script_component.hpp" + +(0.5 - ((worldToScreen positionCameraToWorld [0,1,1]) select 1)) * (getResolution select 5) diff --git a/addons/common/functions/fnc_localEvent.sqf b/addons/common/functions/fnc_localEvent.sqf index 85cc63a3b6..0b8c218eca 100644 --- a/addons/common/functions/fnc_localEvent.sqf +++ b/addons/common/functions/fnc_localEvent.sqf @@ -12,16 +12,23 @@ */ #include "script_component.hpp" -_eventName = _this select 0; -_eventArgs = _this select 1; +PARAMS_2(_eventName,_eventArgs); _eventNames = GVAR(events) select 0; _eventIndex = _eventNames find _eventName; if(_eventIndex != -1) then { _events = (GVAR(events) select 1) select _eventIndex; + #ifdef DEBUG_EVENTS + diag_log text format[ARR_2("* Local Event: %1",_eventName)]; + diag_log text format[ARR_2(" args=%1",_eventArgs)]; + #endif + { if(!isNil "_x") then { _eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Local Event %1 ID: %2",_eventName,_forEachIndex)]); + #ifdef DEBUG_EVENTS_CALLSTACK + diag_log text format[ARR_2(" ID: %1",_forEachIndex)]; + #endif }; } forEach _events; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_logModEntries.sqf b/addons/common/functions/fnc_logModEntries.sqf new file mode 100644 index 0000000000..827802ad3f --- /dev/null +++ b/addons/common/functions/fnc_logModEntries.sqf @@ -0,0 +1,17 @@ +// by commy2 + +private ["_configs", "_entries"]; + +_configs = "true" configClasses (configFile >> _this); + +_entries = []; + +{ + { + _name = toLower configName _x; + if !(_name in _entries) then { + diag_log text _name; + _entries pushBack _name; + }; + } forEach configProperties [_x, "toLower configName _x find 'ace' == 0", false]; +} forEach _configs; diff --git a/addons/common/functions/fnc_serverEvent.sqf b/addons/common/functions/fnc_serverEvent.sqf index 5e7ba3f92b..b792323867 100644 --- a/addons/common/functions/fnc_serverEvent.sqf +++ b/addons/common/functions/fnc_serverEvent.sqf @@ -16,6 +16,10 @@ private ["_eventName", "_eventArgs"]; _eventName = _this select 0; _eventArgs = _this select 1; + #ifdef DEBUG_EVENTS + diag_log text format[ARR_2("* Server Event: %1",_eventName)]; + diag_log text format[ARR_2(" args=%1",_eventArgs)]; + #endif ACEg = [_eventName, _eventArgs]; if(!isServer) then { diff --git a/addons/common/functions/fnc_targetEvent.sqf b/addons/common/functions/fnc_targetEvent.sqf index 4984c3d720..7299eeb057 100644 --- a/addons/common/functions/fnc_targetEvent.sqf +++ b/addons/common/functions/fnc_targetEvent.sqf @@ -21,6 +21,11 @@ _eventName = _this select 0; _eventTargets = _this select 1; _eventArgs = _this select 2; +#ifdef DEBUG_EVENTS + diag_log text format[ARR_3("* Target Event: %1 - %2",_eventName,_eventTargets)]; + diag_log text format[ARR_2(" args=%1",_eventArgs)]; +#endif + ACEc = [_eventName, _eventTargets, _eventArgs]; if(!isServer) then { publicVariableServer "ACEc"; diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp index f568eace4e..e5c454e969 100644 --- a/addons/dragging/CfgEventHandlers.hpp +++ b/addons/dragging/CfgEventHandlers.hpp @@ -23,11 +23,6 @@ class Extended_Init_EventHandlers { init = QUOTE(_this call DFUNC(initObject)); }; }; - class StaticMortar { - class ADDON { - init = QUOTE(_this call DFUNC(initObject)); - }; - }; class ReammoBox_F { class ADDON { init = QUOTE(_this call DFUNC(initObject)); diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf index dbbacae915..24426d0e3a 100644 --- a/addons/dragging/functions/fnc_canCarry.sqf +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; // a static weapon has to be empty for dragging if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; -alive _target && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"]} +alive _target && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false])} diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index be3cda7e6c..f0e269983a 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; // a static weapon has to be empty for dragging if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; -alive _target && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"]} +alive _target && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false])} diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index 8afa0f541a..f3a9329d35 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -14,8 +14,8 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -// drop if the crate is destroyed -if !([_target] call EFUNC(common,isAlive)) then { +// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) +if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject_carry); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index 2290c65e9d..8af8e62b90 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -14,8 +14,8 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -// drop if the crate is destroyed -if !([_target] call EFUNC(common,isAlive)) then { +// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) +if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_handleAnimChanged.sqf b/addons/dragging/functions/fnc_handleAnimChanged.sqf index 91fa3d681b..14b2eff611 100644 --- a/addons/dragging/functions/fnc_handleAnimChanged.sqf +++ b/addons/dragging/functions/fnc_handleAnimChanged.sqf @@ -22,8 +22,8 @@ if (_unit getVariable [QGVAR(isDragging), false]) then { if (_unit getVariable [QGVAR(isCarrying), false]) then { - // drop carried object when not standing - if (stance _unit != "STAND") then { + // drop carried object when not standing; also some exceptions when picking up crate + if (stance _unit != "STAND" && {_anim != "amovpercmstpsnonwnondnon"}) then { private "_carriedObject"; _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; diff --git a/addons/dragging/functions/fnc_startCarry.sqf b/addons/dragging/functions/fnc_startCarry.sqf index 9f1c0bca23..ff201afb02 100644 --- a/addons/dragging/functions/fnc_startCarry.sqf +++ b/addons/dragging/functions/fnc_startCarry.sqf @@ -56,11 +56,12 @@ if (_target isKindOf "CAManBase") then { [_unit, "isDragging", true] call EFUNC(common,setforceWalkStatus); - // prevent multiple players from accessing the same object - [_unit, _target, true] call EFUNC(common,claim); - }; +// prevent multiple players from accessing the same object +[_unit, _target, true] call EFUNC(common,claim); + + // prevents draging and carrying at the same time _unit setVariable [QGVAR(isCarrying), true, true]; diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf index a932d4e189..d98522c5f2 100644 --- a/addons/dragging/functions/fnc_startCarryPFH.sqf +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -16,8 +16,8 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -// same as dragObjectPFH, checks if object is deleted or dead. -if !([_target] call EFUNC(common,isAlive)) then { +// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) +if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index 10d9d896a8..d77a23457e 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -16,8 +16,8 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -// same as dragObjectPFH, checks if object is deleted or dead. -if !([_target] call EFUNC(common,isAlive)) then { +// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) +if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); [_this select 1] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index 7d1cc8f09b..3f1a5707a8 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -3,7 +3,7 @@ ["ACE3", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget", { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; @@ -20,7 +20,7 @@ GVAR(isDownStateKey1) = false; // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false}; @@ -33,7 +33,7 @@ ["ACE3", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp", { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; @@ -47,7 +47,7 @@ ["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown", { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf index c2a08ee73f..01c00511cf 100644 --- a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf +++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf @@ -89,7 +89,7 @@ _gRedOut = MINVIRTUALG / _classCoef; // @todo: Sort the interaction with medical if ((_average > _gBlackOut) and {isClass (configFile >> "CfgPatches" >> "ACE_Medical") and {!(ACE_player getVariable ["ACE_isUnconscious", false])}}) then { - [ACE_player, (10 + floor(random 5))] call EFUNC(medical,knockOut); + [ACE_player, true, (10 + floor(random 5))] call EFUNC(medical,setUnconscious); }; GVAR(GForces_CC) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]]; diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 72bea512d6..8d6ef78a79 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -1,6 +1,8 @@ //XEH_clientInit.sqf #include "script_component.hpp" +if (!hasInterface) exitWith {}; + // Install the render EH on the main display addMissionEventHandler ["Draw3D", DFUNC(render)]; @@ -10,17 +12,43 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; // Wait until the map display is detected waitUntil {(!isNull findDisplay 12)}; - // Install the render EH on the map screen + // Install the render EH on the map screen ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", DFUNC(render)]; }; -["ACE3", QGVAR(InteractKey), "Interact Key", -{[0] call FUNC(keyDown)}, +["ACE3", QGVAR(InteractKey), (localize "STR_ACE_Interact_Menu_InteractKey"), +{ + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Statement + [0] call FUNC(keyDown) +}, {[0] call FUNC(keyUp)}, [219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key -["ACE3", QGVAR(SelfInteractKey), "Self Actions Key", -{[1] call FUNC(keyDown)}, +["ACE3", QGVAR(SelfInteractKey), (localize "STR_ACE_Interact_Menu_SelfInteractKey"), +{ + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Statement + [1] call FUNC(keyDown) +}, {[1] call FUNC(keyUp)}, [219, [false, true, false]], false] call cba_fnc_addKeybind; //Left Windows Key + Ctrl/Strg + + +// Listens for the falling unconscious event, just in case the menu needs to be closed +["medical_onUnconscious", { + diag_log ["im_onUn 1:",_this]; + // If no menu is open just quit + if (GVAR(openedMenuType) < 0) exitWith {}; + + EXPLODE_2_PVT(_this,_unit,_isUnconscious); + + if (_unit != ACE_player || !_isUnconscious) exitWith {}; + + GVAR(actionSelected) = false; + [] call FUNC(keyUp); + diag_log ["im_onUn 2:",_this]; +}] call EFUNC(common,addEventhandler); diff --git a/addons/interact_menu/functions/fnc_addActionToObject.sqf b/addons/interact_menu/functions/fnc_addActionToObject.sqf index 9c4b5013ae..5c736a2da6 100644 --- a/addons/interact_menu/functions/fnc_addActionToObject.sqf +++ b/addons/interact_menu/functions/fnc_addActionToObject.sqf @@ -13,7 +13,7 @@ * The entry full path, which can be used to remove the entry, or add children entries . * * Example: - * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToClass; + * [cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToObject; * * Public: No */ diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 195d741761..968b143701 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -43,7 +43,7 @@ _recurseFnc = { if (_condition == "") then {_condition = "true"}; // Add canInteract (including exceptions) and canInteractWith to condition - _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, objNull, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; + _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; _insertChildren = compile (getText (_entryCfg >> "insertChildren")); @@ -79,18 +79,37 @@ _recurseFnc = { private "_actionsCfg"; _actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions"; +private ["_baseDisplayName", "_baseIcon"]; +_baseDisplayName = ""; +_baseIcon = ""; +if (_objectType isKindOf "CAManBase") then { + _baseDisplayName = localize "STR_ACE_Interact_Menu_SelfActionsRoot"; + _baseIcon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; +} else { + _baseDisplayName = getText (configFile >> "CfgVehicles" >> _objectType >> "displayName"); + //Alt would be to just use a static text, if veh names end up being too long: + // _baseDisplayName = localize "STR_ACE_Interact_Menu_VehicleActionsRoot"; + + //Pull the icon from the vehicle's config: + _baseIcon = getText (configFile >> "CfgVehicles" >> _objectType >> "Icon"); + //icon could be a CfgVehicleIcons + if isText (configFile >> "CfgVehicleIcons" >> _baseIcon) then { + _baseIcon = getText (configFile >> "CfgVehicleIcons" >> _baseIcon); + }; +}; + // Create a master action to base on self action _actions = [ [ [ "ACE_SelfActions", - "Self Actions", - "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa", + _baseDisplayName, + _baseIcon, { // Dummy statement so it's not collapsed when there's no available actions true }, - {[ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)}, + {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)}, {}, [], "Spine3", diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf index 768d51f2a7..172bbea3a4 100644 --- a/addons/interact_menu/functions/fnc_createAction.sqf +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -19,7 +19,7 @@ * Action * * Example: - * [VulcanPinch","Vulcan Pinch",{_target setDamage 1;},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction; + * [VulcanPinch","Vulcan Pinch","",{_target setDamage 1;},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction; * * Public: No */ diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index 5ab9b61788..735130e69a 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -15,6 +15,10 @@ // Exit if there's no menu opened if (GVAR(openedMenuType) < 0) exitWith {true}; +if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then { + closeDialog 0; +}; + if(GVAR(actionSelected)) then { this = GVAR(selectedTarget); @@ -40,10 +44,6 @@ GVAR(keyDown) = false; GVAR(keyDownSelfAction) = false; GVAR(openedMenuType) = -1; -if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then { - closeDialog 0; -}; - GVAR(expanded) = false; GVAR(lastPath) = []; GVAR(menuDepthPath) = []; diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index d35bcc9a93..e14b69472c 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -38,7 +38,7 @@ _fnc_renderNearbyActions = { // Only render them directly if they are base level actions if (count (_x select 1) == 0) then { // Try to render the menu - _action = [_x,[]]; + _action = _x; if ([_target, _action] call FUNC(renderBaseMenu)) then { _numInteractions = _numInteractions + 1; }; @@ -89,7 +89,7 @@ _fnc_renderSelfActions = { { _action = _x; - _pos = if !(visibleMap) then { + _pos = if !(GVAR(useCursorMenu)) then { (((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)) vectorAdd GVAR(selfMenuOffset)) call EFUNC(common,ASLToPosition) } else { [0.5, 0.5] diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index 8054e9d800..1cfc13923e 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -35,7 +35,7 @@ GVAR(iconCount) = GVAR(iconCount) + 1; if(_icon == "") then { _icon = DEFAULT_ICON; }; -_text = format ["
%4", _icon, _color, _color, _text]; +_text = format ["
%4", _icon, _color, _color, _text]; _ctrl ctrlSetStructuredText (parseText _text); _ctrl ctrlSetPosition [(_sPos select 0)-(0.125*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.25*SafeZoneW, 0.1*SafeZoneW]; //_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1]; diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index cecb24fee2..6e5ce8fdb2 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -1,7 +1,21 @@  + Always display cursor for self interaction - + + Interact Key + + + Self Interaction Key + + + Self Actions + + + Vehicle Actions + + + \ No newline at end of file diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 02dd078a2b..e85300f301 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -525,26 +525,6 @@ class CfgVehicles { }; }; - class StaticMortar; - class Mortar_01_base_F: StaticMortar { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = "gunnerview"; - distance = 2; - condition = "true"; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call FUNC(addPassengersActions)); - }; - }; - }; - class thingX; class ReammoBox_F: thingX { class ACE_Actions { diff --git a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf index a23969aa9f..b5c6664657 100644 --- a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf @@ -24,7 +24,7 @@ _onFinish = { EXPLODE_2_PVT((_this select 0),_caller,_target); _caller removeItem "ACE_UAVBattery"; playSound3D [QUOTE(PATHTO_R(sounds\exchange_battery.ogg)), objNull, false, getPosASL _caller, 1, 1, 10]; - ["VehicleSetFuel", [_target], [_target, 1]] call EFUNC(common,targetEvent); //setFuel is local + ["setFuel", [_target], [_target, 1]] call EFUNC(common,targetEvent); //setFuel is local }; _onFailure = { diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf index 6012b1e0e2..6dace9c42d 100644 --- a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -40,12 +40,12 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; if (((getPosASL ace_player) distance _setPosition) > 5) then { _fncStatement = { - _attachedFence = _target getVariable [QGVAR(attachedFence), objNull]; - [ace_player, _attachedFence] call FUNC(cutDownFence); + PARAMS_3(_dummyTarget,_player,_attachedFence); + [_player, _attachedFence] call FUNC(cutDownFence); }; _fncCondition = { - _attachedFence = _target getVariable [QGVAR(attachedFence), objNull]; - ((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items ace_player))}) + PARAMS_3(_dummyTarget,_player,_attachedFence); + ((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items _player))}) }; { @@ -53,10 +53,10 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; if ([_x] call FUNC(isFence)) then { _fencesHelped pushBack _x; _helper = "Sign_Sphere25cm_F" createVehicleLocal (getpos _x); - [_helper, 0, [""], (localize "STR_ACE_logistics_wirecutter_CutFence"), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), [0,0,0], _fncStatement, _fncCondition, 5] call EFUNC(interact_menu,addAction); + _action = [QGVAR(helperCutFence), (localize "STR_ACE_logistics_wirecutter_CutFence"), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, [0,0,0], 5] call EFUNC(interact_menu,createAction); + [_helper, 0, [],_action] call EFUNC(interact_menu,addActionToObject); _helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]); _helper hideObject true; - _helper setVariable [QGVAR(attachedFence), _x]; _addedHelpers pushBack _helper; }; }; diff --git a/addons/magazinerepack/stringtable.xml b/addons/magazinerepack/stringtable.xml index 401d3beaf7..d8fd5ca177 100644 --- a/addons/magazinerepack/stringtable.xml +++ b/addons/magazinerepack/stringtable.xml @@ -11,7 +11,7 @@ Přepáskovat<br/>Zásobníky Ricarica<br/>Caricatori Reorganizar<br/>Carregadores - Újratárazás<<br/>Hungarian> + Újratárazás<br/> Перепаковать<br/>магазины diff --git a/addons/magazines/CfgWeapons.hpp b/addons/magazines/CfgWeapons.hpp index 2b24d578fe..46344d5f06 100644 --- a/addons/magazines/CfgWeapons.hpp +++ b/addons/magazines/CfgWeapons.hpp @@ -230,7 +230,7 @@ class CfgWeapons { class muzzle_snds_H: ItemCore { class ItemInfo: InventoryMuzzleItem_Base_F { class MagazineCoef { - initSpeed = 1.0; + initSpeed = 1.05; }; class AmmoCoef { @@ -263,7 +263,7 @@ class CfgWeapons { class muzzle_snds_L: muzzle_snds_H { class ItemInfo: ItemInfo { class MagazineCoef { - initSpeed = 1.0; + initSpeed = 1.05; }; class AmmoCoef { @@ -296,7 +296,7 @@ class CfgWeapons { class muzzle_snds_M: muzzle_snds_H { class ItemInfo: ItemInfo { class MagazineCoef { - initSpeed = 1.0; + initSpeed = 1.05; }; class AmmoCoef { @@ -329,7 +329,7 @@ class CfgWeapons { class muzzle_snds_B: muzzle_snds_H { class ItemInfo: ItemInfo { class MagazineCoef { - initSpeed = 1.0; + initSpeed = 1.05; }; class AmmoCoef { @@ -362,7 +362,7 @@ class CfgWeapons { class muzzle_snds_H_MG: muzzle_snds_H { class ItemInfo: ItemInfo { class MagazineCoef { - initSpeed = 1.0; + initSpeed = 1.05; }; class AmmoCoef { @@ -395,7 +395,7 @@ class CfgWeapons { class muzzle_snds_H_SW: muzzle_snds_H_MG { class ItemInfo: ItemInfo { class MagazineCoef { - initSpeed = 1.0; + initSpeed = 1.05; }; class AmmoCoef { @@ -428,7 +428,73 @@ class CfgWeapons { class muzzle_snds_acp: muzzle_snds_H { class ItemInfo: ItemInfo { class MagazineCoef { - initSpeed = 1.0; + initSpeed = 1.05; + }; + + class AmmoCoef { + hit = 0.9; + visibleFire = 0.5; + audibleFire = 0.1; + visibleFireTime = 0.5; + audibleFireTime = 0.5; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.8f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + }; + + class muzzle_snds_338_black: ItemCore { + class ItemInfo: InventoryMuzzleItem_Base_F { + class MagazineCoef { + initSpeed = 1.05; + }; + + class AmmoCoef { + hit = 0.9; + visibleFire = 0.5; + audibleFire = 0.1; + visibleFireTime = 0.5; + audibleFireTime = 0.5; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.8f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + }; + + class muzzle_snds_93mmg: ItemCore { + class ItemInfo: InventoryMuzzleItem_Base_F { + class MagazineCoef { + initSpeed = 1.05; }; class AmmoCoef { diff --git a/addons/main/script_debug.hpp b/addons/main/script_debug.hpp index 642de3428d..26475fb226 100644 --- a/addons/main/script_debug.hpp +++ b/addons/main/script_debug.hpp @@ -2,6 +2,8 @@ STACK TRACING **/ //#define ENABLE_CALLSTACK +//#define ENABLE_PERFORMANCE_COUNTERS +//#define DEBUG_EVENTS #ifdef ENABLE_CALLSTACK @@ -29,7 +31,7 @@ PERFORMANCE COUNTERS SECTION //#define ENABLE_PERFORMANCE_COUNTERS #ifdef ENABLE_PERFORMANCE_COUNTERS - #define ADDPFH(function, timing, args) call { _ret = [function, timing, args, #function] call EFUNC(sys_sync,perFrame_add); if(isNil "ACE_PFH" ) then { ACE_PFH=[]; }; ACE_PFH pushBack [[_ret, __FILE__, __LINE__], [function, timing, args]]; _ret } + #define CBA_fnc_addPerFrameHandler { _ret = [(_this select 0), (_this select 1), (_this select 2), #function] call CBA_fnc_addPerFrameHandler; if(isNil "ACE_PFH_COUNTER" ) then { ACE_PFH_COUNTER=[]; }; ACE_PFH_COUNTER pushBack [[_ret, __FILE__, __LINE__], [(_this select 0), (_this select 1), (_this select 2)]]; _ret } #define CREATE_COUNTER(x) if(isNil "ACE_COUNTERS" ) then { ACE_COUNTERS=[]; }; GVAR(DOUBLES(x,counter))=[]; GVAR(DOUBLES(x,counter)) set[0, QUOTE(GVAR(DOUBLES(x,counter)))]; GVAR(DOUBLES(x,counter)) set[1, diag_tickTime]; ACE_COUNTERS pushBack GVAR(DOUBLES(x,counter)); #define BEGIN_COUNTER(x) if(isNil QUOTE(GVAR(DOUBLES(x,counter)))) then { CREATE_COUNTER(x) }; GVAR(DOUBLES(x,counter)) set[2, diag_tickTime]; @@ -37,8 +39,6 @@ PERFORMANCE COUNTERS SECTION #define DUMP_COUNTERS ([__FILE__, __LINE__] call ACE_DUMPCOUNTERS_FNC) #else - #define ADDPFH(function, timing, args) [function, timing, args, #function] call EFUNC(sys_sync,perFrame_add) - #define CREATE_COUNTER(x) /* disabled */ #define BEGIN_COUNTER(x) /* disabled */ #define END_COUNTER(x) /* disabled */ diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index da8c723c8a..855653718a 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -18,10 +18,13 @@ class ACE_Medical_Actions { callbackProgress = ""; animationPatient = ""; - animationCaller = "AinvPknlMstpSnonWnonDnon_medic4"; + animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; + animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"}; + animationCaller = "AinvPknlMstpSlayWnonDnon_medic"; animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; + litter[] = { {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} }; }; class Morphine: Bandage { displayName = "$STR_ACE_Medical_Inject_Morphine"; @@ -30,6 +33,7 @@ class ACE_Medical_Actions { items[] = {"ACE_morphine"}; callbackSuccess = QUOTE(DFUNC(treatmentBasic_morphine)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = { {"All", "", {"ACE_MedicalLitter_morphine"}} }; }; class Epinephrine: Bandage { displayName = "$STR_ACE_Medical_Inject_Epinephrine"; @@ -39,6 +43,7 @@ class ACE_Medical_Actions { items[] = {"ACE_epinephrine"}; callbackSuccess = QUOTE(DFUNC(treatmentBasic_epipen)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} }; }; class BloodIV: Bandage { displayName = "$STR_ACE_Medical_Transfuse_Blood"; @@ -48,35 +53,51 @@ class ACE_Medical_Actions { items[] = {{"ACE_bloodIV", "ACE_bloodIV_500", "ACE_bloodIV_250"}}; callbackSuccess = QUOTE(DFUNC(treatmentBasic_bloodbag)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = {}; }; - class Carry: Bandage { - displayName = ""; - displayNameProgress = ""; + class Tourniquet: Bandage { + displayName = "$STR_ACE_Medical_Apply_Tourniquet"; + displayNameProgress = "$STR_ACE_Medical_Applying_Tourniquet"; + items[] = {"ACE_tourniquet"}; + treatmentTime = 6; + callbackSuccess = QUOTE(DFUNC(treatmentTourniquet)); + condition = QUOTE(!([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo))); + litter[] = {}; + }; + class BodyBag: Bandage { + displayName = "$STR_ACE_MEDICAL_PlaceInBodyBag"; + displayNameProgress = "$STR_ACE_MEDICAL_PlacingInBodyBag"; treatmentLocations[] = {"All"}; requiredMedic = 0; - treatmentTime = 0; - items[] = {}; - condition = QUOTE(DFUNC(canCarry)); - callbackSuccess = QUOTE([ARR_3(_this select 0, _this select 1, true)] call DFUNC(actionCarryUnit)); + treatmentTime = 2; + items[] = {"ACE_bodyBag"}; + condition = "!alive (_this select 1);"; + callbackSuccess = QUOTE(DFUNC(actionPlaceInBodyBag)); callbackFailure = ""; callbackProgress = ""; - itemConsumed = 0; animationPatient = ""; - animationCaller = ""; - animationCallerProne = ""; - animationCallerSelf = ""; - animationCallerSelfProne = ""; + animationPatientUnconscious = ""; + itemConsumed = 0; + litter[] = {}; }; - class Drag: Carry { + /*class PersonalAidKit: Bandage { displayName = ""; displayNameProgress = ""; - condition = QUOTE(DFUNC(canCarry)); - callbackSuccess = QUOTE([ARR_3(_this select 0, _this select 1, false)] call DFUNC(actionCarryUnit)); - }; + items[] = {"ACE_personalAidKit"}; + treatmentLocations[] = {"All"}; + requiredMedic = 1; + treatmentTime = 15; + callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal)); + itemConsumed = 0; + animationCaller = "AinvPknlMstpSlayW[wpn]Dnon_medic"; + litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}}, {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}, {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} }; + };*/ }; class Advanced { class FieldDressing { + displayName = "$STR_ACE_Medical_Bandage"; + displayNameProgress = "$STR_ACE_Medical_Bandaging"; // Which locations can this treatment action be used? Available: Field, MedicalFacility, MedicalVehicle, All. treatmentLocations[] = {"All"}; // What is the level of medical skill required for this treatment action? 0 = all soldiers, 1 = medic, 2 = doctor @@ -92,10 +113,13 @@ class ACE_Medical_Actions { callbackProgress = ""; itemConsumed = 1; animationPatient = ""; - animationCaller = "AinvPknlMstpSnonWnonDnon_medic4"; + animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; + animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"}; + animationCaller = "AinvPknlMstpSlayWnonDnon_medic"; animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; + litter[] = { {"All", "", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} }; }; class PackingBandage: fieldDressing { items[] = {"ACE_packingBandage"}; @@ -107,29 +131,44 @@ class ACE_Medical_Actions { items[] = {"ACE_quikclot"}; }; class Tourniquet: fieldDressing { + displayName = "$STR_ACE_Medical_Apply_Tourniquet"; + displayNameProgress = "$STR_ACE_Medical_Applying_Tourniquet"; items[] = {"ACE_tourniquet"}; treatmentTime = 6; callbackSuccess = QUOTE(DFUNC(treatmentTourniquet)); condition = QUOTE(!([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo))); + litter[] = {}; }; class Morphine: fieldDressing { + displayName = "$STR_ACE_Medical_Inject_Morphine"; + displayNameProgress = "$STR_ACE_Medical_Injecting_Morphine"; items[] = {"ACE_morphine"}; treatmentTime = 3; callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_medication)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = { {"All", "", {"ACE_MedicalLitter_morphine"}} }; }; class Atropine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Atropine"; + displayNameProgress = "$STR_ACE_Medical_Injecting_Atropine"; items[] = {"ACE_atropine"}; + litter[] = { {"All", "", {"ACE_MedicalLitter_atropine"}} }; }; class Epinephrine: Morphine { + displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + displayNameProgress = "$STR_ACE_Medical_Injecting_Epinephrine"; items[] = {"ACE_epinephrine"}; + litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} }; }; class BloodIV: fieldDressing { + displayName = "$STR_ACE_Medical_Transfuse_Blood"; + displayNameProgress = "$STR_ACE_Medical_Transfusing_Blood"; items[] = {"ACE_bloodIV"}; requiredMedic = 1; treatmentTime = 7; callbackSuccess = QUOTE(DFUNC(treatmentIV)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = {}; }; class BloodIV_500: BloodIV { items[] = {"ACE_bloodIV_500"}; @@ -138,6 +177,8 @@ class ACE_Medical_Actions { items[] = {"ACE_bloodIV_250"}; }; class PlasmaIV: BloodIV { + displayName = "$STR_ACE_Medical_Transfuse_Plasma"; + displayNameProgress = "$STR_ACE_Medical_Transfusing_Plasma"; items[] = {"ACE_plasmaIV"}; animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; }; @@ -148,6 +189,8 @@ class ACE_Medical_Actions { items[] = {"ACE_plasmaIV_250"}; }; class SalineIV: BloodIV { + displayName = "$STR_ACE_Medical_Transfuse_Saline"; + displayNameProgress = "$STR_ACE_Medical_Transfusing_Saline"; items[] = {"ACE_salineIV"}; animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; }; @@ -158,24 +201,37 @@ class ACE_Medical_Actions { items[] = {"ACE_salineIV_250"}; }; class SurgicalKit: fieldDressing { + displayName = ""; + displayNameProgress = ""; items[] = {"ACE_surgicalKit"}; treatmentLocations[] = {"MedicalFacility", "MedicalVehicle"}; - requiredMedic = 2; - treatmentTime = 15; + requiredMedic = QGVAR(medicSetting_SurgicalKit); + treatmentTime = 10; callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_surgicalKit)); - itemConsumed = 0; + itemConsumed = QGVAR(consumeItem_SurgicalKit); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"} }}; }; class PersonalAidKit: fieldDressing { + displayName = ""; + displayNameProgress = ""; items[] = {"ACE_personalAidKit"}; treatmentLocations[] = {"All"}; - requiredMedic = 1; - treatmentTime = 15; + requiredMedic = QGVAR(medicSetting_PAK); + treatmentTime = 10; callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal)); - itemConsumed = 0; - animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + itemConsumed = QGVAR(consumeItem_PAK); + animationPatient = ""; + animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; + animationCaller = "AinvPknlMstpSlayWnonDnon_medic"; + animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; + animationCallerSelf = ""; + animationCallerSelfProne = ""; + litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}}, {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}} }, {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} }; }; class CheckPulse: fieldDressing { + displayName = ""; + displayNameProgress = ""; treatmentLocations[] = {"All"}; requiredMedic = 0; treatmentTime = 2; @@ -186,6 +242,7 @@ class ACE_Medical_Actions { animationPatient = ""; animationCaller = ""; // TODO itemConsumed = 0; + litter[] = {}; }; class CheckBloodPressure: CheckPulse { callbackSuccess = QUOTE(DFUNC(actionCheckBloodPressure)); @@ -199,55 +256,41 @@ class ACE_Medical_Actions { condition = QUOTE([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo)); }; class CPR: fieldDressing { + displayName = "CPR"; + displayNameProgress = "Performing CPR"; treatmentLocations[] = {"All"}; requiredMedic = 0; - treatmentTime = 25; + treatmentTime = 15; items[] = {}; - condition = ""; // unconscious? + condition = "((_this select 1) getvariable ['ACE_medical_inCardiacArrest', false])"; callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR)); callbackFailure = ""; - callbackProgress = ""; + callbackProgress = "((_this select 1) getvariable ['ACE_medical_inCardiacArrest', false])"; animationPatient = ""; - animationCaller = ""; // TODO + animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; + animationCaller = "AinvPknlMstpSlayWnonDnon_medic"; + animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; + animationCallerSelf = ""; + animationCallerSelfProne = ""; itemConsumed = 0; + litter[] = {}; }; class BodyBag: fieldDressing { + displayName = "$STR_ACE_MEDICAL_PlaceInBodyBag"; + displayNameProgress = "$STR_ACE_MEDICAL_PlacingInBodyBag"; treatmentLocations[] = {"All"}; requiredMedic = 0; - treatmentTime = 7.5; + treatmentTime = 2; items[] = {"ACE_bodyBag"}; condition = "!alive (_this select 1);"; callbackSuccess = QUOTE(DFUNC(actionPlaceInBodyBag)); callbackFailure = ""; callbackProgress = ""; animationPatient = ""; + animationPatientUnconscious = ""; itemConsumed = 0; + litter[] = {}; }; - class Carry: fieldDressing { - displayName = ""; - displayNameProgress = ""; - treatmentLocations[] = {"All"}; - requiredMedic = 0; - treatmentTime = 0; - items[] = {}; - condition = QUOTE(DFUNC(canCarry)); - callbackSuccess = QUOTE([ARR_3(_this select 0, _this select 1, true)] call DFUNC(actionCarryUnit)); - callbackFailure = ""; - callbackProgress = ""; - itemConsumed = 0; - animationPatient = ""; - animationCaller = ""; - animationCallerProne = ""; - animationCallerSelf = ""; - animationCallerSelfProne = ""; - }; - class Drag: Carry { - displayName = ""; - displayNameProgress = ""; - condition = QUOTE(DFUNC(canCarry)); - callbackSuccess = QUOTE([ARR_3(_this select 0, _this select 1, false)] call DFUNC(actionCarryUnit)); - }; - }; }; @@ -443,6 +486,8 @@ class ACE_Medical_Advanced { class damageTypes { thresholds[] = {{0.1, 1}}; selectionSpecific = 1; + lethalDamage = 0.01; + class bullet { // above damage, amount. Put the highest threshold to the left and lower the threshold with the elements to the right of it. thresholds[] = {{0.1, 1}}; @@ -465,8 +510,9 @@ class ACE_Medical_Advanced { selectionSpecific = 0; }; class backblast { - thresholds[] = {{0.25, 5}}; + thresholds[] = {{0, 2},{0.55, 5}, {1, 6}}; selectionSpecific = 0; + lethalDamage = 1; }; class stab { thresholds[] = {{0.1, 1}}; diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index 003d9897b8..51ad3533f6 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -14,16 +14,12 @@ class ACE_Settings { typeName = "SCALAR"; values[] = {"Players only", "Players and AI"}; }; - class GVAR(maxRevives) { - typeName = "NUMBER"; - value = 1; - }; class GVAR(enableOverdosing) { typeName = "BOOL"; value = true; }; class GVAR(bleedingCoefficient) { - typeName = "NUMBER"; + typeName = "SCALAR"; value = 1; }; @@ -48,16 +44,16 @@ class ACE_Settings { value = true; }; class GVAR(playerDamageThreshold) { - typeName = "NUMBER"; + typeName = "SCALAR"; value = 1; }; class GVAR(AIDamageThreshold) { - typeName = "NUMBER"; + typeName = "SCALAR"; value = 1; }; class GVAR(enableUnsconsiousnessAI) { value = 1; - typeName = "NUMBER"; + typeName = "SCALAR"; values[] = {"Disabled", "Enabled", "50/50"}; }; class GVAR(preventInstaDeath) { @@ -65,11 +61,39 @@ class ACE_Settings { value = false; }; class GVAR(maxReviveTime) { - typeName = "NUMBER"; + typeName = "SCALAR"; value = 120; }; + class GVAR(amountOfReviveLives) { + typeName = "SCALAR"; + value = -1; + }; class GVAR(allowDeadBodyMovement) { typeName = "BOOL"; value = false; }; + class GVAR(allowLitterCreation) { + typeName = "BOOL"; + value = true; + }; + class GVAR(litterCleanUpDelay) { + typeName = "SCALAR"; + value = 1800; + }; + class GVAR(medicSetting_PAK) { + typeName = "SCALAR"; + value = 1; + }; + class GVAR(medicSetting_SurgicalKit) { + typeName = "SCALAR"; + value = 1; + }; + class GVAR(consumeItem_PAK) { + typeName = "SCALAR"; + value = 0; + }; + class GVAR(consumeItem_SurgicalKit) { + typeName = "SCALAR"; + value = 0; + }; }; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 9f3f2c25b7..af5981ebba 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -26,10 +26,6 @@ class CfgVehicles { description = "What is the medical simulation level?"; typeName = "NUMBER"; class values { - class disable { - name = "Disabled"; - value = 0; - }; class normal { name = "Basic"; value = 1; @@ -43,11 +39,11 @@ class CfgVehicles { }; class enableFor { displayName = "Enabled for"; - description = "Select what units the medical system will be enabled for"; + description = "Select what units the medical system will be enabled for (Adv only)"; typeName = "NUMBER"; class values { class playableUnits { - name = "Players only"; + name = "Players only."; value = 0; default = 1; }; @@ -57,21 +53,22 @@ class CfgVehicles { }; }; }; - class enableAirway { + // TODO Disabled until the features are implemented + /*class enableAirway { displayName = "Enable Airway"; - description = "Enable Advanced medical Airway"; + description = "Enable Advanced medical Airway (Adv only)"; typeName = "BOOL"; defaultValue = 0; }; class enableFractures { displayName = "Enable Fractures"; - description = "Enable Advanced medical Fractures"; + description = "Enable Advanced medical Fractures (Adv only)"; typeName = "BOOL"; defaultValue = 0; - }; + };*/ class enableAdvancedWounds { displayName = "Enable Advanced wounds"; - description = "Allow reopening of bandaged wounds?"; + description = "Allow reopening of bandaged wounds? (Adv only)"; typeName = "BOOL"; defaultValue = 0; }; @@ -125,6 +122,12 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 0; }; + class bleedingCoefficient { + displayName = "Bleeding coefficient"; + description = "Coefficient to modify the bleeding speed"; + typeName = "NUMBER"; + defaultValue = 1; + }; }; class ModuleDescription { description = "Provides a medical system for both players and AI."; @@ -134,7 +137,7 @@ class CfgVehicles { class ACE_moduleTreatmentConfiguration: ACE_Module { scope = 2; - displayName = "Treatment Configuration [ACE]"; + displayName = "Treatment Settings [ACE]"; icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); category = "ACE_medical"; function = QUOTE(FUNC(moduleTreatmentConfiguration)); @@ -164,11 +167,17 @@ class CfgVehicles { }; }; }; - class maxRevives { - displayName = "Max revives"; - description = "Max amount of revives available (when preventing death)"; + class maxReviveTime { + displayName = "Max Revive time"; + description = "Max amount of seconds a unit can spend in revive state"; typeName = "NUMBER"; - defaultValue = 1; + defaultValue = 120; + }; + class amountOfReviveLives { + displayName = "Max Revive lives"; + description = "Max amount of lives a unit. 0 or -1 is disabled."; + typeName = "NUMBER"; + defaultValue = -1; }; class enableOverdosing { displayName = "Enable Overdosing"; @@ -176,12 +185,46 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; - class bleedingCoefficient { - displayName = "Bleeding coefficient"; - description = "Coefficient to modify the bleeding speed"; - typeName = "NUMBER"; + class allowLitterCreation { + displayName = "Enable Litter"; + description = "Enable litter being created upon treatment"; + typeName = "BOOL"; defaultValue = 1; }; + class litterCleanUpDelay { + displayName = "Life time of litter objects"; + description = "How long should litter objects stay? In seconds. -1 is forever."; + typeName = "NUMBER"; + defaultValue = 1800; + }; + class medicSetting_PAK { + displayName = "Allow PAK"; + description = "Who can use the PAK for full heal?"; + typeName = "NUMBER"; + class values { + class anyone { name = "Anyone"; value = 0; }; + class Medic { name = "Medics only"; value = 1; default = 1; }; + class Special { name = "Doctors only (Adv)"; value = 2; }; + }; + }; + class consumeItem_PAK { + displayName = "Remove PAK on use"; + description = "Should PAK be removed on usage?"; + typeName = "NUMBER"; + class values { + class keep { name = "No"; value = 0; }; + class remove { name = "Yes"; value = 1; default = 1; }; + }; + }; + class medicSetting_SurgicalKit: medicSetting_PAK { + displayName = "Allow Surgical kit"; + description = "Who can use the surgical kit?"; + }; + class consumeItem_SurgicalKit: consumeItem_PAK { + displayName = "Remove Surgical kit"; + description = "Should Surgical kit be removed on usage?"; + }; + }; class ModuleDescription { description = "Configure the treatment settings from ACE Medical"; @@ -224,7 +267,6 @@ class CfgVehicles { class doctor { name = "Doctor (Only Advanced Medics)"; value = 1; - default = 1; }; }; }; @@ -256,8 +298,18 @@ class CfgVehicles { class enabled { displayName = "Is Medical Vehicle"; description = "Whatever or not the objects in the list will be a medical vehicle."; - typeName = "BOOL"; - defaultValue = 1; + typeName = "NUMBER"; + class values { + class none { + name = "No"; + value = 0; + }; + class medic { + name = "Yes"; + value = 1; + default = 1; + }; + }; }; }; class ModuleDescription { @@ -937,29 +989,16 @@ class CfgVehicles { enableInside = 1; icon = PATHTOF(UI\icons\bandage.paa); }; - class Carry { - displayName = "$STR_ACE_MEDICAL_CARRY"; + class PlaceInBodyBag { + displayName = "$STR_ACE_MEDICAL_PlaceInBodyBag"; distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'body', 'Carry')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'Carry')] call DFUNC(treatment)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'BodyBag')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'body', 'BodyBag')] call DFUNC(treatment)); showDisabled = 1; priority = 2; hotkey = ""; enableInside = 1; - //icon = PATHTOF(UI\icons\bandage.paa); }; - class Drag { - displayName = "$STR_ACE_MEDICAL_DRAG"; - distance = 2.0; - condition = QUOTE([ARR_4(_player, _target, 'body', 'Drag')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'body', 'Drag')] call DFUNC(treatment)); - showDisabled = 1; - priority = 2; - hotkey = ""; - enableInside = 1; - //icon = PATHTOF(UI\icons\bandage.paa); - }; - class TriageCard { displayName = "Triage Card"; distance = 2.0; @@ -1699,6 +1738,40 @@ class CfgVehicles { icon = ""; displayName = $STR_ACE_MEDICAL_BODYBAG_DISPLAY; }; + + // Medical litter classes + class Thing; + class ACE_MedicalLitterBase: Thing { + scope = 1; + displayName = " "; + destrType = "DestructNo"; + model = QUOTE(PATHTOF(data\littergeneric.p3d)); + }; + class ACE_MedicalLitter_bandage1: ACE_MedicalLitterBase { + model = QUOTE(PATHTOF(data\littergeneric_bandages1.p3d)); + }; + class ACE_MedicalLitter_bandage2: ACE_MedicalLitterBase { + model = QUOTE(PATHTOF(data\littergeneric_bandages2.p3d)); + }; + class ACE_MedicalLitter_bandage3: ACE_MedicalLitterBase { + model = QUOTE(PATHTOF(data\littergeneric_bandages3.p3d)); + }; + class ACE_MedicalLitter_packingBandage: ACE_MedicalLitterBase { + model = QUOTE(PATHTOF(data\litter_packingBandage.p3d)); + }; + class ACE_MedicalLitter_gloves: ACE_MedicalLitterBase { + model = QUOTE(PATHTOF(data\littergeneric_gloves.p3d)); + }; + class ACE_MedicalLitter_atropine: ACE_MedicalLitterBase { + model = QUOTE(PATHTOF(data\litter_atropine.p3d)); + }; + class ACE_MedicalLitter_epinephrine: ACE_MedicalLitterBase { + model = QUOTE(PATHTOF(data\litter_epinephrine.p3d)); + }; + class ACE_MedicalLitter_morphine: ACE_MedicalLitterBase { + model = QUOTE(PATHTOF(data\litter_morphine.p3d)); + }; + class Item_Base_F; class ACE_fieldDressingItem: Item_Base_F { scope = 2; @@ -2082,18 +2155,4 @@ class CfgVehicles { }; }; }; - - class StaticMortar; - class Mortar_01_base_F: StaticMortar { - class ACE_Actions { - class ACE_MainActions { - class ACE_UnloadPatients { - displayName = "$STR_ACE_Medical_UnloadPatient"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call FUNC(addUnloadPatientActions)); - }; - }; - }; - }; }; diff --git a/addons/medical/CfgWeapons.hpp b/addons/medical/CfgWeapons.hpp index d0b1b786ed..670cfcb34c 100644 --- a/addons/medical/CfgWeapons.hpp +++ b/addons/medical/CfgWeapons.hpp @@ -25,7 +25,7 @@ class CfgWeapons { class ACE_ItemCore; class ACE_fieldDressing: ACE_ItemCore { scope = 2; - model = "\A3\Structures_F_EPA\Items\Medical\Bandage_F.p3d"; + model = QUOTE(PATHTOF(data\bandage.p3d)); picture = QUOTE(PATHTOF(ui\items\fieldDressing.paa)); displayName = $STR_ACE_MEDICAL_BANDAGE_BASIC_DISPLAY; descriptionShort = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_SHORT; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 6aa001b9ef..77fed65110 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -217,13 +217,18 @@ if (isNil QGVAR(level)) then { }, 0, []] call CBA_fnc_addPerFrameHandler; -// broadcast injuries to JIP clients in a MP session -if (isMultiplayer) then { - // We are only pulling the wounds for the units in the player group. Anything else will come when the unit interacts with them. - if (hasInterface) then { - { - [_x, player] call FUNC(requestWoundSync); - }foreach units group player; +if (USE_WOUND_EVENT_SYNC) then { + // broadcast injuries to JIP clients in a MP session + if (isMultiplayer && hasInterface) then { + ["playerChanged", { + EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer); + if (alive _newPlayer) then { + // We are only pulling the wounds for the units in the player group. Anything else will come when the unit interacts with them. + { + [_x, _newPlayer] call FUNC(requestWoundSync); + }foreach units group player; + }; + }] call EFUNC(common,addEventhandler); }; }; @@ -232,6 +237,11 @@ if (isMultiplayer) then { {(((_this select 0) getvariable [QGVAR(pain), 0]) > 0.9)}, {(((_this select 0) call FUNC(getBloodLoss)) > 0.25)}, {((_this select 0) getvariable [QGVAR(inReviveState), false])}, + {((_this select 0) getvariable [QGVAR(inCardiacArrest), false])}, {((_this select 0) getvariable ["ACE_isDead", false])}, {(((_this select 0) getvariable [QGVAR(airwayStatus), 100]) < 80)} ] call FUNC(addUnconsciousCondition); + +// Prevent all types of interaction while unconscious +// @todo: probably remove this when CBA keybind hold key works properly +["isNotUnconscious", {!((_this select 0) getVariable ["ACE_isUnconscious", false])}] call EFUNC(common,addCanInteractWithCondition); diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 04fb2364a8..c51fecc608 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -23,6 +23,7 @@ PREP(canAccessMedicalEquipment); PREP(canTreat); PREP(canTreatCached); PREP(canCarry); +PREP(createLitter); PREP(determineIfFatal); PREP(getBloodLoss); PREP(getBloodPressure); @@ -49,6 +50,8 @@ PREP(hasItems); PREP(hasMedicalEnabled); PREP(hasTourniquetAppliedTo); PREP(init); +PREP(isBeingCarried); +PREP(isBeingDragged); PREP(isInMedicalFacility); PREP(isMedic); PREP(isMedicalVehicle); diff --git a/addons/medical/data/ace_gloves_ca.paa b/addons/medical/data/ace_gloves_ca.paa new file mode 100644 index 0000000000..0873d7fbf4 Binary files /dev/null and b/addons/medical/data/ace_gloves_ca.paa differ diff --git a/addons/medical/data/ace_littergeneric1_co.paa b/addons/medical/data/ace_littergeneric1_co.paa new file mode 100644 index 0000000000..48aaeeb795 Binary files /dev/null and b/addons/medical/data/ace_littergeneric1_co.paa differ diff --git a/addons/medical/data/bandage.p3d b/addons/medical/data/bandage.p3d new file mode 100644 index 0000000000..873d0feb8b Binary files /dev/null and b/addons/medical/data/bandage.p3d differ diff --git a/addons/medical/data/litter_atropine.p3d b/addons/medical/data/litter_atropine.p3d new file mode 100644 index 0000000000..c6b6450ca4 Binary files /dev/null and b/addons/medical/data/litter_atropine.p3d differ diff --git a/addons/medical/data/litter_epinephrine.p3d b/addons/medical/data/litter_epinephrine.p3d new file mode 100644 index 0000000000..0f45dab936 Binary files /dev/null and b/addons/medical/data/litter_epinephrine.p3d differ diff --git a/addons/medical/data/litter_morphine.p3d b/addons/medical/data/litter_morphine.p3d new file mode 100644 index 0000000000..945db92aab Binary files /dev/null and b/addons/medical/data/litter_morphine.p3d differ diff --git a/addons/medical/data/litter_packingbandage.p3d b/addons/medical/data/litter_packingbandage.p3d new file mode 100644 index 0000000000..5c0cdda10e Binary files /dev/null and b/addons/medical/data/litter_packingbandage.p3d differ diff --git a/addons/medical/data/littergeneric.p3d b/addons/medical/data/littergeneric.p3d new file mode 100644 index 0000000000..4170dd5a41 Binary files /dev/null and b/addons/medical/data/littergeneric.p3d differ diff --git a/addons/medical/data/littergeneric_bandages1.p3d b/addons/medical/data/littergeneric_bandages1.p3d new file mode 100644 index 0000000000..bdbc447178 Binary files /dev/null and b/addons/medical/data/littergeneric_bandages1.p3d differ diff --git a/addons/medical/data/littergeneric_bandages2.p3d b/addons/medical/data/littergeneric_bandages2.p3d new file mode 100644 index 0000000000..7b48675370 Binary files /dev/null and b/addons/medical/data/littergeneric_bandages2.p3d differ diff --git a/addons/medical/data/littergeneric_bandages3.p3d b/addons/medical/data/littergeneric_bandages3.p3d new file mode 100644 index 0000000000..7b48675370 Binary files /dev/null and b/addons/medical/data/littergeneric_bandages3.p3d differ diff --git a/addons/medical/data/littergeneric_gloves.p3d b/addons/medical/data/littergeneric_gloves.p3d new file mode 100644 index 0000000000..269742c802 Binary files /dev/null and b/addons/medical/data/littergeneric_gloves.p3d differ diff --git a/addons/medical/data/medical_co.paa b/addons/medical/data/medical_co.paa new file mode 100644 index 0000000000..b53fffc1c5 Binary files /dev/null and b/addons/medical/data/medical_co.paa differ diff --git a/addons/medical/data/packingbandage.p3d b/addons/medical/data/packingbandage.p3d index ccabe2b1f3..714275e3a3 100644 Binary files a/addons/medical/data/packingbandage.p3d and b/addons/medical/data/packingbandage.p3d differ diff --git a/addons/medical/data/tourniquet.p3d b/addons/medical/data/tourniquet.p3d index e8cb60c9e9..94a7e4c830 100644 Binary files a/addons/medical/data/tourniquet.p3d and b/addons/medical/data/tourniquet.p3d differ diff --git a/addons/medical/data/tournequit_co.paa b/addons/medical/data/tourniquet_co.paa similarity index 100% rename from addons/medical/data/tournequit_co.paa rename to addons/medical/data/tourniquet_co.paa diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf index cd66556609..28ed10c83c 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -56,5 +56,5 @@ if ([_caller] call FUNC(isMedic)) then { ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent); if (_logOutPut != "") then { - [_target,"examine", "%1 checked Blood Pressure: %2", [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); + [_target,"activity", "%1 checked Blood Pressure: %2", [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); }; diff --git a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf index d7b46a38fc..73d1d07190 100644 --- a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf @@ -49,5 +49,5 @@ if (_heartRate > 1.0) then { ["displayTextStructured", [_caller], [[_heartRateOutput, [_unit] call EFUNC(common,getName), round(_heartRate)], 1.5, _caller]] call EFUNC(common,targetEvent); if (_logOutPut != "") then { - [_unit,"examine","%1 checked Heart Rate: %2",[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog); + [_unit,"activity","%1 checked Heart Rate: %2",[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog); }; diff --git a/addons/medical/functions/fnc_actionCheckResponse.sqf b/addons/medical/functions/fnc_actionCheckResponse.sqf index 5823e99fbb..c483706274 100644 --- a/addons/medical/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -27,4 +27,4 @@ if ([_target] call EFUNC(common,isAwake)) then { ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName)], 2, _caller]] call EFUNC(common,targetEvent); -[_target,"examine",_output, [[_target] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target,"activity",_output, [[_target] call EFUNC(common,getName)]] call FUNC(addToLog); diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index 5467031cea..4cb9adf8e1 100644 --- a/addons/medical/functions/fnc_canTreat.sqf +++ b/addons/medical/functions/fnc_canTreat.sqf @@ -30,7 +30,15 @@ if (GVAR(level)>=2) then { }; if !(isClass _config) exitwith {false}; -_medicRequired = getNumber (_config >> "requiredMedic"); +_medicRequired = if (isNumber (_config >> "requiredMedic")) then { + getNumber (_config >> "requiredMedic"); +} else { + // Check for required class + if (isText (_config >> "requiredMedic")) exitwith { + missionNamespace getvariable [(getText (_config >> "requiredMedic")), 0]; + }; + 0; +}; if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith {false}; _items = getArray (_config >> "items"); diff --git a/addons/medical/functions/fnc_createLitter.sqf b/addons/medical/functions/fnc_createLitter.sqf new file mode 100644 index 0000000000..8df56ad1fb --- /dev/null +++ b/addons/medical/functions/fnc_createLitter.sqf @@ -0,0 +1,110 @@ +/* + * Author: Glowbal + * Spawns litter for the treatment action on the ground around the target + * + * Arguments: + * 0: The target + * 1: The treatment classname + * + * Return Value: + * + * + * Public: No + */ + +#include "script_component.hpp" + +#define MIN_ENTRIES_LITTER_CONFIG 3 + +private ["_target", "_className", "_config", "_litter", "_createLitter", "_litterObject", "_position", "_createdLitter"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_className = _this select 3; +_usersOfItems = _this select 5; + +if !(GVAR(allowLitterCreation)) exitwith {}; + +_config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className); +if (GVAR(level) >= 2) then { + _config = (configFile >> "ACE_Medical_Actions" >> "Advanced" >> _className); +}; +if !(isClass _config) exitwith {false}; + + +if !(isArray (_config >> "litter")) exitwith {}; +_litter = getArray (_config >> "litter"); + +_createLitter = { + _position = getPos (_this select 0); + _litterClass = _this select 1; + _litterObject = createVehicle [_litterClass, _position, [], 0, "NONE"]; + if (random(1) >= 0.5) then { + _litterObject setPos [(_position select 0) + random 2, (_position select 1) + random 2, _position select 2]; + } else { + _litterObject setPos [(_position select 0) - random 2, (_position select 1) - random 2, _position select 2]; + }; + _litterObject setDir (random 360); + _litterObject; +}; + +if (isnil QGVAR(allCreatedLitter)) then { + GVAR(allCreatedLitter) = []; + GVAR(litterPFHRunning) = false; +}; + +_createdLitter = []; +{ + if (typeName _x == "ARRAY") then { + if (count _x < MIN_ENTRIES_LITTER_CONFIG) exitwith {}; + private ["_selection", "_litterCondition", "_litterOptions"]; + _selection = _x select 0; + if (toLower _selection in [toLower _selectionName, "all"]) then { // in is case sensitve. We can be forgiving here, so lets use toLower. + _litterCondition = _x select 1; + _litterOptions = _x select 2; + + if (isnil _litterCondition) then { + _litterCondition = if (_litterCondition != "") then {compile _litterCondition} else {{true}}; + } else { + _litterCondition = missionNamespace getvariable _litterCondition; + }; + if !([_caller, _target, _selectionName, _className, _usersOfItems] call _litterCondition) exitwith {}; + + if (typeName _litterOptions == "ARRAY") then { + // Loop through through the litter options and place the litter + { + if (typeName _x == "ARRAY" && {(count _x > 0)}) then { + _createdLitter pushback ([_target, _x select (floor(random(count _x)))] call _createLitter); + }; + if (typeName _x == "STRING") then { + _createdLitter pushback ([_target, _x] call _createLitter); + }; + }foreach _litterOptions; + }; + }; + }; +}foreach _litter; + +if (GVAR(litterCleanUpDelay) >= 0) then { + GVAR(allCreatedLitter) pushback [time, GVAR(litterCleanUpDelay), _createdLitter]; +}; + +if !(GVAR(litterPFHRunning)) then { + GVAR(litterPFHRunning) = true; + [{ + { + if (time - (_x select 0) >= (_x select 1)) then { + { + deleteVehicle _x; + }foreach (_this select 2); + GVAR(allCreatedLitter) set[_foreachIndex, objNull]; + }; + }foreach GVAR(allCreatedLitter); + GVAR(allCreatedLitter) = GVAR(allCreatedLitter) - [objNull]; + + if (count GVAR(allCreatedLitter) == 0) exitwith { + GVAR(litterPFHRunning) = false; + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + }, 30, []] call CBA_fnc_addPerFrameHandler; +}; diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index 24605a3f97..b155a7b1ef 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -21,7 +21,9 @@ GVAR(currentSelectedSelectionN) = if (count _this > 2) then {_this select 2} els GVAR(displayPatientInformationTarget) = if (_show) then {_target} else {ObjNull}; -[_target, ACE_player] call FUNC(requestWoundSync); +if (USE_WOUND_EVENT_SYNC) then { + [_target, ACE_player] call FUNC(requestWoundSync); +}; if (_show) then { ("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutRsc [QGVAR(DisplayInformation),"PLAIN"]; @@ -41,6 +43,10 @@ if (_show) then { _allInjuryTexts = []; _genericMessages = []; + + _partText = ["STR_ACE_Interaction_Head", "STR_ACE_Interaction_Torso", "STR_ACE_Interaction_ArmLeft" ,"STR_ACE_Interaction_ArmRight" ,"STR_ACE_Interaction_LegLeft", "STR_ACE_Interaction_LegRight"] select GVAR(currentSelectedSelectionN); + _genericMessages pushback [localize _partText, [1, 1, 1, 1]]; + if (_target getvariable[QGVAR(isBleeding), false]) then { _genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_BLEEDING", [1, 0.1, 0.1, 1]]; }; @@ -121,7 +127,7 @@ if (_show) then { { _lbCtrl lbAdd _x; }foreach _allInjuryTexts; - if (count _genericMessages == 0 && {count _allInjuryTexts == 0}) then { + if (count _allInjuryTexts == 0) then { _lbCtrl lbAdd "No injuries on this bodypart.."; }; @@ -129,26 +135,23 @@ if (_show) then { lbClear _logCtrl; private ["_logs", "_log", "_message", "_moment", "_arguments", "_lbCtrl"]; - _logs = _target getvariable [QGVAR(allLogs), []]; + _logs = _target getvariable [QGVAR(logFile_Activity), []]; { - _log = _target getvariable [_x, []]; - { - // [_message,_moment,_type, _arguments] - _message = _x select 0; - _moment = _x select 1; - _arguments = _x select 3; - if (isLocalized _message) then { - _message = localize _message; - }; + // [_message,_moment,_type, _arguments] + _message = _x select 0; + _moment = _x select 1; + _arguments = _x select 3; + if (isLocalized _message) then { + _message = localize _message; + }; - { - if (typeName _x == "STRING" && {isLocalized _x}) then { - _arguments set [_foreachIndex, localize _x]; - }; - }foreach _arguments; - _message = format([_message] + _arguments); - _logCtrl lbAdd format["%1 %2", _moment, _message]; - }foreach _log; + { + if (typeName _x == "STRING" && {isLocalized _x}) then { + _arguments set [_foreachIndex, localize _x]; + }; + }foreach _arguments; + _message = format([_message] + _arguments); + _logCtrl lbAdd format["%1 %2", _moment, _message]; }foreach _logs; _triageStatus = [_target] call FUNC(getTriageStatus); diff --git a/addons/medical/functions/fnc_getBloodLoss.sqf b/addons/medical/functions/fnc_getBloodLoss.sqf index ef0a97ea35..4f070e2546 100644 --- a/addons/medical/functions/fnc_getBloodLoss.sqf +++ b/addons/medical/functions/fnc_getBloodLoss.sqf @@ -42,4 +42,4 @@ if (GVAR(level) >= 2) then { } else { // TODO basic medical }; -_totalBloodLoss * GVAR(bleedingCoefficient); +_totalBloodLoss * (GVAR(bleedingCoefficient) max 0); diff --git a/addons/medical/functions/fnc_getTypeOfDamage.sqf b/addons/medical/functions/fnc_getTypeOfDamage.sqf index 1037f8514d..4dd517679a 100644 --- a/addons/medical/functions/fnc_getTypeOfDamage.sqf +++ b/addons/medical/functions/fnc_getTypeOfDamage.sqf @@ -16,7 +16,6 @@ private ["_typeOfProjectile","_typeOfInjury"]; _typeOfProjectile = _this select 0; _typeOfInjury = switch (true) do { - case (_typeOfProjectile isKindOf "Backblast"): {"backblast"}; case (_typeOfProjectile iskindof "BulletBase"): {"Bullet"}; case (_typeOfProjectile iskindof "GrenadeCore"): {"Grenade"}; case (_typeOfProjectile iskindof "TimeBombCore"): {"Explosive"}; @@ -29,7 +28,7 @@ _typeOfInjury = switch (true) do { case (_typeOfProjectile iskindof "BombCore"): {"Explosive"}; case (_typeOfProjectile iskindof "Grenade"): {"Grenade"}; case (_typeOfProjectile == "VehicleCrash"): {"VehicleCrash"}; - default {"Unknown"}; + default {_typeOfProjectile}; }; // TODO replace the capitalization on the switch results instead.. toLower _typeOfInjury; diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index 959dce7b50..7cba3485e7 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -26,8 +26,6 @@ _projectile = _this select 4; if !(local _unit) exitWith {nil}; -if !([_unit] call FUNC(hasMedicalEnabled)) exitwith {}; - if (typeName _projectile == "OBJECT") then { _projectile = typeOf _projectile; _this set [4, _projectile]; @@ -38,22 +36,35 @@ _hitSelections = ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]; if !(_selection in (_hitSelections + [""])) exitWith {0}; _damageReturn = _damage; -if (GVAR(level) == 1) then { - _damageReturn = (_this + [_damageReturn]) call FUNC(handleDamage_basic); +if (GVAR(level) < 2) then { + _damageReturn = _this call FUNC(handleDamage_basic); }; if (GVAR(level) >= 2) then { - [_unit, _selection, _damage, _source, _projectile, _damageReturn] call FUNC(handleDamage_caching); + if !([_unit] call FUNC(hasMedicalEnabled)) exitwith { + // Because of the config changes, we cannot properly disable the medical system for a unit. + // lets use basic for the time being.. + _damageReturn = _this call FUNC(handleDamage_basic); + }; + + [_unit, _selection, _damage, _source, _projectile] call FUNC(handleDamage_caching); if (_damageReturn > 0.9) then { + + _typeOfDamage = [_projectile] call FUNC(getTypeOfDamage); + _minLethalDamage = GVAR(minLethalDamages) select (GVAR(allAvailableDamageTypes) find _typeOfDamage); + _hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; _newDamage = _damage - (damage _unit); if (_selection in _hitSelections) then { _newDamage = _damage - (_unit getHitPointDamage (_hitPoints select (_hitSelections find _selection))); }; - if ([_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)) then { + + if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)} && {_selection in ["", "head", "body"]}) then { if ([_unit] call FUNC(setDead)) then { _damageReturn = 1; + } else { + _damageReturn = 0.89; }; } else { _damageReturn = 0.89; @@ -62,11 +73,13 @@ if (GVAR(level) >= 2) then { }; [_unit] call FUNC(addToInjuredCollection); -if (_unit getVariable [QGVAR(preventDeath), false] && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith { +if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith { if (vehicle _unit != _unit and {damage _vehicle >= 1}) then { // @todo // [_unit] call FUNC(unload); }; + [_unit] call FUNC(setDead); + 0.89 }; diff --git a/addons/medical/functions/fnc_handleDamage_advanced.sqf b/addons/medical/functions/fnc_handleDamage_advanced.sqf index 1f943d98d0..751896be44 100644 --- a/addons/medical/functions/fnc_handleDamage_advanced.sqf +++ b/addons/medical/functions/fnc_handleDamage_advanced.sqf @@ -25,7 +25,6 @@ _selectionName = _this select 1; _amountOfDamage = _this select 2; _sourceOfDamage = _this select 3; _typeOfProjectile = _this select 4; -_returnDamage = _this select 5; // Most likely taking exessive fire damage. Lets exit. if (isNull _sourceOfDamage && (_selectionName == "head" || isBurning _unit) && _typeOfProjectile == "" && vehicle _unit == _unit) exitwith { @@ -63,4 +62,4 @@ if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then { }; }; -_returnDamage; +_amountOfDamage; diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index 5beacc16c2..2986e1b2f7 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -24,15 +24,13 @@ #define ARMDAMAGETRESHOLD2 1.7 #define UNCONSCIOUSNESSTRESHOLD 0.7 -private ["_unit", "_selection", "_damage", "_shooter", "_projectile", "_damageReturn"]; +private ["_unit", "_selectionName", "_damage", "_shooter", "_projectile", "_damage"]; _unit = _this select 0; -_selection = _this select 1; +_selectionName = _this select 1; _damage = _this select 2; _shooter = _this select 3; _projectile = _this select 4; -_damageReturn = _this select 5; - // This is a new hit, reset variables. // Note: sometimes handleDamage spans over 2 or even 3 frames. @@ -50,12 +48,12 @@ if (diag_frameno > (_unit getVariable [QGVAR(frameNo), -3]) + 2) then { _hitSelections = ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]; _hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; -_newDamage = _damageReturn - (damage _unit); -if (_selection in _hitSelections) then { - _newDamage = _damageReturn - (_unit getHitPointDamage (_hitPoints select (_hitSelections find _selection))); +_newDamage = _damage - (damage _unit); +if (_selectionName in _hitSelections) then { + _newDamage = _damage - (_unit getHitPointDamage (_hitPoints select (_hitSelections find _selectionName))); }; -_damageReturn = _damageReturn - _newDamage; +_damage = _damage - _newDamage; // Exclude falling damage to everything other than legs and reduce it overall. @@ -101,7 +99,7 @@ if (_selectionName != "" and !(_unit getVariable QGVAR(isFalling))) then { }; // Get rid of double structural damage (seriously arma, what the fuck?) -if (_selection == "") then { +if (_selectionName == "") then { _cache_structDamage = _unit getVariable QGVAR(structDamage); if (_newDamage > _cache_structDamage) then { _unit setVariable [QGVAR(structDamage), _newDamage]; @@ -128,20 +126,20 @@ if (_selection == "") then { }, [_unit], 2, 0.1] call EFUNC(common,waitAndExecute); -if (_selection == "") then { - _damageReturn = _damageReturn + (_unit getVariable QGVAR(structDamage)); +if (_selectionName == "") then { + _damage = _damage + (_unit getVariable QGVAR(structDamage)); } else { - _damageReturn = _damageReturn + _newDamage; + _damage = _damage + _newDamage; }; // Leg Damage _legdamage = (_unit getHitPointDamage "HitLeftLeg") + (_unit getHitPointDamage "HitRightLeg"); if (_selectionName == "leg_l") then { - _legdamage = _damageReturn + (_unit getHitPointDamage "HitRightLeg"); + _legdamage = _damage + (_unit getHitPointDamage "HitRightLeg"); }; if (_selectionName == "leg_r") then { - _legdamage = (_unit getHitPointDamage "HitLeftLeg") + _damageReturn; + _legdamage = (_unit getHitPointDamage "HitLeftLeg") + _damage; }; if (_legdamage >= LEGDAMAGETRESHOLD1) then { @@ -155,10 +153,10 @@ if (_legdamage >= LEGDAMAGETRESHOLD1) then { // Arm Damage _armdamage = (_unit getHitPointDamage "HitLeftArm") + (_unit getHitPointDamage "HitRightArm"); if (_selectionName == "hand_l") then { - _armdamage = _damageReturn + (_unit getHitPointDamage "HitRightArm"); + _armdamage = _damage + (_unit getHitPointDamage "HitRightArm"); }; if (_selectionName == "hand_r") then { - _armdamage = (_unit getHitPointDamage "HitLeftArm") + _damageReturn; + _armdamage = (_unit getHitPointDamage "HitLeftArm") + _damage; }; if (_armdamage >= ARMDAMAGETRESHOLD1) then { @@ -170,7 +168,7 @@ if (_armdamage >= ARMDAMAGETRESHOLD1) then { // Set Pain -if (_selection == "") then { +if (_selectionName == "") then { _pain = _unit getVariable [QGVAR(pain), 0]; _pain = _pain + _newDamage * (1 - (_unit getVariable [QGVAR(morphine), 0])); _unit setVariable [QGVAR(pain), _pain min 1, true]; @@ -178,16 +176,16 @@ if (_selection == "") then { // Unconsciousness -if (_selection == "" and - _damageReturn >= UNCONSCIOUSNESSTRESHOLD and - _damageReturn < 1 and +if (_selectionName == "" and + _damage >= UNCONSCIOUSNESSTRESHOLD and + _damage < 1 and !(_unit getVariable ["ACE_isUnconscious", False] )) then { if (_unit getVariable [QGVAR(allowUnconscious), ([_unit] call EFUNC(common,isPlayer)) or random 1 > 0.3]) then { [_unit, true] call FUNC(setUnconscious); } else { - _damageReturn = 1; + _damage = 1; }; }; -_damageReturn +_damage diff --git a/addons/medical/functions/fnc_handleDamage_caching.sqf b/addons/medical/functions/fnc_handleDamage_caching.sqf index 1657d65b25..ddd0b6c920 100644 --- a/addons/medical/functions/fnc_handleDamage_caching.sqf +++ b/addons/medical/functions/fnc_handleDamage_caching.sqf @@ -24,7 +24,6 @@ _selectionName = _this select 1; _damage = _this select 2; _source = _this select 3; _projectile = _this select 4; -_returnDamage = _this select 5; _hitSelections = ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]; _hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; @@ -128,14 +127,14 @@ if (_selectionName != "") then { _cache_projectiles pushBack _projectile; _cache_hitpoints pushBack (_hitPoints select (_hitSelections find _selectionName)); _cache_damages pushBack _newDamage; - _cache_params pushBack [_unit, _selectionName, _damage, _source, _projectile, _returnDamage]; + _cache_params pushBack [_unit, _selectionName, _damage, _source, _projectile]; }; } else { // This is an unhandled projectile _cache_projectiles pushBack _projectile; _cache_hitpoints pushBack (_hitPoints select (_hitSelections find _selectionName)); _cache_damages pushBack _newDamage; - _cache_params pushBack [_unit, _selectionName, _damage, _source, _projectile, _returnDamage]; + _cache_params pushBack [_unit, _selectionName, _damage, _source, _projectile]; }; }; diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index ceac7c5f60..b2d7b3514d 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -123,18 +123,20 @@ _woundsCreated = []; }; }foreach (_injuryTypeInfo select 0); -_unit setvariable [QGVAR(openWounds), _openWounds]; +_unit setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; // Only update if new wounds have been created if (count _woundsCreated > 0) then { _unit setvariable [QGVAR(lastUniqueWoundID), _woundID, true]; }; -// TODO Should this be done in a single broadcast? -// Broadcast the new injuries across the net in parts. One broadcast per injury. Prevents having to broadcast one massive array of injuries. -{ - ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); -}foreach _woundsCreated; +if (USE_WOUND_EVENT_SYNC) then { + // TODO Should this be done in a single broadcast? + // Broadcast the new injuries across the net in parts. One broadcast per injury. Prevents having to broadcast one massive array of injuries. + { + ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); + }foreach _woundsCreated; +}; _painLevel = _unit getvariable [QGVAR(pain), 0]; _unit setvariable [QGVAR(pain), _painLevel + _painToAdd]; diff --git a/addons/medical/functions/fnc_handleKilled.sqf b/addons/medical/functions/fnc_handleKilled.sqf index 91475a03dc..1a602bd702 100644 --- a/addons/medical/functions/fnc_handleKilled.sqf +++ b/addons/medical/functions/fnc_handleKilled.sqf @@ -23,8 +23,10 @@ if (GVAR(level) >= 2) then { _unit setvariable [QGVAR(bloodPressure), [0, 0]]; _unit setvariable [QGVAR(airwayStatus), 0]; - _openWounds = _unit getvariable [QGVAR(openWounds), []]; - { - ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); - }foreach _openWounds; + if (USE_WOUND_EVENT_SYNC) then { + _openWounds = _unit getvariable [QGVAR(openWounds), []]; + { + ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); + }foreach _openWounds; + }; }; diff --git a/addons/medical/functions/fnc_init.sqf b/addons/medical/functions/fnc_init.sqf index 0410e2a7ba..fc74711a30 100644 --- a/addons/medical/functions/fnc_init.sqf +++ b/addons/medical/functions/fnc_init.sqf @@ -50,7 +50,7 @@ _unit setVariable [QGVAR(bloodIVVolume), 0]; _unit setvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; // airway -_unit setvariable [QGVAR(airwayStatus), 0, true]; +_unit setvariable [QGVAR(airwayStatus), 100, true]; _unit setVariable [QGVAR(airwayOccluded), false, true]; _unit setvariable [QGVAR(airwayCollapsed), false, true]; @@ -61,6 +61,7 @@ _unit setVariable ["ACE_isUnconscious", false, true]; _unit setvariable [QGVAR(hasLostBlood), false, true]; _unit setvariable [QGVAR(isBleeding), false, true]; _unit setvariable [QGVAR(hasPain), false, true]; +_unit setvariable [QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives), true]; // medication _allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []]; diff --git a/addons/medical/functions/fnc_isBeingCarried.sqf b/addons/medical/functions/fnc_isBeingCarried.sqf new file mode 100644 index 0000000000..6505f8b51a --- /dev/null +++ b/addons/medical/functions/fnc_isBeingCarried.sqf @@ -0,0 +1,26 @@ +/* + * Author: PabstMirror + * Returns if a target is being carried. (from ace_dragging) + * + * Arguments: + * 0: Target Unit + * + * Return Value: + * Is being carried + * + * Example: + * [bob] call ace_medical_fnc_isBeingCarried + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_1(_target); + +private "_owner"; + +_owner = _target getVariable [QEGVAR(common,owner), objNull]; + +if (isNull _owner) exitWith {false}; + +(_owner getVariable [QEGVAR(dragging,carriedObject), objNull]) == _target diff --git a/addons/medical/functions/fnc_isBeingDragged.sqf b/addons/medical/functions/fnc_isBeingDragged.sqf new file mode 100644 index 0000000000..4d09ed9e29 --- /dev/null +++ b/addons/medical/functions/fnc_isBeingDragged.sqf @@ -0,0 +1,26 @@ +/* + * Author: PabstMirror + * Returns if a target is being dragged. (from ace_dragging) + * + * Arguments: + * 0: Target Unit + * + * Return Value: + * Is being dragged + * + * Example: + * [bob] call ace_medical_fnc_isBeingDragged + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_1(_target); + +private "_owner"; + +_owner = _target getVariable [QEGVAR(common,owner), objNull]; + +if (isNull _owner) exitWith {false}; + +(_owner getVariable [QEGVAR(dragging,draggedObject), objNull]) == _target diff --git a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf index ef6d7dfecf..539d428da0 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf @@ -44,7 +44,7 @@ if (!isNull _logic) then { if (!isnil "_x") then { if (typeName _x == typeName objNull) then { if (local _x) then { - _x setvariable [QGVAR(isMedicalVehicle), _setting, true]; + _x setvariable [QGVAR(medicClass), _setting, true]; }; }; }; @@ -54,7 +54,7 @@ if (!isNull _logic) then { if (!isnil "_x") then { if (typeName _x == typeName objNull) then { if (local _x) then { - _x setvariable [QGVAR(isMedicalVehicle), _setting, true]; + _x setvariable [QGVAR(medicClass), _setting, true]; }; }; }; diff --git a/addons/medical/functions/fnc_moduleMedicalSettings.sqf b/addons/medical/functions/fnc_moduleMedicalSettings.sqf index 003cf2afcf..4fa90ae267 100644 --- a/addons/medical/functions/fnc_moduleMedicalSettings.sqf +++ b/addons/medical/functions/fnc_moduleMedicalSettings.sqf @@ -24,11 +24,13 @@ if !(_activated) exitWith {}; [_logic, QGVAR(level), "level"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(enableFor), "enableFor"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(enableAirway), "enableAirway"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(enableFractures), "enableFractures"] call EFUNC(common,readSettingFromModule); +// TODO disabled until implemented +// [_logic, QGVAR(enableAirway), "enableAirway"] call EFUNC(common,readSettingFromModule); +// [_logic, QGVAR(enableFractures), "enableFractures"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(enableAdvancedWounds), "enableAdvancedWounds"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(enableScreams), "enableScreams"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(playerDamageThreshold), "playerDamageThreshold"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(AIDamageThreshold), "AIDamageThreshold"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(enableUnsconsiousnessAI), "enableUnsconsiousnessAI"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(preventInstaDeath), "preventInstaDeath"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(bleedingCoefficient), "bleedingCoefficient"] call EFUNC(common,readSettingFromModule); diff --git a/addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf b/addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf index 74d663ba1e..6ae3f7eeb8 100644 --- a/addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf +++ b/addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf @@ -23,8 +23,12 @@ _activated = _this select 2; if !(_activated) exitWith {}; [_logic, QGVAR(medicSetting), "medicSetting"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(maxRevives), "maxRevives"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(maxReviveTime), "maxReviveTime"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(amountOfReviveLives), "amountOfReviveLives"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(enableOverdosing), "enableOverdosing"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(bleedingCoefficient), "bleedingCoefficient"] call EFUNC(common,readSettingFromModule); - - +[_logic, QGVAR(allowLitterCreation), "allowLitterCreation"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(litterCleanUpDelay), "litterCleanUpDelay"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(medicSetting_PAK), "medicSetting_PAK"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(medicSetting_SurgicalKit), "medicSetting_SurgicalKit"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(consumeItem_PAK), "consumeItem_PAK"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(consumeItem_SurgicalKit), "consumeItem_SurgicalKit"] call EFUNC(common,readSettingFromModule); diff --git a/addons/medical/functions/fnc_onMedicationUsage.sqf b/addons/medical/functions/fnc_onMedicationUsage.sqf index a95a9e0e8e..c56f676744 100644 --- a/addons/medical/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical/functions/fnc_onMedicationUsage.sqf @@ -49,7 +49,7 @@ if (!_foundEntry) then { _usedMeds = _target getvariable [_variable, 0]; -if (_usedMeds >= floor (_maxDosage + round(random(2))) && _maxDosage >= 1) then { +if (_usedMeds >= floor (_maxDosage + round(random(2))) && _maxDosage >= 1 && GVAR(enableOverdosing)) then { [_target] call FUNC(setDead); }; @@ -65,7 +65,7 @@ _hasOverDosed = 0; }foreach _allUsedMedication; }foreach _incompatabileMeds; -if (_hasOverDosed > 0) then { +if (_hasOverDosed > 0 && GVAR(enableOverdosing)) then { _medicationConfig = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "Medication"); _onOverDose = getText (_medicationConfig >> "onOverDose"); if (isClass (_medicationConfig >> _className)) then { diff --git a/addons/medical/functions/fnc_parseConfigForInjuries.sqf b/addons/medical/functions/fnc_parseConfigForInjuries.sqf index 9e56784a0d..4efc7ac8ae 100644 --- a/addons/medical/functions/fnc_parseConfigForInjuries.sqf +++ b/addons/medical/functions/fnc_parseConfigForInjuries.sqf @@ -12,25 +12,35 @@ #include "script_component.hpp" -private ["_injuriesRootConfig", "_woundsConfig", "_allWoundClasses", "_amountOf", "_entry","_classType", "_selections", "_bloodLoss", "_pain","_minDamage","_causes", "_allTypes", "_damageTypesConfig", "_thresholds", "_typeThresholds", "_selectionSpecific", "_selectionSpecificType", "_classDisplayName", "_subClassDisplayName", "_maxDamage", "_subClassmaxDamage"]; +private ["_injuriesRootConfig", "_woundsConfig", "_allWoundClasses", "_amountOf", "_entry","_classType", "_selections", "_bloodLoss", "_pain","_minDamage","_causes", "_allTypes", "_damageTypesConfig", "_thresholds", "_typeThresholds", "_selectionSpecific", "_selectionSpecificType", "_classDisplayName", "_subClassDisplayName", "_maxDamage", "_subClassmaxDamage", "_defaultMinLethalDamage", "_minLethalDamage"]; _injuriesRootConfig = (configFile >> "ACE_Medical_Advanced" >> "Injuries"); _allTypes = ["stab", "grenade", "bullet", "explosive", "shell", "punch", "vehiclecrash", "backblast", "falling", "bite", "ropeburn"]; - -// Collect all available damage types from the config _allFoundDamageTypes = []; _configDamageTypes = (_injuriesRootConfig >> "damageTypes"); + +// minimum lethal damage collection, mapped to damageTypes +_defaultMinLethalDamage = getNumber (_configDamageTypes >> "lethalDamage"); +GVAR(minLethalDamages) = []; + +// Collect all available damage types from the config for "_i" from 0 to (count _configDamageTypes -1) /* step +1 */ do { // Only get the subclasses in damageType class if (isClass(_configDamageTypes select _i)) then { _allFoundDamageTypes pushback (configName (_configDamageTypes select _i)); + _minLethalDamage = if (isNumber((_configDamageTypes select _i) >> "lethalDamage")) then { + getNumber((_configDamageTypes select _i) >> "lethalDamage"); + } else { + _defaultMinLethalDamage + }; + + GVAR(minLethalDamages) pushback _minLethalDamage; }; }; GVAR(allAvailableDamageTypes) = _allFoundDamageTypes; GVAR(woundClassNames) = []; GVAR(fractureClassNames) = []; - // Parsing the wounds // function for parsing a sublcass of an injury _parseForSubClassWounds = { diff --git a/addons/medical/functions/fnc_setCardiacArrest.sqf b/addons/medical/functions/fnc_setCardiacArrest.sqf index 03b9835fd7..6ae9fe1079 100644 --- a/addons/medical/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical/functions/fnc_setCardiacArrest.sqf @@ -14,7 +14,7 @@ #include "script_component.hpp" -private ["_unit", "_modifier","_timer","_counter", "_heartRate"]; +private ["_unit", "_timeInCardiacArrest"]; _unit = _this select 0; if (_unit getvariable [QGVAR(inCardiacArrest),false]) exitwith {}; @@ -23,27 +23,27 @@ _unit setvariable [QGVAR(heartRate), 0]; ["Medical_onEnteredCardiacArrest", [_unit]] call ace_common_fnc_localEvent; -[_unit] call FUNC(setUnconscious); -_counter = 120 + round(random(600)); -_timer = 0; +[_unit, true] call FUNC(setUnconscious); +_timeInCardiacArrest = 120 + round(random(600)); +systemChat format["Unit went cardiac arrest; hr: %1", _unit getvariable [QGVAR(heartRate), -1]]; [{ - private ["_args","_unit","_timer","_counter","_heartRate"]; + private ["_args","_unit","_startTime","_timeInCardiacArrest","_heartRate"]; _args = _this select 0; _unit = _args select 0; - _timer = _args select 1; - _counter = _args select 2; + _startTime = _args select 1; + _timeInCardiacArrest = _args select 2; _heartRate = _unit getvariable [QGVAR(heartRate), 0]; if (_heartRate > 0 || !alive _unit) exitwith { - _unit setvariable [QGVAR(inCardiacArrest), nil,true]; + systemChat format["Unit no longer cardiac arrest; hr: %1", _unit getvariable [QGVAR(heartRate), -1]]; [(_this select 1)] call cba_fnc_removePerFrameHandler; + _unit setvariable [QGVAR(inCardiacArrest), nil,true]; }; - if (_counter - _timer < 1) exitwith { + if (time - _startTime >= _timeInCardiacArrest) exitwith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + _unit setvariable [QGVAR(inCardiacArrest), nil,true]; [_unit] call FUNC(setDead); - [(_this select 1)] call cba_fnc_removePerFrameHandler; - _unit setvariable [QGVAR(inCardiacArrest), nil,true]; }; - _args set[1, _timer + 1]; -}, 1, [_unit, _timer, _counter] ] call CBA_fnc_addPerFrameHandler; +}, 1, [_unit, time, _timeInCardiacArrest] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/medical/functions/fnc_setDead.sqf b/addons/medical/functions/fnc_setDead.sqf index e448554d59..334a2d8b97 100644 --- a/addons/medical/functions/fnc_setDead.sqf +++ b/addons/medical/functions/fnc_setDead.sqf @@ -13,39 +13,60 @@ #include "script_component.hpp" -private ["_unit"]; +private ["_unit", "_force"]; _unit = _this select 0; _force = false; if (count _this >= 2) then { _force = _this select 1; }; -if (!alive _unit) exitwith{}; +if (!alive _unit) exitwith{true}; if (!local _unit) exitwith { [[_unit, _force], QUOTE(DFUNC(setDead)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ + false; }; -if (GVAR(preventInstaDeath) && !_force) exitwith { - if (_unit getvariable [QGVAR(inReviveState), false]) exitwith {}; // already in revive state +if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) && !_force) exitwith { + if (_unit getvariable [QGVAR(inReviveState), false]) exitwith { + if (GVAR(amountOfReviveLives) > 0) then { + _lifesLeft = _unit getvariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)]; + if (_lifesLeft == 0) then { + [_unit, true] call FUNC(setDead); + }; + }; + + false; + }; + _unit setvariable [QGVAR(inReviveState), true, true]; - [_unit] call FUNC(setUnconscious); + _unit setvariable [QGVAR(reviveStartTime), time]; + [_unit, true] call FUNC(setUnconscious); [{ private ["_args","_unit","_startTime"]; _args = _this select 0; _unit = _args select 0; - _startTime = _args select 1; + _startTime = _unit getvariable [QGVAR(reviveStartTime), 0]; if (time - _startTime > GVAR(maxReviveTime)) exitwith { [(_this select 1)] call cba_fnc_removePerFrameHandler; - [_unit, true] call FUNC(setDead); _unit setvariable [QGVAR(inReviveState), nil, true]; + _unit setvariable [QGVAR(reviveStartTime), nil]; + [_unit, true] call FUNC(setDead); }; if !(_unit getvariable [QGVAR(inReviveState), false]) exitwith { + // revived without dieing, so in case we have lifes, remove one. + if (GVAR(amountOfReviveLives) > 0) then { + _lifesLeft = _unit getvariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)]; + _unit setvariable [QGVAR(amountOfReviveLives), _lifesLeft - 1, true]; + }; + + _unit setvariable [QGVAR(reviveStartTime), nil]; [(_this select 1)] call cba_fnc_removePerFrameHandler; }; - }, 1, [_unit, time] ] call CBA_fnc_addPerFrameHandler; + }, 1, [_unit] ] call CBA_fnc_addPerFrameHandler; + false; }; _unit setvariable ["ACE_isDead", true, true]; @@ -53,3 +74,4 @@ if (isPLayer _unit) then { _unit setvariable ["isDeadPlayer", true, true]; }; _unit setdamage 1; +true; diff --git a/addons/medical/functions/fnc_setHitPointDamage.sqf b/addons/medical/functions/fnc_setHitPointDamage.sqf index a9505b2150..d71edc94df 100644 --- a/addons/medical/functions/fnc_setHitPointDamage.sqf +++ b/addons/medical/functions/fnc_setHitPointDamage.sqf @@ -29,7 +29,7 @@ _damage = _this select 2; // Unit isn't local, give function to machine where it is. if !(local _unit) exitWith { - [_this, "ace_medical_fnc_setHitPointDamage", _unit] call EFUNC(common,execRemoteFnc); + [_this, QUOTE(DFUNC(setHitPointDamage)), _unit] call EFUNC(common,execRemoteFnc); }; // Check if overall damage adjustment is disabled @@ -72,9 +72,13 @@ if (_damageOld > 0) then { _damageNew = _damageOld * (_damageSumNew / _damageSumOld); }; -// @todo: prevent death - -_unit setDamage _damageNew; +// prevent death +if (_damageNew >= 0.9) then { + _unit setDamage 0.9; + [_unit] call FUNC(setDead); +} else { + _unit setDamage _damageNew; +}; { _damageFinal = (_damages select _forEachIndex); @@ -88,7 +92,7 @@ if (_legdamage >= LEGDAMAGETRESHOLD1) then { } else { if (_unit getHitPointDamage "HitLegs" != 0) then {_unit setHitPointDamage ["HitLegs", 0]}; }; -// @ŧodo: force prone for completely fucked up legs. +// @todo: force prone for completely fucked up legs. // Arm Damage diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index 5418421872..9e68d2c3e3 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -4,6 +4,8 @@ * * Arguments: * 0: The unit that will be put in an unconscious state + * 1: Set unconsciouns + * 2: Minimum unconscious time * * ReturnValue: * nil @@ -13,9 +15,12 @@ #include "script_component.hpp" +#define DEFAULT_DELAY (round(random(10)+5)) + private ["_unit", "_set", "_animState", "_originalPos", "_captiveSwitch", "_startingTime","_minWaitingTime"]; _unit = _this select 0; _set = if (count _this > 1) then {_this select 1} else {true}; +_minWaitingTime = if (count _this > 2) then {_this select 2} else {DEFAULT_DELAY}; if !(_set) exitwith { _unit setvariable ["ACE_isUnconscious", false,true]; @@ -71,7 +76,6 @@ _unit setUnitPos "DOWN"; [_unit, [_unit] call EFUNC(common,getDeathAnim), 1, true] call EFUNC(common,doAnimation); _startingTime = time; -_minWaitingTime = (round(random(10)+5)); [{ private ["_unit", "_vehicleOfUnit","_minWaitingTime", "_oldAnimation", "_captiveSwitch", "_hasMovedOut"]; @@ -90,17 +94,22 @@ _minWaitingTime = (round(random(10)+5)); // In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation if !(_unit getvariable ["ACE_isUnconscious",false]) exitwith { + // TODO, handle this with carry instead, so we can remove the PFH here. // Wait until the unit isn't being carried anymore, so we won't end up with wierd animations - if !([_unit] call EFUNC(common,beingCarried)) then { + if !(([_unit] call FUNC(isBeingCarried)) || ([_unit] call FUNC(isBeingDragged))) then { if (vehicle _unit == _unit) then { - [_unit,"amovppnemstpsnonwnondnon", 1] call EFUNC(common,doAnimation); + if (animationState _unit == "AinjPpneMstpSnonWrflDnon") then { + [_unit,"AinjPpneMstpSnonWrflDnon_rolltofront", 2] call EFUNC(common,doAnimation); + [_unit,"amovppnemstpsnonwnondnon", 1] call EFUNC(common,doAnimation); + } else { + [_unit,"amovppnemstpsnonwnondnon", 2] call EFUNC(common,doAnimation); + }; } else { // Switch to the units original animation, assuming // TODO: what if the unit switched vehicle? - [_unit, _oldAnimation, 1] call EFUNC(common,doAnimation); + [_unit, _oldAnimation, 2] call EFUNC(common,doAnimation); }; - // EXIT PFH [(_this select 1)] call cba_fnc_removePerFrameHandler; }; @@ -117,7 +126,7 @@ _minWaitingTime = (round(random(10)+5)); _unit setUnconscious false; ["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent); // ensure this statement runs only once - _args set [6, true]; + _args set [5, true]; }; }; @@ -133,9 +142,9 @@ _minWaitingTime = (round(random(10)+5)); // A check to ensure that the animation is being played properly. // TODO: Might no longer be necessary: Have to test this in MP. - if (vehicle _unit == _unit && {animationState _unit != "deadState" && animationState _unit != "unconscious"} && {(isNull ([_unit] call EFUNC(common,getCarriedBy)))} && (time - _startingTime >= 0.5)) then { - [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call EFUNC(common,doAnimation); // Reset animations if unit starts doing wierd things. - }; + // if (vehicle _unit == _unit && {animationState _unit != "deadState" && animationState _unit != "unconscious"} && {(isNull ([_unit] call EFUNC(common,getCarriedBy)))} && (time - _startingTime >= 0.5)) then { + //[_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call EFUNC(common,doAnimation); // Reset animations if unit starts doing wierd things. + //}; }, 0.1, [_unit,_animState, _originalPos, _startingTime, _minWaitingTime, false] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf index cf5115fea5..d3b849b3cd 100644 --- a/addons/medical/functions/fnc_treatment.sqf +++ b/addons/medical/functions/fnc_treatment.sqf @@ -16,12 +16,19 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_config", "_availableLevels", "_medicRequired", "_items", "_locations", "_return", "_callbackSuccess", "_callbackFailure", "_callbackProgress", "_treatmentTime", "_callerAnim", "_patientAnim", "_iconDisplayed", "_return"]; +private ["_caller", "_target", "_selectionName", "_className", "_config", "_availableLevels", "_medicRequired", "_items", "_locations", "_return", "_callbackSuccess", "_callbackFailure", "_callbackProgress", "_treatmentTime", "_callerAnim", "_patientAnim", "_iconDisplayed", "_return", "_usersOfItems", "_consumeItems"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; _className = _this select 3; +// If the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine +if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitwith { + [{ + _this call FUNC(treatment); + }, _this, 0, 0] call EFUNC(common,waitAndExecute); +}; + if !(_target isKindOf "CAManBase") exitWith {false}; _config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className); @@ -30,8 +37,16 @@ if (GVAR(level) >= 2) then { }; if !(isClass _config) exitwith {false}; -// Check for required class -_medicRequired = getNumber (_config >> "requiredMedic"); +_medicRequired = if (isNumber (_config >> "requiredMedic")) then { + getNumber (_config >> "requiredMedic"); +} else { + // Check for required class + if (isText (_config >> "requiredMedic")) exitwith { + missionNamespace getvariable [(getText (_config >> "requiredMedic")), 0]; + }; + 0; +}; + if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith {false}; // Check item @@ -71,6 +86,19 @@ if ("All" in _locations) then { if !(_return) exitwith {false}; +_usersOfItems = []; +_consumeItems = if (isNumber (_config >> "itemConsumed")) then { + getNumber (_config >> "itemConsumed"); +} else { + // Check for required class + if (isText (_config >> "itemConsumed")) exitwith { + missionNamespace getvariable [(getText (_config >> "itemConsumed")), 0]; + }; + 0; +}; +if (_consumeItems > 0) then { + _usersOfItems = ([_caller, _target, _items] call FUNC(useItems)) select 1; +}; // Parse the config for the progress callback _callbackProgress = getText (_config >> "callbackProgress"); @@ -84,9 +112,19 @@ if (isNil _callbackProgress) then { }; // Patient Animation -_patientAnim = getText (_confg >> "animationPatient"); +_patientAnim = getText (_config >> "animationPatient"); +if (_target getvariable ["ACE_isUnconscious", false]) then { + if !(animationState _target in (getArray (_config >> "animationPatientUnconsciousExcludeOn"))) then { + _patientAnim = getText (_config >> "animationPatientUnconscious"); + }; +}; + if (_caller != _target && {vehicle _target == _target} && {_patientAnim != ""}) then { - [_target, _patientAnim] call EFUNC(common,doAnimation); + if (_target getvariable ["ACE_isUnconscious", false]) then { + [_target, _patientAnim, 2, true] call EFUNC(common,doAnimation); + } else { + [_target, _patientAnim, 1, true] call EFUNC(common,doAnimation); + }; }; // Player Animation @@ -94,14 +132,27 @@ _callerAnim = [getText (_config >> "animationCaller"), getText (_config >> "anim if (_caller == _target) then { _callerAnim = [getText (_config >> "animationCallerSelf"), getText (_config >> "animationCallerSelfProne")] select (stance _caller == "PRONE"); }; + +// Cannot use secondairy weapon for animation +if (currentWeapon _caller == secondaryWeapon _caller) then { + _caller selectWeapon (primaryWeapon _caller); +}; + _wpn = ["non", "rfl", "pst"] select (["", primaryWeapon _caller, handgunWeapon _caller] find (currentWeapon _caller)); _callerAnim = [_callerAnim, "[wpn]", _wpn] call CBA_fnc_replace; if (vehicle _caller == _caller && {_callerAnim != ""}) then { if (primaryWeapon _caller == "") then { _caller addWeapon "ACE_FakePrimaryWeapon"; }; - _caller selectWeapon (primaryWeapon _caller); - _caller setvariable [QGVAR(treatmentPrevAnimCaller), animationState _caller]; + if (currentWeapon _caller == "") then { + _caller selectWeapon (primaryWeapon _caller); // unit always has a primary weapon here + }; + + if (stance _caller == "STAND") then { + _caller setvariable [QGVAR(treatmentPrevAnimCaller), "amovpknlmstpsraswrfldnon"]; + } else { + _caller setvariable [QGVAR(treatmentPrevAnimCaller), animationState _caller]; + }; [_caller, _callerAnim] call EFUNC(common,doAnimation); }; @@ -109,11 +160,12 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then { _treatmentTime = getNumber (_config >> "treatmentTime"); [ _treatmentTime, - [_caller, _target, _selectionName, _className, _items], + [_caller, _target, _selectionName, _className, _items, _usersOfItems], DFUNC(treatment_success), DFUNC(treatment_failure), getText (_config >> "displayNameProgress"), - _callbackProgress + _callbackProgress, + ["isnotinside"] ] call EFUNC(common,progressBar); // Display Icon @@ -134,5 +186,4 @@ if (_displayText != "") then { ["displayTextStructured", [_caller], [[_displayText, [_caller] call EFUNC(common,getName), [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); }; - true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index 6707c8d109..6584569227 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -23,20 +23,21 @@ _target = _this select 1; _selectionName = _this select 2; _className = _this select 3; _items = _this select 4; -_specificSpot = if (count _this > 5) then {_this select 5} else {-1}; -if (count _items == 0) exitwith {}; +_specificSpot = if (count _this > 6) then {_this select 6} else {-1}; -if ([_caller, _target, _items] call FUNC(useItems)) then { - [[_target, _className, _selectionName, _specificSpot], QUOTE(DFUNC(treatmentAdvanced_bandageLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ -/* { - if (_x != "") then { - [_target, _x] call FUNC(addToTriageCard); - }; - }foreach _items;*/ - - ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; - [_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_bandagedPatient", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); +if !([_target] call FUNC(hasMedicalEnabled)) exitwith { + _this call FUNC(treatmentBasic_bandage); }; +[[_target, _className, _selectionName, _specificSpot], QUOTE(DFUNC(treatmentAdvanced_bandageLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +/* { + if (_x != "") then { + [_target, _x] call FUNC(addToTriageCard); + }; +}foreach _items;*/ + +["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; +[_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_bandagedPatient", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); + true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index 39eab67fb8..c003f48ead 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -85,10 +85,11 @@ _impact = if ((_mostEffectiveInjury select 3) >= _effectivenessFound) then {_eff _mostEffectiveInjury set [ 3, ((_mostEffectiveInjury select 3) - _effectivenessFound) max 0]; _openWounds set [_mostEffectiveSpot, _mostEffectiveInjury]; -_target setvariable [QGVAR(openWounds), _openWounds]; - -["medical_propagateWound", [_unit, _mostEffectiveInjury]] call EFUNC(common,globalEvent); +_target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; +if (USE_WOUND_EVENT_SYNC) then { + ["medical_propagateWound", [_unit, _mostEffectiveInjury]] call EFUNC(common,globalEvent); +}; // Handle the reopening of bandaged wounds if (_impact > 0) then { // TODO handle reopening of bandaged wounds @@ -98,7 +99,7 @@ if (_impact > 0) then { // If all wounds have been bandaged, we will reset all damage to 0, so the unit is not showing any blood on the model anymore. if (count _openWounds == 0) then { _target setDamage 0; - // TODO also set hitpoints to 0 + // _target setvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; }; true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf index afcc31367b..e8669ecbec 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf @@ -10,59 +10,60 @@ #include "script_component.hpp" -private ["_unit", "_caller", "_allUsedMedication"]; -_unit = _this select 0; -_caller = _this select 1; +private ["_target", "_caller", "_allUsedMedication"]; +_caller = _this select 0; +_target = _this select 1; -if (alive _unit) exitwith { +if (alive _target) exitwith { - _unit setVariable [QGVAR(pain), 0, true]; - _unit setVariable [QGVAR(morphine), 0, true]; - _unit setVariable [QGVAR(bloodVolume), 100, true]; + _target setVariable [QGVAR(pain), 0, true]; + _target setVariable [QGVAR(morphine), 0, true]; + _target setVariable [QGVAR(bloodVolume), 100, true]; // tourniquets - _unit setvariable [QGVAR(tourniquets), [0,0,0,0,0,0], true]; + _target setvariable [QGVAR(tourniquets), [0,0,0,0,0,0], true]; // wounds and injuries - _unit setvariable [QGVAR(openWounds), [], true]; - _unit setVariable [QGVAR(internalWounds), [], true]; + _target setvariable [QGVAR(openWounds), [], true]; + _target setVariable [QGVAR(internalWounds), [], true]; // vitals - _unit setVariable [QGVAR(heartRate), 80]; - _unit setvariable [QGVAR(heartRateAdjustments), []]; - _unit setvariable [QGVAR(bloodPressure), [80, 120]]; - _unit setVariable [QGVAR(peripheralResistance), 100]; + _target setVariable [QGVAR(heartRate), 80]; + _target setvariable [QGVAR(heartRateAdjustments), []]; + _target setvariable [QGVAR(bloodPressure), [80, 120]]; + _target setVariable [QGVAR(peripheralResistance), 100]; // fractures - _unit setVariable [QGVAR(fractures), []]; + _target setVariable [QGVAR(fractures), []]; // IVs - _unit setVariable [QGVAR(salineIVVolume), 0]; - _unit setVariable [QGVAR(plasmaIVVolume), 0]; - _unit setVariable [QGVAR(bloodIVVolume), 0]; + _target setVariable [QGVAR(salineIVVolume), 0]; + _target setVariable [QGVAR(plasmaIVVolume), 0]; + _target setVariable [QGVAR(bloodIVVolume), 0]; // damage storage - _unit setvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; + _target setvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; // airway - _unit setvariable [QGVAR(airwayStatus), 0, true]; - _unit setVariable [QGVAR(airwayOccluded), false, true]; - _unit setvariable [QGVAR(airwayCollapsed), false, true]; + _target setvariable [QGVAR(airwayStatus), 100, true]; + _target setVariable [QGVAR(airwayOccluded), false, true]; + _target setvariable [QGVAR(airwayCollapsed), false, true]; // generic medical admin - _unit setvariable [QGVAR(addedToUnitLoop), false, true]; - _unit setvariable [QGVAR(inCardiacArrest), false, true]; - _unit setVariable ["ACE_isUnconscious", false, true]; - _unit setvariable [QGVAR(hasLostBlood), false, true]; - _unit setvariable [QGVAR(isBleeding), false, true]; - _unit setvariable [QGVAR(hasPain), false, true]; + _target setvariable [QGVAR(addedToUnitLoop), false, true]; + _target setvariable [QGVAR(inCardiacArrest), false, true]; + _target setvariable [QGVAR(inReviveState), false, true]; + _target setVariable ["ACE_isUnconscious", false, true]; + _target setvariable [QGVAR(hasLostBlood), false, true]; + _target setvariable [QGVAR(isBleeding), false, true]; + _target setvariable [QGVAR(hasPain), false, true]; // medication - _allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []]; + _allUsedMedication = _target getVariable [QGVAR(allUsedMedication), []]; { - _unit setvariable [_x select 0, nil]; + _target setvariable [_x select 0, nil]; }foreach _allUsedMedication; // Resetting damage - _unit setDamage 0; + _target setDamage 0; }; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf index f9a5b2f9d9..4d83a97c2e 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf @@ -24,18 +24,15 @@ _selectionName = _this select 2; _className = _this select 3; _items = _this select 4; -if (count _items == 0) exitwith {}; +[[_target, _className], QUOTE(DFUNC(treatmentAdvanced_medicationLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ -if ([_caller, _target, _items] call FUNC(useItems)) then { - [[_target, _className], QUOTE(DFUNC(treatmentAdvanced_medicationLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ - { - if (_x != "") then { - [_target, _x] call FUNC(addToTriageCard); - }; - }foreach _items; +{ + if (_x != "") then { + [_target, _x] call FUNC(addToTriageCard); + }; +}foreach _items; - ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; - [_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_usedItem", [[_caller] call EFUNC(common,getName), _className]] call FUNC(addToLog); -}; +["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; +[_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_usedItem", [[_caller] call EFUNC(common,getName), _className]] call FUNC(addToLog); true; diff --git a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf index 644e98c390..ead2bf9d52 100644 --- a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf @@ -22,3 +22,7 @@ _target = _this select 1; _className = _this select 3; [_target, false] call FUNC(setUnconscious); + +if (_target getvariable [QGVAR(inReviveState), false]) then { + _target setvariable [QGVAR(inReviveState), nil, true]; +}; diff --git a/addons/medical/functions/fnc_treatmentIV.sqf b/addons/medical/functions/fnc_treatmentIV.sqf index 098e134be7..532b1a733c 100644 --- a/addons/medical/functions/fnc_treatmentIV.sqf +++ b/addons/medical/functions/fnc_treatmentIV.sqf @@ -26,10 +26,8 @@ _items = _this select 4; if (count _items == 0) exitwith {}; -if ([_caller, _target, _items] call FUNC(useItems)) then { - _removeItem = _items select 0; - [[_target, _removeItem], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ - ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; - [_target, _removeItem] call FUNC(addToTriageCard); - [_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_gaveIV", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); -}; +_removeItem = _items select 0; +[[_target, _removeItem], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; +[_target, _removeItem] call FUNC(addToTriageCard); +[_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_gaveIV", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); diff --git a/addons/medical/functions/fnc_treatmentIVLocal.sqf b/addons/medical/functions/fnc_treatmentIVLocal.sqf index 6dd8cbf979..aa7b5dbf17 100644 --- a/addons/medical/functions/fnc_treatmentIVLocal.sqf +++ b/addons/medical/functions/fnc_treatmentIVLocal.sqf @@ -37,7 +37,3 @@ if !(_varName in GVAR(IVBags)) then { GVAR(IVBags) pushback _varName; publicVariable QGVAR(IVBags); }; - -// TODO localization -//[_target,"treatment",format["%1 has given %4 a %2(%3ml)",[_caller] call EFUNC(common,getName),_attributes select 2,_attributes select 1,_target]] call FUNC(addActivityToLog); -//[_target,_removeItem] call FUNC(addToTriageList); diff --git a/addons/medical/functions/fnc_treatmentTourniquet.sqf b/addons/medical/functions/fnc_treatmentTourniquet.sqf index 3094b3a53e..379ddbda7a 100644 --- a/addons/medical/functions/fnc_treatmentTourniquet.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquet.sqf @@ -39,12 +39,11 @@ if ((_tourniquets select _part) > 0) exitwith { false; }; -if ([_caller, _target, _items] call FUNC(useItems)) then { - _removeItem = _items select 0; - [[_target, _removeItem], QUOTE(DFUNC(treatmentTourniquetLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ - ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; - [_target, _removeItem] call FUNC(addToTriageCard); - [_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_appliedTourniquet", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); -}; +_removeItem = _items select 0; +[[_target, _removeItem], QUOTE(DFUNC(treatmentTourniquetLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; +[_target, _removeItem] call FUNC(addToTriageCard); +[_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_appliedTourniquet", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); + true; diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index e60b4d9bad..35e57de9ed 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -17,13 +17,14 @@ #include "script_component.hpp" -private ["_caller", "_target","_selectionName","_className","_config","_callback"]; +private ["_caller", "_target","_selectionName","_className","_config","_callback", "_usersOfItems"]; _args = _this select 0; _caller = _args select 0; _target = _args select 1; _selectionName = _args select 2; _className = _args select 3; +_usersOfItems = _args select 5; if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; @@ -31,7 +32,9 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { [_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; -// @todo remove item? +{ + (_x select 0) addItem (_x select 1); +}foreach _usersOfItems; // Record specific callback _config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className); @@ -46,4 +49,6 @@ if (isNil _callback) then { _callback = missionNamespace getvariable _callback; }; -_args call _callback +_args call FUNC(createLitter); + +_args call _callback; diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index fa553c168d..d04bee5253 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -18,7 +18,6 @@ #include "script_component.hpp" private ["_caller", "_target","_selectionName","_className","_config","_callback"]; - _args = _this select 0; _caller = _args select 0; _target = _args select 1; @@ -31,8 +30,6 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { [_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; -// @todo remove item - // Record specific callback _config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className); if (GVAR(level) >= 2) then { @@ -46,4 +43,6 @@ if (isNil _callback) then { _callback = missionNamespace getvariable _callback; }; -_args call _callback +_args call FUNC(createLitter); + +_args call _callback; diff --git a/addons/medical/functions/fnc_useItem.sqf b/addons/medical/functions/fnc_useItem.sqf index 8a9a088247..750ea0452f 100644 --- a/addons/medical/functions/fnc_useItem.sqf +++ b/addons/medical/functions/fnc_useItem.sqf @@ -26,20 +26,20 @@ if (isnil QGVAR(setting_allowSharedEquipment)) then { if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitwith { [[_patient, _item], QUOTE(EFUNC(common,useItem)), _patient] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ - true; + [true, _patient]; }; if ([_medic, _item] call EFUNC(common,hasItem)) exitwith { [[_medic, _item], QUOTE(EFUNC(common,useItem)), _medic] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ - true; + [true, _medic]; }; -_return = false; +_return = [false, objNull]; if ([vehicle _medic] call FUNC(isMedicalVehicle) && {vehicle _medic != _medic}) then { _crew = crew vehicle _medic; { if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitwith { - _return = true; + _return = [true, _x]; [[_x, _item], QUOTE(EFUNC(common,useItem)), _x] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; }foreach _crew; diff --git a/addons/medical/functions/fnc_useItems.sqf b/addons/medical/functions/fnc_useItems.sqf index 4feb234e8c..fbaa324022 100644 --- a/addons/medical/functions/fnc_useItems.sqf +++ b/addons/medical/functions/fnc_useItems.sqf @@ -15,21 +15,26 @@ #include "script_component.hpp" -private ["_medic", "_patient", "_items"]; +private ["_medic", "_patient", "_items", "_itemUsedInfo", "_itemsUsedBy"]; _medic = _this select 0; _patient = _this select 1; _items = _this select 2; +_itemsUsedBy = []; { // handle a one of type use item if (typeName _x == "ARRAY") then { { - if ([_medic, _patient, _x] call FUNC(useItem)) exitwith {}; + _itemUsedInfo = [_medic, _patient, _x] call FUNC(useItem); + if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; }foreach _x; }; // handle required item if (typeName _x == "STRING") then { - [_medic, _patient, _x] call FUNC(useItem); + _itemUsedInfo = [_medic, _patient, _x] call FUNC(useItem); + if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; }; }foreach _items; + +[count _items == count _itemsUsedBy, _itemsUsedBy]; diff --git a/addons/medical/script_component.hpp b/addons/medical/script_component.hpp index ad45e06a3e..939a811a41 100644 --- a/addons/medical/script_component.hpp +++ b/addons/medical/script_component.hpp @@ -10,3 +10,5 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + +#define USE_WOUND_EVENT_SYNC false diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 0d5c985273..a23c37c658 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -30,6 +30,9 @@ Injetar Morfina Inietta Morfina + + Inject Atropine + Transfuse Blood Bluttransfusion @@ -42,6 +45,15 @@ Transfundir Sangue Effettua Trasfusione + + Transfuse Plasma + + + Transfuse Saline + + + Apply Tourniquet + Bandage Verbinden @@ -150,6 +162,9 @@ Injetando Epinefrina ... Inietto l'epinefrina ... + + Injecting Atropine ... + Transfusing Blood ... Bluttransfusion ... @@ -162,6 +177,12 @@ Transfundindo Sangue ... Effettuo la trasfusione ... + + Transfusing Saline ... + + + Transfusing Plasma ... + Bandaging ... Verbinden ... @@ -174,6 +195,9 @@ Atando ... Перевязывание.... + + Applying Tourniquet ... + Medical Zdravotní @@ -852,6 +876,12 @@ Unload patient + + Place body in bodybag + + + Placing body in bodybag + diff --git a/addons/medical/ui/RscTitles.hpp b/addons/medical/ui/RscTitles.hpp index d1cdb80dd3..1962daec80 100644 --- a/addons/medical/ui/RscTitles.hpp +++ b/addons/medical/ui/RscTitles.hpp @@ -78,39 +78,27 @@ class Rsctitles { colorSelectBackground[] = {0, 0, 0, 0.0}; colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.5}; }; - class LogName { - idc = 301; - type = CT_STATIC; - x = "safezoneX + (2 * (((safezoneW / safezoneH) min 1.2) / 40))"; - y = "20.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY"; - w = "9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "0.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; - style = 0x00 + 0x100; // ST_LEFT + ST_SHADOW - font = "PuristaMedium"; - colorText[] = {0.95, 0.95, 0.95, 0.75}; - colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; - text = "ACTIVITY LOG"; - }; class ActivityLog: InjuryList { idc = 302; y = "21.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY"; h = "7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; rowHeight = 0.03; - colorBackground[] = {0, 0, 0, 0.2}; + shadow = 2; + colorBackground[] = {0, 0, 0, 0}; colorText[] = {1,1, 1, 1.0}; colorScrollbar[] = {0.95, 0.95, 0.95, 1}; - colorSelect[] = {0.95, 0.95, 0.95, 1}; - colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {1,1,1,1}; + colorSelect2[] = {1,1,1,1}; colorSelectBackground[] = {0, 0, 0, 0.0}; - colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.5}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0}; }; class TriageStatus { idc = 303; type = CT_STATIC; x = "safezoneX + (2 * (((safezoneW / safezoneH) min 1.2) / 40))"; - y = "28.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY"; + y = "20.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY"; w = "9 * (((safezoneW / safezoneH) min 1.2) / 40)"; h = "0.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; diff --git a/addons/microdagr/CfgVehicles.hpp b/addons/microdagr/CfgVehicles.hpp index f7c22bc30e..833f7bd2f6 100644 --- a/addons/microdagr/CfgVehicles.hpp +++ b/addons/microdagr/CfgVehicles.hpp @@ -11,7 +11,7 @@ class CfgVehicles { showDisabled = 0; priority = 0.2; icon = QUOTE(PATHTOF(UI\icon_microDAGR.paa)); - exceptions[] = {"notOnMap"}; + exceptions[] = {"notOnMap", "isNotInside"}; }; class GVAR(configure) { //Opens the dialog @@ -21,7 +21,7 @@ class CfgVehicles { showDisabled = 0; priority = 0.1; icon = QUOTE(PATHTOF(UI\icon_microDAGR.paa)); - exceptions[] = {"notOnMap"}; + exceptions[] = {"notOnMap", "isNotInside"}; }; class GVAR(close) { displayName = "$STR_ACE_microdagr_closeUnit"; @@ -30,7 +30,7 @@ class CfgVehicles { showDisabled = 0; priority = 0.3; icon = QUOTE(PATHTOF(UI\icon_microDAGR.paa)); - exceptions[] = {"notOnMap"}; + exceptions[] = {"notOnMap", "isNotInside"}; }; }; }; diff --git a/addons/microdagr/XEH_clientInit.sqf b/addons/microdagr/XEH_clientInit.sqf index 61f857cfed..c917eb0a8d 100644 --- a/addons/microdagr/XEH_clientInit.sqf +++ b/addons/microdagr/XEH_clientInit.sqf @@ -7,7 +7,7 @@ if (!hasInterface) exitWith {}; ["ACE3", QGVAR(openGPS), (localize "STR_ACE_microdagr_toggleUnit"), { // canInteractWith (can use on map) - if !([ACE_player, objNull, ["notOnMap"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if (!("ACE_microDAGR" in (items ace_player))) exitWith {false}; @@ -20,7 +20,7 @@ if (!hasInterface) exitWith {}; ["ACE3", QGVAR(closeGPS), (localize "STR_ACE_microdagr_closeUnit"), { // canInteractWith (can use on map) - if !([ACE_player, objNull, ["notOnMap"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if (!("ACE_microDAGR" in (items ace_player))) exitWith {false}; if (GVAR(currentShowMode) == DISPLAY_MODE_CLOSED) exitWith {false}; diff --git a/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf b/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf index 1836e50da2..881c0b3b5d 100644 --- a/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf +++ b/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf @@ -26,7 +26,6 @@ _waypoints = [] call FUNC(deviceGetWaypoints); if ((_newWpIndex < 0) || (_newWpIndex > ((count _waypoints) - 1))) exitWith { GVAR(currentWaypoint) = -1; - ERROR("out of bounds wp"); }; GVAR(currentWaypoint) = _newWpIndex; diff --git a/addons/microdagr/functions/fnc_canShow.sqf b/addons/microdagr/functions/fnc_canShow.sqf index 19b7b8f0c6..b251a65c10 100644 --- a/addons/microdagr/functions/fnc_canShow.sqf +++ b/addons/microdagr/functions/fnc_canShow.sqf @@ -26,11 +26,11 @@ case (DISPLAY_MODE_CLOSED): {_returnValue = true}; //Can always close case (DISPLAY_MODE_HIDDEN): {_returnValue = true}; //Can always hide case (DISPLAY_MODE_DIALOG): { - _returnValue = ("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap"]] call EFUNC(common,canInteractWith)}; + _returnValue = ("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)}; }; case (DISPLAY_MODE_DISPLAY): { //Can't have minimap up while zoomed in - _returnValue = (cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap"]] call EFUNC(common,canInteractWith)}; + _returnValue = (cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)}; }; }; diff --git a/addons/overpressure/CfgEventHandlers.hpp b/addons/overpressure/CfgEventHandlers.hpp index fa70cab5ea..439270861b 100644 --- a/addons/overpressure/CfgEventHandlers.hpp +++ b/addons/overpressure/CfgEventHandlers.hpp @@ -43,7 +43,7 @@ class Extended_FiredBIS_EventHandlers { firedBIS = QUOTE(if (local (_this select 0) && {getNumber (configfile >> 'CfgWeapons' >> _this select 1 >> QUOTE(QGVAR(Damage))) > 0}) then {_this call DFUNC(fireOverpressureZone)}); }; }; - class StaticWeapons { + class StaticWeapon { class ADDON { firedBIS = QUOTE(if (local (_this select 0) && {getNumber (configfile >> 'CfgWeapons' >> _this select 1 >> QUOTE(QGVAR(Damage))) > 0}) then {_this call DFUNC(fireOverpressureZone)}); }; diff --git a/addons/overpressure/CfgWeapons.hpp b/addons/overpressure/CfgWeapons.hpp index 5880795ee2..e9170a4b2e 100644 --- a/addons/overpressure/CfgWeapons.hpp +++ b/addons/overpressure/CfgWeapons.hpp @@ -17,14 +17,16 @@ class CfgWeapons { }; class launch_Titan_short_base: launch_Titan_base { - GVAR(angle) = 40; - GVAR(range) = 8; + // Titan is a soft-launch launcher + GVAR(angle) = 30; + GVAR(range) = 2; GVAR(damage) = 0.5; }; class launch_NLAW_F: Launcher_Base_F { - GVAR(angle) = 40; - GVAR(range) = 5; + // NLAW is a soft-launch launcher + GVAR(angle) = 30; + GVAR(range) = 2; GVAR(damage) = 0.6; }; diff --git a/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf b/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf index d63f3b2359..d5c28cca44 100644 --- a/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf +++ b/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf @@ -53,12 +53,11 @@ if (_distance < _backblastRange) then { _alpha = sqrt (1 - _distance / _backblastRange); _beta = sqrt 0.5; - _damage = 2 * _alpha * _beta * _backblastDamage; + _damage = _alpha * _beta * _backblastDamage; [_damage * 100] call BIS_fnc_bloodEffect; - // TODO: Sort this interaction with medical - if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then { - [_firer, "HitBody", ([_firer, "", ((_firer getHitPointDamage "HitBody") + _damage), objNull, objNull] call EFUNC(medical,handleDamage))] call EFUNC(medical,setHitPointDamage); + if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {([_firer] call EFUNC(medical,hasMedicalEnabled))}) then { + [_firer, "HitBody", [_firer, "body", ((_firer getHitPointDamage "HitBody") + _damage), _firer, "backblast"] call EFUNC(medical,handleDamage)] call EFUNC(medical,setHitPointDamage); } else { _firer setDamage (damage _firer + _damage); }; diff --git a/addons/overpressure/functions/fnc_getDistance.sqf b/addons/overpressure/functions/fnc_getDistance.sqf index 4fe380fbaf..905ecbd180 100644 --- a/addons/overpressure/functions/fnc_getDistance.sqf +++ b/addons/overpressure/functions/fnc_getDistance.sqf @@ -15,15 +15,18 @@ EXPLODE_3_PVT(_this,_posASL,_direction,_maxDistance); -private ["_distance", "_interval", "_line", "_intersections"]; +private ["_distance", "_interval", "_line", "_intersections", "_terrainIntersect", "_lastTerrainIntersect"]; _distance = _maxDistance; _interval = _distance; _line = [_posASL, []]; +_terrainIntersect = false; +_lastTerrainIntersect = false; while { _interval > 0.1 } do { + _lastTerrainIntersect = _terrainIntersect; _interval = _interval / 2; _line set [1, _posASL vectorAdd (_direction vectorMultiply _distance)]; @@ -32,9 +35,32 @@ while { _x isKindOf "Static" || {_x isKindOf "AllVehicles"} } count (lineIntersectsWith _line); - _distance = _distance + ([1, -1] select (_intersections > 0 || {terrainIntersectASL _line})) * _interval; + _terrainIntersect = if (_intersections > 0) then { + false + } else { + terrainIntersectASL _line + }; + + _distance = _distance + ([1, -1] select (_intersections > 0 || _terrainIntersect)) * _interval; if (_distance > _maxDistance) exitWith {_distance = 999}; }; +if (_distance > _maxDistance) exitWith {_distance}; + +// If the intersection was with the terrain, check slope +if (_terrainIntersect || _lastTerrainIntersect) exitWith { + private ["_slope","_angle"]; + _slope = surfaceNormal (_posASL vectorAdd (_direction vectorMultiply _distance)); + // Calculate the angle between the terrain and the back blast direction + _angle = 90 - acos (- (_slope vectorDotProduct _direction)); + + //systemChat format ["Angle: %1", _angle]; + // Angles is below 25º, no backblast at all + if (_angle < 25) exitWith {_distance = 999}; + // Angles is below 45º the distance is increased according to the difference + if (_angle < 45) exitWith {_distance = _distance * (5 - 4 * sqrt ((_angle - 25)/20))}; + // Angles above 45º create full backblast +}; + _distance diff --git a/addons/overpressure/functions/fnc_overpressureDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf index 2fbbcf9aa8..d1280b682f 100644 --- a/addons/overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -50,18 +50,13 @@ if (!surfaceIsWater _pos) then { _alpha = sqrt (1 - _distance / _overpressureRange); _beta = sqrt (1 - _angle / _overpressureAngle); - _damage = 2 * _alpha * _beta * _overpressureDamage; + _damage = _alpha * _beta * _overpressureDamage; // If the target is the ACE_player if (_x == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect}; - // TODO: Sort this interaction with medical - if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then { - [_x, "HitBody", ([_x, "", (_x getHitPointDamage "HitBody") + _damage, objNull, objNull] call EFUNC(medical,handleDamage))] call EFUNC(medical,setHitPointDamage); - _x spawn { - sleep 0.5; - [_this, "", 0, objNull, objNull] call EFUNC(medical,handleDamage); - }; + if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {([_x] call EFUNC(medical,hasMedicalEnabled))}) then { + [_x, "HitBody", [_x, "body", (_x getHitPointDamage "HitBody") + _damage, _firer, "backblast"] call EFUNC(medical,handleDamage)] call EFUNC(medical,setHitPointDamage); } else { _x setDamage (damage _x + _damage); }; diff --git a/addons/protection/FixHelmets.hpp b/addons/protection/FixHelmets.hpp index 6c3d6a9e2f..eb2c515e50 100644 --- a/addons/protection/FixHelmets.hpp +++ b/addons/protection/FixHelmets.hpp @@ -7,224 +7,224 @@ /*class InventoryItem_Base_F; class HeadgearItem: InventoryItem_Base_F { - armor = 0; - passThrough = 1; + armor = 0; + passThrough = 1; }; class H_HelmetB: ItemCore { - class ItemInfo: HeadgearItem { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; + class ItemInfo: HeadgearItem { + //mass = 40; + armor = 4; + passThrough = 0.5; + }; }; class H_HelmetB_camo: H_HelmetB { - class ItemInfo: HeadgearItem { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; + class ItemInfo: HeadgearItem { + //mass = 40; + armor = 4; + passThrough = 0.5; + }; }; class H_HelmetB_light: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 30; - armor = 3; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 30; + armor = 3; + passThrough = 0.5; + }; }; class H_Booniehat_khk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 10; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 10; + armor = 0; + passThrough = 1; + }; }; class H_HelmetB_plain_mcamo: H_HelmetB {}; class H_HelmetSpecB: H_HelmetB_plain_mcamo { - class ItemInfo: ItemInfo { - //mass = 50; - armor = 5; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 50; + armor = 5; + passThrough = 0.5; + }; }; class H_HelmetIA: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 40; + armor = 4; + passThrough = 0.5; + }; }; class H_Cap_red: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 4; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 4; + armor = 0; + passThrough = 1; + }; }; class H_Cap_headphones: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 8; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 8; + armor = 0; + passThrough = 1; + }; }; class H_HelmetCrew_B: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 40; + armor = 4; + passThrough = 0.5; + }; }; class H_PilotHelmetFighter_B: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 50; - armor = 5; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 50; + armor = 5; + passThrough = 0.5; + }; }; class H_PilotHelmetHeli_B: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 30; - armor = 3; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 30; + armor = 3; + passThrough = 0.5; + }; }; class H_CrewHelmetHeli_B: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 30; - armor = 3; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 30; + armor = 3; + passThrough = 0.5; + }; }; class H_HelmetO_ocamo: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 50; - armor = 5; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 50; + armor = 5; + passThrough = 0.5; + }; }; class H_HelmetLeaderO_ocamo: H_HelmetO_ocamo { - class ItemInfo: ItemInfo { - //mass = 60; - armor = 6; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 60; + armor = 6; + passThrough = 0.5; + }; }; class H_MilCap_ocamo: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_BandMask_blk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 8; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 8; + armor = 0; + passThrough = 1; + }; }; class H_HelmetSpecO_ocamo: H_HelmetO_ocamo { - class ItemInfo: ItemInfo { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 40; + armor = 4; + passThrough = 0.5; + }; }; class H_Bandanna_surfer: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 8; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 8; + armor = 0; + passThrough = 1; + }; }; class H_Shemag_khk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_ShemagOpen_khk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_Beret_blk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_Beret_02: H_Beret_blk { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_Watchcap_blk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_TurbanO_blk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 8; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 8; + armor = 0; + passThrough = 1; + }; }; class H_StrawHat: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_Hat_blue: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + //mass = 6; + armor = 0; + passThrough = 1; + }; }; class H_RacingHelmet_1_F: H_HelmetB_camo { - class ItemInfo: ItemInfo { - //mass = 50; - armor = 5; - passThrough = 0.5; - }; + class ItemInfo: ItemInfo { + //mass = 50; + armor = 5; + passThrough = 0.5; + }; };*/ diff --git a/addons/protection/FixUniforms.hpp b/addons/protection/FixUniforms.hpp index add1524c8a..24c02b79aa 100644 --- a/addons/protection/FixUniforms.hpp +++ b/addons/protection/FixUniforms.hpp @@ -1,62 +1,62 @@ class Man; class CAManBase: Man { - class HitPoints { - class HitHead { - /*armor = 1; - passThrough = 1; - radius = 0.1; - explosionShielding = 0.5; - minimalHit = 0;*/ + class HitPoints { + class HitHead { + /*armor = 1; + passThrough = 1; + radius = 0.1; + explosionShielding = 0.5; + minimalHit = 0;*/ + }; + + class HitBody { + /*armor = 1; + passThrough = 1; + radius = 0.15; + explosionShielding = 10; + minimalHit = 0;*/ + }; + + class HitHands { + /*armor = 1; + passThrough = 1; + radius = 0.08; + explosionShielding = 1; + minimalHit = 0;*/ + }; + + class HitLegs { + /*armor = 1; + passThrough = 1; + radius = 0.1; + explosionShielding = 1; + minimalHit = 0;*/ + }; }; - class HitBody { - /*armor = 1; - passThrough = 1; - radius = 0.15; - explosionShielding = 10; - minimalHit = 0;*/ - }; - - class HitHands { - /*armor = 1; - passThrough = 1; - radius = 0.08; - explosionShielding = 1; - minimalHit = 0;*/ - }; - - class HitLegs { - /*armor = 1; - passThrough = 1; - radius = 0.1; - explosionShielding = 1; - minimalHit = 0;*/ - }; - }; - - /*armor = 2; - armorStructural = 5;*/ + /*armor = 2; + armorStructural = 5;*/ }; class Civilian: CAManBase { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + }; - class HitBody: HitBody { - armor = 2; - }; + class HitBody: HitBody { + armor = 2; + }; - class HitHands: HitHands { - armor = 2; - }; + class HitHands: HitHands { + armor = 2; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ }; /*class Civilian_F: Civilian {}; @@ -67,503 +67,503 @@ class SoldierEB: CAManBase {}; class SoldierGB: CAManBase {}; class B_Soldier_base_F: SoldierWB { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + }; + + class HitBody: HitBody { + armor = 2; + }; + + class HitHands: HitHands { + armor = 2; + }; + + class HitLegs: HitLegs { + armor = 2; + }; }; - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 2; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - }; - - armor = 2; - armorStructural = 5;*/ + armor = 2; + armorStructural = 5;*/ }; class B_Soldier_02_f: B_Soldier_base_F { // t-shirt - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + }; - class HitBody: HitBody { - armor = 1; - }; + class HitBody: HitBody { + armor = 1; + }; - class HitHands: HitHands { - armor = 1; - }; + class HitHands: HitHands { + armor = 1; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ - armorStructural = 5; //7; + armorStructural = 5; //7; }; class B_Soldier_03_f: B_Soldier_base_F { // sleeves - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + }; - class HitBody: HitBody { - armor = 2; - }; + class HitBody: HitBody { + armor = 2; + }; - class HitHands: HitHands { - armor = 1; - }; + class HitHands: HitHands { + armor = 1; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ - armorStructural = 5; //7; + armorStructural = 5; //7; }; class B_Soldier_04_f: B_Soldier_base_F { // heli pilot - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; + class HitPoints: HitPoints { + class HitHead: HitHead { + /*armor = 1; + passThrough = 1; + explosionShielding = 0.5;*/ + }; - class HitBody: HitBody { - /*armor = 2;*/ - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; + class HitBody: HitBody { + /*armor = 2;*/ + passThrough = 1; //0.5; + /*explosionShielding = 2.4;*/ + }; - class HitHands: HitHands { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ - }; + class HitHands: HitHands { + armor = 2; //8; + passThrough = 1; //0.5; + /*explosionShielding = 1.2;*/ + }; - class HitLegs: HitLegs { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ + class HitLegs: HitLegs { + armor = 2; //8; + passThrough = 1; //0.5; + /*explosionShielding = 1.2;*/ + }; }; - }; }; class B_Soldier_05_f: B_Soldier_base_F { // cas pilot - armorStructural = 5; //3; + armorStructural = 5; //3; - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; + class HitPoints: HitPoints { + class HitHead: HitHead { + /*armor = 1; + passThrough = 1; + explosionShielding = 0.5;*/ + }; - class HitBody: HitBody { - armor = 3; //2; - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; + class HitBody: HitBody { + armor = 3; //2; + passThrough = 1; //0.5; + /*explosionShielding = 2.4;*/ + }; - class HitHands: HitHands { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ - }; + class HitHands: HitHands { + armor = 3; //8; + /*passThrough = 1; + explosionShielding = 1.2;*/ + }; - class HitLegs: HitLegs { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ + class HitLegs: HitLegs { + armor = 3; //8; + /*passThrough = 1; + explosionShielding = 1.2;*/ + }; }; - }; }; class B_Soldier_diver_base_F: B_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 2; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 2; + }; - class HitBody: HitBody { - armor = 2; - }; + class HitBody: HitBody { + armor = 2; + }; - class HitHands: HitHands { - armor = 2; - }; + class HitHands: HitHands { + armor = 2; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ }; // these appear to be broken, remnants from A2? /*class C_man_p_fugitive_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.3*10"; - }; + class HitPoints: HitPoints { + class HitBody: HitBody { + armor = "0.3*10"; + }; - class HitLegs: HitLegs { - armor = "0.3*5"; + class HitLegs: HitLegs { + armor = "0.3*5"; + }; }; - }; }; class C_man_w_worker_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.6*10"; - }; + class HitPoints: HitPoints { + class HitBody: HitBody { + armor = "0.6*10"; + }; - class HitHands: HitHands { - armor = "0.5*5"; - }; + class HitHands: HitHands { + armor = "0.5*5"; + }; - class HitLegs: HitLegs { - armor = "0.5*5"; + class HitLegs: HitLegs { + armor = "0.5*5"; + }; }; - }; }; class C_man_hunter_1_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.6*10"; - }; + class HitPoints: HitPoints { + class HitBody: HitBody { + armor = "0.6*10"; + }; - class HitHands: HitHands { - armor = "0.5*5"; - }; + class HitHands: HitHands { + armor = "0.5*5"; + }; - class HitLegs: HitLegs { - armor = "0.5*5"; + class HitLegs: HitLegs { + armor = "0.5*5"; + }; }; - }; }; class C_man_p_shorts_1_F: C_man_1 { - class HitPoints: HitPoints { - class HitLegs: HitLegs { - armor = "0.3*5"; + class HitPoints: HitPoints { + class HitLegs: HitLegs { + armor = "0.3*5"; + }; }; - }; }; class C_man_pilot_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.6*10"; - }; + class HitPoints: HitPoints { + class HitBody: HitBody { + armor = "0.6*10"; + }; - class HitHands: HitHands { - armor = "0.5*5"; - }; + class HitHands: HitHands { + armor = "0.5*5"; + }; - class HitLegs: HitLegs { - armor = "0.5*5"; + class HitLegs: HitLegs { + armor = "0.5*5"; + }; }; - }; };*/ class I_Soldier_base_F: SoldierGB { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + }; - class HitBody: HitBody { - armor = 2; - }; + class HitBody: HitBody { + armor = 2; + }; - class HitHands: HitHands { - armor = 2; - }; + class HitHands: HitHands { + armor = 2; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ - /*armor = 2;*/ - armorStructural = 5; //7; + /*armor = 2;*/ + armorStructural = 5; //7; }; class I_Soldier_02_F: I_Soldier_base_F { // sleeves - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + }; - class HitBody: HitBody { - armor = 2; - }; + class HitBody: HitBody { + armor = 2; + }; - class HitHands: HitHands { - armor = 1; - }; + class HitHands: HitHands { + armor = 1; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ }; class I_Soldier_03_F: I_Soldier_base_F { // heli pilot - /*armorStructural = 5;*/ + /*armorStructural = 5;*/ - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; + class HitPoints: HitPoints { + class HitHead: HitHead { + /*armor = 1; + passThrough = 1; + explosionShielding = 0.5;*/ + }; - class HitBody: HitBody { - /*armor = 2;*/ - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; + class HitBody: HitBody { + /*armor = 2;*/ + passThrough = 1; //0.5; + /*explosionShielding = 2.4;*/ + }; - class HitHands: HitHands { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ - }; + class HitHands: HitHands { + armor = 2; //8; + passThrough = 1; //0.5; + /*explosionShielding = 1.2;*/ + }; - class HitLegs: HitLegs { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ + class HitLegs: HitLegs { + armor = 2; //8; + passThrough = 1; //0.5; + /*explosionShielding = 1.2;*/ + }; }; - }; }; class I_Soldier_04_F: I_Soldier_base_F { // cas pilot - armorStructural = 5; //3; + armorStructural = 5; //3; - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; + class HitPoints: HitPoints { + class HitHead: HitHead { + /*armor = 1; + passThrough = 1; + explosionShielding = 0.5;*/ + }; - class HitBody: HitBody { - armor = 3; //2; - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; + class HitBody: HitBody { + armor = 3; //2; + passThrough = 1; //0.5; + /*explosionShielding = 2.4;*/ + }; - class HitHands: HitHands { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ - }; + class HitHands: HitHands { + armor = 3; //8; + /*passThrough = 1; + explosionShielding = 1.2;*/ + }; - class HitLegs: HitLegs { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ + class HitLegs: HitLegs { + armor = 3; //8; + /*passThrough = 1; + explosionShielding = 1.2;*/ + }; }; - }; }; class I_Soldier_diver_base_F: I_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 2; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 2; + }; - class HitBody: HitBody { - armor = 2; - }; + class HitBody: HitBody { + armor = 2; + }; - class HitHands: HitHands { - armor = 2; - }; + class HitHands: HitHands { + armor = 2; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ }; class O_Soldier_base_F: SoldierEB { - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ + class HitPoints: HitPoints { + class HitHead: HitHead { + /*armor = 1; + passThrough = 1; + explosionShielding = 0.5;*/ + }; + + class HitBody: HitBody { + armor = 4; //6; + passThrough = 0.85; //0.5; + /*explosionShielding = 1.5;*/ + }; + + class HitHands: HitHands { + armor = 4; //8; + passThrough = 0.85; //0.5; + /*explosionShielding = 0.8;*/ + }; + + class HitLegs: HitLegs { + armor = 4; //8; + passThrough = 0.85; //0.5; + /*explosionShielding = 0.8;*/ + }; }; - class HitBody: HitBody { - armor = 4; //6; - passThrough = 0.85; //0.5; - /*explosionShielding = 1.5;*/ - }; - - class HitHands: HitHands { - armor = 4; //8; - passThrough = 0.85; //0.5; - /*explosionShielding = 0.8;*/ - }; - - class HitLegs: HitLegs { - armor = 4; //8; - passThrough = 0.85; //0.5; - /*explosionShielding = 0.8;*/ - }; - }; - - /*armor = 2; - armorStructural = 5;*/ + /*armor = 2; + armorStructural = 5;*/ }; class O_officer_F: O_Soldier_base_F { - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; + class HitPoints: HitPoints { + class HitHead: HitHead { + /*armor = 1; + passThrough = 1; + explosionShielding = 0.5;*/ + }; - class HitBody: HitBody { - /*armor = 2; - passThrough = 1; - explosionShielding = 10;*/ - }; + class HitBody: HitBody { + /*armor = 2; + passThrough = 1; + explosionShielding = 10;*/ + }; - class HitHands: HitHands { - /*armor = 2; - passThrough = 1; - explosionShielding = 1;*/ - }; + class HitHands: HitHands { + /*armor = 2; + passThrough = 1; + explosionShielding = 1;*/ + }; - class HitLegs: HitLegs { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1;*/ + class HitLegs: HitLegs { + armor = 2; //8; + passThrough = 1; //0.5; + /*explosionShielding = 1;*/ + }; }; - }; }; class O_Soldier_02_F: O_Soldier_base_F { // crew ? - armorStructural = 5; //3; + armorStructural = 5; //3; - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; + class HitPoints: HitPoints { + class HitHead: HitHead { + /*armor = 1; + passThrough = 1; + explosionShielding = 0.5;*/ + }; - class HitBody: HitBody { - armor = 4; //6; - passThrough = 0.85; //0.5; - /*explosionShielding = 1.5;*/ - }; + class HitBody: HitBody { + armor = 4; //6; + passThrough = 0.85; //0.5; + /*explosionShielding = 1.5;*/ + }; - class HitHands: HitHands { - armor = 4; //8; - passThrough = 0.85; //1; - /*explosionShielding = 0.8;*/ - }; + class HitHands: HitHands { + armor = 4; //8; + passThrough = 0.85; //1; + /*explosionShielding = 0.8;*/ + }; - class HitLegs: HitLegs { - armor = 4; //8; - passThrough = 0.85; //1; - /*explosionShielding = 0.8;*/ + class HitLegs: HitLegs { + armor = 4; //8; + passThrough = 0.85; //1; + /*explosionShielding = 0.8;*/ + }; }; - }; }; class O_Soldier_diver_base_F: O_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 2; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 2; + }; - class HitBody: HitBody { - armor = 2; - }; + class HitBody: HitBody { + armor = 2; + }; - class HitHands: HitHands { - armor = 2; - }; + class HitHands: HitHands { + armor = 2; + }; - class HitLegs: HitLegs { - armor = 2; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + }; + };*/ }; class O_Soldier_VR_F: O_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - passThrough = 1; - explosionShielding = 0.5; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + passThrough = 1; + explosionShielding = 0.5; + }; - class HitBody: HitBody { - armor = 2; - passThrough = 1; - explosionShielding = 10; - }; + class HitBody: HitBody { + armor = 2; + passThrough = 1; + explosionShielding = 10; + }; - class HitHands: HitHands { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; + class HitHands: HitHands { + armor = 2; + passThrough = 1; + explosionShielding = 1; + }; - class HitLegs: HitLegs { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + passThrough = 1; + explosionShielding = 1; + }; + };*/ }; class O_Protagonist_VR_F: O_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - passThrough = 1; - explosionShielding = 0.5; - }; + /*class HitPoints: HitPoints { + class HitHead: HitHead { + armor = 1; + passThrough = 1; + explosionShielding = 0.5; + }; - class HitBody: HitBody { - armor = 2; - passThrough = 1; - explosionShielding = 10; - }; + class HitBody: HitBody { + armor = 2; + passThrough = 1; + explosionShielding = 10; + }; - class HitHands: HitHands { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; + class HitHands: HitHands { + armor = 2; + passThrough = 1; + explosionShielding = 1; + }; - class HitLegs: HitLegs { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; - };*/ + class HitLegs: HitLegs { + armor = 2; + passThrough = 1; + explosionShielding = 1; + }; + };*/ }; diff --git a/addons/protection/FixVests.hpp b/addons/protection/FixVests.hpp index 19e5d777d6..f3d1ad2b3d 100644 --- a/addons/protection/FixVests.hpp +++ b/addons/protection/FixVests.hpp @@ -3,294 +3,301 @@ class ItemCore; class VestItem; class Vest_Camo_Base: ItemCore { - class ItemInfo: VestItem { - /*containerClass = "Supply0"; - mass = 0; - armor = 0; - passThrough = 1;*/ - }; + class ItemInfo: VestItem { + /*containerClass = "Supply0"; + mass = 0; + armor = 0; + passThrough = 1;*/ + }; }; class Vest_NoCamo_Base: ItemCore { - class ItemInfo: VestItem { - /*containerClass = "Supply0"; - mass = 0; - armor = 0; - passThrough = 1;*/ - }; + class ItemInfo: VestItem { + /*containerClass = "Supply0"; + mass = 0; + armor = 0; + passThrough = 1;*/ + }; }; // belts class V_Rangemaster_belt: Vest_NoCamo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply40"; - mass = 10; - armor = 0; - passThrough = 1;*/ - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply40"; + mass = 10; + armor = 0; + passThrough = 1;*/ + }; }; // bandolliers class V_BandollierB_khk: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply80"; - mass = 15; - armor = 0;*/ - passThrough = 0.85; //1; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply80"; + mass = 15; + armor = 0;*/ + passThrough = 0.85; //1; + }; }; /*class V_BandollierB_cbr: V_BandollierB_khk { - class ItemInfo: ItemInfo {}; + class ItemInfo: ItemInfo {}; }; class V_BandollierB_rgr: V_BandollierB_khk { - class ItemInfo: ItemInfo {}; + class ItemInfo: ItemInfo {}; }; class V_BandollierB_blk: V_BandollierB_khk { - class ItemInfo: ItemInfo {}; + class ItemInfo: ItemInfo {}; }; class V_BandollierB_oli: V_BandollierB_khk { - class ItemInfo: ItemInfo {}; + class ItemInfo: ItemInfo {}; };*/ // plate carriers class V_PlateCarrier1_rgr: Vest_NoCamo_Base { // lite - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 80;*/ - armor = 8; //20; - passThrough = 0.75; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply140"; + mass = 80;*/ + armor = 8; //20; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrier2_rgr: V_PlateCarrier1_rgr { // heavy - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 100;*/ - armor = 12; //30; - passThrough = 0.75; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply140"; + mass = 100;*/ + armor = 12; //30; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrier3_rgr: Vest_NoCamo_Base { // heavy (us) - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 100;*/ - armor = 12; //30; - passThrough = 0.75; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply140"; + mass = 100;*/ + armor = 12; //30; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrierGL_rgr: Vest_NoCamo_Base { // lite (gl) - class ItemInfo: ItemInfo { - containerClass = "Supply160"; //"Supply140"; - /*mass = 100;*/ - armor = 8; //100; - passThrough = 0.75; //0.7; - }; + class ItemInfo: ItemInfo { + containerClass = "Supply160"; //"Supply140"; + /*mass = 100;*/ + armor = 8; //100; + passThrough = 0.75; //0.7; + }; }; class V_PlateCarrier1_blk: Vest_Camo_Base { // heavy (black) - class ItemInfo: ItemInfo { - /*containerClass = "Supply140";*/ - mass = 100; //80; - armor = 12; //20; - passThrough = 0.75; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply140";*/ + mass = 100; //80; + armor = 12; //20; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrierSpec_rgr: Vest_NoCamo_Base { // lite (special) - class ItemInfo: ItemInfo { - /*containerClass = "Supply100"; - mass = 120;*/ - armor = 16; //40; - passThrough = 0.75; //0.1; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply100"; + mass = 120;*/ + armor = 16; //40; + passThrough = 0.75; //0.1; + }; }; // chestrigs /*class V_Chestrig_khk: Vest_Camo_Base { - class ItemInfo: ItemInfo { - containerClass = "Supply140"; - mass = 20; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + containerClass = "Supply140"; + mass = 20; + armor = 0; + passThrough = 1; + }; }; class V_Chestrig_rgr: V_Chestrig_khk {}; class V_Chestrig_blk: V_Chestrig_khk {}; class V_Chestrig_oli: Vest_Camo_Base { - class ItemInfo: ItemInfo { - containerClass = "Supply140"; - mass = 20; - armor = 0; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + containerClass = "Supply140"; + mass = 20; + armor = 0; + passThrough = 1; + }; };*/ // tactical vests class V_TacVest_khk: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply100"; - mass = 40;*/ - armor = 8; //20; - /*passThrough = 1;*/ - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply100"; + mass = 40;*/ + armor = 8; //20; + /*passThrough = 1;*/ + }; }; class V_TacVest_brn: V_TacVest_khk {}; class V_TacVest_oli: V_TacVest_khk {}; class V_TacVest_blk: V_TacVest_khk {}; class V_TacVest_camo: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply100"; - mass = 40;*/ - armor = 8; //20; - /*passThrough = 1;*/ - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply100"; + mass = 40;*/ + armor = 8; //20; + /*passThrough = 1;*/ + }; }; class V_TacVest_blk_POLICE: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply100";*/ - mass = 40; //60; - armor = 8; //100; - passThrough = 1; //0.7; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply100";*/ + mass = 40; //60; + armor = 8; //100; + passThrough = 1; //0.7; + }; }; class V_TacVestIR_blk: Vest_NoCamo_Base { // raven vest - class ItemInfo: VestItem { - /*containerClass = "Supply100"; - mass = 50;*/ - armor = 8; //20; - passThrough = 0.85; //0.5; - }; + class ItemInfo: VestItem { + /*containerClass = "Supply100"; + mass = 50;*/ + armor = 8; //20; + passThrough = 0.85; //0.5; + }; }; class V_TacVestCamo_khk: Vest_Camo_Base { - class ItemInfo: VestItem { - /*containerClass = "Supply100"; - mass = 40;*/ - armor = 8; //20; - /*passThrough = 1;*/ - }; + class ItemInfo: VestItem { + /*containerClass = "Supply100"; + mass = 40;*/ + armor = 8; //20; + /*passThrough = 1;*/ + }; }; // harnesses class V_HarnessO_brn: Vest_NoCamo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply160"; - mass = 30; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply160"; + mass = 30; + armor = 0;*/ + passThrough = 0.85; //0.5; + }; }; class V_HarnessOGL_brn: Vest_NoCamo_Base { // gl - class ItemInfo: ItemInfo { - /*containerClass = "Supply120"; - mass = 20; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply120"; + mass = 20; + armor = 0;*/ + passThrough = 0.85; //0.5; + }; }; class V_HarnessO_gry: V_HarnessO_brn { - class ItemInfo: ItemInfo { - /*containerClass = "Supply160"; - mass = 30; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply160"; + mass = 30; + armor = 0;*/ + passThrough = 0.85; //0.5; + }; }; class V_HarnessOGL_gry: V_HarnessO_gry { // gl - class ItemInfo: ItemInfo { - /*containerClass = "Supply120"; - mass = 20; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply120"; + mass = 20; + armor = 0;*/ + passThrough = 0.85; //0.5; + }; }; class V_HarnessOSpec_brn: V_HarnessO_brn { - class ItemInfo: VestItem { - /*containerClass = "Supply160"; - mass = 30; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; + class ItemInfo: VestItem { + /*containerClass = "Supply160"; + mass = 30; + armor = 0;*/ + passThrough = 0.85; //0.5; + }; }; class V_HarnessOSpec_gry: V_HarnessO_gry { - class ItemInfo: ItemInfo { - /*containerClass = "Supply160"; - mass = 30; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply160"; + mass = 30; + armor = 0;*/ + passThrough = 0.85; //0.5; + }; }; // indep plate carriers class V_PlateCarrierIA1_dgtl: Vest_NoCamo_Base { // lite - class ItemInfo: VestItem { - /*containerClass = "Supply120"; - mass = 60;*/ - armor = 8; //20; - passThrough = 0.75; //0.5; - }; + class ItemInfo: VestItem { + /*containerClass = "Supply120"; + mass = 60;*/ + armor = 8; //20; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrierIA2_dgtl: V_PlateCarrierIA1_dgtl { // heavy - class ItemInfo: VestItem { - /*containerClass = "Supply120"; - mass = 80;*/ - armor = 12; //30; - passThrough = 0.75; //0.5; - }; + class ItemInfo: VestItem { + /*containerClass = "Supply120"; + mass = 80;*/ + armor = 12; //30; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrierIAGL_dgtl: V_PlateCarrierIA2_dgtl { // heavy (gl) - class ItemInfo: VestItem { - containerClass = "Supply140"; //"Supply120"; - mass = 100; //80; - armor = 12; //100; - passThrough = 0.75; //0.7; - }; + class ItemInfo: VestItem { + containerClass = "Supply140"; //"Supply120"; + mass = 100; //80; + armor = 12; //100; + passThrough = 0.75; //0.7; + }; }; // rebreather /*class V_RebreatherB: Vest_Camo_Base { - class ItemInfo: ItemInfo { - containerClass = "Supply0"; - mass = 80; - armor = 20; - passThrough = 1; - }; + class ItemInfo: ItemInfo { + containerClass = "Supply0"; + mass = 80; + armor = 20; + passThrough = 1; + }; }; class V_RebreatherIR: V_RebreatherB {}; class V_RebreatherIA: V_RebreatherB {};*/ // more plate carriers class V_PlateCarrier_Kerry: V_PlateCarrier1_rgr { // lighter - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 80;*/ - armor = 8; //30; - passThrough = 0.75; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply140"; + mass = 80;*/ + armor = 8; //30; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrierL_CTRG: V_PlateCarrier1_rgr { // lite - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 80;*/ - armor = 8; //20; - passThrough = 0.75; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply140"; + mass = 80;*/ + armor = 8; //20; + passThrough = 0.75; //0.5; + }; }; class V_PlateCarrierH_CTRG: V_PlateCarrier2_rgr { // heavy - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 100;*/ - armor = 12; //30; - passThrough = 0.75; //0.5; - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply140"; + mass = 100;*/ + armor = 12; //30; + passThrough = 0.75; //0.5; + }; }; // another tactical vest class V_I_G_resistanceLeader_F: V_TacVest_camo { - class ItemInfo: ItemInfo {}; + class ItemInfo: ItemInfo {}; }; // press vest class V_Press_F: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply40"; - mass = 20;*/ - armor = 8; //0; ? - /*passThrough = 1;*/ - }; + class ItemInfo: ItemInfo { + /*containerClass = "Supply40"; + mass = 20;*/ + armor = 8; //0; ? + /*passThrough = 1;*/ + }; }; + +// marksman dlc +/*class V_PlateCarrierGL_blk: V_PlateCarrierGL_rgr {}; +class V_PlateCarrierGL_mtp: V_PlateCarrierGL_rgr {}; +class V_PlateCarrierSpec_blk: V_PlateCarrierSpec_rgr {}; +class V_PlateCarrierSpec_mtp: V_PlateCarrierSpec_rgr {}; +class V_PlateCarrierIAGL_oli: V_PlateCarrierIAGL_dgtl {};*/ diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp index 218e04ff09..0fa3111243 100644 --- a/addons/realisticnames/CfgVehicles.hpp +++ b/addons/realisticnames/CfgVehicles.hpp @@ -552,4 +552,85 @@ class CfgVehicles { class Weapon_srifle_DMR_01_F: Weapon_Base_F { displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; }; + + // marksmen + /*class Weapon_srifle_DMR_02_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_02"; + }; + + class Weapon_srifle_DMR_02_camo_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_camo"; + }; + + class Weapon_srifle_DMR_02_sniper_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_sniper"; + }; + + class Weapon_srifle_DMR_03_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03"; + }; + + class Weapon_srifle_DMR_03_khaki_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_khaki"; + }; + + class Weapon_srifle_DMR_03_tan_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_tan"; + }; + + class Weapon_srifle_DMR_03_multicam_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_multicam"; + }; + + class Weapon_srifle_DMR_03_woodland_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_woodland"; + }; + + class Weapon_srifle_DMR_04_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_04"; + }; + + class Weapon_srifle_DMR_04_Tan_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_04_Tan"; + }; + + class Weapon_srifle_DMR_05_blk_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_blk"; + }; + + class Weapon_srifle_DMR_05_hex_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_hex"; + }; + + class Weapon_srifle_DMR_05_tan_f: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_tan"; + }; + + class Weapon_srifle_DMR_06_camo_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_camo"; + }; + + class Weapon_srifle_DMR_06_olive_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_olive"; + }; + + class Weapon_MMG_01_hex_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_MMG_01_hex"; + }; + + class Weapon_MMG_01_tan_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_MMG_01_tan"; + }; + + class Weapon_MMG_02_camo_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_MMG_02_camo"; + }; + + class Weapon_MMG_02_black_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_MMG_02_black"; + }; + + class Weapon_MMG_02_sand_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_MMG_02_sand"; + };*/ }; diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp index 8e64434bd4..56d9e3b7c8 100644 --- a/addons/realisticnames/CfgWeapons.hpp +++ b/addons/realisticnames/CfgWeapons.hpp @@ -192,6 +192,120 @@ class CfgWeapons { displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; }; + // marksmen marksman + /*class DMR_02_base_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_DMR_02"; //MAR-10 .338"; + }; + + class srifle_DMR_02_F: DMR_02_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_02"; //MAR-10 .338 (Black)"; + }; + + class srifle_DMR_02_camo_F: srifle_DMR_02_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_camo"; //MAR-10 .338 (Camo)"; + }; + + class srifle_DMR_02_sniper_F: srifle_DMR_02_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_sniper"; //MAR-10 .338 (Sand)"; + }; + + class DMR_03_base_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_DMR_03"; //Mk-I EMR 7.62 mm"; + }; + + class srifle_DMR_03_F: DMR_03_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03"; //Mk-I EMR 7.62 mm (Black)"; + }; + + class srifle_DMR_03_khaki_F: srifle_DMR_03_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_khaki"; //Mk-I EMR 7.62 mm (Khaki)"; + }; + + class srifle_DMR_03_tan_F: srifle_DMR_03_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_tan"; //Mk-I EMR 7.62 mm (Sand)"; + }; + + class srifle_DMR_03_multicam_F: srifle_DMR_03_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_multicam"; //Mk-I EMR 7.62 mm (Camo)"; + }; + + class srifle_DMR_03_woodland_F: srifle_DMR_03_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_woodland"; //Mk-I EMR 7.62 mm (Woodland)"; + }; + + class srifle_DMR_03_spotter_F: srifle_DMR_03_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_spotter"; //NATO DMR (provisional) spotter"; + }; + + class DMR_04_base_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_DMR_04"; //ASP-1 Kir 12.7 mm"; + }; + + class srifle_DMR_04_F: DMR_04_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_04"; //ASP-1 Kir 12.7 mm (Black)"; + }; + + class srifle_DMR_04_Tan_F: srifle_DMR_04_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_04_Tan"; //ASP-1 Kir 12.7 mm (Tan)"; + }; + + class DMR_05_base_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_DMR_05"; //Cyrus 9.3 mm"; + }; + + class srifle_DMR_05_blk_F: DMR_05_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_blk"; //Cyrus 9.3 mm (Black) + }; + + class srifle_DMR_05_hex_F: srifle_DMR_05_blk_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_hex"; //Cyrus 9.3 mm (Hex)"; + }; + + class srifle_DMR_05_tan_f: srifle_DMR_05_blk_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_tan"; //Cyrus 9.3 mm (Tan)"; + }; + + class DMR_06_base_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_DMR_06"; //Mk14 7.62 mm"; + }; + + class srifle_DMR_06_camo_F: DMR_06_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_camo"; //Mk14 7.62 mm (Camo) + }; + + class srifle_DMR_06_olive_F: srifle_DMR_06_camo_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_olive"; //Mk14 7.62 mm (Olive)"; + }; + + // marksmen mgs + class MMG_01_base_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_MMG_01"; //Navid 9.3 mm"; + }; + + class MMG_01_hex_F: MMG_01_base_F { + displayName = "$STR_ACE_RealisticNames_MMG_01_hex"; //Navid 9.3 mm (Hex)"; + }; + + class MMG_01_tan_F: MMG_01_hex_F { + displayName = "$STR_ACE_RealisticNames_MMG_01_tan"; //Navid 9.3 mm (Tan)"; + }; + + class MMG_02_base_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_MMG_02"; //SPMG .338"; + }; + + class MMG_02_camo_F: MMG_02_base_F { + displayName = "$STR_ACE_RealisticNames_MMG_02_camo"; //SPMG .338 (MTP)"; + }; + + class MMG_02_black_F: MMG_02_camo_F { + displayName = "$STR_ACE_RealisticNames_MMG_02_black"; //SPMG .338 (Black)"; + }; + + class MMG_02_sand_F: MMG_02_camo_F { + displayName = "$STR_ACE_RealisticNames_MMG_02_sand"; //SPMG .338 (Sand)"; + };*/ + // vehicle weapons // gatlings diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 8c1483ead2..9ccd7752d2 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -1214,5 +1214,97 @@ VS-121 VS-121 + + + TODO: MAR-10 .338 + + + TODO: MAR-10 .338 (Black) + + + TODO: MAR-10 .338 (Camo) + + + TODO: MAR-10 .338 (Sand) + + + + TODO: Mk-I EMR 7.62 mm + + + TODO: Mk-I EMR 7.62 mm (Black) + + + TODO: Mk-I EMR 7.62 mm (Khaki) + + + TODO: Mk-I EMR 7.62 mm (Sand) + + + TODO: Mk-I EMR 7.62 mm (Camo) + + + TODO: Mk-I EMR 7.62 mm (Woodland) + + + TODO: NATO DMR (provisional) spotter + + + + TODO: ASP-1 Kir 12.7 mm + + + TODO: ASP-1 Kir 12.7 mm (Black) + + + TODO: ASP-1 Kir 12.7 mm (Tan) + + + + TODO: Cyrus 9.3 mm + + + TODO: Cyrus 9.3 mm (Black) + + + TODO: Cyrus 9.3 mm (Hex) + + + TODO: Cyrus 9.3 mm (Tan) + + + + TODO: Mk14 7.62 mm + + + TODO: Mk14 7.62 mm (Camo) + + + TODO: Mk14 7.62 mm (Olive) + + + + TODO: Navid 9.3 mm + + + TODO: Navid 9.3 mm (Hex) + + + TODO: Navid 9.3 mm (Tan) + + + + TODO: SPMG .338 + + + TODO: SPMG .338 (MTP) + + + TODO: SPMG .338 (Black) + + + TODO: SPMG .338 (Sand) + + - \ No newline at end of file + diff --git a/addons/respawn/CfgVehicles.hpp b/addons/respawn/CfgVehicles.hpp index 082778bf94..f6b8fc64c2 100644 --- a/addons/respawn/CfgVehicles.hpp +++ b/addons/respawn/CfgVehicles.hpp @@ -18,7 +18,7 @@ class CfgVehicles { class No { default = 1; name = "No"; value = 0; }; }; }; - class RemoveDeadBodiesDisonncected { + class RemoveDeadBodiesDisconnected { displayName = "Remove bodies?"; description = "Remove player bodies after disconnect?"; typeName = "BOOL"; diff --git a/addons/scopes/CfgWeapons.hpp b/addons/scopes/CfgWeapons.hpp index 67898fb449..87b5a4073f 100644 --- a/addons/scopes/CfgWeapons.hpp +++ b/addons/scopes/CfgWeapons.hpp @@ -40,4 +40,29 @@ class CfgWeapons { }; }; }; + + class ACE_optic_DMS: optic_DMS { + author = "$STR_ACE_Common_ACETeam"; + _generalMacro = "ACE_optic_DMS"; + displayName = "LOCALIZE ACE DMR"; + //descriptionShort = "$STR_A3_CFGWEAPONS_ACC_DMS1"; + class ItemInfo: ItemInfo { + modelOptics = QUOTE(PATHTOF(ace_shortdot_optics.p3d)); + + class OpticsModes: OpticsModes { + class Snip: Snip { + opticsZoomMin = 0.05; + opticsZoomMax = 0.3; + opticsZoomInit = 0.3; + discretefov[] = {}; + modelOptics[] = {}; + }; + }; + }; + }; +}; + +class SlotInfo; +class CowsSlot: SlotInfo { + compatibleItems[] += {"ACE_optic_DMS"}; }; diff --git a/addons/scopes/RscTitles.hpp b/addons/scopes/RscTitles.hpp index a9c43aedaf..189ff3613f 100644 --- a/addons/scopes/RscTitles.hpp +++ b/addons/scopes/RscTitles.hpp @@ -1,3 +1,6 @@ + +class RscText; + class RscTitles { class ACE_Scopes_Zeroing { idd = -1; @@ -65,6 +68,30 @@ class RscTitles { }; }; }; + + class ACE_Shortdot_Reticle { + idd = -1; + onLoad = "uiNamespace setVariable ['ACE_ctrlShortdotReticle', (_this select 0) displayCtrl 1];"; + duration = 999999; + fadeIn = 0; + fadeOut = 0; + name = "ACE_Shortdot_Reticle"; + + class controlsBackground { + class Debug_RscElement: RscText { + idc = 1; + style = 48; + size = 1; + sizeEx = 0; + font = "TahomaB"; + text = ""; + x = 0; + y = 0; + w = 0; + h = 0; + }; + }; + }; }; class RscInGameUI { diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index 9a1b0e8ef3..559a21a772 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -92,3 +92,30 @@ if !(hasInterface) exitWith {}; }, {false}, [201, [false, true, false]], false] call cba_fnc_addKeybind; + +// init shortdot +GVAR(showShortdot) = false; + +["playerInventoryChanged", { + if (_this select 1 isEqualTo []) exitWith {}; //@todo fix eh + + private "_showShortdot"; + _showShortdot = _this select 1 select 9 select 2 == "ACE_optic_DMS"; + + if (GVAR(showShortdot)) then { + if (!_showShortdot) then { + // hide control and turn onDraw handler off + (uiNamespace getVariable ["ACE_ctrlShortdotReticle", controlNull]) ctrlShow false; + GVAR(showShortdot) = false; + }; + } else { + if (_showShortdot) then { + // create control and turn onDraw handler on + ([QGVAR(reticle)] call BIS_fnc_rscLayer) cutRsc ["ACE_Shortdot_Reticle", "PLAIN", 0, false]; + (uiNamespace getVariable "ACE_ctrlShortdotReticle") ctrlSetText QUOTE(PATHTOF(data\reticles\ace_shortdot_reticle_1.paa)); + GVAR(showShortdot) = true; + }; + }; +}] call EFUNC(common,addEventHandler); + +addMissionEventHandler ["Draw3D", {if (GVAR(showShortdot)) then {call FUNC(onDrawShortdot)};}]; diff --git a/addons/scopes/XEH_preInit.sqf b/addons/scopes/XEH_preInit.sqf index e574cc72d4..d33801a510 100644 --- a/addons/scopes/XEH_preInit.sqf +++ b/addons/scopes/XEH_preInit.sqf @@ -7,6 +7,7 @@ PREP(canAdjustScope); PREP(firedEH); PREP(getOptics); PREP(inventoryCheck); +PREP(onDrawShortdot); PREP(showZeroing); GVAR(fadeScript) = scriptNull; diff --git a/addons/scopes/ace_shortdot_optics.p3d b/addons/scopes/ace_shortdot_optics.p3d new file mode 100644 index 0000000000..3d0392346a Binary files /dev/null and b/addons/scopes/ace_shortdot_optics.p3d differ diff --git a/addons/scopes/data/reticles/ace_shortdot_reticle_1.paa b/addons/scopes/data/reticles/ace_shortdot_reticle_1.paa new file mode 100644 index 0000000000..6c3d23668a Binary files /dev/null and b/addons/scopes/data/reticles/ace_shortdot_reticle_1.paa differ diff --git a/addons/scopes/data/reticles/ace_shortdot_reticle_2.paa b/addons/scopes/data/reticles/ace_shortdot_reticle_2.paa new file mode 100644 index 0000000000..beb7a651c9 Binary files /dev/null and b/addons/scopes/data/reticles/ace_shortdot_reticle_2.paa differ diff --git a/addons/scopes/functions/fnc_onDrawShortdot.sqf b/addons/scopes/functions/fnc_onDrawShortdot.sqf new file mode 100644 index 0000000000..78ff0b0f50 --- /dev/null +++ b/addons/scopes/functions/fnc_onDrawShortdot.sqf @@ -0,0 +1,25 @@ +// by commy2 +#include "script_component.hpp" + +private "_control"; +_control = uiNamespace getVariable ["ACE_ctrlShortdotReticle", controlNull]; + +if (cameraView != "GUNNER" || {currentWeapon ACE_player != primaryWeapon ACE_player}) exitWith { + _control ctrlShow false; +}; + +private ["_size", "_sizeX", "_sizeY"]; + +_size = call EFUNC(common,getZoom); + +_sizeX = _size/4; +_sizeY = _sizeX*safezoneW/safezoneH; + +_control ctrlSetPosition [ + safezoneX+0.5*safezoneW-0.5*_sizeX, + safezoneY+0.5*safezoneH-0.5*_sizeY, + _sizeX, + _sizeY +]; +_control ctrlCommit 0; +_control ctrlShow true; diff --git a/addons/testmissions/$PBOPREFIX$ b/addons/testmissions/$PBOPREFIX$ new file mode 100644 index 0000000000..30f861b8ff --- /dev/null +++ b/addons/testmissions/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\Addons\testmissions \ No newline at end of file diff --git a/addons/testmissions/MPMissions/ACETestingMap1.Stratis/description.ext b/addons/testmissions/MPMissions/ACETestingMap1.Stratis/description.ext new file mode 100644 index 0000000000..d61b2cf200 --- /dev/null +++ b/addons/testmissions/MPMissions/ACETestingMap1.Stratis/description.ext @@ -0,0 +1,17 @@ +enableDebugConsole = 2; //note security risk + +// respawn = "GROUP"; +respawn = "BASE"; +// respawn = "BIRD"; +respawnDelay = 2; + +class Header { + gameType = Coop; + minPlayers = 1; + maxPlayers = 491; +}; + +onLoadName = "ACE3 Testing"; +// onLoadMission = ""; +// author = ""; +// loadScreen = ""; \ No newline at end of file diff --git a/addons/testmissions/MPMissions/ACETestingMap1.Stratis/init.sqf b/addons/testmissions/MPMissions/ACETestingMap1.Stratis/init.sqf new file mode 100644 index 0000000000..f2c95b8ca2 --- /dev/null +++ b/addons/testmissions/MPMissions/ACETestingMap1.Stratis/init.sqf @@ -0,0 +1 @@ +enableSaving [false, false]; diff --git a/addons/testmissions/MPMissions/ACETestingMap1.Stratis/mission.sqm b/addons/testmissions/MPMissions/ACETestingMap1.Stratis/mission.sqm new file mode 100644 index 0000000000..08bba0bcb1 --- /dev/null +++ b/addons/testmissions/MPMissions/ACETestingMap1.Stratis/mission.sqm @@ -0,0 +1,1248 @@ +version=12; +class Mission +{ + addOns[]= + { + "A3_Characters_F_BLUFOR", + "a3_characters_f", + "a3_map_stratis", + "A3_armor_f_beta_APC_Tracked_02", + "A3_Characters_F_INDEP", + "ace_vehiclelock", + "A3_Soft_F_MRAP_01", + "A3_Soft_F_Car", + "ace_map", + "A3_Static_F_Gamma_AA", + "A3_Static_F_Mortar_01", + "A3_Static_F_Gamma", + "a3_static_f", + "ace_captives", + "A3_Armor_F_Slammer", + "A3_Air_F_Beta_Heli_Attack_01", + "ace_medical", + "ace_common", + "A3_Weapons_F_Ammoboxes", + "A3_Armor_F_EPB_APC_tracked_03", + "A3_Air_F_Heli_Light_01", + "A3_Air_F_Beta_Heli_Transport_01", + "A3_Armor_F_T100K", + "A3_Boat_F_Boat_Armed_01", + "A3_Boat_F_Civilian_Boat", + "A3_Boat_F_Boat_Transport_01", + "A3_Characters_F_Gamma", + "A3_Air_F_Gamma_UAV_02", + "A3_Static_F_Gamma_AT" + }; + addOnsAuto[]= + { + "A3_Characters_F_BLUFOR", + "a3_characters_f", + "A3_Characters_F_INDEP", + "ace_vehiclelock", + "ace_captives", + "A3_Air_F_Gamma_UAV_02", + "A3_Characters_F_Gamma", + "A3_Soft_F_MRAP_01", + "A3_Soft_F_Car", + "A3_Static_F_Gamma_AA", + "A3_Static_F_Mortar_01", + "A3_Static_F_Gamma", + "a3_static_f", + "A3_Armor_F_Slammer", + "ace_medical", + "ace_common", + "A3_Weapons_F_Ammoboxes", + "A3_Armor_F_EPB_APC_tracked_03", + "A3_Air_F_Beta_Heli_Attack_01", + "A3_Air_F_Heli_Light_01", + "A3_Air_F_Beta_Heli_Transport_01", + "A3_Armor_F_T100K", + "A3_Boat_F_Boat_Armed_01", + "A3_Boat_F_Civilian_Boat", + "A3_Boat_F_Boat_Transport_01", + "A3_Static_F_Gamma_AT", + "a3_map_stratis" + }; + randomSeed=709402; + class Intel + { + startWeather=0; + startWind=0; + startWaves=0.099999994; + forecastWeather=0; + forecastWind=0; + forecastWaves=0.099999994; + forecastLightnings=0.099999994; + year=2035; + month=7; + day=6; + hour=12; + minute=0; + startFogDecay=0.013; + forecastFogDecay=0.013; + }; + class Groups + { + items=19; + class Item0 + { + side="WEST"; + class Vehicles + { + items=1; + class Item0 + { + position[]={1716.1971,5.5,5752.0244}; + azimut=-50.831005; + id=0; + side="WEST"; + vehicle="B_Soldier_F"; + player="PLAY CDG"; + leader=1; + skill=0.60000002; + init="this addItem ""ACE_key_civ"""; + description="Keys For CD"; + syncId=0; + synchronizations[]={3}; + }; + }; + }; + class Item1 + { + side="GUER"; + class Vehicles + { + items=1; + class Item0 + { + position[]={1709.5989,5.5,5740.709}; + azimut=-67.220284; + id=1; + side="GUER"; + vehicle="I_soldier_F"; + player="PLAY CDG"; + leader=1; + skill=0.60000002; + init="this addItem ""ACE_key_east"""; + description="Keys for AB"; + syncId=1; + synchronizations[]={2}; + }; + }; + }; + class Item2 + { + side="LOGIC"; + class Vehicles + { + items=1; + class Item0 + { + position[]={1712.0765,5.5,5743.5811}; + id=2; + side="LOGIC"; + vehicle="ACE_VehicleLock_ModuleSyncedAssign"; + leader=1; + lock="UNLOCKED"; + skill=0.60000002; + syncId=2; + synchronizations[]={1,6}; + }; + }; + }; + class Item3 + { + side="LOGIC"; + class Vehicles + { + items=1; + class Item0 + { + position[]={1714.5892,5.5,5748.7002}; + id=3; + side="LOGIC"; + vehicle="ACE_VehicleLock_ModuleSyncedAssign"; + leader=1; + lock="UNLOCKED"; + skill=0.60000002; + syncId=3; + synchronizations[]={7,0}; + }; + }; + }; + class Item4 + { + side="LOGIC"; + class Vehicles + { + items=1; + class Item0 + { + position[]={1715.7699,5.5,5745.752}; + class args + { + items=3; + class Item0 + { + value="1"; + parentCls="ACE_VehicleLock_ModuleSetup"; + typeName="LockVehicleInventory"; + }; + class Item1 + { + value="0"; + parentCls="ACE_VehicleLock_ModuleSetup"; + typeName="SetLockState"; + }; + class Item2 + { + value="15"; + parentCls="ACE_VehicleLock_ModuleSetup"; + typeName="DefaultLockpickStrength"; + }; + }; + id=4; + side="LOGIC"; + vehicle="ACE_VehicleLock_ModuleSetup"; + leader=1; + lock="UNLOCKED"; + skill=0.60000002; + }; + }; + }; + class Item5 + { + side="WEST"; + class Vehicles + { + items=1; + class Item0 + { + position[]={1703.6329,5.5,5730.1909}; + azimut=119.576; + id=5; + side="WEST"; + vehicle="B_Soldier_F"; + player="PLAY CDG"; + leader=1; + skill=0.60000002; + text="Q"; + init="nul = this spawn {sleep 3; [_this] call ace_medical_fnc_setUnconscious};"; + description="Q Unconscious at start"; + }; + }; + }; + class Item6 + { + side="WEST"; + class Vehicles + { + items=1; + class Item0 + { + position[]={1702.6882,5.5,5728.8687}; + azimut=103.13899; + id=6; + side="WEST"; + vehicle="B_Soldier_F"; + player="PLAY CDG"; + leader=1; + skill=0.60000002; + text="a1"; + description="Surrender At Start"; + syncId=4; + synchronizations[]={5}; + }; + }; + }; + class Item7 + { + side="LOGIC"; + class Vehicles + { + items=1; + class Item0 + { + position[]={1701.0719,5.5,5727.5586}; + azimut=15.1769; + id=7; + side="LOGIC"; + vehicle="ace_captives_ModuleSurrender"; + leader=1; + lock="UNLOCKED"; + skill=0.60000002; + syncId=5; + synchronizations[]={4}; + }; + }; + }; + class Item8 + { + side="WEST"; + class Vehicles + { + items=4; + class Item0 + { + position[]={1703.7711,5.5,5715.2427}; + azimut=11.294894; + id=8; + side="WEST"; + vehicle="B_Soldier_TL_F"; + player="PLAY CDG"; + leader=1; + rank="CORPORAL"; + skill=0.60000002; + text="GrpNATO_A1_0"; + description="NATO Alpha 1 Fireteam Leader"; + }; + class Item1 + { + position[]={1706.2533,5.5,5712.9951}; + azimut=11.294894; + id=9; + side="WEST"; + vehicle="B_Soldier_LAT_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_A1_1"; + description="NATO Alpha 1 Rifleman (AT)"; + }; + class Item2 + { + position[]={1709.2836,5.5,5712.2866}; + azimut=11.294894; + id=10; + side="WEST"; + vehicle="B_Soldier_AAR_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_A1_2"; + description="NATO Alpha 1 Assistant Automatic Rifleman"; + }; + class Item3 + { + position[]={1712.4042,5.5,5711.6323}; + azimut=11.294894; + id=11; + side="WEST"; + vehicle="B_Soldier_AR_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_A1_3"; + description="NATO Alpha 1 Automatic Rifleman"; + }; + }; + }; + class Item9 + { + side="WEST"; + class Vehicles + { + items=4; + class Item0 + { + position[]={1700.8379,5.5,5704.4658}; + azimut=11.294894; + id=12; + side="WEST"; + vehicle="B_Soldier_TL_F"; + player="PLAY CDG"; + leader=1; + rank="CORPORAL"; + skill=0.60000002; + text="GrpNATO_A2_0"; + description="NATO Alpha 2 Fireteam Leader"; + }; + class Item1 + { + position[]={1703.1456,5.5,5702.0576}; + azimut=11.294894; + id=13; + side="WEST"; + vehicle="B_Soldier_LAT_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_A2_1"; + description="NATO Alpha 2 Rifleman (AT)"; + }; + class Item2 + { + position[]={1706.1492,5.5,5701.3618}; + azimut=11.294894; + id=14; + side="WEST"; + vehicle="B_Soldier_AAR_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_A2_2"; + description="NATO Alpha 2 Assistant Automatic Rifleman"; + }; + class Item3 + { + position[]={1709.3947,5.5,5700.7007}; + azimut=11.294894; + id=15; + side="WEST"; + vehicle="B_Soldier_AR_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_A2_3"; + description="NATO Alpha 2 Automatic Rifleman"; + }; + }; + }; + class Item10 + { + side="WEST"; + class Vehicles + { + items=4; + class Item0 + { + position[]={1696.9097,5.5,5693.7847}; + azimut=11.294894; + id=16; + side="WEST"; + vehicle="B_Soldier_TL_F"; + player="PLAY CDG"; + leader=1; + rank="CORPORAL"; + skill=0.60000002; + text="GrpNATO_A3_0"; + description="NATO Alpha 3 Fireteam Leader"; + }; + class Item1 + { + position[]={1699.3469,5.5,5691.3257}; + azimut=11.294894; + id=17; + side="WEST"; + vehicle="B_Soldier_LAT_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_A3_1"; + description="NATO Alpha 3 Rifleman (AT)"; + }; + class Item2 + { + position[]={1702.4423,5.5,5690.4912}; + azimut=11.294894; + id=18; + side="WEST"; + vehicle="B_Soldier_AAR_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_A3_2"; + description="NATO Alpha 3 Assistant Automatic Rifleman"; + }; + class Item3 + { + position[]={1705.6521,5.5,5689.7666}; + azimut=11.294894; + id=19; + side="WEST"; + vehicle="B_Soldier_AR_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_A3_3"; + description="NATO Alpha 3 Automatic Rifleman"; + }; + }; + }; + class Item11 + { + side="WEST"; + class Vehicles + { + items=4; + class Item0 + { + position[]={1685.6747,5.5,5720.1187}; + azimut=11.294894; + id=20; + side="WEST"; + vehicle="B_Soldier_TL_F"; + player="PLAY CDG"; + leader=1; + rank="CORPORAL"; + skill=0.60000002; + text="GrpNATO_B1_0"; + description="NATO Bravo 1 Fireteam Leader"; + }; + class Item1 + { + position[]={1688.1687,5.5,5717.9639}; + azimut=11.294894; + id=21; + side="WEST"; + vehicle="B_Soldier_LAT_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_B1_1"; + description="NATO Bravo 1 Rifleman (AT)"; + }; + class Item2 + { + position[]={1691.0776,5.5,5717.2754}; + azimut=11.294894; + id=22; + side="WEST"; + vehicle="B_Soldier_AAR_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_B1_2"; + description="NATO Bravo 1 Assistant Automatic Rifleman"; + }; + class Item3 + { + position[]={1694.293,5.5,5716.6172}; + azimut=11.294894; + id=23; + side="WEST"; + vehicle="B_Soldier_AR_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_B1_3"; + description="NATO Bravo 1 Automatic Rifleman"; + }; + }; + }; + class Item12 + { + side="WEST"; + class Vehicles + { + items=4; + class Item0 + { + position[]={1682.364,5.5,5709.4131}; + azimut=11.294894; + id=24; + side="WEST"; + vehicle="B_Soldier_TL_F"; + player="PLAY CDG"; + leader=1; + rank="CORPORAL"; + skill=0.60000002; + text="GrpNATO_B2_0"; + description="NATO Bravo 2 Fireteam Leader"; + }; + class Item1 + { + position[]={1685.1151,5.5,5707.0654}; + azimut=11.294894; + id=25; + side="WEST"; + vehicle="B_Soldier_LAT_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_B2_1"; + description="NATO Bravo 2 Rifleman (AT)"; + }; + class Item2 + { + position[]={1688.1718,5.5,5706.313}; + azimut=11.294894; + id=26; + side="WEST"; + vehicle="B_Soldier_AAR_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_B2_2"; + description="NATO Bravo 2 Assistant Automatic Rifleman"; + }; + class Item3 + { + position[]={1691.5254,5.5,5705.6113}; + azimut=11.294894; + id=27; + side="WEST"; + vehicle="B_Soldier_AR_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_B2_3"; + description="NATO Bravo 2 Automatic Rifleman"; + }; + }; + }; + class Item13 + { + side="WEST"; + class Vehicles + { + items=4; + class Item0 + { + position[]={1678.4825,5.5,5697.4468}; + azimut=11.294894; + id=28; + side="WEST"; + vehicle="B_Soldier_TL_F"; + player="PLAY CDG"; + leader=1; + rank="CORPORAL"; + skill=0.60000002; + text="GrpNATO_B3_0"; + description="NATO Bravo 3 Fireteam Leader"; + }; + class Item1 + { + position[]={1681.5645,5.5,5696.561}; + azimut=11.294894; + id=29; + side="WEST"; + vehicle="B_Soldier_LAT_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_B3_1"; + description="NATO Bravo 3 Rifleman (AT)"; + }; + class Item2 + { + position[]={1684.6531,5.5,5695.8491}; + azimut=11.294894; + id=30; + side="WEST"; + vehicle="B_Soldier_AAR_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_B3_2"; + description="NATO Bravo 3 Assistant Automatic Rifleman"; + }; + class Item3 + { + position[]={1687.8109,5.5,5695.1021}; + azimut=11.294894; + id=31; + side="WEST"; + vehicle="B_Soldier_AR_F"; + player="PLAY CDG"; + skill=0.60000002; + text="GrpNATO_B3_3"; + description="NATO Bravo 3 Automatic Rifleman"; + }; + }; + }; + class Item14 + { + side="WEST"; + class Vehicles + { + items=1; + class Item0 + { + position[]={1540.8328,-27.831757,6018.0283}; + azimut=4.41886; + special="FLY"; + id=32; + side="WEST"; + vehicle="B_UAV_02_CAS_F"; + isUAV=1; + leader=1; + skill=0.60000002; + }; + }; + }; + class Item15 + { + side="WEST"; + class Vehicles + { + items=1; + class Item0 + { + position[]={2861.0947,0,6407.8574}; + azimut=4.41886; + special="FLY"; + id=33; + side="WEST"; + vehicle="B_UAV_02_CAS_F"; + isUAV=1; + leader=1; + skill=0.60000002; + }; + }; + }; + class Item16 + { + side="WEST"; + class Vehicles + { + items=1; + class Item0 + { + position[]={1944.1785,0,6868.8906}; + azimut=4.41886; + special="FLY"; + id=34; + side="WEST"; + vehicle="B_UAV_02_CAS_F"; + isUAV=1; + leader=1; + skill=0.60000002; + }; + }; + }; + class Item17 + { + side="WEST"; + class Vehicles + { + items=4; + class Item0 + { + position[]={1713.3085,5.5,5725.0205}; + azimut=98.173798; + id=35; + side="WEST"; + vehicle="B_medic_F"; + player="PLAY CDG"; + leader=1; + rank="LIEUTENANT"; + skill=0.60000002; + text="Medic2"; + description="Medic 2"; + }; + class Item1 + { + position[]={1712.2098,5.5,5727.1675}; + azimut=98.173798; + id=36; + side="WEST"; + vehicle="B_medic_F"; + player="PLAY CDG"; + skill=0.60000002; + text="Medic1"; + description="Medic 1"; + }; + class Item2 + { + position[]={1711.6387,5.5,5725.041}; + azimut=98.173798; + id=37; + side="WEST"; + vehicle="B_medic_F"; + player="PLAY CDG"; + skill=0.60000002; + text="Medic3"; + description="Medic 3"; + }; + class Item3 + { + position[]={1710.0735,5.5,5726.4287}; + id=38; + side="WEST"; + vehicle="B_soldier_UAV_F"; + player="PLAY CDG"; + skill=0.60000002; + text="uavGuy"; + }; + }; + }; + class Item18 + { + side="WEST"; + class Vehicles + { + items=2; + class Item0 + { + position[]={1722.298,5.5,5733.4629}; + azimut=4.41886; + special="FLY"; + id=39; + side="WEST"; + vehicle="B_Soldier_F"; + player="PLAYER COMMANDER"; + leader=1; + skill=0.60000002; + text="R1"; + description="sp tester"; + }; + class Item1 + { + position[]={1722.7957,5.5,5732.481}; + azimut=4.41886; + special="FLY"; + id=40; + side="WEST"; + vehicle="B_Soldier_F"; + player="PLAY CDG"; + skill=0.60000002; + text="R2"; + description="sp tester2"; + }; + }; + }; + }; + class Vehicles + { + items=38; + class Item0 + { + position[]={1706.5913,5.5,5748.0903}; + azimut=-68.59301; + id=41; + side="EMPTY"; + vehicle="B_MRAP_01_F"; + leader=1; + skill=0.60000002; + text="car1"; + syncId=6; + synchronizations[]={2}; + }; + class Item1 + { + position[]={1707.5599,5.5,5753.0518}; + azimut=-65.45974; + id=42; + side="EMPTY"; + vehicle="B_MRAP_01_F"; + leader=1; + lock="LOCKED"; + skill=0.60000002; + text="car3"; + syncId=7; + synchronizations[]={3}; + }; + class Item2 + { + position[]={1708.7251,5.5,5757.8809}; + azimut=-65.45974; + id=43; + side="EMPTY"; + vehicle="C_Hatchback_01_F"; + leader=1; + lock="UNLOCKED"; + skill=0.60000002; + text="car4"; + }; + class Item3 + { + position[]={1704.4299,5.5,5742.8721}; + azimut=-68.59301; + id=44; + side="EMPTY"; + vehicle="C_Hatchback_01_F"; + leader=1; + lock="UNLOCKED"; + skill=0.60000002; + text="car0"; + init="this setVariable [""ACE_VehicleLock_lockSide"", east];"; + }; + class Item4 + { + position[]={1738.8502,5.5,5728.8525}; + azimut=101.05981; + id=45; + side="EMPTY"; + vehicle="B_static_AA_F"; + skill=0.60000002; + text="q1"; + }; + class Item5 + { + position[]={1738.4388,5.5,5726.1929}; + azimut=101.05981; + id=46; + side="EMPTY"; + vehicle="B_Mortar_01_F"; + skill=0.60000002; + text="q2"; + }; + class Item6 + { + position[]={1737.8582,5.5,5723.3979}; + azimut=101.05981; + id=47; + side="EMPTY"; + vehicle="B_HMG_01_high_F"; + skill=0.60000002; + text="q3"; + }; + class Item7 + { + position[]={1738.9786,5.5,5734.6968}; + azimut=104.535; + id=48; + side="EMPTY"; + vehicle="B_MBT_01_cannon_F"; + lock="UNLOCKED"; + skill=0.60000002; + }; + class Item8 + { + position[]={1734.713,5.5,5720.061}; + azimut=10.202663; + id=49; + side="EMPTY"; + vehicle="ACE_medicalSupplyCrate"; + leader=1; + skill=0.60000002; + }; + class Item9 + { + position[]={1737.2236,5.5,5719.5591}; + azimut=10.202663; + id=50; + side="EMPTY"; + vehicle="ACE_medicalSupplyCrate"; + leader=1; + skill=0.60000002; + }; + class Item10 + { + position[]={1733.2904,5.5,5717.6465}; + azimut=13.57355; + id=51; + side="EMPTY"; + vehicle="ACE_Box_Misc"; + leader=1; + skill=0.60000002; + }; + class Item11 + { + position[]={1736.1099,5.5,5717.1831}; + azimut=13.57355; + id=52; + side="EMPTY"; + vehicle="ACE_Box_Misc"; + leader=1; + skill=0.60000002; + }; + class Item12 + { + position[]={1732.4794,5.5,5715.4067}; + azimut=9.5156059; + id=53; + side="EMPTY"; + vehicle="Box_NATO_AmmoOrd_F"; + leader=1; + skill=0.60000002; + }; + class Item13 + { + position[]={1735.2601,5.5,5714.7891}; + azimut=9.5156059; + id=54; + side="EMPTY"; + vehicle="Box_NATO_AmmoOrd_F"; + leader=1; + skill=0.60000002; + }; + class Item14 + { + position[]={1743.4641,5.5,5753.5161}; + azimut=104.535; + id=55; + side="EMPTY"; + vehicle="B_MRAP_01_hmg_F"; + lock="UNLOCKED"; + skill=0.60000002; + }; + class Item15 + { + position[]={1741.916,5.5,5747.4302}; + azimut=104.535; + id=56; + side="EMPTY"; + vehicle="I_APC_tracked_03_cannon_F"; + lock="UNLOCKED"; + skill=0.60000002; + }; + class Item16 + { + position[]={1722.1113,5.5,5768.3818}; + azimut=193.13876; + id=57; + side="EMPTY"; + vehicle="B_Heli_Attack_01_F"; + skill=0.60000002; + }; + class Item17 + { + position[]={1733.6005,5.5,5765.2881}; + azimut=198.2417; + id=58; + side="EMPTY"; + vehicle="B_Heli_Light_01_armed_F"; + skill=0.60000002; + }; + class Item18 + { + position[]={1746.17,5.5,5764.1099}; + azimut=198.97742; + id=59; + side="EMPTY"; + vehicle="B_Heli_Transport_01_F"; + skill=0.60000002; + }; + class Item19 + { + position[]={1909.3875,10.094501,5668.21}; + azimut=4.41886; + id=60; + side="EMPTY"; + vehicle="O_MBT_02_cannon_F"; + skill=0.60000002; + }; + class Item20 + { + position[]={1724.0231,5.5,5722.8857}; + azimut=104.535; + id=61; + side="EMPTY"; + vehicle="Box_IND_Wps_F"; + skill=0.60000002; + }; + class Item21 + { + position[]={1724.6892,5.5,5724.7744}; + azimut=104.535; + id=62; + side="EMPTY"; + vehicle="Box_IND_Ammo_F"; + skill=0.60000002; + }; + class Item22 + { + position[]={1717.6512,5.5,5724.0181}; + azimut=104.535; + id=63; + side="EMPTY"; + vehicle="Box_IND_Wps_F"; + skill=0.60000002; + }; + class Item23 + { + position[]={1718.2023,5.5,5726.3066}; + azimut=104.535; + id=64; + side="EMPTY"; + vehicle="Box_IND_Ammo_F"; + skill=0.60000002; + }; + class Item24 + { + position[]={1733.6895,5.5,5706.4785}; + azimut=104.535; + id=65; + side="EMPTY"; + vehicle="Box_NATO_WpsLaunch_F"; + skill=0.60000002; + }; + class Item25 + { + position[]={1733.21,5.5,5704.1836}; + azimut=104.535; + id=66; + side="EMPTY"; + vehicle="Box_East_WpsLaunch_F"; + skill=0.60000002; + }; + class Item26 + { + position[]={1732.4906,5.5,5701.6831}; + azimut=104.535; + id=67; + side="EMPTY"; + vehicle="Box_IND_WpsLaunch_F"; + skill=0.60000002; + }; + class Item27 + { + position[]={1825.109,5.5,5676.3613}; + azimut=4.41886; + id=68; + side="EMPTY"; + vehicle="O_MBT_02_cannon_F"; + skill=0.60000002; + text="t1"; + }; + class Item28 + { + position[]={1894.5531,5.6621442,5745.1523}; + azimut=4.41886; + id=69; + side="EMPTY"; + vehicle="O_MBT_02_cannon_F"; + skill=0.60000002; + }; + class Item29 + { + position[]={1863.2545,5.5,5712.0615}; + azimut=4.41886; + id=70; + side="EMPTY"; + vehicle="O_MBT_02_cannon_F"; + skill=0.60000002; + }; + class Item30 + { + position[]={1740.923,5.5,5741.1685}; + azimut=104.535; + id=71; + side="EMPTY"; + vehicle="B_MBT_01_cannon_F"; + lock="UNLOCKED"; + skill=0.60000002; + }; + class Item31 + { + position[]={1721.363,5.5,5724.4956}; + azimut=104.535; + id=72; + side="EMPTY"; + vehicle="Box_NATO_Grenades_F"; + lock="UNLOCKED"; + skill=0.60000002; + }; + class Item32 + { + position[]={1722.3844,5.5,5727.0381}; + azimut=104.535; + id=73; + side="EMPTY"; + vehicle="Box_NATO_WpsSpecial_F"; + lock="UNLOCKED"; + skill=0.60000002; + }; + class Item33 + { + position[]={1644.8666,0,5751.0166}; + azimut=-19.956911; + id=74; + side="EMPTY"; + vehicle="B_Boat_Armed_01_minigun_F"; + skill=0.60000002; + }; + class Item34 + { + position[]={1639.6296,0,5741.1772}; + azimut=-19.956911; + id=75; + side="EMPTY"; + vehicle="B_Boat_Armed_01_minigun_F"; + skill=0.60000002; + }; + class Item35 + { + position[]={1636.3765,0,5727.1333}; + azimut=-19.9569; + id=76; + side="EMPTY"; + vehicle="C_Boat_Civil_01_F"; + skill=0.60000002; + }; + class Item36 + { + position[]={1652.0231,-0.71640843,5760.2349}; + azimut=-19.9569; + id=77; + side="EMPTY"; + vehicle="B_Boat_Transport_01_F"; + skill=0.60000002; + }; + class Item37 + { + position[]={1739.5898,5.5,5730.6455}; + azimut=101.06; + id=78; + side="EMPTY"; + vehicle="B_static_AT_F"; + skill=0.60000002; + text="q0"; + }; + }; +}; +class Intro +{ + addOns[]= + { + "a3_map_stratis" + }; + addOnsAuto[]= + { + "a3_map_stratis" + }; + randomSeed=13628778; + class Intel + { + timeOfChanges=1800.0002; + startWeather=0.30000001; + startWind=0.1; + startWaves=0.1; + forecastWeather=0.30000001; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + month=7; + day=6; + hour=12; + minute=0; + startFogDecay=0.013; + forecastFogDecay=0.013; + }; +}; +class OutroWin +{ + addOns[]= + { + "a3_map_stratis" + }; + addOnsAuto[]= + { + "a3_map_stratis" + }; + randomSeed=8997795; + class Intel + { + timeOfChanges=1800.0002; + startWeather=0.30000001; + startWind=0.1; + startWaves=0.1; + forecastWeather=0.30000001; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + month=7; + day=6; + hour=12; + minute=0; + startFogDecay=0.013; + forecastFogDecay=0.013; + }; +}; +class OutroLoose +{ + addOns[]= + { + "a3_map_stratis" + }; + addOnsAuto[]= + { + "a3_map_stratis" + }; + randomSeed=1617621; + class Intel + { + timeOfChanges=1800.0002; + startWeather=0.30000001; + startWind=0.1; + startWaves=0.1; + forecastWeather=0.30000001; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + month=7; + day=6; + hour=12; + minute=0; + startFogDecay=0.013; + forecastFogDecay=0.013; + }; +}; diff --git a/addons/testmissions/config.cpp b/addons/testmissions/config.cpp new file mode 100644 index 0000000000..3a73a661d5 --- /dev/null +++ b/addons/testmissions/config.cpp @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + VERSION_CONFIG; + }; +}; + +class CfgMissions { + class MPMissions { + class ACETestingMap1 { + briefingName = "ACE Testing Map 1"; + directory = QUOTE(PATHTO_R(MPMissions\ACETestingMap1.Stratis)); + }; + }; +}; diff --git a/addons/testmissions/script_component.hpp b/addons/testmissions/script_component.hpp new file mode 100644 index 0000000000..c6c629ff91 --- /dev/null +++ b/addons/testmissions/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT testmissions +#include "\z\ace\Addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_TESTMISSIONS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_TESTMISSIONS + #define DEBUG_SETTINGS DEBUG_ENABLED_TESTMISSIONS +#endif + +#include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/weaponselect/XEH_preInit.sqf b/addons/weaponselect/XEH_preInit.sqf index 0dfb72f353..790dfe7a99 100644 --- a/addons/weaponselect/XEH_preInit.sqf +++ b/addons/weaponselect/XEH_preInit.sqf @@ -8,8 +8,6 @@ PREP(findNextGrenadeMagazine); PREP(findNextGrenadeMuzzle); PREP(fireSmokeLauncher); PREP(getSelectedGrenade); -PREP(getWeaponModes); -PREP(getWeaponMuzzles); PREP(playChangeFiremodeSound); PREP(putWeaponAway); PREP(selectGrenadeAll); diff --git a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf index 236f934257..aea777d709 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf @@ -29,8 +29,8 @@ if (_weapon in (_unit getVariable [QEGVAR(safemode,safedWeapons), []])) exitWith private ["_muzzles", "_modes"]; -_muzzles = [_weapon] call FUNC(getWeaponMuzzles); -_modes = [_weapon] call FUNC(getWeaponModes); +_muzzles = [_weapon] call EFUNC(common,getWeaponMuzzles); +_modes = [_weapon] call EFUNC(common,getWeaponModes); private ["_index", "_muzzle", "_mode"]; diff --git a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf index 95e5a9a2aa..011108e448 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf @@ -19,7 +19,7 @@ _weapon = _this select 1; if (_weapon == "") exitWith {}; private "_muzzles"; -_muzzles = [_weapon] call FUNC(getWeaponMuzzles); +_muzzles = [_weapon] call EFUNC(common,getWeaponMuzzles); if (currentWeapon _unit != _weapon) exitWith { if (count _muzzles > 1) then { diff --git a/addons/winddeflection/CfgVehicles.hpp b/addons/winddeflection/CfgVehicles.hpp index f6e7b38b4f..2371c4b135 100644 --- a/addons/winddeflection/CfgVehicles.hpp +++ b/addons/winddeflection/CfgVehicles.hpp @@ -4,7 +4,7 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; displayName = "Wind Deflection"; - function = FUNC(enableModule); + function = FUNC(initalizeModule); scope = 2; isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa));