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

Fast travel enabled only between major locations #332

Merged
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
4 changes: 2 additions & 2 deletions A3A/addons/core/Params.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class Params
class limitedFT
{
title = $STR_params_allowFT;
values[] = {0,1,2};
texts[] = {$STR_params_allowFT_0, $STR_params_allowFT_1,$STR_params_civ_traffic_none};
values[] = {0,1,2,3};
texts[] = {$STR_params_allowFT_0, $STR_params_allowFT_1, $STR_params_allowFT_2, $STR_params_civ_traffic_none};
default = 0;
};
class civTraffic
Expand Down
24 changes: 18 additions & 6 deletions A3A/addons/core/functions/Dialogs/fn_fastTravelRadio.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ private _markersX = markersX + [respawnTeamPlayer];

// private _titleStr = localize "STR_A3A_fn_dialogs_ftradio_title";
private _titleStr = "Fast Travel";
if (limitedFT == 2) exitWith {[_titleStr, "Fast travel is disabled for this server."] call A3A_fnc_customHint}; // [_titleStr, localize "STR_A3A_fn_dialogs_ftradio_no_param"]
if (limitedFT == 3) exitWith {[_titleStr, "Fast travel is disabled for this server."] call A3A_fnc_customHint}; // [_titleStr, localize "STR_A3A_fn_dialogs_ftradio_no_param"]
// This needs a proper stringtable ^

