mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
weather min cloud base; minor updates
This commit is contained in:
parent
73cf5c635f
commit
1a491bb814
@ -6,6 +6,7 @@ from dcs.vehicles import *
|
|||||||
|
|
||||||
from game import db
|
from game import db
|
||||||
from game.operation.intercept import InterceptOperation
|
from game.operation.intercept import InterceptOperation
|
||||||
|
from theater.conflicttheater import *
|
||||||
from userdata.debriefing import Debriefing
|
from userdata.debriefing import Debriefing
|
||||||
|
|
||||||
from .event import Event
|
from .event import Event
|
||||||
@ -38,7 +39,8 @@ class InterceptEvent(Event):
|
|||||||
|
|
||||||
if self.attacker_name == self.game.player:
|
if self.attacker_name == self.game.player:
|
||||||
if self.is_successfull(debriefing):
|
if self.is_successfull(debriefing):
|
||||||
self.to_cp.base.affect_strength(-self.STRENGTH_INFLUENCE)
|
for _, cp in self.game.theater.conflicts(True):
|
||||||
|
cp.base.affect_strength(-self.STRENGTH_INFLUENCE)
|
||||||
else:
|
else:
|
||||||
self.from_cp.base.affect_strength(-self.STRENGTH_INFLUENCE)
|
self.from_cp.base.affect_strength(-self.STRENGTH_INFLUENCE)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -3,3 +3,4 @@ class Settings:
|
|||||||
player_skill = "Good"
|
player_skill = "Good"
|
||||||
enemy_skill = "Average"
|
enemy_skill = "Average"
|
||||||
only_player_takeoff = False
|
only_player_takeoff = False
|
||||||
|
night_disabled = False
|
||||||
|
|||||||
@ -22,6 +22,8 @@ PUSH_TRIGGER_SIZE = 3000
|
|||||||
REGROUP_ZONE_DISTANCE = 12000
|
REGROUP_ZONE_DISTANCE = 12000
|
||||||
REGROUP_ALT = 5000
|
REGROUP_ALT = 5000
|
||||||
|
|
||||||
|
CLOUDS_BASE_MIN = 4000
|
||||||
|
|
||||||
RANDOM_TIME = {
|
RANDOM_TIME = {
|
||||||
"night": 5,
|
"night": 5,
|
||||||
"dusk": 30,
|
"dusk": 30,
|
||||||
@ -46,6 +48,9 @@ class SettingsGenerator:
|
|||||||
start_time = datetime.combine(datetime.today(), time())
|
start_time = datetime.combine(datetime.today(), time())
|
||||||
time_range = None
|
time_range = None
|
||||||
for k, v in RANDOM_TIME.items():
|
for k, v in RANDOM_TIME.items():
|
||||||
|
if self.game.settings.night_disabled and k == "night":
|
||||||
|
continue
|
||||||
|
|
||||||
if random.randint(0, 100) <= v:
|
if random.randint(0, 100) <= v:
|
||||||
time_range = self.game.theater.daytime_map[k]
|
time_range = self.game.theater.daytime_map[k]
|
||||||
break
|
break
|
||||||
@ -71,6 +76,9 @@ class SettingsGenerator:
|
|||||||
elif weather_type == 3:
|
elif weather_type == 3:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
if self.mission.weather.clouds_density > 0:
|
||||||
|
self.mission.weather.clouds_base = max(self.mission.weather.clouds_base, CLOUDS_BASE_MIN)
|
||||||
|
|
||||||
def _gen_activation_trigger(self, player_coalition: str, enemy_coalition: str):
|
def _gen_activation_trigger(self, player_coalition: str, enemy_coalition: str):
|
||||||
activate_by_trigger = []
|
activate_by_trigger = []
|
||||||
for coalition_name, coalition in self.mission.coalition.items():
|
for coalition_name, coalition in self.mission.coalition.items():
|
||||||
@ -101,6 +109,8 @@ class SettingsGenerator:
|
|||||||
for country in coalition.countries.values():
|
for country in coalition.countries.values():
|
||||||
if coalition_name == player_coalition:
|
if coalition_name == player_coalition:
|
||||||
for plane_group in country.plane_group:
|
for plane_group in country.plane_group:
|
||||||
|
if plane_group.task == AWACS.name:
|
||||||
|
continue
|
||||||
regroup_heading = self.conflict.to_cp.position.heading_between_point(self.conflict.from_cp.position)
|
regroup_heading = self.conflict.to_cp.position.heading_between_point(self.conflict.from_cp.position)
|
||||||
|
|
||||||
pos1 = plane_group.position.point_from_heading(regroup_heading, REGROUP_ZONE_DISTANCE)
|
pos1 = plane_group.position.point_from_heading(regroup_heading, REGROUP_ZONE_DISTANCE)
|
||||||
|
|||||||
@ -17,10 +17,14 @@ class ConfigurationMenu(Menu):
|
|||||||
self.takeoff_var = BooleanVar()
|
self.takeoff_var = BooleanVar()
|
||||||
self.takeoff_var.set(self.game.settings.only_player_takeoff)
|
self.takeoff_var.set(self.game.settings.only_player_takeoff)
|
||||||
|
|
||||||
|
self.night_var = BooleanVar()
|
||||||
|
self.night_var.set(self.game.settings.night_disabled)
|
||||||
|
|
||||||
def dismiss(self):
|
def dismiss(self):
|
||||||
self.game.settings.player_skill = self.player_skill_var.get()
|
self.game.settings.player_skill = self.player_skill_var.get()
|
||||||
self.game.settings.enemy_skill = self.enemy_skill_var.get()
|
self.game.settings.enemy_skill = self.enemy_skill_var.get()
|
||||||
self.game.settings.only_player_takeoff = self.takeoff_var.get()
|
self.game.settings.only_player_takeoff = self.takeoff_var.get()
|
||||||
|
self.game.settings.night_disabled = self.night_var.get()
|
||||||
super(ConfigurationMenu, self).dismiss()
|
super(ConfigurationMenu, self).dismiss()
|
||||||
|
|
||||||
def display(self):
|
def display(self):
|
||||||
@ -33,9 +37,10 @@ class ConfigurationMenu(Menu):
|
|||||||
OptionMenu(self.frame, self.enemy_skill_var, "Average", "Good", "High", "Excellent").grid(row=1, column=1)
|
OptionMenu(self.frame, self.enemy_skill_var, "Average", "Good", "High", "Excellent").grid(row=1, column=1)
|
||||||
|
|
||||||
Checkbutton(self.frame, text="Takeoff only for player group", variable=self.takeoff_var).grid(row=2, column=0, columnspan=2)
|
Checkbutton(self.frame, text="Takeoff only for player group", variable=self.takeoff_var).grid(row=2, column=0, columnspan=2)
|
||||||
|
Checkbutton(self.frame, text="Disable night missions", variable=self.night_var).grid(row=3, column=0, columnspan=2)
|
||||||
|
|
||||||
Button(self.frame, text="Back", command=self.dismiss).grid(row=3, column=0, columnspan=1)
|
Button(self.frame, text="Back", command=self.dismiss).grid(row=4, column=0, columnspan=1)
|
||||||
Button(self.frame, text="Cheat +200m", command=self.cheat_money).grid(row=4, column=0)
|
Button(self.frame, text="Cheat +200m", command=self.cheat_money).grid(row=5, column=0)
|
||||||
|
|
||||||
def cheat_money(self):
|
def cheat_money(self):
|
||||||
self.game.budget += 200
|
self.game.budget += 200
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user