Move the AI to the normal procurement system.

The procurement AI now uses the same system as the players. Orders are
placed and take a turn to fulfill.

This has a few advantages:

* We no longer need special case purchase logic for the turn 0
  population of opfor airbases.
* Players using auto-purchase can cancel orders they don't like.
This commit is contained in:
Dan Albert
2020-12-05 22:36:17 -08:00
parent 7226359e64
commit d519aa1dad
4 changed files with 34 additions and 80 deletions

View File

@@ -374,7 +374,11 @@ class UnitsDeliveryEvent(Event):
def skip(self) -> None:
for k, v in self.units.items():
info = Information("Ally Reinforcement", str(k.id) + " x " + str(v) + " at " + self.to_cp.name, self.game.turn)
self.game.informations.append(info)
if self.to_cp.captured:
name = "Ally "
else:
name = "Enemy "
self.game.message(
f"{name} reinforcements: {k.id} x {v} at {self.to_cp.name}")
self.to_cp.base.commision_units(self.units)