dcs-retribution/game/sim/simulationresults.py
Dan Albert 2585dcc130 Add (very!) rough simulation of frozen combat.
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
2022-02-26 13:01:46 -08:00

24 lines
770 B
Python

from __future__ import annotations
from dataclasses import dataclass, field
from typing import TYPE_CHECKING
from game.unitmap import FlyingUnit
if TYPE_CHECKING:
from game.ato import Flight
from game.squadrons import Pilot
# TODO: Serialize for bug reproducibility.
# Any bugs filed that can only be reproduced with auto-resolved combat results will not
# be reproducible since we cannot replay the auto-resolution that the player saw. We
# need to be able to serialize this data so bug repro can include the auto-resolved
# results.
@dataclass
class SimulationResults:
air_losses: list[FlyingUnit] = field(default_factory=list)
def kill_pilot(self, flight: Flight, pilot: Pilot) -> None:
self.air_losses.append(FlyingUnit(flight, pilot))