UtBS S8: Simplify the additional gold calculation

This commit is contained in:
DisherProject 2019-03-04 18:32:53 +01:00
parent e8d3376e24
commit 6e8ac9a4f1

View file

@ -2899,47 +2899,32 @@
side=1
variable=gold_amount
[/store_gold]
{VARIABLE min_gold {ON_DIFFICULTY 125 100 100}}
[if]
[variable]
name=gold_amount
greater_than=0
[/variable]
[then]
[set_variable]
name=gold_amount
multiply=-0.6
[/set_variable]
[set_variable]
name=gold_amount
round=floor
[/set_variable]
{VARIABLE profit "$(max([50, $min_gold - $($gold_amount * 6/10)]))"}
[gold]
side=1
amount=$profit
[/gold]
{CLEAR_VARIABLE profit}
[/then]
[else]
[set_variable]
name=gold_amount
multiply=-1
[/set_variable]
[modify_side]
side=1
gold=$min_gold
[/modify_side]
[/else]
[/if]
[set_variable]
name=gold_amount
add={ON_DIFFICULTY 125 100 100}
[/set_variable]
[if]
[variable]
name=gold_amount
less_than=50
[/variable]
[then]
{VARIABLE gold_amount 50}
[/then]
[/if]
[gold]
amount=$gold_amount
side=1
[/gold]
{CLEAR_VARIABLE gold_amount}
{CLEAR_VARIABLE gold_amount,min_gold}
[/event]
# Event 15: Elves step out into the daylight, Eloh appears