#script_game_get_date_text:
# This script is called from the game engine when the date needs to be displayed.
# INPUT: arg1 = number of days passed since the beginning of the game
# OUTPUT: result string = date
("game_get_date_text",
[
(store_script_param_2, ":num_hours"),
(store_div, ":num_days", ":num_hours", 24),
(store_add, ":cur_day", ":num_days", 23),
(assign, ":cur_month", 6),
(assign, ":cur_year", 6077),
(assign, ":try_range", 99999),
(try_for_range, ":unused", 0, ":try_range"),
(try_begin),
(this_or_next|eq, ":cur_month", 1),
(this_or_next|eq, ":cur_month", 3),
(this_or_next|eq, ":cur_month", 5),
(this_or_next|eq, ":cur_month", 7),
(this_or_next|eq, ":cur_month", 8),
(this_or_next|eq, ":cur_month", 10),
(eq, ":cur_month", 12),
(assign, ":month_day_limit", 31),
(else_try),
(this_or_next|eq, ":cur_month", 4),
(this_or_next|eq, ":cur_month", 6),
(this_or_next|eq, ":cur_month", 9),
(eq, ":cur_month", 11),
(assign, ":month_day_limit", 30),
(else_try),
(try_begin),
(store_div, ":cur_year_div_4", ":cur_year", 4),
(val_mul, ":cur_year_div_4", 4),
(eq, ":cur_year_div_4", ":cur_year"),
(assign, ":month_day_limit", 29),
(else_try),
(assign, ":month_day_limit", 28),
(try_end),
(try_end),
(try_begin),
(gt, ":cur_day", ":month_day_limit"),
(val_sub, ":cur_day", ":month_day_limit"),
(val_add, ":cur_month", 1),
(try_begin),
(gt, ":cur_month", 12),
(val_sub, ":cur_month", 12),
(val_add, ":cur_year", 1),
(try_end),
(else_try),
(assign, ":try_range", 0),
(try_end),
(try_end),
(assign, reg1, ":cur_day"),
(assign, reg2, ":cur_year"),
(try_begin),
(eq, ":cur_month", 1),
(str_store_string, s1, "str_january_reg1_reg2"),
(assign, "$season", 4), #at start as it was spring MadG 1spring 2 summer 3 autumn 4 winter
(else_try),
(eq, ":cur_month", 2),
(assign, "$season", 4),
(str_store_string, s1, "str_february_reg1_reg2"),
(else_try),
(eq, ":cur_month", 3),
(str_store_string, s1, "str_march_reg1_reg2"),
(assign, "$season", 1),
(else_try),
(eq, ":cur_month", 4),
(str_store_string, s1, "str_april_reg1_reg2"),
(assign, "$season", 1),
(else_try),
(eq, ":cur_month", 5),
(str_store_string, s1, "str_may_reg1_reg2"),
(assign, "$season", 1),
(else_try),
(eq, ":cur_month", 6),
(str_store_string, s1, "str_june_reg1_reg2"),
(assign, "$season", 2),
(else_try),
(eq, ":cur_month", 7),
(str_store_string, s1, "str_july_reg1_reg2"),
(assign, "$season", 2),
(else_try),
(eq, ":cur_month", 8),
(str_store_string, s1, "str_august_reg1_reg2"),
(assign, "$season", 2),
(else_try),
(eq, ":cur_month", 9),
(str_store_string, s1, "str_september_reg1_reg2"),
(assign, "$season", 3),
(else_try),
(eq, ":cur_month", 10),
(str_store_string, s1, "str_october_reg1_reg2"),
(assign, "$season", 3),
(else_try),
(eq, ":cur_month", 11),
(str_store_string, s1, "str_november_reg1_reg2"),
(assign, "$season", 3),
(else_try),
(eq, ":cur_month", 12),
(str_store_string, s1, "str_december_reg1_reg2"),
(assign, "$season", 4),
(try_end),
(set_result_string, s1),
]),