-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from acemod/disarmingTest
Unit Disarming/DropGear Merge
- Loading branch information
Showing
24 changed files
with
968 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
z\ace\addons\disarming |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Extended_PreInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_preInit)); | ||
}; | ||
}; | ||
|
||
class Extended_PostInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_postInit)); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class CfgVehicles { | ||
class Man; | ||
class CAManBase: Man { | ||
class ACE_Actions { | ||
class ACE_MainActions { | ||
class ACE_DisarmInventory { | ||
displayName = "$STR_ACE_Disarming_OpenInventory"; | ||
distance = 3.5; | ||
condition = QUOTE([ARR_2(_player,_target)] call FUNC(canPlayerDisarmUnit)); | ||
statement = QUOTE([ARR_2(_player,_target)] call FUNC(openDisarmDialog)); | ||
icon = "\a3\Modules_F_Curator\Data\portraitRespawnInventory_ca.paa"; | ||
exceptions[] = {}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class CfgWeapons { | ||
class ACE_ItemCore; | ||
class InventoryItem_Base_F; | ||
|
||
class ACE_DebugPotato: ACE_ItemCore { | ||
displayName = "ACE Potato (debug)"; | ||
descriptionShort = "Glorious Potato<br/>If you see this in game it means someone fucked up"; | ||
picture = QUOTE(PATHTOF(UI\potato_ca.paa)); | ||
scope = 1; | ||
class ItemInfo: InventoryItem_Base_F { | ||
mass = 1; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ace_disarming | ||
============ | ||
|
||
Adds ability to make units drop items/weapons/magazines. | ||
|
||
|
||
## Maintainers | ||
|
||
The people responsible for merging changes to this component or answering potential questions. | ||
|
||
- [PabstMirror](https://github.com/PabstMirror) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include "script_component.hpp" | ||
|
||
["DisarmDropItems", {_this call FUNC(eventTargetStart)}] call EFUNC(common,addEventHandler); | ||
["DisarmDebugCallback", {_this call FUNC(eventCallerFinish)}] call EFUNC(common,addEventHandler); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "script_component.hpp" | ||
|
||
ADDON = false; | ||
|
||
PREP(canBeDisarmed); | ||
PREP(canPlayerDisarmUnit); | ||
PREP(disarmDropItems); | ||
PREP(eventCallerFinish); | ||
PREP(eventTargetFinish); | ||
PREP(eventTargetStart); | ||
PREP(getAllGearContainer); | ||
PREP(getAllGearUnit); | ||
PREP(openDisarmDialog); | ||
PREP(showItemsInListbox); | ||
PREP(verifyMagazinesMoved); | ||
|
||
ADDON = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "script_component.hpp" | ||
|
||
class CfgPatches { | ||
class ADDON { | ||
units[] = {}; | ||
weapons[] = {"ACE_DebugPotato"}; | ||
requiredVersion = REQUIRED_VERSION; | ||
requiredAddons[] = {"ACE_Interaction"}; | ||
author[] = {"PabstMirror"}; | ||
authorUrl = "https://github.com/PabstMirror/"; | ||
VERSION_CONFIG; | ||
}; | ||
}; | ||
|
||
#include "CfgEventHandlers.hpp" | ||
#include "CfgVehicles.hpp" | ||
#include "CfgWeapons.hpp" | ||
|
||
#include "gui_disarm.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Author: PabstMirror | ||
* Checks the conditions for being able to disarm a unit | ||
* | ||
* Arguments: | ||
* 0: Target <OBJECT> | ||
* | ||
* Return Value: | ||
* Can Be Disarmed <BOOL> | ||
* | ||
* Example: | ||
* [cursorTarget] call ace_disarming_fnc_canBeDisarmed | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
PARAMS_1(_target); | ||
|
||
//Check animationState for putDown anim | ||
//This ensures the unit doesn't have to actualy do any animation to drop something | ||
//This should always be true for the 3 possible status effects that allow disarming | ||
_animationStateCfgMoves = getText (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState _target) >> "actions"); | ||
if (_animationStateCfgMoves == "") exitWith {false}; | ||
_putDownAnim = getText (configFile >> "CfgMovesBasic" >> "Actions" >> _animationStateCfgMoves >> "PutDown"); | ||
if (_putDownAnim != "") exitWith {false}; | ||
|
||
|
||
(alive _target) && | ||
{(abs (speed _target)) < 1} && | ||
{(vehicle _target) == _target} && | ||
{(_target getVariable ["ACE_isUnconscious", false]) || | ||
{_target getVariable [QEGVAR(captives,isHandcuffed), false]} || | ||
{_target getVariable [QEGVAR(captives,isSurrendering), false]}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Author: PabstMirror | ||
* Checks the conditions for being able to disarm a unit | ||
* | ||
* Arguments: | ||
* 0: Player <OBJECT> | ||
* 1: Target <OBJECT> | ||
* | ||
* Return Value: | ||
* Can Be Disarm Target <BOOL> | ||
* | ||
* Example: | ||
* [player, cursorTarget] call ace_disarming_fnc_canPlayerDisarmUnit | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
PARAMS_2(_player,_target); | ||
|
||
([_target] call FUNC(canBeDisarmed)) && | ||
{([_player, _target, []] call EFUNC(common,canInteractWith))} |
Oops, something went wrong.