Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initZones Refactor #2182

Merged
merged 3 commits into from
Nov 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
66 changes: 32 additions & 34 deletions A3-Antistasi/Templates/selector.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ Dependencies:
FIX_LINE_NUMBERS()

//======================|
// Map categories |
// Climate Getter |
//======================|

aridmaps = ["altis","kunduz","malden","tem_anizay","takistan","sara"];
tropicalmaps = ["tanoa","cam_lao_nam"];
temperatemaps = ["enoch","chernarus_summer","vt7","tembelan"];
arcticmaps = ["chernarus_winter"];
private _fileName = "Map\" + toLower worldName + "Info.sqf";
A3A_climate = ["climate"] call compile preProcessFileLineNumbers _filename;

//======================|
// Autopick Functions |
Expand All @@ -39,9 +37,9 @@ private _autoPickAI = {
case (A3A_has3CBBAF): {"BAF"};
case (A3A_has3CBFactions): {
switch(true) do {
case (toLower worldName in arcticmaps);
case (toLower worldName in temperatemaps): {"US Marines"};
case (toLower worldName in tropicalmaps): {"Coldwar US"};
case (A3A_climate isEqualTo "arctic");
case (A3A_climate isEqualTo "temperate"): {"US Marines"};
case (A3A_climate isEqualTo "tropical"): {"Coldwar US"};
case (toLower worldName == "kunduz"): {"ANA"};
case (toLower worldName == "altis"): {"3CB AAF"};
case (toLower worldName == "tanoa"): {"HIDF"};
Expand Down Expand Up @@ -71,9 +69,9 @@ private _autoPickAI = {
switch (true) do {
case (A3A_has3CBFactions): {
switch(true) do {
case (toLower worldName in arcticmaps);
case (toLower worldName in temperatemaps): {"AFRF"};
case (toLower worldName in tropicalmaps): {"Coldwar Soviets"};
case (A3A_climate isEqualTo "arctic");
case (A3A_climate isEqualTo "temperate"): {"AFRF"};
case (A3A_climate isEqualTo "tropical"): {"Coldwar Soviets"};
default {"TKA East"};
};
};
Expand All @@ -86,9 +84,9 @@ private _autoPickReb = {
switch (true) do {
case (A3A_has3CBFactions): {
switch(true) do {
case (toLower worldName in arcticmaps);
case (toLower worldName in temperatemaps);
case (toLower worldName in tropicalmaps): { "CNM" };
case (A3A_climate isEqualTo "arctic");
case (A3A_climate isEqualTo "temperate");
case (A3A_climate isEqualTo "tropical"): { "CNM" };
default { "TKM" };
};
};
Expand Down Expand Up @@ -163,9 +161,9 @@ private _pickAITemplate = {
switch _this do {
case "BAF": {
switch(true) do {
case (toLower worldName in arcticmaps): { "Templates\Templates\3CB\3CB_AI_BAF_Arctic.sqf" };
case (toLower worldName in temperatemaps): { "Templates\Templates\3CB\3CB_AI_BAF_Temperate.sqf" };
case (toLower worldName in tropicalmaps): { "Templates\Templates\3CB\3CB_AI_BAF_Tropical.sqf" };
case (A3A_climate isEqualTo "arctic"): { "Templates\Templates\3CB\3CB_AI_BAF_Arctic.sqf" };
case (A3A_climate isEqualTo "temperate"): { "Templates\Templates\3CB\3CB_AI_BAF_Temperate.sqf" };
case (A3A_climate isEqualTo "tropical"): { "Templates\Templates\3CB\3CB_AI_BAF_Tropical.sqf" };
default { "Templates\Templates\3CB\3CB_AI_BAF_Arid.sqf" };
};
};
Expand All @@ -184,26 +182,26 @@ private _pickAITemplate = {
//RHS
case "US Marines": {
switch(true) do {
case (toLower worldName in arcticmaps);
case (toLower worldName in temperatemaps);
case (toLower worldName in tropicalmaps): { "Templates\Templates\RHS\RHS_AI_USAF_Marines_Temperate.sqf" };
case (A3A_climate isEqualTo "arctic");
case (A3A_climate isEqualTo "temperate");
case (A3A_climate isEqualTo "tropical"): { "Templates\Templates\RHS\RHS_AI_USAF_Marines_Temperate.sqf" };
default { "Templates\Templates\RHS\RHS_AI_USAF_Marines_Arid.sqf" };
};
};
case "CDF": { "Templates\Templates\RHS\RHS_AI_CDF_Temperate.sqf" };
case "USAF": {
switch(true) do {
case (toLower worldName in arcticmaps);
case (toLower worldName in temperatemaps);
case (toLower worldName in tropicalmaps): { "Templates\Templates\RHS\RHS_AI_USAF_Army_Temperate.sqf" };
case (A3A_climate isEqualTo "arctic");
case (A3A_climate isEqualTo "temperate");
case (A3A_climate isEqualTo "tropical"): { "Templates\Templates\RHS\RHS_AI_USAF_Army_Temperate.sqf" };
default { "Templates\Templates\RHS\RHS_AI_USAF_Army_Arid.sqf" };
};
};
case "AFRF": {
switch(true) do {
case (toLower worldName in arcticmaps);
case (toLower worldName in temperatemaps);
case (toLower worldName in tropicalmaps): { "Templates\Templates\RHS\RHS_AI_AFRF_Temperate.sqf" };
case (A3A_climate isEqualTo "arctic");
case (A3A_climate isEqualTo "temperate");
case (A3A_climate isEqualTo "tropical"): { "Templates\Templates\RHS\RHS_AI_AFRF_Temperate.sqf" };
default { "Templates\Templates\RHS\RHS_AI_AFRF_Arid.sqf" };
};
};
Expand All @@ -218,8 +216,8 @@ private _pickAITemplate = {
case "NATO": {
switch(true) do {
case (toLower worldName == "tanoa"): { "Templates\Templates\Vanilla\Vanilla_AI_NATO_Tropical.sqf" };
case (toLower worldName in temperatemaps);
case (toLower worldName in tropicalmaps): { "Templates\Templates\Vanilla\Vanilla_AI_NATO_Temperate.sqf" };
case (A3A_climate isEqualTo "temperate");
case (A3A_climate isEqualTo "tropical"): { "Templates\Templates\Vanilla\Vanilla_AI_NATO_Temperate.sqf" };
default { "Templates\Templates\Vanilla\Vanilla_AI_NATO_Arid.sqf" };
};
};
Expand All @@ -243,9 +241,9 @@ private _pickRebTemplate = {
//RHS
case "NAPA": {
switch(true) do {
case (toLower worldName in arcticmaps);
case (toLower worldName in temperatemaps);
case (toLower worldName in tropicalmaps): { "Templates\Templates\RHS\RHS_Reb_NAPA_Temperate.sqf" };
case (A3A_climate isEqualTo "arctic");
case (A3A_climate isEqualTo "temperate");
case (A3A_climate isEqualTo "tropical"): { "Templates\Templates\RHS\RHS_Reb_NAPA_Temperate.sqf" };
default { "Templates\Templates\RHS\RHS_Reb_NAPA_Arid.sqf" };
};
};
Expand All @@ -268,9 +266,9 @@ private _pickCIVTemplate = {
switch _this do {
case "Factions": {
switch(true) do {
case (toLower worldName in arcticmaps);
case (toLower worldName in temperatemaps);
case (toLower worldName in tropicalmaps): { "Templates\Templates\3CB\3CB_Civ_Temperate.sqf" };
case (A3A_climate isEqualTo "arctic");
case (A3A_climate isEqualTo "temperate");
case (A3A_climate isEqualTo "tropical"): { "Templates\Templates\3CB\3CB_Civ_Temperate.sqf" };
default { "Templates\Templates\3CB\3CB_Civ_Arid.sqf" };
};
};
Expand Down
2 changes: 1 addition & 1 deletion A3-Antistasi/functions/AI/fn_combatLanding.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private _endPos = getPosASL _landingPad;
private _startPos = getPosASL _helicopter;

private _midPos = +_endPos;
if(toLower worldName in tropicalmaps) then
if(A3A_climate isEqualTo "tropical") then
{
_midPos set [2, (_endPos select 2) + 250];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ switch (true) do
_vehWP0 setWaypointCompletionRadius 150;
_vehWP0 setWaypointBehaviour "CARELESS";

if(toLower worldName in tropicalmaps) then
if(A3A_climate isEqualTo "tropical") then
{
_vehicle flyInHeight 250;
};
Expand Down
2 changes: 1 addition & 1 deletion A3-Antistasi/functions/CREATE/fn_invaderPunish.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ for "_i" from 1 to _numVehicles do
_vehWP0 setWaypointBehaviour "CARELESS";

// Hack for tree-dodging on landing path
if(toLower worldName in tropicalmaps) then { _veh flyInHeight 250 };
if(A3A_climate isEqualTo "tropical") then { _veh flyInHeight 250 };

[_veh, _landPos] spawn
{
Expand Down
65 changes: 5 additions & 60 deletions A3-Antistasi/functions/init/fn_initGarrisons.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ scriptName "fn_initGarrisons";
FIX_LINE_NUMBERS()
Info("InitGarrisons started");

//get terrain specific info
private _fnc_mapInfo = compile preProcessFileLineNumbers ("Map\"+ toLower worldName +"Info.sqf");

_fnc_initMarker =
{
params ["_mrkCSAT", "_target", "_mrkType", "_mrkText", ["_useSideName", false]];
Expand Down Expand Up @@ -90,10 +93,8 @@ _fnc_initGarrison =
} forEach _markerArray;
};

private _mrkNATO = [];
private _mrkCSAT = [];
private _controlsNATO = [];
private _controlsCSAT = [];
("garrison" call _fnc_mapInfo) params [["_mrkNATO", [], [[]]], ["_mrkCSAT",[],[[]]], ["_controlsNATO", [], [[]]], ["_controlsCSAT",[],[[]]]];


if (debug) then
{
Expand All @@ -103,62 +104,6 @@ if (debug) then
if (gameMode == 1) then
{
_controlsNATO = controlsX;
switch (toLower worldName) do {
case "tanoa": {
_mrkCSAT = ["airport_1", "seaport_5", "outpost_10", "control_20"];
_controlsCSAT = ["control_20"];
};
case "altis": {
_mrkCSAT = ["airport_2", "seaport_4", "outpost_5", "control_52", "control_33"];
_controlsCSAT = ["control_52", "control_33"];
};
case "chernarus_summer": {
_mrkCSAT = ["outpost_21"];
};
case "tem_anizay": {
_mrkCSAT = ["outpost_8", "control_19", "control_44", "control_45"];
_controlsCSAT = ["control_19", "control_44", "control_45"];
};
case "chernarus_winter": {
_mrkCSAT = ["outpost_21", "control_30"];
_controlsCSAT = ["control_30"];
};
case "kunduz": {
_mrkCSAT = ["outpost"];
};
case "enoch": {
_mrkCSAT = ["airport_3", "control_14"];
_controlsCSAT = ["control_14"];
};
case "tembelan": {
_mrkCSAT = ["airport_4"];
};
case "malden": {
_mrkCSAT = ["airport", "seaport_7"];
};
case "tem_kujari": {
_mrkCSAT = [];
};
case "vt7": {
_mrkCSAT = ["airport_2", "control_25", "control_29", "control_30", "control_31", "control_32", "Seaport_1", "Outpost_3"];
_controlsCSAT = ["control_25", "control_29", "control_30", "control_31", "control_32"];
};
case "stratis": {
_mrkCSAT = ["outpost_3"];
};
case "takistan": {
_mrkCSAT = ["airport_1", "outpost_5", "outpost_6", "outpost_7", "outpost_8", "resource", "resource_5", "resource_6"];
_controlsCSAT = ["control", "control_1", "control_2", "control_5", "control_13", "control_20", "control_21", "control_22", "control_24", "control_25", "control_31"];
};
case "sara": {
_mrkCSAT = ["airport_1", "seaport_6", "outpost_22", "outpost_15", "resource_9", "outpost_19", "outpost_14", "resource_11"];
_controlsCSAT = ["control_28", "control_27"];
};
case "cam_lao_nam": {
_mrkCSAT = ["airport_5", "outpost_33", "outpost_34", "resource_4", "seaport_3", "outpost_15", "outpost_22", "outpost_8", "outpost_4", "resource_9", "outpost_21", "resource_14", "outpost_3", "outpost_2", "factory_3", "outpost_1", "outpost_7", "seaport_2", "outpost_32", "airport_1", "outpost_23", "outpost_10", "outpost_5", "outpost_16", "outpost_6", "outpost_11", "resource_6", "resource_20", "outpost_9", "outpost_38"];
_controlsCSAT = ["control_1", "control_2", "control_3", "control_4", "control_5", "control_6", "control_7", "control_8", "control_9", "control_10", "control_11", "control_12", "control_13", "control_14", "control_15", "control_16", "control_17", "control_18", "control_19", "control_20", "control_21", "control_22", "control_23", "control_24", "control_25", "control_26", "control_27", "control_28", "control_29"];
}
};
_controlsNATO = _controlsNATO - _controlsCSAT;
_mrkNATO = markersX - _mrkCSAT - ["Synd_HQ"];

Expand Down
Loading