@@ -5,20 +5,27 @@ var/round_start_time
55
66// Returns the world time in english
77/ proc / worldtime2text(time = world . time, timeshift = 1 )
8- if (! roundstart_hour) roundstart_hour = REALTIMEOFDAY - (TIME_OFFSET HOURS )
8+ if (! roundstart_hour)
9+ roundstart_hour = REALTIMEOFDAY - (TIME_OFFSET HOURS )
910 return timeshift ? time2text(time+ roundstart_hour, " hh:mm" ) : time2text(time, " hh:mm" )
1011
1112/ proc / worldtime2hours()
1213 if (! roundstart_hour)
1314 worldtime2text ()
14- . = text2num(time2text(world . time + (roundstart_hour HOURS ), " hh" ))
15+ . = text2num(time2text(world . time+ roundstart_hour, " hh" ))
16+
17+ / proc / worldtime2minutes()
18+ if (! roundstart_hour)
19+ worldtime2text ()
20+ . = text2num(time2text(world . time+ roundstart_hour, " mm" ))
1521
1622/ proc / worlddate2text()
1723 return num2text(GLOB . game_year) + " -" + time2text(world . timeofday, " MM-DD" )
1824
1925/ proc / time_stamp()
2026 return time2text(world . timeofday, " hh:mm:ss" )
2127
28+
2229/* *
2330 * Check if specific day of the year
2431 *
@@ -121,3 +128,60 @@ var/real_round_start_time
121128 if (hour)
122129 hourT = " and [ hour] hour [ (hour != 1 )? " s" : " " ] "
123130 return " [ day] day [ (day != 1 )? " s" : " " ] [ hourT] [ minuteT] [ secondT] "
131+
132+ /* *
133+ * The current time on Adhomai
134+ */
135+ / proc / tajaran_time()
136+ var /adhomian_time = worldtime2hours()
137+ var /adhomian_minute = worldtime2minutes()
138+ var /adhomian_day = tajaran_date()
139+ if (ISEVEN (adhomian_day))
140+ adhomian_time += 24
141+ if (adhomian_minute < 10 ) // make it display 5:08 instead of 5:8 when the time is in single digits
142+ adhomian_minute = " 0[ adhomian_minute] "
143+ return " [ adhomian_time] : [ adhomian_minute] "
144+
145+ /* *
146+ * The current month/season on Adhomai
147+ */
148+ / proc / tajaran_month()
149+ var /static /months = list (" Menshe-aysaif" , " Sil'nryy-aysaif" , " Menshe-rhazzimy" , " Sil'nryy-rhazzimy" )
150+
151+ var /adhomian_month = text2num(time2text(world . time, " MM" ))
152+
153+ adhomian_month = months[Ceiling(adhomian_month/ 3 )]
154+
155+ return adhomian_month
156+
157+ /* *
158+ * The current date on Adhomai
159+ */
160+ / proc / tajaran_date()
161+ var /adhomian_day = text2num(time2text(world . time, " DD" ))
162+ var /current_month = text2num(time2text(world . time, " MM" ))
163+ switch (current_month)
164+ if (2 , 5 , 8 , 11 )
165+ adhomian_day += 31
166+ if (6 , 9 , 12 )
167+ adhomian_day += 61
168+ if (3 )
169+ adhomian_day += 59 + isLeap(text2num(time2text(world . realtime, " YYYY" ))) // we can conveniently use the result of `isLeap` to add 1 when we are in a leap year
170+
171+ adhomian_day = FLOOR (adhomian_day / 2 , 1 )
172+
173+ return adhomian_day
174+
175+ /* *
176+ * The current year on Adhomai
177+ */
178+ / proc / tajaran_year()
179+ return GLOB . game_year + 1158
180+
181+ /* *
182+ * The full year, month and date on Adhomai
183+ */
184+ / proc / tajaran_full_date()
185+ var /adhomian_month = text2num(time2text(world . time, " MM" ))
186+ adhomian_month = Ceiling(adhomian_month/ 3 )
187+ return " [ tajaran_year()] - [ adhomian_month] - [ tajaran_date()] "
0 commit comments