mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Update SA-5 Generator for factions without the TinShield
- added an EarlySA5Generator with the P-19 FlatFace SR which is supported by all factions
- allows factions without access to the TinShield to have a working SA-5
cherry-pick from f526681f
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
from typing import Type
|
||||
|
||||
from dcs.unittype import VehicleType
|
||||
from dcs.vehicles import AirDefence, Unarmed
|
||||
|
||||
from game import Game
|
||||
from game.theater import SamGroundObject
|
||||
from gen.sam.airdefensegroupgenerator import (
|
||||
AirDefenseRange,
|
||||
AirDefenseGroupGenerator,
|
||||
@@ -8,15 +13,18 @@ from gen.sam.airdefensegroupgenerator import (
|
||||
|
||||
class SA5Generator(AirDefenseGroupGenerator):
|
||||
"""
|
||||
This generate a SA-5 group
|
||||
This generate a SA-5 group using the TinShield SR
|
||||
"""
|
||||
|
||||
name = "SA-5/S-200 Site"
|
||||
|
||||
def generate(self) -> None:
|
||||
def __init__(self, game: Game, ground_object: SamGroundObject):
|
||||
super().__init__(game, ground_object)
|
||||
self.sr: Type[VehicleType] = AirDefence.RLS_19J6
|
||||
|
||||
def generate(self) -> None:
|
||||
self.add_unit(
|
||||
AirDefence.RLS_19J6,
|
||||
self.sr,
|
||||
"SR",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
@@ -54,3 +62,14 @@ class SA5Generator(AirDefenseGroupGenerator):
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
return AirDefenseRange.Long
|
||||
|
||||
|
||||
# TODO Replace this legacy handling once the Generators can be faction sensitive #1903
|
||||
class SA5FlatFaceGenerator(SA5Generator):
|
||||
"""
|
||||
This generate a SA-5 group using the P-19 FlatFace SR
|
||||
"""
|
||||
|
||||
def __init__(self, game: Game, ground_object: SamGroundObject):
|
||||
super().__init__(game, ground_object)
|
||||
self.sr: Type[VehicleType] = AirDefence.P_19_s_125_sr
|
||||
|
||||
Reference in New Issue
Block a user