Add a sandstorm command
This commit is contained in:
parent
9520e7e782
commit
36343dd8e7
3 changed files with 32 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
|
||||||
* Players can no longer bypass tile checks by using the Tile packet (@ProfessorXZ)
|
* Players can no longer bypass tile checks by using the Tile packet (@ProfessorXZ)
|
||||||
* Fixed a bug where players couldn't hammer a Junction Box without "allowclientsideworldedit" permission (@Patrikkk)
|
* Fixed a bug where players couldn't hammer a Junction Box without "allowclientsideworldedit" permission (@Patrikkk)
|
||||||
* Fixed the client's UI not being draw when setting wind speed to abnormal values (@ProfessorXZ)
|
* Fixed the client's UI not being draw when setting wind speed to abnormal values (@ProfessorXZ)
|
||||||
|
* Added a command to start and stop sandstorms (@WhiteXZ)
|
||||||
|
|
||||||
## TShock 4.3.17
|
## TShock 4.3.17
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -499,6 +499,10 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
HelpText = "Toggles spawn protection."
|
HelpText = "Toggles spawn protection."
|
||||||
});
|
});
|
||||||
|
add(new Command(Permissions.sandstorm, Sandstorm, "sandstorm")
|
||||||
|
{
|
||||||
|
HelpText = "Toggles sandstorms."
|
||||||
|
});
|
||||||
add(new Command(Permissions.rain, Rain, "rain")
|
add(new Command(Permissions.rain, Rain, "rain")
|
||||||
{
|
{
|
||||||
HelpText = "Toggles the rain."
|
HelpText = "Toggles the rain."
|
||||||
|
|
@ -3816,6 +3820,30 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void Sandstorm(CommandArgs args)
|
||||||
|
{
|
||||||
|
if (args.Parameters.Count < 1)
|
||||||
|
{
|
||||||
|
args.Player.SendErrorMessage("Invalid syntax! Proper syntax: {0}sandstorm <stop/start>", Specifier);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (args.Parameters[0].ToLowerInvariant())
|
||||||
|
{
|
||||||
|
case "start":
|
||||||
|
Terraria.GameContent.Events.Sandstorm.StartSandstorm();
|
||||||
|
TSPlayer.All.SendInfoMessage("{0} started a sandstorm.", args.Player.Name);
|
||||||
|
break;
|
||||||
|
case "stop":
|
||||||
|
Terraria.GameContent.Events.Sandstorm.StopSandstorm();
|
||||||
|
TSPlayer.All.SendInfoMessage("{0} stopped the sandstorm.", args.Player.Name);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
args.Player.SendErrorMessage("Invalid syntax! Proper syntax: {0}sandstorm <stop/start>", Specifier);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void Rain(CommandArgs args)
|
private static void Rain(CommandArgs args)
|
||||||
{
|
{
|
||||||
if (args.Parameters.Count < 1 || args.Parameters.Count > 2)
|
if (args.Parameters.Count < 1 || args.Parameters.Count > 2)
|
||||||
|
|
|
||||||
|
|
@ -326,6 +326,9 @@ namespace TShockAPI
|
||||||
[Description("User can paint tiles.")]
|
[Description("User can paint tiles.")]
|
||||||
public static readonly string canpaint = "tshock.world.paint";
|
public static readonly string canpaint = "tshock.world.paint";
|
||||||
|
|
||||||
|
[Description("User can turn on or off sandstorms.")]
|
||||||
|
public static readonly string sandstorm = "tshock.world.sandstorm";
|
||||||
|
|
||||||
[Description("User can turn on or off the rain.")]
|
[Description("User can turn on or off the rain.")]
|
||||||
public static readonly string rain = "tshock.world.rain";
|
public static readonly string rain = "tshock.world.rain";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue