My ascensions: Difference between revisions
Jump to navigation
Jump to search
imported>Heeheehee Page added with two (!) examples! |
imported>Bale Valhalla revamp in r9307 |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 5: | Line 5: | ||
FunctionPage| | FunctionPage| | ||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
Line 22: | Line 21: | ||
<syntaxhighlight> | <syntaxhighlight> | ||
boolean mcd_max() { | boolean mcd_max() { | ||
if (my_ascensions() < 1 || in_bad_moon()) return true; | |||
if(my_ascensions() < 1 || in_bad_moon()) | |||
// Heartbreaker's Hotel uses an adventure, and I don't think you want that. | // Heartbreaker's Hotel uses an adventure, and I don't think you want that. | ||
int maxmcd = 10 + canadia_available().to_int() | |||
return (current_mcd() == maxmcd) ? true : change_mcd(maxmcd); | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
{{CodeSample| | |||
description=The following baby of a function checks if you have mall access.| | description=The following baby of a function checks if you have mall access.| | ||
code= | code= | ||
<syntaxhighlight> | <syntaxhighlight> | ||
boolean mall_access() { | boolean mall_access() { | ||
if(my_ascensions() < 1) return (my_level() > 4); | if (my_ascensions() < 1) return (my_level() > 4); | ||
// Easier to type >4 than >= 5. | // Easier to type >4 than >= 5. | ||
return can_interact(); | return can_interact(); | ||
Line 43: | Line 39: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}}| | }}| | ||
see_also={{SeeAlso| | see_also={{SeeAlso|my_name|my_class|my_primestat}}| | ||
special=When not logged in, this function returns false. | special=When not logged in, this function returns false. | ||
}} | }} | ||
[[Category:Your Character]] |
Latest revision as of 10:10, 19 May 2011
Function Syntax
int my_ascensions()
Returns the number of times your character has ascended. Useful for checking several states that appear only after ascending the first time.
Code Samples
The following function sets the MCD to the maximum possible value.
boolean mcd_max() {
if (my_ascensions() < 1 || in_bad_moon()) return true;
// Heartbreaker's Hotel uses an adventure, and I don't think you want that.
int maxmcd = 10 + canadia_available().to_int()
return (current_mcd() == maxmcd) ? true : change_mcd(maxmcd);
}
The following baby of a function checks if you have mall access.
boolean mall_access() {
if (my_ascensions() < 1) return (my_level() > 4);
// Easier to type >4 than >= 5.
return can_interact();
}
See Also
Special
When not logged in, this function returns false.