Skip to content

Commit eec8b73

Browse files
committed
Merge branch 'develop'
2 parents 018ef93 + c92479f commit eec8b73

13 files changed

+203
-103
lines changed

ManhuntFunctions.hpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,58 @@ class CfgFunctions
1212
class Intel
1313
{
1414
file = "manhunt_fnc";
15-
15+
1616
class getIntelCount { };
1717
class changeIntelCount { };
1818
class clearIntelCount { };
1919
class setIntelCount { };
2020
class giveIntelCount { };
2121
class getIntelCountInRadius { };
2222
};
23-
23+
2424
class Actions
2525
{
2626
file = "manhunt_fnc";
2727
class markGrid { };
2828
class repair { };
2929
class repairPart { };
3030
};
31-
32-
31+
32+
3333
class Units
3434
{
3535
file = "manhunt_fnc";
3636
class getSideUnits {};
3737
};
38-
38+
3939
class Map
4040
{
4141
file = "manhunt_fnc";
4242
class createMarker { };
4343
};
44-
44+
4545
class Tasks
4646
{
4747
file = "manhunt_fnc";
4848
class removeAllTasks { };
4949
};
50-
50+
5151
class Building
5252
{
5353
file = "manhunt_fnc";
5454
class findRandomBuildingPosition { };
5555
};
56-
56+
5757
class UI
5858
{
5959
file = "manhunt_fnc";
6060
class updateUI { };
6161
};
62+
63+
class Debug
64+
{
65+
file = "manhunt_fnc";
66+
class isDebug { };
67+
};
6268
};
6369
};

extraction.sqf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#define EXTRACTION_RESPAWN 45
33

