Add documentation for tourist trade bug in King

- really bad pollution can get positive money from tourists
- fix issue in python implementation, other implementations still lack
  it
This commit is contained in:
Guido Knips
2023-08-28 20:29:46 +02:00
parent 0b7b162f9f
commit adba99e767
2 changed files with 19 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ class GameState:
return self.countrymen - self.population_change
def sell_land(self, amount: int) -> None:
assert amount < self.farmland
assert amount <= self.farmland
self.land -= amount
self.rallods += self.land_buy_price * amount
@@ -126,7 +126,9 @@ class GameState:
def handle_tourist_trade(self) -> None:
V1 = int(self.settled_people * 22 + random() * 500)
V2 = int((INITIAL_LAND - self.land) * 15)
tourist_trade_earnings = int(V1 - V2)
tourist_trade_earnings = 0
if V1 > V2:
tourist_trade_earnings = V1 - V2
print(f" YOU MADE {tourist_trade_earnings} RALLODS FROM TOURIST TRADE.")
if V2 != 0 and not (V1 - V2 >= self.tourism_earnings):
print(" DECREASE BECAUSE ")