* NEW QUEST LANGUAGE COOKIE MATH FUNCTIONS.There are now several cookieMath commands which modify an existing cookie in some way:
ADD cookieName, "3" <-- add 3 to cookie
SUB cookieName, "5" <-- subtract 5 from cookie
MUL cookieName, "6" <-- multiply cookie by 6
DIV cookieName, "11" <-- divide cookie by 11
MOD cookieName, "10" <-- modulus operator (remainder from integer division)
And, oh heck, I will have these set the IFc result, as if you had followed each by a COMPARE #<cookieName>, "0"
So
SET A, "5"
SUB "5"
IF= @AisNowZero
IF> @AisNow>Zero
IF< @AisNow<Zero
---------
You can say either MOD or MODULUS in your scripts, by the way.
The modulus operator may give unexpected results for negative numbers as that is not what it is intended for. So it is really only the 'division remainder' for positive numbers, as in:
11/10 = 1 with remainder 1
-11/10 = who knows.
11/-10 = equally cryptic.
I am just passing your wishes along to the c compiler's implementation of the "%" operator (except for mod 0, that I am ignoring).
-----------
Now, just because you CAN do basic calculator math in WoS now, doesn't mean your world SHOULD do calculator math...
The main justification for these functions is for looping, as in:
SET loop, "10000"
@repeat
1: I know a song that gets on everybody's nerves!
SUB loop, "1"
IF> @repeat