mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fixed issue with lost helicopters causing errors in debriefing.
Mission generated now configure bluefor and redfor coalition properly, so it is possible to use country that are not in the default coalitions. Added insurgent faction.
This commit is contained in:
25
gen/sam/aaa_zu23_insurgent.py
Normal file
25
gen/sam/aaa_zu23_insurgent.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import random
|
||||
|
||||
from dcs.vehicles import AirDefence
|
||||
|
||||
from gen.sam.group_generator import AntiAirGroupGenerator
|
||||
|
||||
|
||||
class ZU23InsurgentGenerator(AntiAirGroupGenerator):
|
||||
"""
|
||||
This generate a ZU23 insurgent flak artillery group
|
||||
"""
|
||||
|
||||
def generate(self):
|
||||
grid_x = random.randint(2, 4)
|
||||
grid_y = random.randint(2, 4)
|
||||
|
||||
spacing = random.randint(10,40)
|
||||
|
||||
index = 0
|
||||
for i in range(grid_x):
|
||||
for j in range(grid_y):
|
||||
index = index+1
|
||||
self.add_unit(AirDefence.AAA_ZU_23_Insurgent_Closed, "AAA#" + str(index),
|
||||
self.position.x + spacing*i,
|
||||
self.position.y + spacing*j, self.heading)
|
||||
@@ -10,6 +10,7 @@ from dcs.vehicles import AirDefence
|
||||
from game import db
|
||||
from gen.sam.aaa_bofors import BoforsGenerator
|
||||
from gen.sam.aaa_flak36 import Flak36Generator
|
||||
from gen.sam.aaa_zu23_insurgent import ZU23InsurgentGenerator
|
||||
from gen.sam.sam_avenger import AvengerGenerator
|
||||
from gen.sam.sam_chaparral import ChaparralGenerator
|
||||
from gen.sam.sam_gepard import GepardGenerator
|
||||
@@ -33,6 +34,7 @@ from gen.sam.sam_vulcan import VulcanGenerator
|
||||
from gen.sam.sam_zsu23 import ZSU23Generator
|
||||
from gen.sam.sam_zu23 import ZU23Generator
|
||||
from gen.sam.sam_zu23_ural import ZU23UralGenerator
|
||||
from gen.sam.sam_zu23_ural_insurgent import ZU23UralInsurgentGenerator
|
||||
|
||||
|
||||
def generate_anti_air_group(game, parent_cp, ground_object, faction:str):
|
||||
@@ -47,9 +49,12 @@ def generate_anti_air_group(game, parent_cp, ground_object, faction:str):
|
||||
SAM_MAP = {
|
||||
|
||||
AirDefence.SAM_Hawk_PCP:HawkGenerator,
|
||||
AirDefence.AAA_ZU_23_Emplacement: ZU23Generator,
|
||||
AirDefence.AAA_ZU_23_Closed:ZU23Generator,
|
||||
AirDefence.AAA_ZU_23_on_Ural_375: ZU23UralGenerator,
|
||||
AirDefence.AAA_ZU_23_Insurgent_on_Ural_375:ZU23UralGenerator,
|
||||
AirDefence.AAA_ZU_23_Insurgent_on_Ural_375:ZU23UralInsurgentGenerator,
|
||||
AirDefence.AAA_ZU_23_Insurgent_Closed: ZU23InsurgentGenerator,
|
||||
AirDefence.AAA_ZU_23_Insurgent: ZU23InsurgentGenerator,
|
||||
AirDefence.SPAAA_ZSU_23_4_Shilka:ZSU23Generator,
|
||||
AirDefence.AAA_Vulcan_M163: VulcanGenerator,
|
||||
AirDefence.SAM_Linebacker_M6: LinebackerGenerator,
|
||||
|
||||
18
gen/sam/sam_zu23_ural_insurgent.py
Normal file
18
gen/sam/sam_zu23_ural_insurgent.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import random
|
||||
|
||||
from dcs.vehicles import AirDefence
|
||||
|
||||
from gen.sam.group_generator import AntiAirGroupGenerator
|
||||
|
||||
|
||||
class ZU23UralInsurgentGenerator(AntiAirGroupGenerator):
|
||||
"""
|
||||
This generate a Zu23 Ural group
|
||||
"""
|
||||
|
||||
def generate(self):
|
||||
num_launchers = random.randint(2, 8)
|
||||
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=80, coverage=360)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.AAA_ZU_23_Insurgent_on_Ural_375, "SPAA#" + str(i), position[0], position[1], position[2])
|
||||
Reference in New Issue
Block a user