Difference between revisions of "My class"
Jump to navigation
Jump to search
imported>StDoodle m |
imported>StDoodle m |
||
Line 1: | Line 1: | ||
− | {{ | + | {{#vardefine:name|my_class}} |
− | {{ | + | {{#vardefine:return_type|class}} |
− | name=my_class| | + | {{FunctionPage| |
− | returns | + | name={{#var:name}}| |
+ | function_category=Your Character| | ||
+ | function1={{Function| | ||
+ | name={{#var:name}}| | ||
+ | aggregate={{#var:aggregate}}| | ||
+ | return_type={{#var:return_type}}| | ||
+ | return_also={{#var:return_also}} | ||
+ | }}| | ||
+ | function_description=Returns the current class of the logged-in character.| | ||
+ | code1={{CodeSample| | ||
+ | title=Code Sample| | ||
+ | description=The following decides how many big rocks to acquire based on the character's class:| | ||
+ | code= | ||
+ | <syntaxhighlight> | ||
+ | int rocks = 1; | ||
+ | |||
+ | if (my_class() == $class[seal clubber] || my_class() == $class[turtle tamer] || my_class() == $class[disco bandit]) { | ||
+ | rocks = 2 | ||
+ | } | ||
+ | </syntaxhighlight>}}| | ||
+ | special=When not logged in, this function returns $[[class]][none]. | ||
}} | }} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 16:12, 28 February 2010
Function Syntax
class my_class()
Returns the current class of the logged-in character.
Code Sample
The following decides how many big rocks to acquire based on the character's class:
int rocks = 1;
if (my_class() == $class[seal clubber] || my_class() == $class[turtle tamer] || my_class() == $class[disco bandit]) {
rocks = 2
}
Special
When not logged in, this function returns $class[none].