Man calendar

From LSWiki

Jump to: navigation, search

Description

This file will detail the effects of the calendar. This will be a general outline of the structure of the Lost Souls calendar, the gtime() efun and the weather system (which are all tied together).

Each year on Lost Souls has 10 months, each month is comprised of 30 days, each day has 30 hours, and each hour is comprised of 60 minutes of 60 seconds each. All of these values are stored in /lib/time.h in the form of <Division>_Per_<Unit> (ie. Seconds_Per_Minute), and /lib/time.h also provides shortcut functions for conversions, the most important of w which is convert_date(), which accepts an integer in the form of gtime(), and converts it into an array of integers representing the year, month, etc. The position of the values in the array are defined to be DATE_YEAR, DATE_MONTH, DATE_DAY, DATE_HOUR, DATE_MINUTE, DATE_SECOND.

The former game clock has been converted from a primitive call_out mechanism to an algorithm based upon 'real' time. As a result, all of the functionality that the game clock provided can be handled by calling the new efun gtime() and using the values stored in /lib/time.h to calculate any value you think you need.

Below are old functions from game_clock.c (now retired), what they did, and the modern equivalent.

  [ query_season(),  query_moon(), and  query_night() are in
   the weather daemon now.]
query_month() - Returns numerical month value.
  to_int(cgtimef("%l",gtime()));
query_month_s() - Returns month name.
  cgtimef("%M",gtime());
query_day() - Returns numerical day of the month.
  to_int(cgtimef("%d",gtime()));
query_year() - Returns year.
  to_int(cgtimef("%y",gtime()));
query_date() - Returns date as mm/dd/yy.
  cgtimef("%l/%d/%y",gtime());
query_date_s() - Returns date as Mm dd, yy.
  cgtimef("%M %d, %y",gtime());
query_minute() - Returns minutes past the hour.
  to_int(cgtimef("%m",gtime()));
query_hour() - Returns hour in 30 hour cycle.
  to_int(cgtimef("%h",gtime()));
query_15_hour() - Returns hour in 15 hour cycle.
  to_int(cgtimef("%H",gtime()));
query_10_hour() - Returns hour in 10 hour cycle.
  to_int(cgtimef("%g",gtime()));
query_am() - Returns true if am.
  (cgtimef("%D",gtime())==AMPM15[0]); 
query_pm() - Returns true if pm.
  (cgtimef("%D",gtime())==AMPM15[1]);
query_noon() - Returns true if noon.
  ( query_30_hour()==(Hours_Per_Day/2-1)&&! query_minute());
query_midnight() - Returns true if midnight.
  ( query_30_hour()==0&&! query_minute());
query_time() - Returns time in 30 hour cycle.
  cgtimef("%T",gtime());
query_time_10() - Returns time in 10 hour cycle.
  cgtimef("%I",gtime());
query_time_15() - Returns time in 15 hour cycle.
  cgtimef("%i",gtime());
query_abs_day() - Returns day number since start of calendar system.
  gtime()/Minutes_Per_Day;

SEE ALSO cgtime(efun), cgtimef(efun), gtime(efun), time(build), weather(concept)


Also from /txt/lit/game/Calendar_Template

================================================================================
||  Ispran   ||   Thoso   ||   Entil   ||   Chomo   ||   Harim   ||   Tuao    ||
================================================================================
================================================================================
||     1     ||     2     ||     3     ||     4     ||     5     ||     6     ||
================================================================================
||     7     ||     8     ||     9     ||    10     ||    11     ||    12     ||
================================================================================
||    13     ||    14     ||    15     ||    16     ||    17     ||    18     ||
================================================================================
||    19     ||    20     ||    21     ||    22     ||    23     ||    24     ||
================================================================================
||    25     ||    26     ||    27     ||    28     ||    29     ||    30     ||
================================================================================
Personal tools