Can interact: Difference between revisions
Jump to navigation
Jump to search
imported>Grotfang m moved Can interact() to Can interact |
imported>Grotfang No edit summary |
||
Line 1: | Line 1: | ||
{{#vardefine:name|can_interact}} | |||
{{#vardefine:return_type|boolean}} | |||
{{FunctionPage| | |||
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=This function returns true if the logged-in character is subject to neither Hardcore nor Ronin restrictions. If the character has not spent the requisite turns and/or has not freed the King (for Hardcore characters), the function returns false.| | |||
When not logged in, this function returns | code1={{CodeSample| | ||
title=Code Samples| | |||
description=This is commonly used to determine whether a player can access the mall.| | |||
code= | |||
<syntaxhighlight> | |||
if(can_interact()) { | |||
buy(3 , $item[hot hi mein]); | |||
} | |||
else { | |||
adventure(10 , $location[Knob Goblin Kitchens]); | |||
} | |||
</syntaxhighlight> | |||
}}| | |||
see_also={{SeeAlso|in_hardcore|adventure|buy}}| | |||
special=When not logged in, this function returns false. | |||
}} |
Revision as of 14:18, 1 March 2010
Function Syntax
boolean can_interact()
This function returns true if the logged-in character is subject to neither Hardcore nor Ronin restrictions. If the character has not spent the requisite turns and/or has not freed the King (for Hardcore characters), the function returns false.
Code Samples
This is commonly used to determine whether a player can access the mall.
if(can_interact()) {
buy(3 , $item[hot hi mein]);
}
else {
adventure(10 , $location[Knob Goblin Kitchens]);
}
See Also
Special
When not logged in, this function returns false.