Add toggles for pumpkin moon
This commit is contained in:
parent
a7261d6db2
commit
ace810c8b3
2 changed files with 19 additions and 0 deletions
|
|
@ -276,6 +276,10 @@ namespace TShockAPI
|
||||||
|
|
||||||
[Description("Forces your world to be in Halloween mode regardless of the data.")] public bool ForceHalloween = false;
|
[Description("Forces your world to be in Halloween mode regardless of the data.")] public bool ForceHalloween = false;
|
||||||
|
|
||||||
|
[Description("Disables the pumpkin moon when the night is over, regardless of wave.")] public bool DisablePumpkinMoonOnDaybreak = false;
|
||||||
|
|
||||||
|
[Description("Disables the pumpkin moon when the night is over if you reached wave 15.")] public bool DisablePumpkinMoonAfterWave15 = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reads a configuration file from a given path
|
/// Reads a configuration file from a given path
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -648,6 +648,7 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool lastTickDay = false;
|
||||||
private void OnSecondUpdate()
|
private void OnSecondUpdate()
|
||||||
{
|
{
|
||||||
if (Config.ForceTime != "normal")
|
if (Config.ForceTime != "normal")
|
||||||
|
|
@ -663,6 +664,20 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!lastTickDay && Main.dayTime)
|
||||||
|
{
|
||||||
|
lastTickDay = true;
|
||||||
|
if (Config.DisablePumpkinMoonOnDaybreak || (Config.DisablePumpkinMoonAfterWave15 && NPC.waveCount == 15))
|
||||||
|
{
|
||||||
|
Main.pumpkinMoon = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (lastTickDay && !Main.dayTime)
|
||||||
|
{
|
||||||
|
lastTickDay = false;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (TSPlayer player in Players)
|
foreach (TSPlayer player in Players)
|
||||||
{
|
{
|
||||||
if (player != null && player.Active)
|
if (player != null && player.Active)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue