From 69b97bf972852e1863be6c28590230f6c1a69e06 Mon Sep 17 00:00:00 2001
From: MaxxLite <162753200+UAC-MaxxLite@users.noreply.github.com>
Date: Mon, 21 Oct 2024 11:36:06 +0300
Subject: [PATCH] economic victory needed amount fix / bug fixes (#339)
* economic victory per map
* hud warning weapon sway
* updated to use correct values
---
A3A/addons/core/Params.hpp | 2 +-
A3A/addons/core/Stringtable.xml | 4 ++--
A3A/addons/core/functions/Base/fn_checkWinCondition.sqf | 6 ++++--
A3A/addons/core/functions/REINF/fn_controlunit.sqf | 2 +-
A3A/addons/core/functions/REINF/fn_garrisonAdd.sqf | 2 +-
A3A/addons/core/functions/init/fn_briefing.sqf | 4 +++-
A3A/addons/core/functions/proxy/fn_onPlayerRespawn.sqf | 4 ++--
7 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/A3A/addons/core/Params.hpp b/A3A/addons/core/Params.hpp
index 309a2ae320..a6186031ab 100644
--- a/A3A/addons/core/Params.hpp
+++ b/A3A/addons/core/Params.hpp
@@ -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
diff --git a/A3A/addons/core/Stringtable.xml b/A3A/addons/core/Stringtable.xml
index 1b43954848..73da795c30 100644
--- a/A3A/addons/core/Stringtable.xml
+++ b/A3A/addons/core/Stringtable.xml
@@ -2724,8 +2724,8 @@
Выбрана полная победа<br/>Чтобы выполнить это условие победы, захватите все аванпосты, ресурсы, фабрики, морские порты, военные базы и аэропорты и поддерживайте большую поддержку населения, чем ваши враги.
- Economic Victory Selected<br/>To complete this win condition, Gain more than 2 million units of currency.
- Экономическая победа выбрана<br/>Чтобы выполнить это условие победы, получите более 2 миллионов единиц валюты.
+ Economic Victory Selected<br/>To complete this win condition, Gain more than a set amount of currency.<br/>Calculated as: amount of resources on the map * 100,000<br/>Needed amount on current map : %1%2
+ Экономическая победа выбрана<br/>Чтобы выполнить это условие победы, получите больше установленной суммы валюты.<br/>Рассчитывается как: количество ресурсов на карте * 100,000.<br/>Необходимая сумма на текущей карте : %1%2
Logistical Victory Selected<br/>To complete this win condition, capture all seaports, military bases, and airports, and maintain more population support than your enemies.
diff --git a/A3A/addons/core/functions/Base/fn_checkWinCondition.sqf b/A3A/addons/core/functions/Base/fn_checkWinCondition.sqf
index 6fbf81b31e..5aae154d47 100644
--- a/A3A/addons/core/functions/Base/fn_checkWinCondition.sqf
+++ b/A3A/addons/core/functions/Base/fn_checkWinCondition.sqf
@@ -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;
@@ -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 {
diff --git a/A3A/addons/core/functions/REINF/fn_controlunit.sqf b/A3A/addons/core/functions/REINF/fn_controlunit.sqf
index 0a7418e4e3..44bd7149b5 100644
--- a/A3A/addons/core/functions/REINF/fn_controlunit.sqf
+++ b/A3A/addons/core/functions/REINF/fn_controlunit.sqf
@@ -59,7 +59,7 @@ if (staminaEnabled isEqualTo false) then {
};
private _newWeaponSway = swayEnabled / 100;
-player setCustomAimCoef _newWeaponSway;
+_unit setCustomAimCoef _newWeaponSway;
private _timeX = aiControlTime;
diff --git a/A3A/addons/core/functions/REINF/fn_garrisonAdd.sqf b/A3A/addons/core/functions/REINF/fn_garrisonAdd.sqf
index b796838c97..f3fe666204 100644
--- a/A3A/addons/core/functions/REINF/fn_garrisonAdd.sqf
+++ b/A3A/addons/core/functions/REINF/fn_garrisonAdd.sqf
@@ -49,7 +49,7 @@ waitUntil {(_countX < count (garrison getVariable [_markerX, []])) or (sidesX ge
if(((server getVariable ["hr",0]) <= 10) && (loseHROnDeath isEqualTo 2)) then {
_warningText = "" + localize "STR_A3AU_respawn_warning" +""+"
"+"" + format [localize "STR_A3AU_HR_warning_info", (A3A_faction_reb get "name"), (server getVariable ["hr",0])]+"";
- [_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 {
diff --git a/A3A/addons/core/functions/init/fn_briefing.sqf b/A3A/addons/core/functions/init/fn_briefing.sqf
index 36cf9166e4..4fcf41ee2e 100644
--- a/A3A/addons/core/functions/init/fn_briefing.sqf
+++ b/A3A/addons/core/functions/init/fn_briefing.sqf
@@ -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"]]];
diff --git a/A3A/addons/core/functions/proxy/fn_onPlayerRespawn.sqf b/A3A/addons/core/functions/proxy/fn_onPlayerRespawn.sqf
index 744e3706c5..bc5cef3b73 100644
--- a/A3A/addons/core/functions/proxy/fn_onPlayerRespawn.sqf
+++ b/A3A/addons/core/functions/proxy/fn_onPlayerRespawn.sqf
@@ -114,7 +114,7 @@ if (side group _newUnit == teamPlayer) then
if(((server getVariable ["hr",0]) > 10) && (tierWar >= 2)) then
{
_warningText = "" + format [localize "STR_chats_player_kia", _deathPenaltyNum]+"";
- [_warningText,0,safezoneY+0.05] spawn BIS_fnc_dynamicText;
+ [_warningText,0,safezoneY+0.05] remoteExec ["BIS_fnc_dynamicText"];
};
};
};
@@ -279,4 +279,4 @@ if (staminaEnabled isEqualTo false) then {
};
private _newWeaponSway = swayEnabled / 100;
-player setCustomAimCoef _newWeaponSway;
+_newunit setCustomAimCoef _newWeaponSway;