mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #1307 from jokoho48/master
Cut Parachute/Reserve parachute
This commit is contained in:
commit
9d7374c893
@ -8,3 +8,10 @@ class Extended_PostInit_EventHandlers {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
class Extended_Respawn_EventHandlers {
|
||||
class CAManBase {
|
||||
class ADDON {
|
||||
respawn = QUOTE(call COMPILE_FILE(XEH_respawn));
|
||||
};
|
||||
};
|
||||
};
|
@ -12,9 +12,35 @@ class CfgVehicles {
|
||||
backpack = "ACE_NonSteerableParachute";
|
||||
count = 4;
|
||||
};
|
||||
class _xx_ACE_ReserveParachute {
|
||||
backpack = "ACE_ReserveParachute";
|
||||
count = 4;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Man;
|
||||
class CAManBase: Man {
|
||||
class ACE_SelfActions {
|
||||
class ACE_CutParachute {
|
||||
displayName = CSTRING("CutParachute");
|
||||
exceptions[] = {"isNotInside"};
|
||||
condition = QUOTE([_player] call FUNC(checkCutParachute));
|
||||
statement = QUOTE([_player] call FUNC(cutParachute));
|
||||
showDisabled = 0;
|
||||
priority = 2.9;
|
||||
icon = QUOTE(PATHTOF(UI\cut_ca.paa));
|
||||
hotkey = "C"; // Did this realy Work?
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Helicopter;
|
||||
class ParachuteBase: Helicopter {
|
||||
ace_hasReserveParachute = 1;
|
||||
ace_reserveParachute = "ACE_ReserveParachute";
|
||||
};
|
||||
|
||||
class B_Parachute;
|
||||
class ACE_NonSteerableParachute: B_Parachute {
|
||||
author = ECSTRING(common,ACETeam);
|
||||
@ -28,6 +54,16 @@ class CfgVehicles {
|
||||
mass = 100;
|
||||
};
|
||||
|
||||
class ACE_ReserveParachute: ACE_NonSteerableParachute {
|
||||
author = ECSTRING(common,ACETeam);
|
||||
displayName = CSTRING(ReserveParachute);
|
||||
scope = 2;
|
||||
mass = 70;
|
||||
ParachuteClass = "NonSteerable_Parachute_F";
|
||||
ace_reserveParachute = "";
|
||||
ace_hasReserveParachute = 0;
|
||||
};
|
||||
|
||||
class B_Soldier_05_f; class B_Pilot_F: B_Soldier_05_f {backpack = "ACE_NonSteerableParachute";};
|
||||
class I_Soldier_04_F; class I_pilot_F: I_Soldier_04_F {backpack = "ACE_NonSteerableParachute";};
|
||||
class O_helipilot_F; class O_Pilot_F: O_helipilot_F {backpack = "ACE_NonSteerableParachute";};
|
||||
|
BIN
addons/parachute/UI/cut_ca.paa
Normal file
BIN
addons/parachute/UI/cut_ca.paa
Normal file
Binary file not shown.
@ -23,7 +23,7 @@ if (!hasInterface) exitWith {};
|
||||
if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false};
|
||||
if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then {
|
||||
[ace_player] call FUNC(showAltimeter);
|
||||
[ACE_player] call FUNC(showAltimeter);
|
||||
} else {
|
||||
call FUNC(hideAltimeter);
|
||||
};
|
||||
@ -42,3 +42,5 @@ GVAR(PFH) = false;
|
||||
|
||||
// don't show speed and height when in expert mode
|
||||
["infoDisplayChanged", {_this call FUNC(handleInfoDisplayChanged)}] call EFUNC(common,addEventHandler);
|
||||
//[ACE_Player,([ACE_player] call EFUNC(common,getAllGear))] call FUNC(storeParachute);
|
||||
["playerInventoryChanged", FUNC(storeParachute) ] call EFUNC(common,addEventHandler);
|
||||
|
@ -22,5 +22,7 @@ PREP(handleInfoDisplayChanged);
|
||||
PREP(hideAltimeter);
|
||||
PREP(onEachFrame);
|
||||
PREP(showAltimeter);
|
||||
|
||||
PREP(cutParachute);
|
||||
PREP(checkCutParachute);
|
||||
PREP(storeParachute);
|
||||
ADDON = true;
|
||||
|
17
addons/parachute/XEH_respawn.sqf
Normal file
17
addons/parachute/XEH_respawn.sqf
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Author: joko // Jonas
|
||||
* Reset the parachute system.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
ACE_player setVariable [QGVAR(chuteIsCut), false];
|
19
addons/parachute/functions/fnc_checkCutParachute.sqf
Normal file
19
addons/parachute/functions/fnc_checkCutParachute.sqf
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Author: joko // Jonas
|
||||
* Reset the parachute system.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Object
|
||||
*
|
||||
* Return Value:
|
||||
* Boolean
|
||||
*
|
||||
* Example:
|
||||
* [player] call FUNC(checkCutParachute);
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private["_unit"];
|
||||
_unit = _this select 0;
|
||||
(vehicle _unit isKindOf 'ParachuteBase' && !(_unit getvariable [QGVAR(chuteIsCut),false]) && (_unit getvariable [QGVAR(hasReserve),false]))
|
22
addons/parachute/functions/fnc_cutParachute.sqf
Normal file
22
addons/parachute/functions/fnc_cutParachute.sqf
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Author: joko // Jonas
|
||||
* Cut Parachute and delete Old
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Object
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [player] call FUNC(cutParachute);
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private["_unit","_vehicle"];
|
||||
_unit = _this select 0;
|
||||
_vehicle = vehicle _unit;
|
||||
_unit action ["GetOut", _vehicle];
|
||||
deleteVehicle _vehicle;
|
||||
_unit setVariable [QGVAR(chuteIsCut), true];
|
@ -14,10 +14,11 @@
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_unit"];
|
||||
private["_unit"];
|
||||
_unit = _this select 0;
|
||||
GVAR(PFH) = false;
|
||||
[_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call EFUNC(common,doAnimation);
|
||||
_unit setVariable [QGVAR(chuteIsCut), false];
|
||||
[{
|
||||
if (ACE_time >= ((_this select 0) select 0) + 1) then {
|
||||
((_this select 0) select 1) playActionNow "Crouch";
|
||||
|
30
addons/parachute/functions/fnc_storeParachute.sqf
Normal file
30
addons/parachute/functions/fnc_storeParachute.sqf
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Author: joko // Jonas
|
||||
* Add the Reserve Parachute to Units or Save Backpack if is a Parachute in Unit
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* 0: Unit
|
||||
* 1: getAllGear-Array
|
||||
*
|
||||
* Example:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_unit","_backpack"];
|
||||
_unit = _this select 0;
|
||||
_backpack = (_this select 1) select 6 ;
|
||||
if ((vehicle _unit) isKindOf "ParachuteBase" && backpack _unit == "" && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getvariable [QGVAR(hasReserve),false])) then {
|
||||
_unit addBackpack (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]);
|
||||
} else {
|
||||
if ([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) then {
|
||||
_unit setVariable[QGVAR(backpackClass),getText(configFile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute")];
|
||||
};
|
||||
if (!(_unit getVariable [QGVAR(chuteIsCut),false]) && !(animationState _unit == 'para_pilot')) then {
|
||||
_unit setVariable [QGVAR(hasReserve),[false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))];
|
||||
};
|
||||
};
|
@ -49,5 +49,13 @@
|
||||
<Italian>Paracadute non manovrabile</Italian>
|
||||
<Portuguese>Para-querdas não controlável</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Parachute_CutParachute">
|
||||
<English>Cut Parachute</English>
|
||||
<German>Fallschirm abschneiden</German>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Parachute_ReserveParachute">
|
||||
<English>Reserve Parachute</English>
|
||||
<German>Reserve Fallschirm</German>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
@ -73,7 +73,7 @@ PREP(onTapShoulder);
|
||||
<td>"playerInventoryChanged"</td>
|
||||
<td>Inventory changed</td>
|
||||
<td>common</td>
|
||||
<td>getAllGear-Array</td>
|
||||
<td>[_player, getAllGear-Array]</td>
|
||||
<td>local</td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user