fixed incompatible missions being available from carriers

This commit is contained in:
Vasyl Horbachenko
2018-11-06 02:59:24 +02:00
parent e1d50f1f27
commit 7842c69ebb
13 changed files with 69 additions and 9 deletions

View File

@@ -28,6 +28,10 @@ class ConvoyStrikeEvent(Event):
def tasks(self):
return [CAS]
@property
def global_cp_available(self) -> bool:
return True
def flight_name(self, for_task: typing.Type[Task]) -> str:
if for_task == CAS:
return "Strike flight"

View File

@@ -70,6 +70,10 @@ class Event:
def ai_banned_tasks(self) -> typing.Collection[typing.Type[Task]]:
return []
@property
def global_cp_available(self) -> bool:
return False
def bonus(self) -> int:
return int(math.log(self.to_cp.importance + 1, DIFFICULTY_LOG_BASE) * self.BONUS_BASE)

View File

@@ -22,6 +22,10 @@ class FrontlineAttackEvent(Event):
else:
return [CAP]
@property
def global_cp_available(self) -> bool:
return True
def flight_name(self, for_task: typing.Type[Task]) -> str:
if for_task == CAS:
return "CAS flight"

View File

@@ -37,6 +37,10 @@ class InterceptEvent(Event):
def threat_description(self):
return "{} aircraft".format(self.enemy_cp.base.scramble_count(self._enemy_scramble_multiplier(), CAP))
@property
def global_cp_available(self) -> bool:
return True
def is_successfull(self, debriefing: Debriefing):
units_destroyed = debriefing.destroyed_units[self.defender_name].get(self.transport_unit, 0)
if self.departure_cp.captured:

View File

@@ -42,6 +42,10 @@ class NavalInterceptEvent(Event):
s += ", {} aircraft".format(self.departure_cp.base.scramble_count(self.game.settings.multiplier))
return s
@property
def global_cp_available(self) -> bool:
return True
def is_successfull(self, debriefing: Debriefing):
total_targets = sum(self.targets.values())
destroyed_targets = 0

View File

@@ -28,6 +28,10 @@ class StrikeEvent(Event):
def ai_banned_tasks(self):
return [CAS]
@property
def global_cp_available(self) -> bool:
return True
def flight_name(self, for_task: typing.Type[Task]) -> str:
if for_task == CAP:
if self.is_player_attacking: