-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
215 additions
and
41 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
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
PREP(addBushCutter); | ||
PREP(addChatCommands); | ||
PREP(addGrassCutter); | ||
PREP(areModsLoaded); | ||
PREP(arsenalPBWFix); | ||
PREP(parseNameToPlayer) | ||
PREP(parseNameToPlayer); | ||
PREP(seesBush); |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#include "script_component.hpp" | ||
|
||
call FUNC(addBushCutter); | ||
call FUNC(addGrassCutter); | ||
call FUNC(arsenalPBWFix); | ||
call FUNC(addChatCommands); |
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
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,52 @@ | ||
#include "script_component.hpp" | ||
/** | ||
* Author: Timi007 | ||
* | ||
* Description: | ||
* Adds ability to destroy the bush infront of the player. | ||
* | ||
* Parameter(s): | ||
* None | ||
* | ||
* Returns: | ||
* Nothing | ||
* | ||
* Example: | ||
* call mts_common_fnc_addBushCutter | ||
* | ||
*/ | ||
|
||
CHECK(!GVAR(bushcutter_enabled) || !hasinterface); | ||
|
||
private _action = [ | ||
QGVAR(bushcutter), | ||
LLSTRING(bushcutter_removeBush), | ||
QPATHTOF(ui\mts_bushcutter.paa), | ||
{ | ||
params ["", "_player"]; | ||
|
||
private _bush = [_player, BUSH_CUTTING_DISTANCE] call FUNC(seesBush); | ||
|
||
if (isNull _bush) exitWith {WARNING("No bush found. Cannot remove bush.")}; | ||
|
||
if ((stance _player) isEqualTo "PRONE") then { | ||
_player playMove "AinvPpneMstpSnonWnonDnon_Putdown_AmovPpneMstpSnonWnonDnon"; | ||
} else { | ||
_player playMove "AinvPknlMstpSnonWnonDnon_medic0"; | ||
}; | ||
|
||
[GVAR(bushcutter_duration), [_bush], { | ||
(_this select 0) params ["_bush"]; | ||
|
||
// TODO: When Arma v2.12 releases, change to _bush setDamage [1, true, _player, _player]; (server execution) | ||
_bush setDamage 1; | ||
}, {}, LLSTRING(bushcutter_removeBush) | ||
] call ace_common_fnc_progressBar; | ||
}, | ||
{ | ||
params ["", "_player"]; | ||
[_player, objNull] call ace_common_fnc_canInteractWith && | ||
{!isNull ([_player, BUSH_CUTTING_DISTANCE] call FUNC(seesBush))} | ||
} | ||
] call ace_interact_menu_fnc_createAction; | ||
[(typeOf ACE_player), 1, ["ACE_SelfActions", "ACE_Equipment"], _action] call ace_interact_menu_fnc_addActionToClass; |
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
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,37 @@ | ||
#include "script_component.hpp" | ||
/** | ||
* Author: Timi007 | ||
* | ||
* Description: | ||
* Checks if the given unit sees a bush in front of him. Returns the bush if available. | ||
* | ||
* Parameter(s): | ||
* 0: OBJECT - Unit. | ||
* 1: NUMBER - Max distance to search for bushes. | ||
* | ||
* Returns: | ||
* OBJECT - Bush that the given unit sees or objNull if there is no bush. | ||
* | ||
* Example: | ||
* [player] call mts_common_fnc_seesBush; | ||
* | ||
*/ | ||
|
||
params ["_player", ["_maxDistance", 5, [0]]]; | ||
|
||
private _startPosASL = eyePos _player; | ||
private _endPosASL = _startPosASL vectoradd (getCameraViewDirection _player vectorMultiply _maxDistance); | ||
|
||
private _intersections = lineIntersectsSurfaces [_startPosASL, _endPosASL, _player, objNull, true, 1, "VIEW"]; | ||
|
||
if (_intersections isEqualTo []) exitWith {objNull}; | ||
|
||
(_intersections select 0) params ["_bushPosASL", "", "_bush", "_parentObject"]; | ||
|
||
// Not a bush but maybe ground | ||
if (isNull _bush && isNull _parentObject) exitWith {objNull}; | ||
|
||
// If is not a bush, exit | ||
if (nearestTerrainObjects [_bush, ["Bush"], 0] isEqualTo []) exitWith {objNull}; | ||
|
||
_bush |
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,61 @@ | ||
#define MIN_DURATION 1 | ||
#define MAX_DURATION 60 | ||
#define TRAILING_DECIMALS 0 | ||
|
||
#define DEFAULT_GRASSCUTTER_DURATION 5 | ||
#define DEFAULT_BUSHCUTTER_DURATION 10 | ||
|
||
// Grasscutter: On/off | ||
[ | ||
QGVAR(grasscutter_enabled), | ||
"CHECKBOX", | ||
[LLSTRING(grasscutter), LLSTRING(grasscutter_tooltip)], | ||
[LELSTRING(main,category), LLSTRING(grasscutter_subCategory)], | ||
true, | ||
0 | ||
] call CBA_fnc_addSetting; | ||
|
||
// Grasscutter: Size | ||
[ | ||
QGVAR(grasscutter_size), | ||
"LIST", | ||
[LLSTRING(grasscutter_size), LLSTRING(grasscutter_size_tooltip)], | ||
[LELSTRING(main,category), LLSTRING(grasscutter_subCategory)], | ||
[ | ||
[0, 1], | ||
[LLSTRING(grasscutter_size_large), LLSTRING(grasscutter_size_medium)], | ||
1 | ||
], | ||
0 | ||
] call CBA_fnc_addSetting; | ||
|
||
// Grasscutter: Time it takes to cut grass | ||
[ | ||
QGVAR(grasscutter_duration), | ||
"SLIDER", | ||
[LLSTRING(grasscutter_duration), LLSTRING(grasscutter_duration_tooltip)], | ||
[LELSTRING(main,category), LLSTRING(grasscutter_subCategory)], | ||
[MIN_DURATION, MAX_DURATION, DEFAULT_GRASSCUTTER_DURATION, TRAILING_DECIMALS], | ||
1 // Server setting | ||
] call CBA_fnc_addSetting; | ||
|
||
|
||
// Bushcutter: On/off | ||
[ | ||
QGVAR(bushcutter_enabled), | ||
"CHECKBOX", | ||
[LLSTRING(bushcutter), LLSTRING(bushcutter_tooltip)], | ||
[LELSTRING(main,category), LLSTRING(bushcutter_subCategory)], | ||
true, | ||
0 | ||
] call CBA_fnc_addSetting; | ||
|
||
// Bushcutter: Time it takes to cut down a bush | ||
[ | ||
QGVAR(bushcutter_duration), | ||
"SLIDER", | ||
[LLSTRING(bushcutter_duration), LLSTRING(bushcutter_duration_tooltip)], | ||
[LELSTRING(main,category), LLSTRING(bushcutter_subCategory)], | ||
[MIN_DURATION, MAX_DURATION, DEFAULT_BUSHCUTTER_DURATION, TRAILING_DECIMALS], | ||
1 // Server setting | ||
] call CBA_fnc_addSetting; |
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 |
---|---|---|
|
@@ -15,3 +15,5 @@ | |
#endif | ||
|
||
#include "\z\mts_enhanced\addons\main\script_macros.hpp" | ||
|
||
#define BUSH_CUTTING_DISTANCE 2 |
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#define MAJOR 1 | ||
#define MINOR 4 | ||
#define PATCHLVL 3 | ||
#define BUILD 220502 | ||
#define MINOR 5 | ||
#define PATCHLVL 0 | ||
#define BUILD 220822 |
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,2 @@ | ||
protocol = 1; | ||
publishedid = 2799167087; |