Re: [NEWBIE] [CODE]

From: Edward Glamkowski (EGlamkowski@MATHEMATICA-MPR.COM)
Date: 12/19/97


>>    af[0].modifier=1+(level>18);
>
>Uhhhh... no. You just said: add 1 to the charactors level which is greater
>than 18.
>
Actually, this is entirely reasonable, and if I'm not mistaken, stock.
It means that higher level casters add 2 to the victim's strength
instead of one.
(level > 18) evaluates to 1 (if caster's level is greater than 18) or
0 (if caster's level is less than or equal to 18).
Alternately, you could write: 1 + (level > 18) ? 1 : 0;
but why? :P

I actually use this quite a bit in my own spells :)


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST