Difference between pages "My audience" and "Get chateau"
(Difference between pages)
Jump to navigation
Jump to search
imported>Bale (categories) |
imported>Relyk |
||
Line 1: | Line 1: | ||
{{ | {{ | ||
− | #vardefine:name| | + | #vardefine:name|get_chateau}}{{ |
− | #vardefine:return_type|int}}{{ | + | #vardefine:return_type|int [item]}}{{ |
+ | #vardefine:aggregate|yes}}{{ | ||
FunctionPage| | FunctionPage| | ||
− | |||
name={{#var:name}}| | name={{#var:name}}| | ||
Line 14: | Line 14: | ||
}}| | }}| | ||
− | function_description= | + | function_description=Returns a map of your campground items as integers, keyed by item names. |
+ | <ul> | ||
+ | <li> Most values will be 1 to represent the item exists.</li> | ||
+ | <li> Not all items will be included, players must purchase at least one item for each spot to appear.</li> | ||
+ | <li> Your painting is accessed separately with its own properties.</li> | ||
+ | </ul>| | ||
code1={{CodeSample| | code1={{CodeSample| | ||
− | title=Code | + | title=Code Sample| |
− | description=The following | + | description=The following checks if Chateau Mantegna is available and then prints the contents and painting status.| |
code= | code= | ||
<syntaxhighlight> | <syntaxhighlight> | ||
− | if( | + | if(to_boolean(get_property("chateauAvailable"))) |
− | + | { | |
− | + | int [item] chateau = get_chateau(); | |
− | + | foreach furniture in chateau | |
− | + | { | |
− | + | print(furniture + " " + chateau[furniture]); | |
− | + | } | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | string painting = get_property("chateauMonster"); | |
+ | string fought = get_property("_chateauMonsterFought"); | ||
+ | print(painting + " " + fought); | ||
+ | } | ||
+ | </syntaxhighlight>}}| | ||
+ | see_also={{SeeAlso|get_campground}}| | ||
}} | }} | ||
− | [[Category: | + | [[Category:Item Management]] |
Revision as of 12:31, 29 April 2015
Function Syntax
int [item] get_chateau()
Returns a map of your campground items as integers, keyed by item names.
- Most values will be 1 to represent the item exists.
- Not all items will be included, players must purchase at least one item for each spot to appear.
- Your painting is accessed separately with its own properties.
Code Sample
The following checks if Chateau Mantegna is available and then prints the contents and painting status.
if(to_boolean(get_property("chateauAvailable")))
{
int [item] chateau = get_chateau();
foreach furniture in chateau
{
print(furniture + " " + chateau[furniture]);
}
string painting = get_property("chateauMonster");
string fought = get_property("_chateauMonsterFought");
print(painting + " " + fought);
}