mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
There are some TODOs here but th behavior is flagged off by default. The biggest TODO here is that the time spent frozen is not simulated, so flights that are engaged by SAMs will unfreeze, move slightly, then re- freeze. https://github.com/dcs-liberation/dcs_liberation/issues/1680
34 lines
904 B
Python
34 lines
904 B
Python
from __future__ import annotations
|
|
|
|
import logging
|
|
from collections.abc import Iterator
|
|
from datetime import timedelta
|
|
from typing import TYPE_CHECKING
|
|
|
|
from .frozencombat import FrozenCombat
|
|
|
|
if TYPE_CHECKING:
|
|
from game.ato import Flight
|
|
from ..simulationresults import SimulationResults
|
|
|
|
|
|
class AtIp(FrozenCombat):
|
|
def __init__(self, freeze_duration: timedelta, flight: Flight) -> None:
|
|
super().__init__(freeze_duration)
|
|
self.flight = flight
|
|
|
|
def because(self) -> str:
|
|
return f"{self.flight} is at its IP"
|
|
|
|
def describe(self) -> str:
|
|
return f"at IP"
|
|
|
|
def iter_flights(self) -> Iterator[Flight]:
|
|
yield self.flight
|
|
|
|
def resolve(self, results: SimulationResults) -> None:
|
|
logging.debug(
|
|
f"{self.flight} attack on {self.flight.package.target} auto-resolved with "
|
|
"mission failure but no losses"
|
|
)
|