mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
First pass at cargo ships.
The simple form of this works, but without the multi-mode routing it'll only get used when the final destination is a port with a link to a port with a factory. These also aren't targetable or simulated yet. https://github.com/Khopa/dcs_liberation/issues/826
This commit is contained in:
@@ -10,7 +10,7 @@ from dcs.unit import Vehicle
|
||||
from dcs.unitgroup import VehicleGroup
|
||||
from dcs.unittype import VehicleType
|
||||
|
||||
from game.transfers import Convoy
|
||||
from game.transfers import MultiGroupTransport
|
||||
from game.unitmap import UnitMap
|
||||
from game.utils import kph
|
||||
|
||||
@@ -30,7 +30,7 @@ class ConvoyGenerator:
|
||||
for convoy in self.game.transfers.convoys:
|
||||
self.generate_convoy(convoy)
|
||||
|
||||
def generate_convoy(self, convoy: Convoy) -> VehicleGroup:
|
||||
def generate_convoy(self, convoy: MultiGroupTransport) -> VehicleGroup:
|
||||
group = self._create_mixed_unit_group(
|
||||
convoy.name,
|
||||
convoy.route_start,
|
||||
|
||||
@@ -39,7 +39,7 @@ from game.theater.theatergroundobject import (
|
||||
NavalGroundObject,
|
||||
VehicleGroupGroundObject,
|
||||
)
|
||||
from game.transfers import Convoy, TransferOrder
|
||||
from game.transfers import Convoy, MultiGroupTransport, TransferOrder
|
||||
from game.utils import Distance, nautical_miles
|
||||
from gen import Conflict
|
||||
from gen.ato import Package
|
||||
@@ -445,7 +445,7 @@ class ObjectiveFinder:
|
||||
airfields.append(control_point)
|
||||
return self._targets_by_range(airfields)
|
||||
|
||||
def convoys(self) -> Iterator[Convoy]:
|
||||
def convoys(self) -> Iterator[MultiGroupTransport]:
|
||||
for front_line in self.front_lines():
|
||||
if front_line.control_point_a.is_friendly(self.is_player):
|
||||
enemy_cp = front_line.control_point_a
|
||||
|
||||
@@ -251,6 +251,7 @@ class NameGenerator:
|
||||
infantry_number = 0
|
||||
aircraft_number = 0
|
||||
convoy_number = 0
|
||||
cargo_ship_number = 0
|
||||
|
||||
ANIMALS = ANIMALS
|
||||
existing_alphas: List[str] = []
|
||||
@@ -260,6 +261,7 @@ class NameGenerator:
|
||||
cls.number = 0
|
||||
cls.infantry_number = 0
|
||||
cls.convoy_number = 0
|
||||
cls.cargo_ship_number = 0
|
||||
cls.ANIMALS = ANIMALS
|
||||
cls.existing_alphas = []
|
||||
|
||||
@@ -269,6 +271,7 @@ class NameGenerator:
|
||||
cls.infantry_number = 0
|
||||
cls.aircraft_number = 0
|
||||
cls.convoy_number = 0
|
||||
cls.cargo_ship_number = 0
|
||||
|
||||
@classmethod
|
||||
def next_aircraft_name(cls, country: Country, parent_base_id: int, flight: Flight):
|
||||
@@ -335,6 +338,11 @@ class NameGenerator:
|
||||
cls.convoy_number += 1
|
||||
return f"Convoy {cls.convoy_number:03}"
|
||||
|
||||
@classmethod
|
||||
def next_cargo_ship_name(cls) -> str:
|
||||
cls.cargo_ship_number += 1
|
||||
return f"Cargo Ship {cls.cargo_ship_number:03}"
|
||||
|
||||
@classmethod
|
||||
def random_objective_name(cls):
|
||||
if len(cls.ANIMALS) == 0:
|
||||
|
||||
Reference in New Issue
Block a user