44
if(isServer) then
5-
{
6-
[[[East, "HQ"], "Copy that, extraction on the way"], "sideChat", east] call Bis_fnc_mp;
5+
{
6+
[[[East, "HQ"], "Copy that, extraction on the way."], "sideChat", east] call Bis_fnc_mp;
77
[[[West, "HQ"], "Enemy extraction started!"], "sideChat", west] call Bis_fnc_mp;
88

99
sleep RESCUE_DELAY;

fatigueRelaxation.sqf

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
private ["_lastFatigue"];
2-
_lastFatigue = 0;
1+
private _lastFatigue = 0;
32
while{true} do
43
{
5-
private ["_multiplier"];
6-
_multiplier = 0.35;
4+
5+
private _multiplier = 0.35;
76
if(side player != west) then
87
{
98
_multiplier = 0.75;
109
};
11-
12-
private ["_diff", "_cur"];
13-
_cur = getFatigue player;
14-
_diff = _cur - _lastFatigue;
15-
10+
11+
private _cur = getFatigue player;
12+
private _diff = _cur - _lastFatigue;
13+
private _newFatigue = _lastFatigue + _diff * _multiplier;
14+
1615
if(_diff > 0) then
1716
{
18-
player setFatigue ( _lastFatigue + _diff * _multiplier );
17+
player setFatigue _newFatigue;
1918
};
20-
21-
_lastFatigue = _cur;
22-
sleep 1;
19+
20+
_lastFatigue = _newFatigue;
21+
sleep 0.5;
2322
};

init.sqf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,30 @@ call compile preProcessFileLineNumbers "initVariables.sqf";
22

33
enableSaving [ false, false ];
44

5+
if(call Mh_fnc_isDebug) then {
6+
systemChat "Debug mode is enabled";
7+
};
8+
59
if(isServer) then
610
{
711
// All assumptions here are that the game starting time is noon
812
timeSkip = random 24;
9-
13+
1014
// Eliminate dark night time (4-6 AM)
1115
if(timeSkip >= 16 && timeSkip <= 18) then
1216
{
1317
timeSkip = timeSkip + 2;
1418
};
15-
16-
switch (startingTime) do
19+
20+
switch (startingTime) do
1721
{
1822
// Skip to an hour between 7 AM and 6 PM
1923
case 1: { timeSkip = -5 + random 11; };
2024
// Skip to an hour between 8 PM and 6 AM
2125
case 2: { timeSkip = 8 + random 10; };
2226
};
2327
publicVariable "timeSkip";
24-
28+
2529
setTimeMultiplier acceleratedTime;
2630
};
2731

initBriefingChanges.sqf

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#define BLUFOR_DRONES "High altitude drone coverage will be made available shortly after the mission start. It will be able to provide roughly the location of any footsoldiers, and its accuracy will increase if they keep sticking around the same area. If OpFor uses vehicles the drones will not only more easily catch them, especially if they stick to roads, but it will have a chance of providing intel about any abandoned cars. There is no guarantee that every drone check will succeed in finding anything though, but it should provide enough clues to help you track down any hostiles."
99

10-
#define BLUFOR_BODIES "Once an OpFor is killed you can check their body for any information about the other operatives. Simply approach the body and use the ""Check body"" action, your map will be updated with the position of all other operatives in the moment of the killed one's death. Bodies might also be carrying intel that other operatives will want to collect, so it might be wise making sure you keep track of them."
10+
#define BLUFOR_BODIES "Once an OpFor is killed you can check their body for any information about the other operatives. Simply approach the body and use the ""Check body"" action, your map will be updated with the position of all other operatives' position at the time of their teammate's death. Bodies might also be carrying intel that other operatives will want to collect, so it might be wise making sure you keep track of them."
1111

1212
#define BLUFOR_ACTIONS "Your action menu contains three additional options: ""Earplugs in/out"" which might be useful when flying a helicopter.<br/>""Mark grid"", use it whenever you are pointing your crosshair at a target you want to report. A report will be made in chat and appropriate grid will be marked on the map.<br/>""Repair"", only available when next to a damaged vehicle. This will allow you to spend some time repairing it to full health."
1313

@@ -17,13 +17,13 @@
1717

1818
#define OPFOR_INTEL "Intel is what you came here for, you need the specified amount of it to be carried by players in the extraction helicopter to win. It does not matter who lives, only how much intel is carried off the island. You can share it with another player, if you are close enough, and take it from friendly bodies. Make sure one player does not hoard all of it, and remember you can accomplish more objectives than the minimum if you want to. Finally, BluFor can not take intel from your dead friendlies, however they can search the body to recover information about your position at the time of the teammate's death!"
1919

20-
#define OPFOR_DRONES "BluFor will eventually get high altitude drone coverage of the region. Periodically it will feed the enemy team info about your possible location. Your best chance of avoiding it is to limit the usage of vehicles and move quickly when on foot, do not stick around one area for too long. A single small UAV is also at NATO's disposal, however it does not have any thermal cameras on it."
20+
#define OPFOR_DRONES "BluFor will eventually get high altitude drone coverage of the region. Periodically it will feed the enemy team info about your approximate location. Your best chance of avoiding it is to limit the usage of vehicles and move quickly when on foot, do not stick around one area for too long or your location will get more and more accurate. If you do have to make use of a vehicle avoid staying close to roads, drones have harder time tracking you off road."
2121

22-
#define OPFOR_AMMOCACHES "There are three ammo caches for you to find: one in <marker name=""girna_cache"">Girna</marker>, the other one is deployed <marker name=""random_cache"">somewhere up north</marker>, and finally there's one in <marker name=""forest_cache"">the forest</marker>. They will contain ammo, weapons and various utilities for you. Those locations are random and BluFor is not aware of the exact location of those caches, only their general wherabouts."
22+
#define OPFOR_AMMOCACHES "There are four ammo caches for you to find: one in <marker name=""girna_cache"">Girna</marker>, the other one is deployed in a building <marker name=""random_cache"">somewhere up north</marker>, one more has been placed in north eastern <marker name=""forest_cache"">forests</marker> and one was parachuted in <marker name=""forest_cache"">central Stratis</marker>. They will contain ammo, weapons and various utilities for you. Those locations are random and BluFor is not aware of the exact location of those caches, only their general wherabouts."
2323

2424
#define OPFOR_EXTRACTION "Once enough intel to win is present in the wider circle of the <marker name=""extraction_zone"">this zone</marker>, and at least one person in the green zone, extraction will start. Hide until your rescue shows up, the Taru will bring armed friends. Board it as soon as possible - it doesn't matter who's in it at the end, as long as the sum of passengers' carried intel matches the mission requirement. The helicopter will not wait forever, however you are invulnerable while inside it and you can still provide covering fire!"
2525

26-
#define OPFOR_ENEMYASSETS "BluFor will track you down using following assets:<br/>- Striders and Hunters with thermal cameras, Hunter turrets cannot fire<br/>- Hunters with no turrets<br/>- Maximum of one UAV without any thermal capabilities<br/>- Hummingbirds<br/>- A Hellcat, the camera only has night vision mode available<br/>- Mortar tubes, however with no artillery computer<br/>- Speedboats, only the minigun is capable of engaging<br/>All BluFor vehicles act as respawn points if any BluFor players are within 20 meters of them"
26+
#define OPFOR_ENEMYASSETS "BluFor will track you down using following assets:<br/>- Striders and Hunters equipped with thermal cameras, but no functioning weapons<br/>- Maximum of one UAV without any thermal capabilities<br/>- Hummingbirds<br/>- A Hellcat, the camera only has night vision mode available<br/>- Mortar tubes, however with no artillery computer<br/>- Speedboats, only the minigun is capable of engaging<br/>All BluFor vehicles act as respawn points if any BluFor players are within 20 meters of them"
2727

2828
#define SETTINGS_STRING "Objectives needed for extraction: %1<br/>Amount of objectives available at start: %2<br/>Intel required to win: %3"
2929

@@ -47,13 +47,13 @@ if(side group player == west) then
4747
};
4848
_x setMarkerColorLocal "ColorWEST";
4949
} forEach _bluMarkers;
50-
50+
5151
{
5252
_x setMarkerColorLocal "ColorEAST";
5353
} forEach _opforMarkers;
54-
54+
5555
private ["_removeBlufor"];
56-
_removeBlufor = [ "random_cache", "forest_cache" ];
56+
_removeBlufor = [ "random_cache", "forest_cache", "valley_cache" ];
5757
{
5858
deleteMarkerLocal _x;
5959
} forEach _removeBlufor;
@@ -63,7 +63,8 @@ else
6363
"girna_cache" setMarkerPosLocal (getPos (missionNamespace getVariable ["cache1", objNull]));
6464
"random_cache" setMarkerPosLocal (getPos (missionNamespace getVariable ["cache2", objNull]));
6565
"forest_cache" setMarkerPosLocal (getPos (missionNamespace getVariable ["cache3", objNull]));
66-
66+
"valley_cache" setMarkerPosLocal (getPos (missionNamespace getVariable ["cache4", objNull]));
67+
6768
private ["_removeOpfor"];
6869
_removeOpfor = [ "airbase_fuel", "airfield_boats", "airfield_fuel", "airbase_uav" ];
6970
{

initNeutralVehicle.sqf

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#define GRACE_PERIOD 30
2+
3+
params ["_unit"];
4+
5+
clearMagazineCargoGlobal _unit;
6+
clearWeaponCargoGlobal _unit;
7+
clearItemCargoGlobal _unit;
8+
9+
if(time < GRACE_PERIOD) then {
10+
private _handlerId = _unit addEventHandler ["HandleDamage", {
11+
private _v = _this select 0;
12+
if (!alive _v) then {
13+
if(call Mh_fnc_isDebug) then {
14+
private _markerId = floor random 10000000000;
15+
private _markerName = format ["debug_vehicle_%1", _markerId];
16+
private _marker = createMarker [_markerName, _v];
17+
_marker setMarkerShape "ICON";
18+
_marker setMarkerText format ["Destroyed %1", typeof _v];
19+
_marker setMarkerType "mil_dot";
20+
[format ["Destroyed vehicle %1 before grace period, marker with name %2 created", typeOf _v, _markerName], "systemChat", true] call Bis_fnc_mp;
21+
};
22+
deleteVehicle _v;
23+
_v removeEventHandler ["HandleDamage", _thisEventHandler];
24+
};
25+
}];
26+
27+
[_handlerId, _unit] spawn {
28+
waitUntil { time >= GRACE_PERIOD };
29+
private _id = _this select 0;
30+
private _v = _this select 1;
31+
_v removeEventHandler ["HandleDamage", _id];
32+
};
33+
};

initPlayerLocal.sqf

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
#define PARACHUTE_ALTITUDE 80
3+
14
call compile preProcessFileLineNumbers "initVariables.sqf";
25
call compile preprocessFileLineNumbers "initBriefingChanges.sqf";
36

@@ -33,20 +36,26 @@ if(side player == east) then
3336
if(side _x == east && _x != player) then
3437
{
3538
_x addAction [format["Give %1 an intel piece", name _x], {
36-
39+
3740
[[_this select 1, _this select 0, 1], "Mh_fnc_giveIntelCount", false] call Bis_fnc_mp;
3841
[[_this select 0, format ["Received an intel piece from %1", name (_this select 1)]], "sideChat", east] call BIS_fnc_MP;
39-
40-
}, [], 1, false, true, "", "alive _target && _this distance _target <= 3 && ([_this] call Mh_fnc_getIntelCount > 0);"];
42+
43+
}, [], 1, false, true, "", "alive _target && _this distance _target <= 3 && ([_this] call Mh_fnc_getIntelCount > 0);"];
4144
};
4245
} forEach (if (isMultiplayer) then {playableUnits} else {switchableUnits});
46+
47+
[] spawn {
48+
waitUntil { getPosATL player select 2 < PARACHUTE_ALTITUDE };
49+
player action ["openParachute"];
50+
};
51+
4352
}
4453
else
4554
{
4655
setPlayerRespawnTime respawnTime;
4756
};
4857

