Tavern: Difference between revisions
Jump to navigation
Jump to search
imported>StDoodle Created page with '{{ #vardefine:name|tavern}}{{ #vardefine:return_type|int}}{{ FunctionPage| name={{#var:name}}| function_category=Adventuring| function1={{Function| name={{#var:name}}| aggregat…' |
imported>Padth Previous information was way wrong |
||
(9 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
FunctionPage| | FunctionPage| | ||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
Line 14: | Line 13: | ||
}}| | }}| | ||
function_description=Attempts to complete the level 3 tavern quest. Returns the | function2={{Function| | ||
name={{#var:name}}| | |||
aggregate={{#var:aggregate}}| | |||
return_type={{#var:return_type}}| | |||
return_also={{#var:return_also}}| | |||
parameter1={{Param|string|target}}| | |||
p1desc={{Pspan|target}} is the (optional) target destination (one of "faucet", "baron", "fight", or "explore".) Defaults to "faucet".| | |||
}}| | |||
function_description=Attempts to complete the level 3 tavern quest, stopping when it has reached the target specified. "faucet" and "baron" will find the faucet and the baron respectively, "fight" will find and fight the baron, and "explore" will explore the entire cellar. Returns the square the faucet or baron is found in, 0 if "explore" is chosen, or -1 if an error is encountered. | |||
| | |||
code1={{CodeSample| | |||
title=Code Sample| | |||
description=Solve the Typical Tavern.| | |||
code= | |||
<syntaxhighlight> | |||
int square = tavern(); | |||
if(get_property("tavernLayout").contains_text("3")) { | |||
print("Found the Rat Faucet in square " + square); | |||
if(available_amount($item[Baron von Ratsworth's monocle]) == 0 | |||
&& available_amount($item[Baron von Ratsworth's money clip]) == 0 | |||
&& available_amount($item[Baron von Ratsworth's tophat]) == 0 | |||
&& user_confirm("Do you want to fight Baron Von Ratsworth?")) { | |||
tavern("fight"); | |||
} | |||
} else print("Did not find the rat faucet.", "red"); | |||
</syntaxhighlight> | |||
}}| | |||
cli_equiv=The CLI | see_also={{SeeAlso|chamber|entryway|guardians|hedgemaze}}| | ||
cli_equiv=The CLI commands "tavern" and "baron" function similarly.| | |||
}} | }} | ||
[[Category:Adventuring]] |
Latest revision as of 13:55, 28 July 2014
Function Syntax
int tavern()
- target is the (optional) target destination (one of "faucet", "baron", "fight", or "explore".) Defaults to "faucet".
Attempts to complete the level 3 tavern quest, stopping when it has reached the target specified. "faucet" and "baron" will find the faucet and the baron respectively, "fight" will find and fight the baron, and "explore" will explore the entire cellar. Returns the square the faucet or baron is found in, 0 if "explore" is chosen, or -1 if an error is encountered.
Code Sample
Solve the Typical Tavern.
int square = tavern();
if(get_property("tavernLayout").contains_text("3")) {
print("Found the Rat Faucet in square " + square);
if(available_amount($item[Baron von Ratsworth's monocle]) == 0
&& available_amount($item[Baron von Ratsworth's money clip]) == 0
&& available_amount($item[Baron von Ratsworth's tophat]) == 0
&& user_confirm("Do you want to fight Baron Von Ratsworth?")) {
tavern("fight");
}
} else print("Did not find the rat faucet.", "red");
CLI Equivalent
The CLI commands "tavern" and "baron" function similarly.