mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
new game ui; random weather and time
This commit is contained in:
@@ -44,7 +44,7 @@ class AircraftConflictGenerator:
|
||||
aircraft_type=unit_type,
|
||||
airport=self.m.terrain.airport_by_id(airport.id),
|
||||
maintask=None,
|
||||
start_type=StartType.Cold,
|
||||
start_type=StartType.Warm,
|
||||
group_size=count,
|
||||
parking_slots=None)
|
||||
|
||||
|
||||
28
gen/envsettingsgen.py
Normal file
28
gen/envsettingsgen.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import typing
|
||||
import random
|
||||
|
||||
from dcs.mission import Mission
|
||||
|
||||
from theater.weatherforecast import WeatherForecast
|
||||
|
||||
|
||||
RANDOM_TIME = {
|
||||
"night": 5,
|
||||
"dusk": 25,
|
||||
"down": 50,
|
||||
"noon": 75,
|
||||
"day": 100,
|
||||
}
|
||||
|
||||
|
||||
class EnvironmentSettingsGenerator:
|
||||
def __init__(self, mission: Mission):
|
||||
self.mission = mission
|
||||
|
||||
def generate(self):
|
||||
self.mission.random_weather = True
|
||||
|
||||
time_roll = random.randint(0, 100)
|
||||
time_period = [k for k, v in RANDOM_TIME.items() if v > time_roll][-1]
|
||||
self.mission.random_daytime(time_period)
|
||||
|
||||
Reference in New Issue
Block a user