Question about state of variables

So, is ASH a language whereby variables actually store an equation, and work out the current state at the moment?

To put it another way (from the MaxMp.ash script):

Suppose I have full mp...

mpFull = (my_mp() == my_maxmp());

.. and then I script to adventure a few times, casting saucegeyser.

Print ("Do I have full mana?: " + mpFull);

is this gonna work out the current state of MpFull (ie, false), or is it gonna remember the one figured out at the start of the script? I *had* thought that if you wanted a dynamic value, you'd have to use a subroutine.. this question is less about the actual example, more about my understanding of ASH..

Cheers
R
 

jasonharper

Developer
No; a boolean variable (for example) stores a specific boolean value, set at the time the variable was most recently assigned.
 

heeheehee

Developer
Staff member
You can, however, totally do this with user-defined functions.
So, for instance:
Code:
boolean mpFull () {
   if(my_mp() == my_maxmp()) return true;
   return false;
}
And then a bit of code for testing... if(!mpFull()) print(Your MP is not full!);
 
Top