finished modifier system

This commit is contained in:
Ellpeck 2020-06-08 20:47:40 +02:00
parent 93ea869a16
commit 375d2e569e
3 changed files with 9 additions and 7 deletions

View file

@ -2,6 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -14,7 +15,7 @@ namespace Android
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
public partial class Resource
{
@ -43,8 +44,8 @@ namespace Android
public partial class Drawable
{
// aapt resource value: 0x7F010000
public const int Icon = 2130771968;
// aapt resource value: 0x7f020000
public const int Icon = 2130837504;
static Drawable()
{
@ -59,8 +60,8 @@ namespace Android
public partial class String
{
// aapt resource value: 0x7F020000
public const int app_name = 2130837504;
// aapt resource value: 0x7f030000
public const int app_name = 2130903040;
static String()
{

View file

@ -80,7 +80,7 @@ namespace TouchyTickets {
}
public BigInteger GetStarPrice() {
return 1000000 * BigInteger.Pow(10, this.TimesRestarted);
return 1000000000 * BigInteger.Pow(10, this.TimesRestarted);
}
public int GetMaxStars() {

View file

@ -253,6 +253,7 @@ namespace TouchyTickets {
var attraction = map.GetAttractionAt(map.SelectedPosition.Value);
attraction.ApplyModifier(modifier);
GameImpl.Instance.Tickets -= price;
// if we're out of tickets to buy this modifier, automatically go back
if (GameImpl.Instance.Tickets < CalculatePrice())
this.FadeUi(false, () => this.uiSystem.Remove(e2.Root.Name));
@ -280,8 +281,8 @@ namespace TouchyTickets {
var right = button.AddChild(new Group(Anchor.TopRight, new Vector2(0.8F, 1)) {CanBeMoused = false});
right.AddChild(new Paragraph(Anchor.TopLeft, 1, Localization.Get(modifier.Name), true));
right.AddChild(new Paragraph(Anchor.AutoLeft, 1, Localization.Get(modifier.Name + "Description"), true) {TextScale = 0.08F});
right.AddChild(new Paragraph(Anchor.BottomLeft, 1, $"x{modifier.Multiplier}<i ticket>", true) {TextScale = 0.08F});
right.AddChild(new Paragraph(Anchor.AutoRight, 1, p => PrettyPrintNumber(price) + "<i ticket>", true));
right.AddChild(new Paragraph(Anchor.BottomLeft, 1, $"x{modifier.Multiplier}<i ticket>", true) {TextScale = 0.08F});
}
this.uiSystem.Add("Modifiers", modifierUi);