mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Missile sites now fire at random times
This commit is contained in:
parent
e41c923ad4
commit
5fc967cfd2
@ -35,6 +35,8 @@ from dcs.task import (
|
|||||||
ActivateICLSCommand,
|
ActivateICLSCommand,
|
||||||
ActivateLink4Command,
|
ActivateLink4Command,
|
||||||
ActivateACLSCommand,
|
ActivateACLSCommand,
|
||||||
|
ControlledTask,
|
||||||
|
Hold,
|
||||||
EPLRS,
|
EPLRS,
|
||||||
FireAtPoint,
|
FireAtPoint,
|
||||||
OptAlarmState,
|
OptAlarmState,
|
||||||
@ -488,7 +490,6 @@ class MissileSiteGenerator(GroundObjectGenerator):
|
|||||||
|
|
||||||
# Note : Only the SCUD missiles group can fire (V1 site cannot fire in game right now)
|
# Note : Only the SCUD missiles group can fire (V1 site cannot fire in game right now)
|
||||||
# TODO : Should be pre-planned ?
|
# TODO : Should be pre-planned ?
|
||||||
# TODO : Add delay to task to spread fire task over mission duration ?
|
|
||||||
for group in self.ground_object.groups:
|
for group in self.ground_object.groups:
|
||||||
vg = self.m.find_group(group.group_name)
|
vg = self.m.find_group(group.group_name)
|
||||||
if vg is not None:
|
if vg is not None:
|
||||||
@ -498,6 +499,14 @@ class MissileSiteGenerator(GroundObjectGenerator):
|
|||||||
real_target = target.point_from_heading(
|
real_target = target.point_from_heading(
|
||||||
Heading.random().degrees, random.randint(0, 2500)
|
Heading.random().degrees, random.randint(0, 2500)
|
||||||
)
|
)
|
||||||
|
hold = ControlledTask(Hold())
|
||||||
|
hold.stop_after_duration(
|
||||||
|
random.randint(
|
||||||
|
60,
|
||||||
|
self.game.settings.desired_player_mission_duration.total_seconds(),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
vg.points[0].add_task(hold)
|
||||||
vg.points[0].add_task(FireAtPoint(real_target))
|
vg.points[0].add_task(FireAtPoint(real_target))
|
||||||
logging.info("Set up fire task for missile group.")
|
logging.info("Set up fire task for missile group.")
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user