Change Operation to a static class

Removed always True "event successful"

Add `AirWarEvent` as the primary game `Event` applied to every miz

Cleanup of `FrontLineAttackEvent`

Change `Operation.is_awacs_enabled` to two bools for each side red/blue
Currently controlled by whether an AWACs is available for the faction
(and only ever true for Blue)
This commit is contained in:
walterroach
2020-11-23 16:46:05 -06:00
parent 63bdbebcaa
commit da17d1e5d1
8 changed files with 182 additions and 206 deletions

View File

@@ -1,42 +1,11 @@
from typing import List, Type
from dcs.task import CAP, CAS, Task
from game.operation.operation import Operation
from ..debriefing import Debriefing
from .event import Event
class FrontlineAttackEvent(Event):
@property
def tasks(self) -> List[Type[Task]]:
if self.is_player_attacking:
return [CAS, CAP]
else:
return [CAP]
@property
def global_cp_available(self) -> bool:
return True
"""
An event centered on a FrontLine Conflict.
Currently the same as its parent, but here for legacy compatibility as well as to allow for
future unique Event handling
"""
def __str__(self):
return "Frontline attack"
def is_successful(self, debriefing: Debriefing):
attackers_success = True
if self.from_cp.captured:
return attackers_success
else:
return not attackers_success
def commit(self, debriefing: Debriefing):
super(FrontlineAttackEvent, self).commit(debriefing)
def skip(self):
if self.to_cp.captured:
self.to_cp.base.affect_strength(-0.1)
def player_attacking(self):
assert self.departure_cp is not None
self.operation = Operation(departure_cp=self.departure_cp,)