diff --git a/Assets/DebugWindow.cs b/Assets/DebugWindow.cs index c87fdf65..4d5b2ea6 100644 --- a/Assets/DebugWindow.cs +++ b/Assets/DebugWindow.cs @@ -28,6 +28,7 @@ private void Start() { Exist = true; devModeToggle.isOn = Game.devMode; + logInvestmentsToggle.isOn = Game.logInvestments; } public override void Hide() @@ -42,7 +43,9 @@ public void OnDevModeChange(bool value) } public void OnLogInvestmentsChange(bool value) - { } + { + Game.logInvestments = value; + } public void OnLogMarketFailsChange(bool value) { } diff --git a/Assets/EconomicSimulation/ES-base.unity b/Assets/EconomicSimulation/ES-base.unity index 032b4845..b2e845df 100644 Binary files a/Assets/EconomicSimulation/ES-base.unity and b/Assets/EconomicSimulation/ES-base.unity differ diff --git a/Assets/EconomicSimulation/Scripts/Logic/Country.cs b/Assets/EconomicSimulation/Scripts/Logic/Country.cs index c90e21ce..575c33bf 100644 --- a/Assets/EconomicSimulation/Scripts/Logic/Country.cs +++ b/Assets/EconomicSimulation/Scripts/Logic/Country.cs @@ -34,7 +34,7 @@ public class Country : MultiSeller, IClickable, IShareOwner, ISortableName, INam public readonly List reforms = new List(); public readonly List movements = new List(); - private readonly string name; + private string name; private readonly Culture culture; private readonly Color nationalColor; private Province capital; @@ -205,6 +205,11 @@ public Country(string name, Culture culture, Color color, Province capital, floa } } + internal void SetName(string v) + { + name = v; + } + private void ressurect(Province province, Government.ReformValue newGovernment) { alive = true; @@ -983,17 +988,17 @@ public void AIThink() { var isFactory = x.Key as Factory; if (isFactory != null) - return Country.InventedFactory(isFactory.Type); + return InventedFactory(isFactory.Type); else { var newFactory = x.Key as NewFactoryProject; if (newFactory != null) - return Country.InventedFactory(newFactory.Type); + return InventedFactory(newFactory.Type); } return true; } ).MaxByRandom(x => x.Value.get()); - if (!project.Equals(default(KeyValuePair)) && project.Value.isBiggerThan(Options.minMarginToInvest)) + if (!project.Equals(default(KeyValuePair)) && project.Value.isBiggerThan(Options.minMarginToInvest.Copy().Multiply(Options.InvestorEmploymentSafety))) { MoneyView investmentCost = project.Key.GetInvestmentCost(); if (!CanPay(investmentCost)) diff --git a/Assets/EconomicSimulation/Scripts/Logic/Game.cs b/Assets/EconomicSimulation/Scripts/Logic/Game.cs index 48eec560..e9a07667 100644 --- a/Assets/EconomicSimulation/Scripts/Logic/Game.cs +++ b/Assets/EconomicSimulation/Scripts/Logic/Game.cs @@ -10,7 +10,8 @@ namespace Nashet.EconomicSimulation { public class Game : ThreadedJob { - internal static bool devMode = false; + public static bool devMode = false; + public static bool logInvestments = false; private static readonly bool readMapFormFile = false; private static MyTexture mapTexture; diff --git a/Assets/EconomicSimulation/Scripts/Logic/Population/Investor.cs b/Assets/EconomicSimulation/Scripts/Logic/Population/Investor.cs index 689d0c64..a83e14c5 100644 --- a/Assets/EconomicSimulation/Scripts/Logic/Population/Investor.cs +++ b/Assets/EconomicSimulation/Scripts/Logic/Population/Investor.cs @@ -35,11 +35,11 @@ public Procent getBusinessSecurity(IInvestable business) { var res = business.Country.OwnershipSecurity; - if (business.Country != Country) - res.Multiply(Options.InvestingForeignCountrySecurity); + //if (business.Country != Country) + // res.Multiply(Options.InvestingForeignCountrySecurity); - if (business.Province != Province) - res.Multiply(Options.InvestingAnotherProvinceSecurity); + //if (business.Province != Province) + // res.Multiply(Options.InvestingAnotherProvinceSecurity); if (business is NewFactoryProject) // building, upgrading and opening requires hiring people which can be impossible res.Multiply(Options.InvestorEmploymentSafety); diff --git a/Assets/EconomicSimulation/Scripts/Logic/Production/Factory.cs b/Assets/EconomicSimulation/Scripts/Logic/Production/Factory.cs index eb440ab3..b076a32e 100644 --- a/Assets/EconomicSimulation/Scripts/Logic/Production/Factory.cs +++ b/Assets/EconomicSimulation/Scripts/Logic/Production/Factory.cs @@ -163,7 +163,7 @@ internal static readonly DoubleConditionsList conditionsDestroy = new DoubleConditionsList(new List { //new Condition(Economy.isNotLF, x=>(x as Producer).Country), conPlacedInOurCountry, Economy.isNotLF }),//}).addForSecondObject(new List { - // (status == Economy.PlannedEconomy || status == Economy.NaturalEconomy || status == Economy.StateCapitalism) + // (status == Economy.PlannedEconomy || status == Economy.NaturalEconomy || status == Economy.StateCapitalism) conditionsNatinalize = new DoubleConditionsList(new List { conNotFullyBelongsToCountry, conPlacedInOurCountry, Economy.isNotLF, Economy.isNotInterventionism }),//}) .addForSecondObject(new List { conditionsSubsidize = new DoubleConditionsList(new List { conPlacedInOurCountry ,Economy.isNotLF, Economy.isNotNatural, @@ -239,8 +239,8 @@ public Factory(Province province, IShareOwner investor, ProductionType type, Mon salary.Set(province.getLocalMinSalary()); if (Country.economy.getValue() == Economy.PlannedEconomy) setPriorityAutoWithPlannedEconomy(); - //else - // Debug.Log(investor + " invested " + cost + " in building new " + this); + if (Game.logInvestments) + Debug.Log(investor + " invested " + cost + " in building new " + this +" awaiting " + type.GetPossibleMargin(province)+ " margin"); } } @@ -908,7 +908,8 @@ internal void open(IShareOwner byWhom, bool payMoney) { agent.PayWithoutRecord(this, getReopenCost()); ownership.Add(byWhom, getReopenCost()); - //Debug.Log(byWhom + " invested " + getReopenCost() + " in reopening " + this); + if (Game.logInvestments) + Debug.Log(byWhom + " invested " + getReopenCost() + " in reopening " + this + " awaiting " + this.Type.GetPossibleMargin(Province) + " margin"); } _isOpen = true; daysUnprofitable = 0; @@ -956,10 +957,12 @@ internal void upgrade(IShareOwner byWhom) var cost = Game.market.getCost(getUpgradeNeeds()); (byWhom as Agent).PayWithoutRecord(this, cost); ownership.Add(byWhom, cost); - //Debug.Log(byWhom + " invested " + cost + " in upgrading " + this); + if (Game.logInvestments) + Debug.Log(byWhom + " invested " + cost + " in upgrading " + this + " awaiting " + GetMargin() + " margin"); } - //else - // Debug.Log(byWhom + " invested in upgrading " + this); + else + if (Game.logInvestments) + Debug.Log(byWhom + " invested in upgrading " + this); } internal int getDaysInConstruction() diff --git a/Assets/EconomicSimulation/Scripts/Logic/Production/Ownership.cs b/Assets/EconomicSimulation/Scripts/Logic/Production/Ownership.cs index 61b9bead..86cdc559 100644 --- a/Assets/EconomicSimulation/Scripts/Logic/Production/Ownership.cs +++ b/Assets/EconomicSimulation/Scripts/Logic/Production/Ownership.cs @@ -349,7 +349,8 @@ internal void BuyStandardShare(IShareOwner buyer) shareToBuy.Value.ReduceSale(cost); var boughtProcent = new Procent(cost, parent.ownership.totallyInvested); - //Debug.Log(buyer + " bough " + boughtProcent + " shares (" + cost + ") of " + parent + " from " + shareToBuy.Key); + if (Game.logInvestments) + Debug.Log(buyer + " bough " + boughtProcent + " shares (" + cost + ") of " + parent + " from " + shareToBuy.Key + " awaiting " + GetMargin() + " margin"); } } } diff --git a/Assets/EconomicSimulation/Scripts/Logic/World.cs b/Assets/EconomicSimulation/Scripts/Logic/World.cs index c11994ea..8fe783b5 100644 --- a/Assets/EconomicSimulation/Scripts/Logic/World.cs +++ b/Assets/EconomicSimulation/Scripts/Logic/World.cs @@ -186,6 +186,7 @@ internal static void CreateCountries() } Game.Player = allCountries[1]; // not wild Tribes, DONT touch that + allCountries.Random().SetName("Zacharia"); //foreach (var pro in allProvinces) // if (pro.Country == null) // pro.InitialOwner(World.UncolonizedLand); diff --git a/Assets/EconomicSimulation/Scripts/Panels/BottomPanel.cs b/Assets/EconomicSimulation/Scripts/Panels/BottomPanel.cs index b43451b1..22c49cc6 100644 --- a/Assets/EconomicSimulation/Scripts/Panels/BottomPanel.cs +++ b/Assets/EconomicSimulation/Scripts/Panels/BottomPanel.cs @@ -16,7 +16,7 @@ public class BottomPanel : Window private void Awake() // used to position other windows { MainCamera.bottomPanel = this; - generalText.text = "Prosperity Wars v0.19.3"; + generalText.text = "Prosperity Wars v0.19.4"; Hide(); } diff --git a/Assets/EconomicSimulation/Scripts/Panels/PoliticsPanel.cs b/Assets/EconomicSimulation/Scripts/Panels/PoliticsPanel.cs index 650ed2d3..578fe658 100644 --- a/Assets/EconomicSimulation/Scripts/Panels/PoliticsPanel.cs +++ b/Assets/EconomicSimulation/Scripts/Panels/PoliticsPanel.cs @@ -43,7 +43,7 @@ private void Start() voteButton.interactable = false; dropDown.interactable = false; forceDecisionButton.interactable = false; - GetComponent().anchoredPosition = new Vector2(15f, 15f); + GetComponent().anchoredPosition = new Vector2(15f, 45f); Hide(); } diff --git a/Assets/UnityUIUtils/Scripts/TooltipBase.cs b/Assets/UnityUIUtils/Scripts/TooltipBase.cs index 2aa8ee31..f4282960 100644 --- a/Assets/UnityUIUtils/Scripts/TooltipBase.cs +++ b/Assets/UnityUIUtils/Scripts/TooltipBase.cs @@ -75,6 +75,12 @@ public class TooltipBase : MonoBehaviour [SerializeField] private RectTransform bgImage; + private void Start() + { + var image =transform.parent.GetComponent(); + image.color = GUIChanger.DarkestColor; + } + // Use this for initialization private void Awake() { diff --git a/WEBGL/Build/WEBGL.asm.code.unityweb b/WEBGL/Build/WEBGL.asm.code.unityweb index 19ad3263..a63312be 100644 Binary files a/WEBGL/Build/WEBGL.asm.code.unityweb and b/WEBGL/Build/WEBGL.asm.code.unityweb differ diff --git a/WEBGL/Build/WEBGL.asm.framework.unityweb b/WEBGL/Build/WEBGL.asm.framework.unityweb index 99bd8d30..dadd4427 100644 Binary files a/WEBGL/Build/WEBGL.asm.framework.unityweb and b/WEBGL/Build/WEBGL.asm.framework.unityweb differ diff --git a/WEBGL/Build/WEBGL.asm.memory.unityweb b/WEBGL/Build/WEBGL.asm.memory.unityweb index 9ab08a92..1d2a3670 100644 Binary files a/WEBGL/Build/WEBGL.asm.memory.unityweb and b/WEBGL/Build/WEBGL.asm.memory.unityweb differ diff --git a/WEBGL/Build/WEBGL.data.unityweb b/WEBGL/Build/WEBGL.data.unityweb index 02b3e0b6..d771aef0 100644 Binary files a/WEBGL/Build/WEBGL.data.unityweb and b/WEBGL/Build/WEBGL.data.unityweb differ diff --git a/WEBGL/TemplateData/style.css b/WEBGL/TemplateData/style.css index 92b45bb1..e4c9815a 100644 --- a/WEBGL/TemplateData/style.css +++ b/WEBGL/TemplateData/style.css @@ -48,7 +48,7 @@ /* Container holding the image and the text */ .container { position: relative; - text-align: center; + text-align: left; color: black; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 22px; @@ -68,7 +68,7 @@ font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; /* Top left text */ .top-left { position: absolute; - top: 210px; + top: 160px; left: 120px; } diff --git a/WEBGL/credits.html b/WEBGL/credits.html index 2cf858c8..018e4398 100644 --- a/WEBGL/credits.html +++ b/WEBGL/credits.html @@ -23,7 +23,25 @@
Background -
Nashetovich - coding in general

more soming soon
+
Credits: +
+
Nashetovich - coding in general +
dillyo09 - bug fixing +
Zachary Pruckowski - sponsorship +
Jakob Stenberg - sponsorship +
el lyss - sponsorship +
+
+
+
+
+
+
+
+
+
+
Support that game on Patreon! +
diff --git a/WEBGL/credits_background.png b/WEBGL/credits_background.png index 179cdeac..d5f64e8f 100644 Binary files a/WEBGL/credits_background.png and b/WEBGL/credits_background.png differ