mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Added SAM HQ-7, tweaks in db
This commit is contained in:
@@ -299,9 +299,9 @@ class AircraftConflictGenerator:
|
||||
def generate_patrol_group(self, cp: ControlPoint, country):
|
||||
|
||||
aircraft = dict({k:v for k,v in cp.base.aircraft.items() if k in [u for u in db.UNIT_BY_TASK[CAP]]})
|
||||
delta = random.randint(10, 20)
|
||||
delta = random.randint(1, 20)
|
||||
|
||||
for i in range(12):
|
||||
for i in range(8):
|
||||
if(len(aircraft.keys())) > 0:
|
||||
print(aircraft.keys())
|
||||
type = random.choice(list(aircraft.keys()))
|
||||
@@ -320,7 +320,7 @@ class AircraftConflictGenerator:
|
||||
client_count=0,
|
||||
airport=self.m.terrain.airport_by_id(cp.at.id),
|
||||
start_type=StartType.Runway)
|
||||
except RunwayOccupiedError:
|
||||
except Exception:
|
||||
group = self._generate_group(
|
||||
name=namegen.next_unit_name(country, type),
|
||||
side=country,
|
||||
@@ -329,11 +329,13 @@ class AircraftConflictGenerator:
|
||||
client_count=0,
|
||||
at=cp.position)
|
||||
|
||||
patrol_alt = random.randint(3600, 7000)
|
||||
self._setup_group(group, CAP, 0)
|
||||
|
||||
patrol_alt = random.randint(3600, 7000)
|
||||
group.points[0].alt = patrol_alt
|
||||
group.points[0].ETA = delta*60 + i*10*60
|
||||
|
||||
|
||||
patrolled = []
|
||||
for ground_object in cp.ground_objects:
|
||||
if not ground_object.group_id in patrolled:
|
||||
|
||||
@@ -12,6 +12,7 @@ from gen.sam.sam_avenger import AvengerGenerator
|
||||
from gen.sam.sam_chaparral import ChaparralGenerator
|
||||
from gen.sam.sam_gepard import GepardGenerator
|
||||
from gen.sam.sam_hawk import HawkGenerator
|
||||
from gen.sam.sam_hq7 import HQ7Generator
|
||||
from gen.sam.sam_linebacker import LinebackerGenerator
|
||||
from gen.sam.sam_patriot import PatriotGenerator
|
||||
from gen.sam.sam_rapier import RapierGenerator
|
||||
@@ -68,6 +69,7 @@ def generate_anti_air_group(game, parent_cp, ground_object, faction:str):
|
||||
AirDefence.SAM_SA_13_Strela_10M3_9A35M3: SA13Generator,
|
||||
AirDefence.SAM_SA_15_Tor_9A331: SA15Generator,
|
||||
AirDefence.SAM_SA_19_Tunguska_2S6: SA19Generator,
|
||||
AirDefence.HQ_7_Self_Propelled_LN: HQ7Generator
|
||||
}
|
||||
|
||||
possible_sams = [u for u in db.FACTIONS[faction]["units"] if u in AirDefence.__dict__.values()]
|
||||
|
||||
25
gen/sam/sam_hq7.py
Normal file
25
gen/sam/sam_hq7.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import random
|
||||
|
||||
from dcs.vehicles import AirDefence
|
||||
|
||||
from gen.sam.group_generator import AntiAirGroupGenerator
|
||||
|
||||
|
||||
class HQ7Generator(AntiAirGroupGenerator):
|
||||
"""
|
||||
This generate an HQ7 group
|
||||
"""
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(AirDefence.HQ_7_Self_Propelled_STR, "STR", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(AirDefence.HQ_7_Self_Propelled_LN, "LN", self.position.x + 20, self.position.y, self.heading)
|
||||
|
||||
# Triple A for close range defense
|
||||
self.add_unit(AirDefence.AAA_ZU_23_on_Ural_375, "AAA", self.position.x + 20, self.position.y+30, self.heading)
|
||||
self.add_unit(AirDefence.AAA_ZU_23_on_Ural_375, "AAA", self.position.x - 20, self.position.y-30, self.heading)
|
||||
|
||||
num_launchers = random.randint(0, 3)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=120, coverage=360)
|
||||
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.HQ_7_Self_Propelled_LN, "LN#" + str(i), position[0], position[1], position[2])
|
||||
Reference in New Issue
Block a user