if (!isNil "traderMarker") then {
Expand All @@ -26,7 +26,7 @@ if (count hcSelected player == 1) then {
_groupX = group player;
};
private _checkForPlayer = false;
if (!_esHC and {(limitedFT == 1)}) then {_checkForPlayer = true};
if (!_esHC and {(limitedFT == 1 or limitedFT == 2)}) then {_checkForPlayer = true};
private _boss = leader _groupX;

if (_boss != player and {!_esHC}) then {_groupX = player};
Expand Down Expand Up @@ -98,12 +98,24 @@ if (_positionTel isEqualTo []) exitWith {
};

private _base = [_markersX, _positionTel] call BIS_Fnc_nearestPosition;

private _rebelMarkers = if (!isNil "traderMarker") then {["Synd_HQ", traderMarker]} else {["Synd_HQ"]};
if (_checkForPlayer && {!(_base in (_rebelMarkers + airportsX + milbases))}) exitWith {
private _isValidTargetLocation = (_base in (_rebelMarkers + airportsX + milbases));

if (_checkForPlayer && limitedFT == 1 && !_isValidTargetLocation) exitWith {
[localize "STR_A3A_Dialogs_fast_travel_header", localize "STR_A3A_Dialogs_fast_travel_limited"] call SCRT_fnc_misc_deniedHint;
};

private _withinBoundaries = true;
if (limitedFT == 2) then {
private _rebelLocations = (_rebelMarkers + airportsX + milbases) select { sidesX getVariable _x == teamPlayer };
private _nearestPosition = [_rebelLocations, player] call BIS_Fnc_nearestPosition;
private _distanceToNearest = player distance getMarkerPos _nearestPosition;
_withinBoundaries = _distanceToNearest < 50;
};
if (_checkForPlayer && limitedFT == 2 && (!_isValidTargetLocation or !_withinBoundaries)) exitWith {
[localize "STR_A3A_Dialogs_fast_travel_header", localize "STR_A3A_Dialogs_fast_travel_limited_to_between_destinations"] call SCRT_fnc_misc_deniedHint;
};

if ((sidesX getVariable [_base,sideUnknown]) in [Occupants, Invaders]) exitWith {
[localize "STR_A3A_Dialogs_fast_travel_header", localize "STR_A3A_Dialogs_fast_travel_no_enemy_zone"] call SCRT_fnc_misc_deniedHint;
openMap [false,false];
Expand Down Expand Up @@ -141,13 +153,13 @@ if (_positionTel distance getMarkerPos _base < 50) then {
};
};
private _exit = false;
if (limitedFT == 1) then {
if (limitedFT == 1 or limitedFT == 2) then {
_vehicles = [];
{if (vehicle _x != _x) then {_vehicles pushBackUnique (vehicle _x)}} forEach units _groupX;
{if ((vehicle _x) in _vehicles) exitWith {_checkForPlayer = true}} forEach (call A3A_fnc_playableUnits);
};

if (_checkForPlayer and {!(_base in (_rebelMarkers + airportsX + milbases))}) exitWith {
if (_checkForPlayer and !_isValidTargetLocation) exitWith {
[localize "STR_A3A_Dialogs_fast_travel_header", format [localize "STR_A3A_Dialogs_fast_travel_cancel",groupID _groupX]] call A3A_fnc_customHint;
};

Expand Down
16 changes: 15 additions & 1 deletion A3A/addons/scrt/Stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@
<French>&lt;t size='0.6' color='#C1C0BB'&gt;Revenu&lt;br/&gt; &lt;t size='0.5' color='#C1C0BB'&gt;&lt;br/&gt;HR: +%1&lt;br/&gt;Argent: +%2%3</French>
</Key>
<Key ID="STR_comms_mp_paycheck">
<Original>&lt;t size='0.6'&gt;%1 receieves &lt;t size='0.6' color='#00FF00'&gt;%2%3&lt;/t&gt; for fighting for %4!&lt;/t&gt;</Original>
<Original>&lt;t size='0.6'&gt;%1 receives &lt;t size='0.6' color='#00FF00'&gt;%2%3&lt;/t&gt; for fighting for %4!&lt;/t&gt;</Original>
<Russian>&lt;t size='0.6'&gt;%1 получает &lt;t size='0.6' color='#00FF00'&gt;%2%3&lt;/t&gt; на борьбу за %4!&lt;/t&gt;</Russian>
<Chinesesimp>&lt;t size='0.6'&gt;%1 收到了 &lt;t size='0.6' color='#00FF00'&gt;%2%3&lt;/t&gt;,因为为%4!而战!&lt;/t&gt;</Chinesesimp>
<Korean>&lt;t size='0.6'&gt;%1이(가) %4을(를) 위해 싸운 것에 대해 &lt;t size='0.6' color='#00FF00'&gt;%2%3&lt;/t&gt;을(를) 받았습니다!&lt;/t&gt;</Korean>
Expand Down Expand Up @@ -4658,6 +4658,13 @@
<Korean>공항, 군사 기지와 본부만</Korean>
<French>Uniquement les aéroports, les bases militaires et les QG</French>
</Key>
<Key ID="STR_params_allowFT_2">
<Original>Only between airports, military bases and HQ</Original>
<Russian>Только между аэропортами, военными базами и штаб-квартирами</Russian>
<Chinesesimp>仅限机场、军事基地和总部之间</Chinesesimp>
<Korean>공항, 군 기지, 본부 간에만 가능</Korean>
<French>Uniquement entre les aéroports, les bases militaires et les quartiers généraux</French>
</Key>
<Key ID="STR_params_napalmEnabled">
<Original>Enable Napalm Bombing for AI</Original>
<Russian>Включить бомбардировки напалмом для ИИ</Russian>
Expand Down Expand Up @@ -12270,6 +12277,13 @@
<Korean>플레이어 그룹은 본부, 공군 기지, 군사 기지, 집결 지점, 암거래상으로만 빠른 이동이 가능합니다.</Korean>
<French>Les groupes de joueurs ne sont autorisés à voyager rapidement que vers le QG, les bases aériennes, les bases militaires, les points de ralliement et les marchands d'armes.</French>
</Key>
<Key ID="STR_A3A_Dialogs_fast_travel_limited_to_between_destinations">
<Original>Player groups are only allowed to Fast Travel between HQ, Airbases, Military Bases, Arms Dealer and to Rally Points.</Original>
<Russian>Группам игроков разрешено быстро перемещаться только между штаб-квартирами, авиабазами, военными базами, торговцами оружием и точками сбора.</Russian>
<Chinesesimp>玩家组队只能快速前往总部、空军基地、军事基地、集结点和军火商。</Chinesesimp>
<Korean>플레이어 그룹은 본부, 공군 기지, 군사 기지, 무기 상인, 집결 지점 사이로만 빠른 이동이 허용됩니다.</Korean>
<French>Les groupes de joueurs ne sont autorisés à voyager rapidement qu'entre le QG, les bases aériennes, les bases militaires, les marchands d'armes et les points de rassemblement.</French>
</Key>
<Key ID="STR_A3A_Dialogs_fast_travel_no_enemy_zone">
<Original>You can't Fast Travel to an enemy controlled zone.</Original>
<Russian>Вы не можете быстро путешествовать в место, контроллируемое врагом.</Russian>
Expand Down