From ddb98d5e071ab90491237ac7a0d5159a695fbc42 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 21 Sep 2018 00:14:12 -0300 Subject: Try a different day/night cycle --- npc/functions/weather.txt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'npc/functions') diff --git a/npc/functions/weather.txt b/npc/functions/weather.txt index 464af8c96..9a589dea1 100644 --- a/npc/functions/weather.txt +++ b/npc/functions/weather.txt @@ -6,11 +6,23 @@ // is_night() function script is_night { - // For convenience, night time is from 00:15 to 00:45, every hour. + // Night time depends on season. + // Summer: Day > Night + // Winter: Night > Day + // Autumn/Spring: Day = Night + // + // By default, each period lasts a whole hour, give or take 15 minutes (?) // 2 = GETTIME_MINUTE - if (gettime(2) >= 15 && gettime(2) < 45) + // 3 = GETTIME_HOUR + if (gettime(3) % 1) { + if (season() == SUMMER && gettime(2) <= 15) + return 0; return 1; - return 0; + } else { + if (season() == WINTER && gettime(2) >= 45) + return 1; + return 0; + } } 000-0,0,0,0 script #WeatherCore NPC_HIDDEN,{ -- cgit v1.2.3-60-g2f50