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 ➜ Smaug spells

Smaug spells

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


Posted by Halomantis   (27 posts)  Bio
Date Wed 09 Jul 2003 02:32 AM (UTC)
Message
I was looking into and trying to understand the skills and spells in stock smaug(FUSS) one of the skills is blitz. I looked into in through skills.dat file.

#SKILL
Name blitz~
Type Skill
Info 9096
Flags 6144
Target 1
Minpos 105
Rounds 8
Code spell_smaug
Dammsg Blitz~
Hitchar You attack $N with a set of furious blows.~
Dice l/2 { 40~
Minlevel 28
End

ok each step I kinda understand
Name - understood
Type - understood
Info - ok ????
Flags - ok ????
Target - kinda understood
Minpos - not worried about since I can play with it online
rounds - understood
code - understood
dammsg - understood
hitchar - understood
dice - ok normaly understood but what is the { in the equation. it looks level divided in half and something 40......
minlevel - understood

can anyone explain how to understand the parts I have no-clue on.


Thanks beforehand!
Top

Posted by Halomantis   (27 posts)  Bio
Date Reply #1 on Wed 09 Jul 2003 02:38 AM (UTC)
Message
ok I think I got it all using slookup except for the equation..... what is the '{' in the equation?
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #2 on Wed 09 Jul 2003 04:31 AM (UTC)
Message
What does slookup say in the dice section of the smaug spell? That'll probably give hints as to what '{' means. I'd help you more if I could, but my version of SMAUG is older than 1.4 and doesn't have that feature...

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Halomantis   (27 posts)  Bio
Date Reply #3 on Wed 09 Jul 2003 04:56 AM (UTC)
Message
Sn: 176 Slot: 0 Skill: 'blitz '
DamType: none ActType: create ClassType: death PowerType: minor
Flags: noscribe nobrew
Saves: none SaveEffect: halfdam
Type: Skill Target: offensive Minpos: 5 Mana: 0 Beats: 8 Range: 0
Flags: 6144 Guild: -1 Value: 0 Info: 9096 Code: spell_smaug
Sectors Allowed: All
Dammsg: Blitz
Wearoff: (none set)
Dice: l/2 { 40
Hitchar : You attack $N with a set of furious blows.
--------------------------[CLASS USE]--------------------------
Mag) lvl: 51 max: 95% Cle) lvl: 51 max: 95% Thi) lvl: 51 max: 95%
War) lvl: 28 max: 80% Vam) lvl: 51 max: 95% Dru) lvl: 51 max: 95%
Ran) lvl: 51 max: 95% Aug) lvl: 51 max: 95% Pal) lvl: 51 max: 95%
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #4 on Wed 09 Jul 2003 07:33 AM (UTC)
Message
"Use the Source, Luke ...".

The source gives a clue. Looking at spell_smaug I see this:


/*                                                                  -Thoric
 * Fancy dice expression parsing complete with order of operations,
 * simple exponent support, dice support as well as a few extra
 * variables: L = level, H = hp, M = mana, V = move, S = str, X = dex
 *            I = int, W = wis, C = con, A = cha, U = luck, A = age
 *
 * Used for spell dice parsing, ie: 3d8+L-6
 *
 */
i


I also see:


   switch(operation)
    {
        case '-':               total -= rd_parse(ch, level, sexp[1]);  break;
        case '+':               total += rd_parse(ch, level, sexp[1]);  break;
        case '*':               total *= rd_parse(ch, level, sexp[1]);  break;
        case '/':               total /= rd_parse(ch, level, sexp[1]);  break;
        case '%':               total %= rd_parse(ch, level, sexp[1]);  break;
        case 'd': case 'D':     total = dice( total, rd_parse(ch, level, sexp[1]
) );    break;
        case '<':               total = (total < rd_parse(ch, level, sexp[1]));
        break;
        case '>':               total = (total > rd_parse(ch, level, sexp[1]));
        break;
        case '=':               total = (total == rd_parse(ch, level, sexp[1]));
        break;
        case '{':               total = UMIN( total, rd_parse(ch, level, sexp[1]
) );    break;
        case '}':               total = UMAX( total, rd_parse(ch, level, sexp[1]
) );    break;

        case '^':
        {
            int y = rd_parse(ch, level, sexp[1]), z = total;

            for (x = 1; x < y; ++x, z *= total);
            total = z;
            break;
        }
    }
    return total;


So, it seems to be something to do with the minimum of two numbers. :)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #5 on Wed 09 Jul 2003 07:57 AM (UTC)
Message
In the game try typing HELP DICEFORMULAS:


To make the special SMAUG spells possible, special dice formula handling
had to be coded in.  (At least to make it nice).  This dice formula code
supports full BEDMAS expressions ( ) ^^ / * + -, plus extra mud related
operators and variables:

D dice         L level          H hit points      M mana
V movement     S strength       I intelligence    W wisdom
X dexterity    C consitution    A charisma        U luck
Y age


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Halomantis   (27 posts)  Bio
Date Reply #6 on Wed 09 Jul 2003 05:57 PM (UTC)
Message
Sweet, see I learn something new every day.... Thanks!!
Top

Posted by Typhon   USA  (112 posts)  Bio
Date Reply #7 on Sun 13 Jul 2003 11:29 AM (UTC)
Message
hehe just fyi the {
Dice: l/2 { 40
means that it calculates the number and { is the max :p
so nomatter what blitz maxes out at 40 damage
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #8 on Mon 14 Jul 2003 01:35 AM (UTC)
Message
Looking at the code above, "{" does a UMIN (unsigned minimum).

Thus the damage would be the minimum of intelligence divided by 2, and 40.

So you are right, the maximum is 40, because it takes the minimum of 2 numbers. A bit confusing.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


28,931 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.