Less round-about way to update the weather.
This commit is contained in:
parent
72af74ca4d
commit
067b7bf620
1 changed files with 57 additions and 96 deletions
|
@ -909,83 +909,65 @@ Note: You need to use the default map settings for the scenario to work right."
|
|||
[/print]
|
||||
#enddef
|
||||
|
||||
#define ADJUST_WEATHER
|
||||
[if]
|
||||
[variable]
|
||||
name=weather_change
|
||||
numerical_equals=4
|
||||
[/variable]
|
||||
[then]
|
||||
#define ADJUST_WEATHER VAR
|
||||
[switch]
|
||||
variable={VAR}
|
||||
|
||||
[case]
|
||||
value=4
|
||||
# second snow
|
||||
{WEATHER_MAP "{multiplayer/maps/Dark_Forecast_secondsnow.mask}"}
|
||||
[sound]
|
||||
name=bat-flapping.wav
|
||||
[/sound]
|
||||
{WEATHER_ALERT _"Heavy Snowfall" 224 255 251}
|
||||
[/then]
|
||||
[/case]
|
||||
|
||||
[case]
|
||||
value=3
|
||||
# first snow
|
||||
{WEATHER_MAP "{multiplayer/maps/Dark_Forecast_firstsnow.mask}"}
|
||||
[sound]
|
||||
name=wail.wav
|
||||
[/sound]
|
||||
{WEATHER_ALERT _"Snowfall" 229 243 241}
|
||||
[/case]
|
||||
|
||||
[case]
|
||||
value=2
|
||||
# heavy rains
|
||||
{WEATHER_MAP "{multiplayer/maps/Dark_Forecast_rain.mask}"}
|
||||
[sound]
|
||||
name=magic-faeriefire-miss.ogg
|
||||
[/sound]
|
||||
[delay]
|
||||
time=250
|
||||
[/delay]
|
||||
[sound]
|
||||
name=ambient/ship.ogg
|
||||
[/sound]
|
||||
{WEATHER_ALERT _"Heavy Rains" 174 220 255}
|
||||
[/case]
|
||||
|
||||
[case]
|
||||
value=1
|
||||
# drought
|
||||
{WEATHER_MAP "{multiplayer/maps/Dark_Forecast_drought.mask}"}
|
||||
[sound]
|
||||
name=gryphon-shriek-1.ogg
|
||||
[/sound]
|
||||
{WEATHER_ALERT _"Drought" 251 231 171}
|
||||
[/case]
|
||||
|
||||
[else]
|
||||
[if]
|
||||
[variable]
|
||||
name=weather_change
|
||||
numerical_equals=3
|
||||
[/variable]
|
||||
[then]
|
||||
# first snow
|
||||
{WEATHER_MAP "{multiplayer/maps/Dark_Forecast_firstsnow.mask}"}
|
||||
[sound]
|
||||
name=wail.wav
|
||||
[/sound]
|
||||
{WEATHER_ALERT _"Snowfall" 229 243 241}
|
||||
[/then]
|
||||
[else]
|
||||
[if]
|
||||
[variable]
|
||||
name=weather_change
|
||||
numerical_equals=2
|
||||
[/variable]
|
||||
[then]
|
||||
# heavy rains
|
||||
{WEATHER_MAP "{multiplayer/maps/Dark_Forecast_rain.mask}"}
|
||||
[sound]
|
||||
name=magic-faeriefire-miss.ogg
|
||||
[/sound]
|
||||
[delay]
|
||||
time=250
|
||||
[/delay]
|
||||
[sound]
|
||||
name=ambient/ship.ogg
|
||||
[/sound]
|
||||
{WEATHER_ALERT _"Heavy Rains" 174 220 255}
|
||||
[/then]
|
||||
[else]
|
||||
[if]
|
||||
[variable]
|
||||
name=weather_change
|
||||
numerical_equals=1
|
||||
[/variable]
|
||||
[then]
|
||||
# drought
|
||||
{WEATHER_MAP "{multiplayer/maps/Dark_Forecast_drought.mask}"}
|
||||
[sound]
|
||||
name=gryphon-shriek-1.ogg
|
||||
[/sound]
|
||||
{WEATHER_ALERT _"Drought" 251 231 171}
|
||||
[/then]
|
||||
[else]
|
||||
# clear weather
|
||||
{WEATHER_MAP "{multiplayer/maps/Dark_Forecast_basic.mask}"}
|
||||
[sound]
|
||||
name=magic-holy-miss-2.ogg
|
||||
[/sound]
|
||||
{WEATHER_ALERT _"Clear Weather" 221 253 171}
|
||||
[/else]
|
||||
[/if]
|
||||
[/else]
|
||||
[/if]
|
||||
[/else]
|
||||
[/if]
|
||||
# clear weather
|
||||
{WEATHER_MAP "{multiplayer/maps/Dark_Forecast_basic.mask}"}
|
||||
[sound]
|
||||
name=magic-holy-miss-2.ogg
|
||||
[/sound]
|
||||
{WEATHER_ALERT _"Clear Weather" 221 253 171}
|
||||
[/else]
|
||||
[/if]
|
||||
[/switch]
|
||||
#enddef
|
||||
|
||||
#define INIT_WEATHER
|
||||
|
@ -1056,38 +1038,17 @@ Note: You need to use the default map settings for the scenario to work right."
|
|||
[/do]
|
||||
[/while]
|
||||
[event]
|
||||
name=side turn
|
||||
name=side 3 turn
|
||||
first_time_only=no
|
||||
[if]
|
||||
[variable]
|
||||
name=weather_change
|
||||
greater_than=-1
|
||||
[/variable]
|
||||
[variable]
|
||||
name=side_number
|
||||
numerical_equals=3
|
||||
[/variable]
|
||||
[then]
|
||||
{ADJUST_WEATHER}
|
||||
[/then]
|
||||
[/if]
|
||||
[/event]
|
||||
[event]
|
||||
name=new turn
|
||||
first_time_only=no
|
||||
[if]
|
||||
[filter_condition]
|
||||
[variable]
|
||||
name=turn_number
|
||||
greater_than_equal_to=$weather_event[$next_weather].turn
|
||||
[/variable]
|
||||
[then]
|
||||
{VARIABLE weather_change $weather_event[$next_weather].weather}
|
||||
{VARIABLE_OP next_weather add 1}
|
||||
[/then]
|
||||
[else]
|
||||
{VARIABLE weather_change -1}
|
||||
[/else]
|
||||
[/if]
|
||||
[/filter_condition]
|
||||
|
||||
{ADJUST_WEATHER weather_event[$next_weather].weather}
|
||||
{VARIABLE_OP next_weather add 1}
|
||||
[/event]
|
||||
#enddef
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue