[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]  Combat rounds
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Combat rounds

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Zuccuss   (8 posts)  [Biography] bio
Date Fri 16 Jan 2004 06:13 PM (UTC)  quote  ]
Message
Does anyone know where I would change the length of combat rounds and how complicated this would be? Thanks!
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Reply #1 on Fri 16 Jan 2004 08:31 PM (UTC)  quote  ]
Message
I think you want to look at PULSE_VIOLENCE or something like that, which should be in mud.h.

However, changing this might have consequences you don't expect. I think that combat rounds are used for many things other than combat; for one, spell effect durations are in combat rounds. I think that some mob behavior as well is dependent on combat rounds, but I'm not sure about that.

The function that processes combat rounds is violence_update in fight.c, if I'm not mistaken.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Meerclar   USA  (606 posts)  [Biography] bio
Date Reply #2 on Fri 16 Jan 2004 10:27 PM (UTC)  quote  ]
Message
Spell durations and most of the other things Ksilyan mentioned are actually measured in ticks, not combat rounds. There are some other issues to address when you tinker with combat rounds though, spell recasting delay, skill reuse timers and most of the other delay timers are handled on the violence_update function that works based on combat rounds. I would *strongly* advise against tinkering with combat round durations until you have looked at everything else that might be affected by that change. There may be things affected by this that you'd never even imagine would be connected to it.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Reply #3 on Sat 17 Jan 2004 12:32 AM (UTC)  quote  ]
Message
If by tick you mean the area reset, I would be astounded if spell durations are counted in those.

Unless it's changed since SMAUG 1.0, effect durations are measured in violence_update...


/*
		 * We need spells that have shorter durations than an hour.
		 * So a melee round sounds good to me... -Thoric
		 */
		for ( paf = ch->first_affect; paf; paf = paf_next )
		{
			paf_next	= paf->next;
			
			if ( paf->duration > 0 )
			{
				paf->duration--;
			} 
			else if ( paf->duration < 0 )
			{
			}
			else
			{
				if ( !paf_next
					||	  paf_next->type != paf->type
					||	  paf_next->duration > 0 )
				{
					skill = get_skilltype(paf->type);
					if ( paf->type > 0 && skill && skill->msg_off )
					{
						set_char_color( AT_WEAROFF, ch );
						send_to_char( skill->msg_off, ch );
						send_to_char( "\n\r", ch );
					}
				}
				if (paf->type == gsn_possess)
				{
					ch->GetConnection()->CurrentCharId = ch->GetConnection()->OriginalCharId;
					ch->GetConnection()->OriginalCharId = 0;
					ch->GetConnection()->GetCharacter()->SwitchedCharId = 0;
					ch->GetConnection()->GetCharacter()->SetConnection( ch->GetConnection() );
					ch->SetConnection( NULL );
				}
				
				
				affect_remove( ch, paf );
			}
		}


Maybe Thoric took it out in later versions, but I know that it was not added to our custom codebase by the coders before me.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Zuccuss   (8 posts)  [Biography] bio
Date Reply #4 on Sat 17 Jan 2004 08:46 PM (UTC)  quote  ]
Message
What I'm trying to do here is make combat rounds take a random amount of time between like 1-3 ticks. However, I still want spells and abilities to take a set amount of time.

This is from mud.h:

#define SECONDS_PER_TICK 70

#define PULSE_PER_SECOND 4
#define PULSE_VIOLENCE (3 * PULSE_PER_SECOND)
#define PULSE_MOBILE (4 * PULSE_PER_SECOND)
#define PULSE_TICK (SECONDS_PER_TICK * PULSE_PER_SECOND)
#define PULSE_AREA (60 * PULSE_PER_SECOND)
#define PULSE_AUCTION (9 * PULSE_PER_SECOND)

Could i make a #define PULSE_SKILLS (some set time), then change PULSE_VIOLENCE to random time?
The problems I see with this are that I'd have to revamp fight.c so skill use and spell casting isn't in violence_update (which would be ran with random times), but in something else which would be ran off of PULSE_SKILLS. Any ideas?

p.s. I've tried to add a WAIT_STATE at the beginning of the violence_update function but instead of adding time to each round it adds time after combat has been completed for some reason.
[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.


2,114 views.

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [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.

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]