From cfeb19faf61e832f0fe01f518472fa517b85a24b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 5 Jun 2020 23:51:23 +0200 Subject: [PATCH] rebalance star purchasing --- TouchyTickets/Content/Localization/Localization.json | 2 +- TouchyTickets/GameImpl.cs | 10 +++++++++- TouchyTickets/Ui.cs | 6 +++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/TouchyTickets/Content/Localization/Localization.json b/TouchyTickets/Content/Localization/Localization.json index 0cabc0d..5bdc3a5 100644 --- a/TouchyTickets/Content/Localization/Localization.json +++ b/TouchyTickets/Content/Localization/Localization.json @@ -6,7 +6,7 @@ "ReallyEarnStar": "Cashing in your now would earn you {0}. It will also remove all placed attractions and reset your . Are you sure?", "Yes": "Yes", "Okay": "Okay", - "RequiresTickets": "1 requires {0}", + "RequiresTickets": "{0} for 1. Maximum {1}.", "AppliedUpgrades": "Active Upgrades", "Tutorial1": "Hi! Welcome to Touchy Tickets. To start the game, simply tap the ticket booth to sell a . Start by racking up 50!", "Tutorial2": "Great! Now, you can buy your first attraction. Access the menu on the right by swiping and purchase a carousel.", diff --git a/TouchyTickets/GameImpl.cs b/TouchyTickets/GameImpl.cs index af06581..8ebfdca 100644 --- a/TouchyTickets/GameImpl.cs +++ b/TouchyTickets/GameImpl.cs @@ -94,7 +94,15 @@ namespace TouchyTickets { } public BigInteger GetStarPrice() { - return 10000000 * BigInteger.Pow(10, this.TimesRestarted); + return 1000000 * BigInteger.Pow(10, this.TimesRestarted); + } + + public int GetMaxStars() { + return 3 * (this.TimesRestarted + 1); + } + + public int GetBuyableStars() { + return Math.Min(this.GetMaxStars(), (int) (this.Tickets / this.GetStarPrice())); } } diff --git a/TouchyTickets/Ui.cs b/TouchyTickets/Ui.cs index 6f03f42..65e1051 100644 --- a/TouchyTickets/Ui.cs +++ b/TouchyTickets/Ui.cs @@ -223,7 +223,7 @@ namespace TouchyTickets { OnDrawn = (e2, time, batch, alpha) => batch.Draw(batch.GetBlankTexture(), e2.DisplayArea, Color.Black * 0.35F) }; var panel = infoBox.AddChild(new Panel(Anchor.Center, new Vector2(0.8F), Vector2.Zero, true)); - panel.AddChild(new Paragraph(Anchor.AutoLeft, 1, string.Format(Localization.Get("ReallyEarnStar"), GameImpl.Instance.Tickets / GameImpl.Instance.GetStarPrice()))); + panel.AddChild(new Paragraph(Anchor.AutoLeft, 1, string.Format(Localization.Get("ReallyEarnStar"), GameImpl.Instance.GetBuyableStars()))); panel.AddChild(new Button(Anchor.AutoLeft, new Vector2(0.5F, 30), Localization.Get("Back")) { OnPressed = e2 => this.uiSystem.Remove(e2.Root.Name) }); @@ -235,7 +235,7 @@ namespace TouchyTickets { game.Analytics.AddResourceEvent(true, "Tickets", (long) game.Tickets, "Restart", "Restart" + game.TimesRestarted); game.Analytics.AddResourceEvent(false, "Stars", (long) game.Tickets, "Restart", "Restart" + game.TimesRestarted); - game.Stars += (int) (game.Tickets / game.GetStarPrice()); + game.Stars += game.GetBuyableStars(); game.TimesRestarted++; game.Tickets = 0; game.Map = new ParkMap(game.Map.Width, game.Map.Height); @@ -244,7 +244,7 @@ namespace TouchyTickets { this.uiSystem.Add("ReallyEarnStarBox", infoBox); } }); - upgradeHeader.AddChild(new Paragraph(Anchor.AutoCenter, 1, p => string.Format(Localization.Get("RequiresTickets"), PrettyPrintNumber(GameImpl.Instance.GetStarPrice())), true) { + upgradeHeader.AddChild(new Paragraph(Anchor.AutoCenter, 1, p => string.Format(Localization.Get("RequiresTickets"), PrettyPrintNumber(GameImpl.Instance.GetStarPrice()), GameImpl.Instance.GetMaxStars()), true) { PositionOffset = new Vector2(0, 2) }); var upgradeList = upgradeUi.AddChild(new Panel(Anchor.AutoLeft, new Vector2(1, 0.73F), Vector2.Zero, false, true, new Point(10, 30), false) {