Split purchase budget based on investment ratio.

The AI purchaser will aim to have a 50/50 ground/air investment mix.
This allows it to overspend on one category if significant losses were
taken the previous turn.

The total purchase amount is still limited, so if the bases are full
when only 10% of the investment is in ground units, the full budget for
the turn will still go to air.
This commit is contained in:
Florian
2021-05-31 19:04:31 +02:00
committed by Dan Albert
parent b74f60fe0e
commit 3a592aee8b
5 changed files with 90 additions and 41 deletions

View File

@@ -164,16 +164,16 @@ class QHangarStatus(QHBoxLayout):
self.setAlignment(Qt.AlignLeft)
def update_label(self) -> None:
next_turn = self.control_point.expected_aircraft_next_turn(self.game_model.game)
next_turn = self.control_point.allocated_aircraft(self.game_model.game)
max_amount = self.control_point.total_aircraft_parking
components = [f"{next_turn.present} present"]
if next_turn.ordered > 0:
components.append(f"{next_turn.ordered} purchased")
elif next_turn.ordered < 0:
components.append(f"{-next_turn.ordered} sold")
if next_turn.total_ordered > 0:
components.append(f"{next_turn.total_ordered} purchased")
elif next_turn.total_ordered < 0:
components.append(f"{-next_turn.total_ordered} sold")
transferring = next_turn.transferring
transferring = next_turn.total_transferring
if transferring > 0:
components.append(f"{transferring} transferring in")
if transferring < 0: