mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Pretense zone radius (radii) for FOBs with FARPs will now be dynamically adjusted. Increased the size of Pretense zones at Damascus, Khalkhalah and Krasnodar-Pashkovsky (which are quite spread out) so the zone would encompass the entire airfield.
This commit is contained in:
parent
49ba40aaf3
commit
969f0e26c7
@ -24,6 +24,8 @@ from dcs.condition import (
|
|||||||
)
|
)
|
||||||
from dcs.mission import Mission
|
from dcs.mission import Mission
|
||||||
from dcs.task import Option
|
from dcs.task import Option
|
||||||
|
from dcs.terrain.caucasus.airports import Krasnodar_Pashkovsky
|
||||||
|
from dcs.terrain.syria.airports import Damascus, Khalkhalah
|
||||||
from dcs.translation import String
|
from dcs.translation import String
|
||||||
from dcs.triggers import Event, TriggerCondition, TriggerOnce
|
from dcs.triggers import Event, TriggerCondition, TriggerOnce
|
||||||
from dcs.unit import Skill
|
from dcs.unit import Skill
|
||||||
@ -53,6 +55,7 @@ TRIGGER_RADIUS_CLEAR_SCENERY = 1000
|
|||||||
TRIGGER_RADIUS_PRETENSE_TGO = 500
|
TRIGGER_RADIUS_PRETENSE_TGO = 500
|
||||||
TRIGGER_RADIUS_PRETENSE_SUPPLY = 500
|
TRIGGER_RADIUS_PRETENSE_SUPPLY = 500
|
||||||
TRIGGER_RADIUS_PRETENSE_HELI = 1000
|
TRIGGER_RADIUS_PRETENSE_HELI = 1000
|
||||||
|
TRIGGER_RADIUS_PRETENSE_HELI_BUFFER = 500
|
||||||
TRIGGER_RADIUS_PRETENSE_CARRIER = 50000
|
TRIGGER_RADIUS_PRETENSE_CARRIER = 50000
|
||||||
TRIGGER_RUNWAY_LENGTH_PRETENSE = 2500
|
TRIGGER_RUNWAY_LENGTH_PRETENSE = 2500
|
||||||
TRIGGER_RUNWAY_WIDTH_PRETENSE = 400
|
TRIGGER_RUNWAY_WIDTH_PRETENSE = 400
|
||||||
@ -224,19 +227,42 @@ class PretenseTriggerGenerator:
|
|||||||
"""
|
"""
|
||||||
for cp in self.game.theater.controlpoints:
|
for cp in self.game.theater.controlpoints:
|
||||||
if cp.is_fleet:
|
if cp.is_fleet:
|
||||||
trigger_radius = TRIGGER_RADIUS_PRETENSE_CARRIER
|
trigger_radius = float(TRIGGER_RADIUS_PRETENSE_CARRIER)
|
||||||
|
elif isinstance(cp, Fob) and cp.has_helipads:
|
||||||
|
trigger_radius = TRIGGER_RADIUS_PRETENSE_HELI
|
||||||
|
for helipad in list(
|
||||||
|
cp.helipads + cp.helipads_quad + cp.helipads_invisible
|
||||||
|
):
|
||||||
|
if cp.position.distance_to_point(helipad) > trigger_radius:
|
||||||
|
trigger_radius = cp.position.distance_to_point(helipad)
|
||||||
|
for ground_spawn, ground_spawn_wp in list(
|
||||||
|
cp.ground_spawns + cp.ground_spawns_roadbase
|
||||||
|
):
|
||||||
|
if cp.position.distance_to_point(ground_spawn) > trigger_radius:
|
||||||
|
trigger_radius = cp.position.distance_to_point(ground_spawn)
|
||||||
|
trigger_radius += TRIGGER_RADIUS_PRETENSE_HELI_BUFFER
|
||||||
|
else:
|
||||||
|
if cp.dcs_airport is not None and (
|
||||||
|
isinstance(cp.dcs_airport, Damascus)
|
||||||
|
or isinstance(cp.dcs_airport, Khalkhalah)
|
||||||
|
or isinstance(cp.dcs_airport, Krasnodar_Pashkovsky)
|
||||||
|
):
|
||||||
|
trigger_radius = int(TRIGGER_RADIUS_CAPTURE * 1.8)
|
||||||
else:
|
else:
|
||||||
trigger_radius = TRIGGER_RADIUS_CAPTURE
|
trigger_radius = TRIGGER_RADIUS_CAPTURE
|
||||||
|
cp_name = "".join(
|
||||||
|
[i for i in cp.name if i.isalnum() or i.isspace() or i == "-"]
|
||||||
|
)
|
||||||
if not isinstance(cp, OffMapSpawn):
|
if not isinstance(cp, OffMapSpawn):
|
||||||
zone_color = {1: 0.0, 2: 0.0, 3: 0.0, 4: 0.15}
|
zone_color = {1: 0.0, 2: 0.0, 3: 0.0, 4: 0.15}
|
||||||
self.mission.triggers.add_triggerzone(
|
self.mission.triggers.add_triggerzone(
|
||||||
cp.position,
|
cp.position,
|
||||||
radius=trigger_radius,
|
radius=trigger_radius,
|
||||||
hidden=False,
|
hidden=False,
|
||||||
name=cp.name,
|
name=cp_name,
|
||||||
color=zone_color,
|
color=zone_color,
|
||||||
)
|
)
|
||||||
cp_name_trimmed = "".join([i for i in cp.name.lower() if i.isalnum()])
|
cp_name_trimmed = "".join([i for i in cp.name.lower() if i.isalpha()])
|
||||||
tgo_num = 0
|
tgo_num = 0
|
||||||
for tgo in cp.ground_objects:
|
for tgo in cp.ground_objects:
|
||||||
if cp.is_fleet or tgo.sea_object:
|
if cp.is_fleet or tgo.sea_object:
|
||||||
@ -285,7 +311,7 @@ class PretenseTriggerGenerator:
|
|||||||
if cp_airport is None:
|
if cp_airport is None:
|
||||||
continue
|
continue
|
||||||
cp_name_trimmed = "".join(
|
cp_name_trimmed = "".join(
|
||||||
[i for i in cp_airport.name.lower() if i.isalnum()]
|
[i for i in cp_airport.name.lower() if i.isalpha()]
|
||||||
)
|
)
|
||||||
zone_color = {1: 0.0, 2: 1.0, 3: 0.5, 4: 0.15}
|
zone_color = {1: 0.0, 2: 1.0, 3: 0.5, 4: 0.15}
|
||||||
if cp_airport is None:
|
if cp_airport is None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user