[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Affect Timer
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Affect Timer

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


Posted by Dace K   Canada  (169 posts)  [Biography] bio
Date Sat 10 May 2003 04:40 AM (UTC)
Message
Hey. Does anybody know where the updating for affects
is located? I need to change the time for spell/skill affects from rounds (seconds) to beats. I can't find it, and it's rather annoying me. If anyone could post, I'd appreciate. Thanks.

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
[Go to top] top

Posted by Boborak   USA  (228 posts)  [Biography] bio
Date Reply #1 on Sat 10 May 2003 09:47 PM (UTC)
Message
As per our MSN conversation:

First comment out the old timer stuff in violence_update() in fight.c:

/*
        for ( timer = ch->first_timer; timer; timer = timer_next )
        {
            timer_next = timer->next;
            if ( --timer->count <= 0 )
            {
                if ( timer->type == TIMER_DO_FUN )
                {
                    int tempsub;
                    DO_FUN *current = timer->do_fun;

                    tempsub = ch->substate;
                    ch->substate = timer->value;
                    extract_timer( ch, timer );
                    (current)( ch, "" );
                    if ( char_died(ch) )
                      break;
                    ch->substate = tempsub;
                }
                else
                  extract_timer( ch, timer );
            }
        }
*/

Add this to update.c somewhere:


void update_timers( void )
{
  DESCRIPTOR_DATA *d;
  CHAR_DATA *ch;

    for ( d = first_descriptor; d; d = d->next )
    {
            if ( d->connected == CON_PLAYING )
              ch = d->character;
            else
              continue;

      for ( timer = ch->first_timer; timer; timer = timer_next )
        {
            timer_next = timer->next;
            if ( --timer->count <= 0 )
            {
                if ( timer->type == TIMER_DO_FUN )
                {
                    int tempsub;
                    DO_FUN *current = timer->do_fun;

                    tempsub = ch->substate;
                    ch->substate = timer->value;
                    extract_timer( ch, timer );
                    (current)( ch, "" );
                    if ( char_died(ch) )
                      break;
                    ch->substate = tempsub;
                }
                else
                  extract_timer( ch, timer );
            }
        }
   }
   return;
}


then in update_handler add:


static  int     pulse_timercheck;

if ( --pulse_timercheck     <= 0 )
    {
        pulse_check      = PULSE_TIMERCHECK;
        update_timers     ( );
    }


add the PULSE_TIMERCHECK to mud.h

I whipped this up real quick, hopefully you can fill in the blanks. But this should give you control over the timers as you want.
[Go to top] top

Posted by Dace K   Canada  (169 posts)  [Biography] bio
Date Reply #2 on Sat 10 May 2003 10:52 PM (UTC)
Message
Boborak 0wns. Just thought you all should know that =D.

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
[Go to top] 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.


4,126 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]