mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
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:
@@ -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,)
|
||||
|
||||
Reference in New Issue
Block a user