Smaug spells

Posted by Halomantis on Wed 09 Jul 2003 02:32 AM — 9 posts, 32,506 views.

#0
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!
#1
ok I think I got it all using slookup except for the equation..... what is the '{' in the equation?
USA #2
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...
#3
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%
Australia Forum Administrator #4
"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. :)
Australia Forum Administrator #5
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

#6
Sweet, see I learn something new every day.... Thanks!!
USA #7
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
Australia Forum Administrator #8
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.