Added trading system and cargo saving

This commit is contained in:
gotfishmakesticks 2023-11-13 17:13:36 +03:00
commit 30e53f858f
19 changed files with 301 additions and 12 deletions

View file

@ -44,12 +44,14 @@ func update_prices():
buy_prices = []
var price : float
for item in want_to_sell:
price = randi_range(item.min_price * 100, item.max_price * 100) / 100
if type != Game.BASE_TYPE.TRADING:
price = randi_range(item.min_price, item.max_price * 100) / 100.0
else:
price = randi_range((item.max_price + item.min_price) / 2 * 100, item.max_price * 100) / 100.0
sell_prices.append(price)
for item in want_to_buy:
if type != Game.BASE_TYPE.TRADING:
price = randi_range((item.max_price + item.min_price) / 2 * 100, item.max_price * 100) / 100
price = randi_range(item.min_price, item.max_price * 100) / 100.0
else:
price = randi_range(item.min_price * 100, (item.max_price + item.min_price) / 2 * 100) / 100
price = randi_range(item.min_price * 100, (item.max_price + item.min_price) / 2 * 100) / 100.0
buy_prices.append(price)
print(sell_prices, buy_prices)