Oozaru Every Night on DBSC?

Posted by Daydreamer on Sun 19 Aug 2007 03:42 PM — 2 posts, 12,488 views.

#0
This is for DBSC (SMAUG Derivative).

This is the do_time function in act_info.c:

void do_time( CHAR_DATA *ch, char *argument )
{
extern char str_boot_time[];
extern char reboot_time[];
char *suf;
char *moon = "\r";
int day;

day = time_info.day + 1;

if ( day > 4 && day < 20 )
suf = "th";
else if ( day % 10 == 1 )
suf = "st";
else if ( day % 10 == 2 )
suf = "nd";
else if ( day % 10 == 3 )
suf = "rd";
else
suf = "th";

if ( time_info.hour > 6 && time_info.hour < 20 )
moon = "&YThe sun is up.";
else
{
if ( time_info.day == 13 )
moon = "&BIt's a new moon tonight.";
else if ( time_info.day == 29 )
moon = "&WIt's a full moon tonight.";
else if ( (time_info.day <= 9 && time_info.day >= 3)
|| (time_info.day >= 17 && time_info.day <= 26) )
moon = "&WA quarter moon is up.";
else if ( time_info.day > 9 && time_info.day < 17 )
{
if( time_info.day == 14 )
moon = "&RThe Makeo Star shines down with evil, blood red light.";
else
moon = "&WOnly a sliver of the moon is visable.";
}
else if ( time_info.day < 3 || time_info.day > 26 )
moon = "&WThe moon is almost full.";
else
bug( "act_info.c: do_time - unknown moon phase.", 0 );
}

set_char_color( AT_YELLOW, ch );
pager_printf_color( ch,
"&YToday is the Day of %s, in the year &O%s &YA.D.\n\r"
"&YIt is &O%d o'clock %s&Y, during the %d%s day in the Month of %s.\n\r"
"%s&Y\n\r"
" - The mud started up at: &R%s&Y\r"
" - The system time (M.S.T.): &R%s&Y\r"
" - Next Reboot is set for: &R%s&Y\r",
day_name[day % 7], num_punct(time_info.year),
(time_info.hour % 12 == 0) ? 12 : time_info.hour % 12,
time_info.hour >= 12 ? "pm" : "am",
day, suf, month_name[time_info.month],
moon,
str_boot_time,
(char *) ctime( &current_time ),
reboot_time
);


/* "&YIt is &C%d o'clock %s&Y, Day of %s, %d%s the Month of %s.\n\r"
"%s&Y\n\r"
"The mud started up at: &R%s&Y\r"
"The system time (M.S.T.): &R%s&Y\r"
"Next Reboot is set for: &R%s&Y\r",

(time_info.hour % 12 == 0) ? 12 : time_info.hour % 12,
time_info.hour >= 12 ? "pm" : "am",
day_name[day % 7],
day, suf,
month_name[time_info.month],
moon,
str_boot_time,
(char *) ctime( &current_time ),
reboot_time
);
*/

return;
}

And the do_moon_echo in update.c

char *get_moon_echo(WEATHER_DATA *weath)
{
switch(time_info.day)
{
case 6:
{
return("&WA quarter of the moon is visable.\n\r");
}
case 13:
{
return("&WThe moon is completly dark.\n\r");
}
case 14:
{
return("&RThe Makeo Star shines down with evil, blood red light.\n\r");
}
case 21:
{
return("&WA quarter of the moon is visable.\n\r");
}
case 29:
{
return("&YThe full moon shines brightly down on you.\n\r");
}
}

return ("");
}

Is there anything I need to change to make the Full Moon come out every night from 8 PM to 5 AM? Remember: This is on a 24 hour clock. 20 = 8 PM. 5 = 5 AM.
USA #1
This might work.


if ( time_info.hour > 6 && time_info.hour < 20 )
moon = "&YThe sun is up.";
else
{
  if ( time_info.day >= 1 && time_info.day <=13 )
     moon = "&BIt's a full moon tonight.";

  else if( time_info.day == 14 )
     moon = "&RThe Makeo Star shines down with evil, blood red light.";
/* i don't know how many days you have so I put 30. */
  else if ( time_info.day >= 15 && time_info.day <  30 )
     moon = "&BIt's a full moon tonight.";
  else
     bug( "act_info.c: do_time - unknown moon phase.", 0 );
}