mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
updated weather generation - now including rain
This commit is contained in:
parent
064b9ba877
commit
a4145154af
2
.idea/dcs_pmcliberation.iml
generated
2
.idea/dcs_pmcliberation.iml
generated
@ -4,7 +4,7 @@
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.6 (venv)" jdkType="Python SDK" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.6" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="TestRunnerService">
|
||||
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6 (venv)" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
@ -14,6 +14,12 @@ RANDOM_TIME = {
|
||||
"day": 100,
|
||||
}
|
||||
|
||||
RANDOM_WEATHER = {
|
||||
0: 0, # thunderstorm
|
||||
1: 5, # heavy rain
|
||||
2: 15, # rain
|
||||
3: 35, # random dynamic
|
||||
}
|
||||
|
||||
class EnvironmentSettingsGenerator:
|
||||
def __init__(self, mission: Mission, game):
|
||||
@ -29,6 +35,22 @@ class EnvironmentSettingsGenerator:
|
||||
break
|
||||
|
||||
self.mission.random_daytime(time_period)
|
||||
|
||||
weather_roll = random.randint(0, 100)
|
||||
weather_type = None
|
||||
for k, v in RANDOM_TIME.items():
|
||||
if v >= weather_roll:
|
||||
weather_type = k
|
||||
break
|
||||
|
||||
if weather_type == 0:
|
||||
self.mission.weather.random_thunderstorm()
|
||||
elif weather_type == 1:
|
||||
self.mission.weather.heavy_rain()
|
||||
elif weather_type == 2:
|
||||
self.mission.weather.heavy_rain()
|
||||
self.mission.weather.enable_fog = False
|
||||
elif weather_type == 3:
|
||||
self.mission.weather.random(self.mission.start_time, self.mission.terrain)
|
||||
|
||||
for cp in self.game.theater.controlpoints:
|
||||
|
||||
@ -68,7 +68,7 @@ class OverviewCanvas:
|
||||
|
||||
for cp in self.game.theater.controlpoints:
|
||||
coords = self.cp_coordinates(cp)
|
||||
arc_size = 28 * math.pow(cp.importance, 1)
|
||||
arc_size = 22 * math.pow(cp.importance, 1)
|
||||
extent = max(cp.base.strength * 180, 10)
|
||||
start = (180 - extent) / 2
|
||||
color = cp.captured and 'blue' or 'red'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user