Difference between pages "Get ignore zone warnings" and "Get chateau"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Bale
(r12662)
 
imported>Degrassi knowles
m (very minor cleanup.)
 
Line 1: Line 1:
 
{{
 
{{
#vardefine:name|get_ignore_zone_warnings}}{{
+
#vardefine:name|get_chateau}}{{
#vardefine:return_type|boolean}}{{
+
#vardefine:return_type|int [item]}}{{
 +
#vardefine:aggregate|yes}}{{
  
 
FunctionPage|
 
FunctionPage|
Line 8: Line 9:
 
function1={{Function|
 
function1={{Function|
 
name={{#var:name}}|
 
name={{#var:name}}|
return_type={{#var:return_type}}
+
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 
}}|
 
}}|
  
function_description=Returns the value of the KoL option to disable the "This area might be too tough for you" warnings. If KoL ignores those stat requirement warnings, then this returns true.|
+
function_description=Returns a map of your chateau 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 Samples|
+
title=Code Sample|
description=If the character can access the White Citadel, this code will buy Cherry Cloaca Colas to restore MP to max.|
+
description=The following checks if Chateau Mantegna is available and then prints the contents and painting status.|
 
code=
 
code=
 
<syntaxhighlight>
 
<syntaxhighlight>
if( !get_ignore_zone_warnings() && my_buffedstat( my_primestat() ) < my_location().recommended_stat )
+
  if(to_boolean(get_property("chateauAvailable")))
  print( "Warning! Your stat is too low!" );
+
  {
</syntaxhighlight>
+
    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|my_buffedstat|my_location}}|
+
see_also={{SeeAlso|get_campground}}|
 
}}
 
}}
  
[[Category:Your Character]]
+
[[Category:Item Management]]

Latest revision as of 22:08, 8 July 2016

Function Syntax

int [item] get_chateau()

Returns a map of your chateau 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);
  }

See Also

get_campground()