[ScryMUD] SVN Commit Info r747 - trunk/mud/grrmud/server

scrymud at wanfear.com scrymud at wanfear.com
Sat Dec 11 03:12:28 PST 2004


Author: gingon
Date: 2004-12-11 03:11:01 -0800 (Sat, 11 Dec 2004)
New Revision: 747

Modified:
   trunk/mud/grrmud/server/classes.h
   trunk/mud/grrmud/server/command3.cc
   trunk/mud/grrmud/server/const.cc
   trunk/mud/grrmud/server/const.h
   trunk/mud/grrmud/server/misc2.cc
   trunk/mud/grrmud/server/misc2.h
Log:
Added seasons, displayed by date.



Modified: trunk/mud/grrmud/server/classes.h
===================================================================
--- trunk/mud/grrmud/server/classes.h	2004-12-11 08:36:23 UTC (rev 746)
+++ trunk/mud/grrmud/server/classes.h	2004-12-11 11:11:01 UTC (rev 747)
@@ -191,4 +191,8 @@
    void Write(ofstream& da_file);
 };//PathCell
 
+
+enum SeasonType {spring = 0, summer, fall, winter};
+
+
 #endif

Modified: trunk/mud/grrmud/server/command3.cc
===================================================================
--- trunk/mud/grrmud/server/command3.cc	2004-12-11 08:36:23 UTC (rev 746)
+++ trunk/mud/grrmud/server/command3.cc	2004-12-11 11:11:01 UTC (rev 747)
@@ -1746,8 +1746,9 @@
 int date(critter& pc) {
    String buf(100);
 
-   Sprintf(buf, "The date is %s %i, %i.\n", get_month(config.day),
-           get_day_of_month(config.day), config.year);
+   Sprintf(buf, "It is currently %s, %s %i, %i.\n", seasons[get_season(config.day)],
+         get_month(config.day),
+         get_day_of_month(config.day), config.year);
    show(buf, pc);
    return 0;
 }//date

Modified: trunk/mud/grrmud/server/const.cc
===================================================================
--- trunk/mud/grrmud/server/const.cc	2004-12-11 08:36:23 UTC (rev 746)
+++ trunk/mud/grrmud/server/const.cc	2004-12-11 11:11:01 UTC (rev 747)
@@ -33,6 +33,10 @@
 /** All the words and phrases that one deems useless to the
  * cause of humane communication goes here.
  */
+
+
+const char* seasons[] = {"spring","summer","fall","winter"};
+
 const char* CensoredStrings[] = {
    "asshole",
    "cunt",

Modified: trunk/mud/grrmud/server/const.h
===================================================================
--- trunk/mud/grrmud/server/const.h	2004-12-11 08:36:23 UTC (rev 746)
+++ trunk/mud/grrmud/server/const.h	2004-12-11 11:11:01 UTC (rev 747)
@@ -1709,4 +1709,6 @@
 #define MAX_LEVEL    45
 extern long levels[MAX_LEVEL];
 
+extern const char* seasons[];
+
 #endif

Modified: trunk/mud/grrmud/server/misc2.cc
===================================================================
--- trunk/mud/grrmud/server/misc2.cc	2004-12-11 08:36:23 UTC (rev 746)
+++ trunk/mud/grrmud/server/misc2.cc	2004-12-11 11:11:01 UTC (rev 747)
@@ -1541,6 +1541,35 @@
    }//else
 }//get_day_of_month
 
+SeasonType get_season(int day){
+   if (day <= 31)
+   return winter;
+      else if (day <= 60)
+   return winter;
+	   else if (day <= 91)
+   return spring;
+      else if (day <= 120)
+   return spring;
+      else if (day <= 150)
+   return spring;
+      else if (day <= 181)
+   return summer;
+      else if (day <= 211)
+   return summer;
+      else if (day <= 242)
+   return summer;
+      else if (day <= 273)
+   return fall;
+      else if (day <= 303)
+   return fall;
+      else if (day <= 334)
+   return fall;
+      else if (day <= 365)
+   return winter;
+      else return winter; //leap day
+
+}		
+
 const char* military_to_am(int m_time) {
    if (m_time == 0)
       return "1 am";

Modified: trunk/mud/grrmud/server/misc2.h
===================================================================
--- trunk/mud/grrmud/server/misc2.h	2004-12-11 08:36:23 UTC (rev 746)
+++ trunk/mud/grrmud/server/misc2.h	2004-12-11 11:11:01 UTC (rev 747)
@@ -173,6 +173,8 @@
 object* get_target_obj(int i_th, const String* target, critter& pc);
 door* get_target_door(int i_th, const String* target, critter& pc);
 room* get_target_room(critter& pc);
+SeasonType get_season(int day);
+String* get_season_string(int day);
 
 //distributed probability matrix code
 //only handles single dimension probability matrices
@@ -189,6 +191,4 @@
    ~DistProbMatrix(){delete matrix;}
 };																					 
 
-
-
 #endif 




More information about the ScryMUD mailing list