diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-09-11 10:56:32 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-09-11 10:56:32 -0300 |
commit | d2c4027ec84c886436833d2da898d8d8d74a29d2 (patch) | |
tree | 26746ac547d250526b137d9219d6dfce830fec17 /npc/functions | |
parent | 713fb10129b502ae9559b9e62cf08593663ff93c (diff) | |
download | serverdata-jesusalva/housekeeping1.tar.gz serverdata-jesusalva/housekeeping1.tar.bz2 serverdata-jesusalva/housekeeping1.tar.xz serverdata-jesusalva/housekeeping1.zip |
Add season constants so if a script is written changing based on season,jesusalva/housekeeping1
we don't end up with unreadable `if (season_direction() == DOWN)`
And have much better `if (season_direction() == WINTER)`.
PS. Both versions work.
Diffstat (limited to 'npc/functions')
-rw-r--r-- | npc/functions/util.txt | 10 |
1 files changed, 6 insertions, 4 deletions
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)); |