fixes for selectable departure; generate statics for used units; raised RTB alt

This commit is contained in:
Vasyl Horbachenko
2018-11-05 03:17:06 +02:00
parent 355cd3e0e4
commit 9d0997624b
17 changed files with 57 additions and 26 deletions

View File

@@ -235,7 +235,6 @@ SAM_BAN = [
Units that will always be spawned in the air
"""
TAKEOFF_BAN = [
AV8BNA, # AI takeoff currently bugged attempting VTOL with no regards for the total weight
]
"""

View File

@@ -61,7 +61,8 @@ class BaseAttackEvent(Event):
op = BaseAttackOperation(game=self.game,
attacker_name=self.attacker_name,
defender_name=self.defender_name,
from_cp=self.departure_cp,
from_cp=self.from_cp,
departure_cp=self.departure_cp,
to_cp=self.to_cp)
op.setup(cas=assigned_units_from(cas),
@@ -79,7 +80,8 @@ class BaseAttackEvent(Event):
op = BaseAttackOperation(game=self.game,
attacker_name=self.attacker_name,
defender_name=self.defender_name,
from_cp=self.departure_cp,
from_cp=self.from_cp,
departure_cp=self.departure_cp,
to_cp=self.to_cp)
defenders = self.to_cp.base.scramble_sweep(self.game.settings.multiplier)

View File

@@ -68,6 +68,7 @@ class FrontlineAttackEvent(Event):
attacker_name=self.attacker_name,
defender_name=self.defender_name,
from_cp=self.from_cp,
departure_cp=self.departure_cp,
to_cp=self.to_cp)
defenders = self.to_cp.base.assemble_attack()

View File

@@ -64,6 +64,7 @@ class FrontlinePatrolEvent(Event):
attacker_name=self.attacker_name,
defender_name=self.defender_name,
from_cp=self.from_cp,
departure_cp=self.departure_cp,
to_cp=self.to_cp)
defenders = self.to_cp.base.assemble_attack()

View File

@@ -44,7 +44,8 @@ class InfantryTransportEvent(Event):
game=self.game,
attacker_name=self.attacker_name,
defender_name=self.defender_name,
from_cp=self.departure_cp,
from_cp=self.from_cp,
departure_cp=self.departure_cp,
to_cp=self.to_cp
)

View File

@@ -56,7 +56,8 @@ class InsurgentAttackEvent(Event):
op = InsurgentAttackOperation(game=self.game,
attacker_name=self.attacker_name,
defender_name=self.defender_name,
from_cp=self.departure_cp,
from_cp=self.from_cp,
departure_cp=self.departure_cp,
to_cp=self.to_cp)
op.setup(target=self.targets,
strikegroup=flights[CAS])

View File

@@ -76,7 +76,8 @@ class InterceptEvent(Event):
op = InterceptOperation(game=self.game,
attacker_name=self.attacker_name,
defender_name=self.defender_name,
from_cp=self.departure_cp,
from_cp=self.from_cp,
departure_cp=self.departure_cp,
to_cp=self.to_cp)
op.setup(location=self.location,
@@ -98,7 +99,8 @@ class InterceptEvent(Event):
op = InterceptOperation(game=self.game,
attacker_name=self.attacker_name,
defender_name=self.defender_name,
from_cp=self.departure_cp,
from_cp=self.from_cp,
departure_cp=self.departure_cp,
to_cp=self.to_cp)
op.setup(escort=flights[CAP],

View File

@@ -84,7 +84,8 @@ class NavalInterceptEvent(Event):
self.game,
attacker_name=self.attacker_name,
defender_name=self.defender_name,
from_cp=self.departure_cp,
from_cp=self.from_cp,
departure_cp=self.departure_cp,
to_cp=self.to_cp
)
@@ -106,7 +107,8 @@ class NavalInterceptEvent(Event):
self.game,
attacker_name=self.attacker_name,
defender_name=self.defender_name,
from_cp=self.departure_cp,
from_cp=self.from_cp,
departure_cp=self.departure_cp,
to_cp=self.to_cp
)

View File

@@ -49,7 +49,8 @@ class StrikeEvent(Event):
self.game,
attacker_name=self.attacker_name,
defender_name=self.defender_name,
from_cp=self.departure_cp,
from_cp=self.from_cp,
departure_cp=self.departure_cp,
to_cp=self.to_cp
)

View File

@@ -39,11 +39,13 @@ class Operation:
attacker_name: str,
defender_name: str,
from_cp: ControlPoint,
departure_cp: ControlPoint,
to_cp: ControlPoint = None):
self.game = game
self.attacker_name = attacker_name
self.defender_name = defender_name
self.from_cp = from_cp
self.departure_cp = departure_cp
self.to_cp = to_cp
self.is_quick = False
@@ -89,7 +91,7 @@ class Operation:
self.attackers_starting_position = None
self.defenders_starting_position = None
else:
self.attackers_starting_position = self.from_cp.at
self.attackers_starting_position = self.departure_cp.at
self.defenders_starting_position = self.to_cp.at
def prepare_carriers(self, for_units: db.UnitsDict):
@@ -101,12 +103,10 @@ class Operation:
country=self.game.player,
at=global_cp.at)
if global_cp == self.from_cp and not self.is_quick:
if global_cp == self.departure_cp and not self.is_quick:
self.attackers_starting_position = ship
def generate(self):
self.visualgen.generate()
# air support
self.airsupportgen.generate(self.is_awacs_enabled)
for i, tanker_type in enumerate(self.airsupportgen.generated_tankers):
@@ -143,12 +143,17 @@ class Operation:
else:
self.envgen.load(self.environment_settings)
# options
self.forcedoptionsgen.generate()
# main frequencies
self.briefinggen.append_frequency("Flight", "251 MHz AM")
if self.conflict.from_cp.is_global or self.conflict.to_cp.is_global:
if self.departure_cp.is_global or self.conflict.to_cp.is_global:
self.briefinggen.append_frequency("Carrier", "20X/ICLS CHAN1")
# briefing
self.briefinggen.generate()
# visuals
self.visualgen.generate()