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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Can someone help me with this?

Can someone help me with this?

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


Posted by Toy   (206 posts)  [Biography] bio
Date Fri 27 Aug 2004 11:06 PM (UTC)
Message
I'm just looking over some of the stock smaug spells and I ran into a question:

ch_ret spell_fireball( int sn, int level, CHAR_DATA *ch, void *vo )
{
    CHAR_DATA *victim = (CHAR_DATA *) vo;
    static const sh_int dam_each[] =
    {
	  0,
	  0,   0,   0,   0,   0,	  0,   0,   0,   0,   0,
	  0,   0,   0,   0,  30,	 35,  40,  45,  50,  55,
	 60,  65,  70,  75,  80,	 82,  84,  86,  88,  90,
	 92,  94,  96,  98, 100,	102, 104, 106, 108, 110,
    112, 114, 116, 118, 120,    122, 124, 126, 128, 130,
    132, 134, 136, 138, 140,    142, 144, 146, 148, 150,
    152, 154, 156, 158, 160,    162, 164, 166, 168, 170
    };
    int dam;

    level	= UMIN(level, sizeof(dam_each)/sizeof(dam_each[0]) - 1);
    level	= UMAX(0, level);
    dam		= number_range( dam_each[level] / 2, dam_each[level] * 2 );
    if ( saves_spell_staff( level, victim ) )
	dam /= 2;
    return damage( ch, victim, dam, sn );
}


What are the static constants for the dam_each based on? Levels or just random numbers are picked.

Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #1 on Sat 28 Aug 2004 06:17 AM (UTC)
Message
As far as I know, its just random numbers, it seems kinda wasteful to m.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by Toy   (206 posts)  [Biography] bio
Date Reply #2 on Sat 28 Aug 2004 01:44 PM (UTC)
Message
That's what I thought. Thanks. :)

-Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
[Go to top] top

Posted by Toy   (206 posts)  [Biography] bio
Date Reply #3 on Sun 29 Aug 2004 05:27 AM (UTC)
Message
*laughs* bet you can't tell that'd I've basically tough myself how to code by this question.. :p

dam = dice( level, 6 );

Ok, for this, it means the dice rolled is the character's level rolled by 6-sided die? I'm getting a bit confused with the stock coded spells and the way the stock help files are written.

Toy

PS- I got accepted into a technical institute for Software and Application Programmin! Finally will learn how to code right. :)

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #4 on Mon 30 Aug 2004 06:02 AM (UTC)
Message
Yes, dice(level,6) is saying "roll 6 sided dice equal to casters level". As for the fireball spell, I've always hated stuff like that because it's seriously over complicated.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[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.


16,689 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 HostDash]