My basestat: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Zarqon
Redirecting to My basestat()
imported>Grotfang
No edit summary
Line 1: Line 1:
#REDIRECT [[my_basestat()]]
[[int]] '''[[my_basestat()|my_basestat]]( [[stat]] st )'''
 
This function returns the base (unbuffed) value of the logged-in character's particular [[stat]] as an [[int]].
 
Note that this function also accepts $stat[submuscle], $stat[submysticality], and $stat[submoxie] as parameters, in which case it will return the current number of substats as an [[int]].
 
<code>
  [[print()|print]]("My base muscle: " + [[my_basestat()|my_basestat]]($[[stat]][muscle]));
  [[print()|print]]("My base moxie: " + [[my_basestat()|my_basestat]]($[[stat]][moxie]));
  [[print()|print]]("My base mysticality: " + [[my_basestat()|my_basestat]]($[[stat]][mysticality]));
  [[comments|// To grab your base main stat, you can:]]
  [[print()|print]]("My base main stat: " + [[my_basestat()|my_basestat]]([[my_primestat()]]));
  [[comments|// To grab substats, you can:]]
  [[print()|print]]("My current muscle substats: " + [[my_basestat()|my_basestat]]($[[stat]][submuscle]));
</code>
[[Category:Your Character | my_basestat()]]
[[Category:Ash Functions | my_basestat()]]
 
When not logged in, this function will return 0 regardless of parameter.

Revision as of 13:13, 1 March 2010

int my_basestat( stat st )

This function returns the base (unbuffed) value of the logged-in character's particular stat as an int.

Note that this function also accepts $stat[submuscle], $stat[submysticality], and $stat[submoxie] as parameters, in which case it will return the current number of substats as an int.

 print("My base muscle: " + my_basestat($stat[muscle]));
 print("My base moxie: " + my_basestat($stat[moxie]));
 print("My base mysticality: " + my_basestat($stat[mysticality]));
 // To grab your base main stat, you can:
 print("My base main stat: " + my_basestat(my_primestat()));
 // To grab substats, you can:
 print("My current muscle substats: " + my_basestat($stat[submuscle]));

When not logged in, this function will return 0 regardless of parameter.