summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/functions/weather.txt18
1 files changed, 15 insertions, 3 deletions
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,{