--- deliantra/server/include/tod.h 2007/05/28 21:15:56 1.11 +++ deliantra/server/include/tod.h 2008/12/23 06:58:23 1.15 @@ -1,26 +1,25 @@ /* - * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game. + * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team + * Copyright (©) 2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team * Copyright (©) 2003-2006,2007 Mark Wedel & Crossfire Development Team * Copyright (©) 2000,2007 Tim Rightnour * Copyright (©) 1992,2007 Frank Tore Johansen * - * Crossfire TRT is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. + * Deliantra is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . * - * The authors can be reached via e-mail to + * The authors can be reached via e-mail to */ #ifndef TOD_H_ @@ -31,7 +30,8 @@ #define TICK2TIME(tick) (tstamp (tick) * TICK) #define TIME2TICK(time) tstamp ((time) / TICK) -#define RUNTIME_PER_HOUR 180. +#define RUNTIME_PER_MINUTE 3. +#define RUNTIME_PER_HOUR (RUNTIME_PER_MINUTE * 60.) #define TICKS_PER_HOUR int (RUNTIME_PER_HOUR / MAX_TIME * 1e6) /* game time */ @@ -40,6 +40,13 @@ #define WEEKS_PER_MONTH 5 #define MONTHS_PER_YEAR 17 +// one game minute is 3s +// one game hour is 3m +// one game day is 1h24s +// one game week is 9h48s +// one game month is 2d1h +// one game year is 34d17h + /* convenience */ #define WEEKS_PER_YEAR (WEEKS_PER_MONTH * MONTHS_PER_YEAR) #define DAYS_PER_MONTH (DAYS_PER_WEEK * WEEKS_PER_MONTH) @@ -63,84 +70,10 @@ }; /* from common/time.c */ -extern void get_tod (timeofday_t *tod); - -#if 0 -/* weather stuff */ - -#define POLAR_BASE_TEMP 0 /* C */ -#define EQUATOR_BASE_TEMP 30 /* C */ -#define SEASONAL_ADJUST 10 /* polar distance */ -#define GULF_STREAM_WIDTH 3 /* width of gulf stream */ -#define GULF_STREAM_BASE_SPEED 40 /* base speed of gulf stream */ - -/* don't muck with these unless you are sure you know what they do */ -#define PRESSURE_ITERATIONS 30 -#define PRESSURE_AREA 180 -#define PRESSURE_ROUNDING_FACTOR 2 -#define PRESSURE_ROUNDING_ITER 1 -#define PRESSURE_SPIKES 3 -#define PRESSURE_MAX 1040 -#define PRESSURE_MIN 960 - -/* This is a multiplier for the wind caused by pressure differences. - * The type of overal climate you get depends on this. - * Too little wind, and the rain hugs the coast. - * Too much wind, and there are hurricanes and blizzards everywhere. - * 1 is too little. - */ -#define WIND_FACTOR 4.0 - -/* editing the below might require actual changes to code */ -#define WEATHERMAPTILESX 100 -#define WEATHERMAPTILESY 100 - -/* sky conditions */ -#define SKY_CLEAR 0 -#define SKY_LIGHTCLOUD 1 -#define SKY_OVERCAST 2 -#define SKY_LIGHT_RAIN 3 -#define SKY_RAIN 4 /* rain -> storm has lightning */ -#define SKY_HEAVY_RAIN 5 -#define SKY_HURRICANE 6 -/* wierd weather 7-12 */ -#define SKY_FOG 7 -#define SKY_HAIL 8 -/* snow */ -#define SKY_LIGHT_SNOW 13 /* add 10 to rain to get snow */ -#define SKY_SNOW 14 -#define SKY_HEAVY_SNOW 15 -#define SKY_BLIZZARD 16 - -typedef struct _weather_avoids { - const char *name; - int snow; - archetype *what; /*inited from name, faste to compare arch pointers than strings*/ -} weather_avoids_t; - -typedef struct _weather_replace { - const char *tile; - const char *special_snow; - const char *doublestack_arch; - int arch_or_name; -} weather_replace_t; - -typedef struct _weather_grow { - const char *herb; /* arch name of item to grow */ - const char *tile; /* arch tile to grow on, NULL if anything */ - int random; /* random factor. min 1, higher = lower chance of - * appearance */ - float rfmin; - float rfmax; /* rainfall min/max (inches/day) */ - int humin; - int humax; /* humidity min/max */ - int tempmin; - int tempmax; /* temp min/max */ - int elevmin; - int elevmax; /* elevation min/max */ - int season; /* 0=any or 1-5 */ -} weather_grow_t; -#endif +void get_tod (timeofday_t *tod); +char *format_tod (char *buf, int len, timeofday_t *tod); +const char *get_current_tod_str (); +void print_tod (object *op); #endif