Skip to content

Commit

Permalink
economic victory needed amount fix / bug fixes (#339)
Browse files Browse the repository at this point in the history
* economic victory per map

* hud warning weapon sway

* updated to use correct values
  • Loading branch information
UAC-MaxxLite authored Oct 21, 2024
1 parent 098855a commit 69b97bf
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion A3A/addons/core/Params.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ class Params
title = $STR_A3AU_sway_enabled;
values[] = {0,25,50,75,100};
texts[] = {"0%","25%","50%","75%","100%"};
default = 1;
default = 100;
};

class Spacer60
Expand Down
4 changes: 2 additions & 2 deletions A3A/addons/core/Stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2724,8 +2724,8 @@
<Russian>Выбрана полная победа&lt;br/&gt;Чтобы выполнить это условие победы, захватите все аванпосты, ресурсы, фабрики, морские порты, военные базы и аэропорты и поддерживайте большую поддержку населения, чем ваши враги.</Russian>
</Key>
<Key ID="STR_antistasi_journal_entry_text_Default_economic">
<Original>Economic Victory Selected&lt;br/&gt;To complete this win condition, Gain more than 2 million units of currency.</Original>
<Russian>Экономическая победа выбрана&lt;br/&gt;Чтобы выполнить это условие победы, получите более 2 миллионов единиц валюты.</Russian>
<Original>Economic Victory Selected&lt;br/&gt;To complete this win condition, Gain more than a set amount of currency.&lt;br/&gt;Calculated as: amount of resources on the map * 100,000&lt;br/&gt;Needed amount on current map : %1%2</Original>
<Russian>Экономическая победа выбрана&lt;br/&gt;Чтобы выполнить это условие победы, получите больше установленной суммы валюты.&lt;br/&gt;Рассчитывается как: количество ресурсов на карте * 100,000.&lt;br/&gt;Необходимая сумма на текущей карте : %1%2</Russian>
</Key>
<Key ID="STR_antistasi_journal_entry_text_Default_logistical">
<Original>Logistical Victory Selected&lt;br/&gt;To complete this win condition, capture all seaports, military bases, and airports, and maintain more population support than your enemies.</Original>
Expand Down
6 changes: 4 additions & 2 deletions A3A/addons/core/functions/Base/fn_checkWinCondition.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ private _victoryZones = airportsX + milbases + outposts + resourcesX + factories
private _victoryZonesLogistical = airportsX + milbases + seaports;
private _popTotal = 0;
private _popKilled = 0;
private _missingMoney = ((2000000 - _factionMoney) call BIS_fnc_numberText) splitString " " joinString ",";
private _popReb = 0;
private _popGov = 0;
private _popMajority = 0;
private _resourcesCount = count (resourcesX);
private _economicCalculation = (_resourcesCount * 100000);
private _missingMoney = ((_economicCalculation - _factionMoney) call BIS_fnc_numberText) splitString " " joinString ",";

{
private _city = _x;
Expand Down Expand Up @@ -71,7 +73,7 @@ switch (victoryCondition) do
//Economic Victory
case 2:
{
if (_factionMoney >= 2000000) then {
if (_factionMoney >= _economicCalculation) then {
isNil {["ended", true] call A3A_fnc_writebackSaveVar};
["economicVictory",true,true,true,true] remoteExec ["BIS_fnc_endMission"];
} else {
Expand Down
2 changes: 1 addition & 1 deletion A3A/addons/core/functions/REINF/fn_controlunit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if (staminaEnabled isEqualTo false) then {
};

private _newWeaponSway = swayEnabled / 100;
player setCustomAimCoef _newWeaponSway;
_unit setCustomAimCoef _newWeaponSway;

private _timeX = aiControlTime;

Expand Down
2 changes: 1 addition & 1 deletion A3A/addons/core/functions/REINF/fn_garrisonAdd.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ waitUntil {(_countX < count (garrison getVariable [_markerX, []])) or (sidesX ge

if(((server getVariable ["hr",0]) <= 10) && (loseHROnDeath isEqualTo 2)) then {
_warningText = "<t font ='PuristaBold' align = 'center' size='0.8' color='#bd0000'>" + localize "STR_A3AU_respawn_warning" +"</t>"+"<br />"+"<t font ='PuristaSemibold' align = 'center' size='0.55' color='#ebebeb'>" + format [localize "STR_A3AU_HR_warning_info", (A3A_faction_reb get "name"), (server getVariable ["hr",0])]+"</t>";
[_warningText,0,safezoneY+0.05] spawn BIS_fnc_dynamicText;
[_warningText,0,safezoneY+0.05] remoteExec ["BIS_fnc_dynamicText"];
};

if (sidesX getVariable [_markerX,sideUnknown] == teamPlayer) then {
Expand Down
4 changes: 3 additions & 1 deletion A3A/addons/core/functions/init/fn_briefing.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ switch (victoryCondition) do
player createDiaryRecord ["Diary",[format [localize "STR_antistasi_journal_entry_header_Default_2"],format [localize "STR_antistasi_journal_entry_text_Default_total"]]];
};
case 2: {
player createDiaryRecord ["Diary",[format [localize "STR_antistasi_journal_entry_header_Default_2"],format [localize "STR_antistasi_journal_entry_text_Default_economic"]]];
private _resourcesCount = count (resourcesX);
private _economicCalculation = ((_resourcesCount * 100000) call BIS_fnc_numberText) splitString " " joinString ",";
player createDiaryRecord ["Diary",[format [localize "STR_antistasi_journal_entry_header_Default_2"],format [localize "STR_antistasi_journal_entry_text_Default_economic", _economicCalculation, A3A_faction_civ get "currencySymbol"]]];
};
case 3: {
player createDiaryRecord ["Diary",[format [localize "STR_antistasi_journal_entry_header_Default_2"],format [localize "STR_antistasi_journal_entry_text_Default_logistical"]]];
Expand Down
4 changes: 2 additions & 2 deletions A3A/addons/core/functions/proxy/fn_onPlayerRespawn.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ if (side group _newUnit == teamPlayer) then
if(((server getVariable ["hr",0]) > 10) && (tierWar >= 2)) then
{
_warningText = "<t font ='PuristaSemibold' align = 'center' size='0.5' color='#ebebeb'>" + format [localize "STR_chats_player_kia", _deathPenaltyNum]+"</t>";
[_warningText,0,safezoneY+0.05] spawn BIS_fnc_dynamicText;
[_warningText,0,safezoneY+0.05] remoteExec ["BIS_fnc_dynamicText"];
};
};
};
Expand Down Expand Up @@ -279,4 +279,4 @@ if (staminaEnabled isEqualTo false) then {
};

private _newWeaponSway = swayEnabled / 100;
player setCustomAimCoef _newWeaponSway;
_newunit setCustomAimCoef _newWeaponSway;

0 comments on commit 69b97bf

Please sign in to comment.