49-
if(debugMode == 1) then
58+
if(call Mh_fnc_isDebug) then
5059
{
5160
setPlayerRespawnTime 5;
5261
["debugTeleport", "onMapSingleClick", {

initVariables.sqf

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,38 @@
1-
gpsSetting = paramsArray select 0;
2-
startingTime = paramsArray select 1;
3-
detectionRadius = paramsArray select 2;
4-
detectionRadiusVehicle = paramsArray select 3;
5-
requiredObjectives = paramsArray select 4;
6-
availableObjectives = paramsArray select 5;
7-
objectiveRadius = paramsArray select 6;
8-
nameTags = paramsArray select 7;
9-
requiredIntel = paramsArray select 8;
10-
//startingWeather = paramsArray select 9;
11-
debugMode = paramsArray select 10;
12-
disallowTeamswitch = paramsArray select 11;
13-
acceleratedTime = paramsArray select 12;
14-
respawnTime = paramsArray select 13;
15-
initialDroneDelay = paramsArray select 14;
16-
dynamicObjectives = 0;
17-
maxUavs = 1;
181

19-
if(!isMultiplayer) then { debugMode = 1; };
2+
if(isMultiplayer) then {
3+
gpsSetting = paramsArray select 0;
4+
startingTime = paramsArray select 1;
5+
detectionRadius = paramsArray select 2;
6+
detectionRadiusVehicle = paramsArray select 3;
7+
requiredObjectives = paramsArray select 4;
8+
availableObjectives = paramsArray select 5;
9+
objectiveRadius = paramsArray select 6;
10+
nameTags = paramsArray select 7;
11+
requiredIntel = paramsArray select 8;
12+
//startingWeather = paramsArray select 9;
13+
14+
disallowTeamswitch = paramsArray select 11;
15+
acceleratedTime = paramsArray select 12;
16+
respawnTime = paramsArray select 13;
17+
initialDroneDelay = paramsArray select 14;
18+
dynamicObjectives = 0;
19+
maxUavs = 1;
20+
} else {
21+
gpsSetting = 3;
22+
startingTime = 12;
23+
detectionRadius = 350;
24+
detectionRadiusVehicle = 110;
25+
requiredObjectives = 3;
26+
availableObjectives = 6;
27+
objectiveRadius = 1250;
28+
nameTags = 2;
29+
requiredIntel = 3;
30+
//startingWeather = paramsArray select 9;
31+
32+
disallowTeamswitch = 1;
33+
acceleratedTime = 1;
34+
respawnTime = 105;
35+
initialDroneDelay = 240;
36+
dynamicObjectives = 0;
37+
maxUavs = 1;
38+
}

initWeaponsCache.sqf

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,23 @@ if(isServer) then
2424
};
2525
};
2626

27-
clearMagazineCargoGlobal _cache;
28-
clearWeaponCargoGlobal _cache;
29-
clearItemCargoGlobal _cache;
27+
clearMagazineCargoGlobal _cache;
28+
clearWeaponCargoGlobal _cache;
29+
clearItemCargoGlobal _cache;
3030
clearBackpackCargoGlobal _cache;
3131

3232
_cache addMagazineCargoGlobal ["RPG32_F", 1];
33-
_cache addMagazineCargoGlobal ["150Rnd_762x54_Box", 1];
34-
_cache addMagazineCargoGlobal ["30Rnd_65x39_caseless_green", 3];
35-
_cache addMagazineCargoGlobal ["30Rnd_556x45_Stanag", 2];
36-
_cache addMagazineCargoGlobal ["10Rnd_762x54_Mag", 3];
33+
_cache addMagazineCargoGlobal ["150Rnd_762x54_Box", 2];
34+
_cache addMagazineCargoGlobal ["30Rnd_65x39_caseless_green", 4];
35+
_cache addMagazineCargoGlobal ["30Rnd_556x45_Stanag", 3];
36+
_cache addMagazineCargoGlobal ["10Rnd_762x54_Mag", 4];
3737
_cache addMagazineCargoGlobal ["ATMine_Range_Mag", 1];
3838
_cache addMagazineCargoGlobal ["APERSMine_Range_Mag", 1];
3939
_cache addMagazineCargoGlobal ["SatchelCharge_Remote_Mag", 1];
40-
_cache addItemCargoGlobal ["NVGoggles_OPFOR", 1];
40+
_cache addItemCargoGlobal ["NVGoggles_OPFOR", 2];
4141
_cache addItemCargoGlobal ["HandGrenade", 2];
4242
_cache addItemCargoGlobal ["U_O_Wetsuit", 1];
43+
_cache addItemCargoGlobal ["FirstAidKit", 2];
4344
_cache addBackpackCargoGlobal ["B_FieldPack_khk", 1];
4445
_cache addWeaponCargoGlobal ["arifle_Katiba_F", 1]
4546
};

manhunt_fnc/fn_isDebug.sqf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
Author: Michał Tuśnio
3+
4+
Description:
5+
Returns true if debug mode is enabled, false otherwise. This function is useful since some initialization
6+
scripts run before init.sqf, and will not read a variable describing debug mode properly. Similarly, we do
7+
not read paramsArray in single player.
8+
9+
Parameter(s):
10+
None
11+
12+
Returns:
13+
Boolean
14+
*/
15+
16+
if(!isMultiplayer) then {
17+
true;
18+
} else {
19+
(paramsArray select 10) == 1;
20+
}
21+
22+

0 commit comments

Comments
 (0)