Upload from upload_mods.ps1
This commit is contained in:
31
Scripts/Dialog/DialogRequirementIsntBloodMoonRebirth.cs
Normal file
31
Scripts/Dialog/DialogRequirementIsntBloodMoonRebirth.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
public class DialogRequirementIsntBloodMoonRebirth : BaseDialogRequirement
|
||||
{
|
||||
public override bool CheckRequirement(EntityPlayer player, EntityNPC talkingTo)
|
||||
{
|
||||
if (!SkyManager.IsBloodMoonVisible())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ulong worldTime = GameManager.Instance.World.worldTime;
|
||||
ValueTuple<int, int, int> valueTuple = GameUtils.WorldTimeToElements(worldTime);
|
||||
|
||||
int num = valueTuple.Item2;
|
||||
int num2 = valueTuple.Item3;
|
||||
|
||||
int numDaylength = GamePrefs.GetInt(EnumGamePrefs.DayLightLength);
|
||||
|
||||
int numOpenTime = 22 - numDaylength;
|
||||
|
||||
if ((num == 21 && num2 >= 55) || (num >= 22) || num < numOpenTime)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user