From d2c4027ec84c886436833d2da898d8d8d74a29d2 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 11 Sep 2019 10:56:32 -0300 Subject: Add season constants so if a script is written changing based on season, we don't end up with unreadable `if (season_direction() == DOWN)` And have much better `if (season_direction() == WINTER)`. PS. Both versions work. --- npc/functions/util.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'npc/functions') diff --git a/npc/functions/util.txt b/npc/functions/util.txt index b45e7cdc..8e263eb0 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -8,10 +8,12 @@ // season_direction({day, month}) // returns the direction that represents our current season (approximation) -// DOWN: Winter, 21/12 -// DOWNLEFT: Spring, 20/03 -// LEFT: Summer, 21/06 -// UPLEFT: Autumn, 22/09 +// Note: You may also use WINTER/SPRING/SUMMER/AUTUMN constants for scripts +// where the direction is not important, but the season is. (Readability) +// DOWN: Winter, 21/12 WINTER +// DOWNLEFT: Spring, 20/03 SPRING +// LEFT: Summer, 21/06 SUMMER +// UPLEFT: Autumn, 22/09 AUTUMN function script season_direction { .@current_month = getarg(1, gettime(GETTIME_MONTH)); -- cgit v1.2.3-70-g09d2