number of fixes and improvements to mission generation & debriefings

This commit is contained in:
Vasyl Horbachenko
2018-06-15 04:34:38 +03:00
parent a4dfde157d
commit d78b2dd238
12 changed files with 175 additions and 74 deletions

View File

@@ -8,6 +8,7 @@ from dcs.mission import *
DISTANCE_FACTOR = 4, 5
EXTRA_AA_MIN_DISTANCE = 70000
EXTRA_AA_POSITION_FROM_CP = 10000
class AAConflictGenerator:
def __init__(self, mission: Mission, conflict: Conflict):
@@ -37,18 +38,21 @@ class ExtraAAConflictGenerator:
self.enemy_name = enemy_name
def generate(self):
from theater.conflicttheater import ControlPoint
for cp in self.game.theater.controlpoints:
if cp.is_global:
continue
if cp.position.distance_to_point(self.conflict.position) > EXTRA_AA_MIN_DISTANCE:
country_name = cp.captured and self.player_name or self.enemy_name
position = cp.position.point_from_heading(0, EXTRA_AA_POSITION_FROM_CP)
self.mission.vehicle_group(
country=self.mission.country(country_name),
name=namegen.next_ground_group_name(),
_type=random.choice(db.find_unittype(AirDefence, country_name)),
position=cp.position,
position=position,
group_size=2
)