Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions addons/artillery/CfgUI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ class GVAR(ArtilleryDisplay) {
text = "Slow Barrage with Walk";
value = ARTILLERY_MISSIONTYPE_SLOW_WITH_WALK;
};
class lazyZeroQuick {
text = "Slow Adjust (90 Second Warning)";
value = ARTILLERY_MISSIONTYPE_QUICK_LAZY;
};
class slowBarrageQuickWalk {
text = "Slow Barrage (90 Second Warning)";
value = ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY;
};
};
};
class RscText_roundType: RscText_gunCount {
Expand Down
56 changes: 54 additions & 2 deletions addons/artillery/cup/CfgAmmo.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,58 @@
#define SET_SOUND_FLY(pitch,volume) soundFly[] = {"CUP\Weapons\CUP_Weapons_Ammunition\data\sound\shorter.wss",volume,pitch,1000}
#define PITCH_155MM 0.4
#define VOLUME_155MM 3.5
#define PITCH_122MM 1
#define VOLUME_122MM 3
#define PITCH_120MM 1.05
#define VOLUME_120MM 2.5
#define PITCH_105MM 1.5
#define VOLUME_105MM 2.25
#define PITCH_8XMM 2
#define VOLUME_8XMM 2
#define PITCH_110MM_ROCKET 0.5
#define VOLUME_110MM_ROCKET 0.5

#define CREATE_AMMOS_PITCH(parent,grandparent,pitch,volume) class parent: grandparent { SET_SOUND_FLY(pitch,volume); };\
class GVARMAIN(DOUBLES(parent,noFrag)): parent {\
ACEGVAR(frag,skip) = 1;\
};\
class GVARMAIN(DOUBLES(parent,noSplash)): GVARMAIN(DOUBLES(parent,noFrag)) {\
indirectHit = 0;\
indirectHitRange = 0;\
hit = 8;\
}

class CfgAmmo {
CREATE_AMMOS(CUP_Sh_105_HE);
CREATE_AMMOS(CUP_Sh_122_HE);
CREATE_AMMOS(CUP_R_MLRS_HE);
CREATE_AMMOS_SUBMUNTION(CUP_R_GRAD_HE,potato_R_GRAD_HE_fly);

//// Audio effects
// Vanilla
class SubmunitionBase;
class Sh_82mm_AMOS_guided: SubmunitionBase { SET_SOUND_FLY(PITCH_8XMM,VOLUME_8XMM); };
class Sh_155mm_AMOS_guided: Sh_82mm_AMOS_guided { SET_SOUND_FLY(PITCH_155MM,VOLUME_155MM); };
class Sh_82mm_AMOS_LG: Sh_82mm_AMOS_guided {};
class Sh_155mm_AMOS_LG: Sh_82mm_AMOS_LG { SET_SOUND_FLY(PITCH_155MM,VOLUME_155MM); };
class ShellBase;
class Sh_155mm_AMOS: ShellBase { SET_SOUND_FLY(PITCH_155MM,VOLUME_155MM); };
class Sh_82mm_AMOS: Sh_155mm_AMOS { SET_SOUND_FLY(PITCH_8XMM,VOLUME_8XMM); };
class MissileBase;
class M_Mo_82mm_AT: MissileBase { SET_SOUND_FLY(PITCH_8XMM,VOLUME_8XMM); };
class M_Mo_120mm_AT: M_Mo_82mm_AT { SET_SOUND_FLY(PITCH_120MM,VOLUME_120MM); };
class M_Mo_155mm_AT: M_Mo_120mm_AT { SET_SOUND_FLY(PITCH_155MM,VOLUME_155MM); };

// GM
//class gm_Submunition_base;
//class gm_rocket_mlrs_110mm_base: gm_Submunition_base { SET_SOUND_FLY(PITCH_110MM_ROCKET); };
class gm_shell_artillery_HE_Base;
class gm_shell_120mm_he_dm51: gm_shell_artillery_HE_Base { SET_SOUND_FLY(PITCH_120MM,VOLUME_120MM); };
class gm_shell_120mm_he_of843: gm_shell_artillery_HE_Base { SET_SOUND_FLY(PITCH_120MM,VOLUME_120MM); };
class gm_shell_155mm_he_m107: gm_shell_artillery_HE_Base { SET_SOUND_FLY(PITCH_155MM,VOLUME_155MM); };
class gm_shell_155mm_he_m795: gm_shell_artillery_HE_Base { SET_SOUND_FLY(PITCH_155MM,VOLUME_155MM); };
class gm_shell_122x447mm_he_of462: gm_shell_artillery_HE_Base { SET_SOUND_FLY(PITCH_122MM,VOLUME_122MM); };
class gm_shell_122x447mm_he_3of56: gm_shell_artillery_HE_Base { SET_SOUND_FLY(PITCH_122MM,VOLUME_122MM); };

// CUP Audio and config
CREATE_AMMOS_PITCH(CUP_Sh_105_HE,Sh_155mm_AMOS,PITCH_105MM,VOLUME_105MM);
CREATE_AMMOS_PITCH(CUP_Sh_122_HE,Sh_155mm_AMOS,PITCH_122MM,VOLUME_122MM);
};
14 changes: 13 additions & 1 deletion addons/artillery/cup/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"potato_miscFixes_patchCUP"};
requiredAddons[] = {
"potato_artillery",
"potato_miscFixes_patchCUP",
"CUP_Weapons_VehicleWeapons",
"A3_Weapons_F",
"gm_weapons_cannons_122mm_2a18",
"gm_weapons_mortars_m120",
"gm_weapons_mortars_2s12",
"gm_weapons_cannons_155mm_m126",
"gm_weapons_launchers_mlrs_110mm",
"gm_weapons_launchers_luna",
"gm_weapons_launchers_mlrs_122mm"
};
skipWhenMissingDependencies = 1;
author = "Potato";
authors[] = {"Lambda.Tiger"};
Expand Down
30 changes: 28 additions & 2 deletions addons/artillery/functions/fnc_addMission.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,30 @@ switch (_missionType) do {
];
GVAR(artilleryMissionCache) set [_missionID, _missionInfo];
};
case ARTILLERY_MISSIONTYPE_QUICK_LAZY: {
private _parentMission = _missionID;
_missionID = _missionID + "_lazy";
_missionType = ARTILLERY_MISSIONTYPE_QUICK_LAZY_WALK;
_missionInfo set [5, ARTILLERY_MISSIONTYPE_QUICK_LAZY_BARRAGE];
_missionInfo = [
_clientID, _missionInfo#1, _magazine, _positionATL,
_missionInfo#4, _missionType, _missionInfo#6, _missionInfo#7,
true, 1, _missionInfo#10, _parentMission
];
GVAR(artilleryMissionCache) set [_missionID, _missionInfo];
};
case ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY: {
private _parentMission = _missionID;
_missionID = _missionID + "_lazy";
_missionType = ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY_WALK;
_missionInfo set [5, ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY_BARRAGE];
_missionInfo = [
_clientID, _missionInfo#1, _magazine, _positionATL,
_missionInfo#4, _missionType, _missionInfo#6, _missionInfo#7,
true, 1, _missionInfo#10, _parentMission
];
GVAR(artilleryMissionCache) set [_missionID, _missionInfo];
};
case ARTILLERY_MISSIONTYPE_LAZY: {
private _parentMission = _missionID;
_missionID = _missionID + "_lazy";
Expand Down Expand Up @@ -157,15 +181,17 @@ switch (_missionType) do {
// calculate target zone bounds []
private _targetBounds = [_positionATL];
switch (_missionType) do { // Add extra points
case ARTILLERY_MISSIONTYPE_LAZY: {
case ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY_WALK;
case ARTILLERY_MISSIONTYPE_QUICK_LAZY_WALK;
case ARTILLERY_MISSIONTYPE_LAZY_WALK: {
private _dir = 180 + _missionInfo#7;
{
private _targetPos = (_positionATL getPos [_x, _dir]);
_targetPos = [_targetPos, 100, _dir, call CBA_fnc_players] call FUNC(findSafeMortarPos);
_targetBounds pushBack _targetPos;
} forEach ARTILLERY_POSITIONS_LAZYADJUST;
};
case ARTILLERY_MISSIONTYPE_BRACKET: {
case ARTILLERY_MISSIONTYPE_BRACKET_SHOTS: {
private _dir = 180 + _missionInfo#7;
private _dispersion = _missionHashMap getOrDefault ["dispersion", 100];
{
Expand Down
58 changes: 57 additions & 1 deletion addons/artillery/functions/fnc_beginMission.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Public: No
*/
params [["_missionID", "", [""]]];

TRACE_1("beginning mission",_missionID);
if (_missionID == "" || !(_missionID in GVAR(artilleryMissionCache))) exitWith {};
(GVAR(artilleryMissionCache) getOrDefault [_missionID, []]) params [
["_clientID", 2],
Expand Down Expand Up @@ -174,6 +174,58 @@ switch (_missionType) do {
]
], _gunsToUse apply {_x#0}] call CBA_fnc_targetEvent;
};
case ARTILLERY_MISSIONTYPE_QUICK_LAZY_WALK: {
private _holdGuns = (_gunsToUse select [1]) apply {_x#1}; // selects all but first element
private _bracketGun = _gunsToUse#0#1;
[QGVAR(issueArty), [
_missionID,
[[_bracketGun, 30]],
ARTILLERY_MISSION_STATUS_FIRING, [
ARTILLERY_MISSIONTYPE_QUICK_LAZY_WALK,
_magazine,
_centerPosATL,
_roundCount,
_avoidPlayers,
_dispersion,
_rotation
]
], _bracketGun] call CBA_fnc_targetEvent;

[QGVAR(issueArty), [
_missionID,
_holdGuns,
ARTILLERY_MISSION_STATUS_ASSIGN, [
ARTILLERY_MISSIONTYPE_QUICK_LAZY_BARRAGE,
200 // we force the mission to take 30-45 secs per round
]
], _holdGuns] call CBA_fnc_targetEvent;
};
case ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY_WALK: {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref BrettMayson/HEMTT#1322

help[L-S52]: Duplicate case `11` in switch statement
    ┌─ addons/artillery/functions/fnc_beginMission.sqf:203:10
    │
177 │     case ARTILLERY_MISSIONTYPE_QUICK_LAZY_WALK: {
    │          -------------------------------------- first case here
    ·
203 │     case ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY_WALK: {
    │          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate case

so I think this should be ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY_BARRAGE?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not the barrage there, I think the two cases can be collapsed into each other, but I'll look.

private _holdGuns = (_gunsToUse select [1]) apply {_x#1}; // selects all but first element
private _bracketGun = _gunsToUse#0#1;
[QGVAR(issueArty), [
_missionID,
[[_bracketGun, 30]],
ARTILLERY_MISSION_STATUS_FIRING, [
ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY_WALK,
_magazine,
_centerPosATL,
_roundCount,
_avoidPlayers,
_dispersion,
_rotation
]
], _bracketGun] call CBA_fnc_targetEvent;

[QGVAR(issueArty), [
_missionID,
_holdGuns,
ARTILLERY_MISSION_STATUS_ASSIGN, [
ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY_BARRAGE,
200 // we force the mission to take 30-45 secs per round
]
], _holdGuns] call CBA_fnc_targetEvent;
};
case ARTILLERY_MISSIONTYPE_LAZY_WALK: {
private _holdGuns = (_gunsToUse select [1]) apply {_x#1}; // selects all but first element
private _bracketGun = _gunsToUse#0#1;
Expand Down Expand Up @@ -208,13 +260,17 @@ if (_clientID > 2 || is3DENPreview) then {
private _missionTypeStr = switch (_missionType) do {
case ARTILLERY_MISSIONTYPE_LAZY_BARRAGE;
case ARTILLERY_MISSIONTYPE_BRACKET_BARRAGE;
case ARTILLERY_MISSIONTYPE_QUICK_LAZY_BARRAGE;
case ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY_BARRAGE;
case ARTILLERY_MISSIONTYPE_POINT: {"Area Barrage"};
case ARTILLERY_MISSIONTYPE_LAZY_WALK: {"Lazy Walk onto target"};
case ARTILLERY_MISSIONTYPE_LINEAR_WALK;
case ARTILLERY_MISSIONTYPE_BRACKET_SHOTS: {"Bracketing Rounds"};
case ARTILLERY_MISSIONTYPE_LINEAR: {"Linear Barrage"};
case ARTILLERY_MISSIONTYPE_CREEPING: {"Creeping Barrage"};
case ARTILLERY_MISSIONTYPE_SLOW: {"Slow Barrage"};
case ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY_WALK;
case ARTILLERY_MISSIONTYPE_QUICK_LAZY_WALK: {"Lazy Walk (Quick) onto target"};
default {"Err"};
};
[QGVAR(artyNotif), [format ["Beginning %1 using %2 rounds [%3x %4mm]",
Expand Down
12 changes: 12 additions & 0 deletions addons/artillery/functions/fnc_localMissionInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*
* Public: No
*/
TRACE_1("localMissionInit",_this);
params [
["_gun", objNull, [objNull]],
["_offset", [0, 0, 0], [[]]],
Expand Down Expand Up @@ -75,6 +76,17 @@ switch (_missionType) do {
} forEach ARTILLERY_POSITIONS_LAZYADJUST;
[_gun, _targetArray, _magazine, _tof + 20 + random 15] call FUNC(fireOnArray);
};
case ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY_WALK;
case ARTILLERY_MISSIONTYPE_QUICK_LAZY_WALK: {
private _targetArray = [];
_rotation = 180 + _rotation;
{
_targetArray pushBack (_posATL getPos [_x, _rotation - 5 + random 10]);
} forEach ARTILLERY_POSITIONS_QUICKLAZYADJUST;
[_gun, _targetArray, _magazine, 25 + random 20] call FUNC(fireOnArray);
};
case ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY_BARRAGE;
case ARTILLERY_MISSIONTYPE_QUICK_LAZY_BARRAGE;
case ARTILLERY_MISSIONTYPE_BRACKET_BARRAGE;
case ARTILLERY_MISSIONTYPE_LAZY_BARRAGE;
case ARTILLERY_MISSIONTYPE_POINT: {
Expand Down
1 change: 0 additions & 1 deletion addons/artillery/functions/fnc_ui_artilleryHandle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ if (_isClosing) then {
(_display displayCtrl IDC_ARTILLERY_ROUNDTYPE) lbSetCurSel ((GVAR(artilleryAmmoTypes) find ((GVAR(artilleryParams) getOrDefault ["roundType", [0,0]])#1)) - 1);
(_display displayCtrl IDC_ARTILLERY_DISPERSION) sliderSetPosition (2 * (_dims#1));
(_display displayCtrl IDC_ARTILLERY_ROTATION) sliderSetPosition (_dims#2);
(_display displayCtrl IDC_ARTILLERY_AVOIDPLAYERS) cbSetChecked (GVAR(artilleryParams) getOrDefault ["avoidPlayers", true]);
// update initial values
private _textCtrl = _display displayCtrl IDC_ARTILLERY_DISPERSIONTXT;
_textCtrl ctrlSetText format ["Round Dispersion: %1m", round (_dims#1)];
Expand Down
2 changes: 1 addition & 1 deletion addons/artillery/functions/fnc_ui_updateArtillleryMenu.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ switch (_sliderUpdate) do {
_newValue = _newValue * 2;
_baseText = "Rounds per gun (2-32): ";
};
if (_missionTypeIdx in [ARTILLERY_MISSIONTYPE_SLOW, ARTILLERY_MISSIONTYPE_SLOW_WITH_WALK]) then {
if (_missionTypeIdx in ARTILLERY_SLOWBARRAGE_TIMER) then {
(_display displayCtrl IDC_ARTILLERY_MISSIONGLENGTHTIME) ctrlEnable true;
} else {
(_display displayCtrl IDC_ARTILLERY_MISSIONGLENGTHTIME) ctrlEnable false;
Expand Down
10 changes: 9 additions & 1 deletion addons/artillery/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,21 @@ class GVARMAIN(DOUBLES(baseMagazine,noSplash)): baseMagazine {\
#define ARTILLERY_MISSIONTYPE_SLOW_WITH_WALK 7
#define ARTILLERY_MISSIONTYPE_SLOW_WALK 11
#define ARTILLERY_MISSIONTYPE_SLOW_BARRAGE 6
#define ARTILLERY_REPORT_ON_COMPLETION [ARTILLERY_MISSIONTYPE_LAZY_WALK,ARTILLERY_MISSIONTYPE_BRACKET_SHOTS]
#define ARTILLERY_MISSIONTYPE_QUICK_LAZY 8
#define ARTILLERY_MISSIONTYPE_QUICK_LAZY_WALK 18
#define ARTILLERY_MISSIONTYPE_QUICK_LAZY_BARRAGE 2
#define ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY 9
#define ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY_WALK 18
#define ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY_BARRAGE 2
#define ARTILLERY_SLOWBARRAGE_TIMER [ARTILLERY_MISSIONTYPE_SLOW,ARTILLERY_MISSIONTYPE_SLOW_WITH_WALK,ARTILLERY_MISSIONTYPE_SLOW_QUICK_LAZY]
#define ARTILLERY_REPORT_ON_COMPLETION [ARTILLERY_MISSIONTYPE_LAZY_WALK,ARTILLERY_MISSIONTYPE_BRACKET_SHOTS,ARTILLERY_MISSIONTYPE_QUICK_LAZY_WALK]

#define ARTILLERY_MISSION_STATUS_FREE -1
#define ARTILLERY_MISSION_STATUS_WAIT 0
#define ARTILLERY_MISSION_STATUS_ASSIGN 1
#define ARTILLERY_MISSION_STATUS_FIRING 2

#define ARTILLERY_POSITIONS_QUICKLAZYADJUST [150, 350]
#define ARTILLERY_POSITIONS_LAZYADJUST [150, 300, 500]
#define ARTILLERY_POSITIONS_BRACKET(dispersion) [200 max dispersion, 300 max dispersion, -500]

Expand Down
Loading