My basestat: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
No edit summary
imported>Grotfang
Conform to template
Line 1: Line 1:
[[int]] '''[[my_basestat()|my_basestat]]( [[stat]] st )'''
{{#vardefine:name|my_basestat}}
{{#vardefine:return_type|int}}


This function returns the base (unbuffed) value of the logged-in character's particular [[stat]] as an [[int]].
{{FunctionPage|
name={{#var:name}}|
function_category=Your Character|


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]].
function1={{Function|
name={{#var:name}}|
aggregate={{#var:aggregate}}|
return_type={{#var:return_type}}|
return_also={{#var:return_also}}|
parameter1={{Param|stat|st}}|
p1desc=Enter the stat you want to return the unbuffed value of.
}}|


<code>
function_description=This function returns the base (unbuffed) value of the logged-in character's particular stat as an int.</p><p>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()|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.
code1={{CodeSample|
title=Code Samples|
description=Prints your unbuffed mainstat.|
code=
<syntaxhighlight>
print("My base main stat: " + my_basestat(my_primestat()));
</syntaxhighlight>
}}|
code2={{CodeSample|
description=Prints each stat value.|
code=
<syntaxhighlight>
print("My base muscle: " + my_basestat($stat[muscle]));
print("My base mysticality: " + my_basestat($stat[mysticality]));
print("My base moxie: " + my_basestat($stat[moxie]));
print("My current muscle substats: " + my_basestat($stat[submuscle]));
print("My current mysticality substats: " + my_basestat($stat[submysticality]));
print("My current moxie substats: " + my_basestat($stat[submoxie]));
</syntaxhighlight>
}}|
 
see_also={{SeeAlso|my_primestat|my_buffedstat}}|
special=When not logged in, this function will return 0 regardless of parameter.
}}

Revision as of 13:20, 1 March 2010



Function Syntax

int my_basestat(stat st )

  • Enter the stat you want to return the unbuffed value of.

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 Samples

Prints your unbuffed mainstat.

print("My base main stat: " + my_basestat(my_primestat()));

Prints each stat value.

print("My base muscle: " + my_basestat($stat[muscle]));
print("My base mysticality: " + my_basestat($stat[mysticality]));
print("My base moxie: " + my_basestat($stat[moxie]));
print("My current muscle substats: " + my_basestat($stat[submuscle]));
print("My current mysticality substats: " + my_basestat($stat[submysticality]));
print("My current moxie substats: " + my_basestat($stat[submoxie]));

See Also

my_primestat() | my_buffedstat()

Special

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