Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Oozaru Every Night on DBSC?

Oozaru Every Night on DBSC?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Daydreamer   (1 post)  Bio
Date Sun 19 Aug 2007 03:42 PM (UTC)
Message
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.
Top

Posted by Orik   USA  (182 posts)  Bio
Date Reply #1 on Sun 19 Aug 2007 03:53 PM (UTC)
Message
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 );
}
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


10,129 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.