use compound interest for price increase

This commit is contained in:
Ellpeck 2020-06-01 16:31:08 +02:00
parent c7f2446282
commit 9988efca07

View file

@ -138,8 +138,9 @@ namespace ThemeParkClicker {
},
OnAreaUpdated = e => {
// only update the price when the area updates, since it won't change while we're in the buy ui
var markup = GameImpl.Instance.Map.GetAttractionAmount(attraction.Value) * 0.05F;
price = (attraction.Value.InitialPrice * (1 + markup)).Ceil();
var amount = GameImpl.Instance.Map.GetAttractionAmount(attraction.Value);
// yay compound interest
price = (attraction.Value.InitialPrice * (float) Math.Pow(1 + 0.1F, amount)).Ceil();
}
});
button.OnUpdated += (e, time) => {