rebalance star purchasing

This commit is contained in:
Ellpeck 2020-06-05 23:51:23 +02:00
parent db6811cc20
commit cfeb19faf6
3 changed files with 13 additions and 5 deletions

View file

@ -6,7 +6,7 @@
"ReallyEarnStar": "Cashing in your <i ticket> now would earn you {0}<i star>. It will also remove all placed attractions and reset your <i ticket>. Are you sure?", "ReallyEarnStar": "Cashing in your <i ticket> now would earn you {0}<i star>. It will also remove all placed attractions and reset your <i ticket>. Are you sure?",
"Yes": "Yes", "Yes": "Yes",
"Okay": "Okay", "Okay": "Okay",
"RequiresTickets": "1<i star> requires {0}<i ticket>", "RequiresTickets": "{0}<i ticket> for 1<i star>. Maximum {1}.",
"AppliedUpgrades": "Active Upgrades", "AppliedUpgrades": "Active Upgrades",
"Tutorial1": "Hi! Welcome to Touchy Tickets. To start the game, simply tap the ticket booth to sell a <i ticket>. Start by racking up 50<i ticket>!", "Tutorial1": "Hi! Welcome to Touchy Tickets. To start the game, simply tap the ticket booth to sell a <i ticket>. Start by racking up 50<i ticket>!",
"Tutorial2": "Great! Now, you can buy your first attraction. Access the menu on the right by swiping and purchase a carousel.", "Tutorial2": "Great! Now, you can buy your first attraction. Access the menu on the right by swiping and purchase a carousel.",

View file

@ -94,7 +94,15 @@ namespace TouchyTickets {
} }
public BigInteger GetStarPrice() { 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()));
} }
} }

View file

@ -223,7 +223,7 @@ namespace TouchyTickets {
OnDrawn = (e2, time, batch, alpha) => batch.Draw(batch.GetBlankTexture(), e2.DisplayArea, Color.Black * 0.35F) 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)); 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")) { panel.AddChild(new Button(Anchor.AutoLeft, new Vector2(0.5F, 30), Localization.Get("Back")) {
OnPressed = e2 => this.uiSystem.Remove(e2.Root.Name) 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(true, "Tickets", (long) game.Tickets, "Restart", "Restart" + game.TimesRestarted);
game.Analytics.AddResourceEvent(false, "Stars", (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.TimesRestarted++;
game.Tickets = 0; game.Tickets = 0;
game.Map = new ParkMap(game.Map.Width, game.Map.Height); game.Map = new ParkMap(game.Map.Width, game.Map.Height);
@ -244,7 +244,7 @@ namespace TouchyTickets {
this.uiSystem.Add("ReallyEarnStarBox", infoBox); 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) 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) { var upgradeList = upgradeUi.AddChild(new Panel(Anchor.AutoLeft, new Vector2(1, 0.73F), Vector2.Zero, false, true, new Point(10, 30), false) {