Added command that changes the current season: @environment.setseason(int)

Argument "int" can be:
	 0 = Winter
	 1 = Spring
	 2 = Summer
	 3 = Fall
	-1 = The default season based on the date
This commit is contained in:
JappaWakka 2022-01-07 12:27:30 +01:00
parent f5941a79bc
commit 3ecc99fbd4
3 changed files with 24 additions and 12 deletions

View File

@ -15,6 +15,12 @@
Screen.Level.WeatherType = int(argument)
Case "setregionweather"
World.RegionWeather = CType(int(argument), World.Weathers)
Case "setseason"
If int(argument) = -1 Then
World.setSeason = Nothing
Else
World.setSeason = CType(int(argument), World.Seasons)
End If
Case "setcanfly"
Screen.Level.CanFly = CBool(argument)
Case "setcandig"

View File

@ -393,6 +393,7 @@ Namespace ScriptVersion2
' Commands:
r(New ScriptCommand("environment", "setweather", {New ScriptArgument("weatherType", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Changes the weather type of the current map."))
r(New ScriptCommand("environment", "setregionweather", {New ScriptArgument("weatherID", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Changes the weather of the current region."))
r(New ScriptCommand("environment", "setseason", {New ScriptArgument("seasonID", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Changes the season. Use -1 as the argument to change back to the default season."))
r(New ScriptCommand("environment", "setcanfly", {New ScriptArgument("canfly", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Sets the ""CanFly"" parameter of the current map."))
r(New ScriptCommand("environment", "setcandig", {New ScriptArgument("candig", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Sets the ""CanDig"" parameter of the current map."))
r(New ScriptCommand("environment", "setcanteleport", {New ScriptArgument("canteleport", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Sets the ""CanTeleport"" parameter of the current map."))

View File

@ -4,6 +4,7 @@ Public Class World
Private Shared _regionWeather As Weathers = Weathers.Clear
Private Shared _regionWeatherSet As Boolean = False
Public Shared setSeason As Seasons = Nothing
Public Shared IsMainMenu As Boolean = False
Public Shared IsAurora As Boolean = False
@ -56,19 +57,23 @@ Public Class World
Return Seasons.Summer
End If
If NeedServerObject() = True Then
Return ServerSeason
If setSeason <> Nothing Then
Return setSeason
Else
If NeedServerObject() = True Then
Return ServerSeason
End If
Select Case WeekOfYear Mod 4
Case 1
Return Seasons.Winter
Case 2
Return Seasons.Spring
Case 3
Return Seasons.Summer
Case 0
Return Seasons.Fall
End Select
End If
Select Case WeekOfYear Mod 4
Case 1
Return Seasons.Winter
Case 2
Return Seasons.Spring
Case 3
Return Seasons.Summer
Case 0
Return Seasons.Fall
End Select
Return Seasons.Summer
End Get
End Property