Have outfit: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
Created page with '{{#vardefine:name|have_outfit}} {{#vardefine:return_type|boolean}} {{FunctionPage| name={{#var:name}}| function_category=Equipment| function1={{Function| name={{#var:name}}| ag…'
 
imported>Bale
see also
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{#vardefine:name|have_outfit}}
{{
{{#vardefine:return_type|boolean}}
#vardefine:name|have_outfit}}{{
#vardefine:return_type|boolean}}{{


{{FunctionPage|
FunctionPage|
name={{#var:name}}|
name={{#var:name}}|
function_category=Equipment|


function1={{Function|
function1={{Function|
Line 15: Line 15:
}}|
}}|


function_description=This function returns true if you have all parts of the outfit {{Pspan|name}} and meet all of the stat requirements to equip it. You can specify an in-game or custom outfit for {{Pspan|name}}.|
function_description=This function returns true if you have all parts of the outfit {{Pspan|name}} and meet all of the stat requirements to equip it. {{Pspan|name}} can be a default outfit or a custom outfit.|


needscode=yes|


see_also={{SeeAlso|outfit}}|
code1={{CodeSample|
title=Code Sample|
description=The following code will attempt to buy herbs from the [http://kol.coldfront.net/thekolwiki/index.php/The_Hippy_Store The Hippy Store].|
code=<syntaxhighlight>
if ( have_outfit( "Filthy Hippy Disguise" ) )
{
  outfit( "Filthy Hippy Disguise" );
  buy( 1 , $item[ herbs ] );
}
else
  print( "Cannot purchase herbs from the Hippy Store, you junkie." );
</syntaxhighlight>
}}|
 
see_also={{SeeAlso|outfit|outfit_pieces|is_wearing_outfit|get_outfits|get_custom_outfits}}|
cli_equiv=The CLI command command "outfit" with the parameter "list" gives information on the in-game outfits you have available (but does not list custom outfits or check for whether the outfit can be equipped).|
cli_equiv=The CLI command command "outfit" with the parameter "list" gives information on the in-game outfits you have available (but does not list custom outfits or check for whether the outfit can be equipped).|
special=Note that this function does not check for miscellaneous requirements such as Torso Awaregness.|
}}
}}
{{RFI|Does this function check for misc. requirements such as torso & chefstaff wielding ability?|The custom outfit part was already listed; but how? (It doesn't work for me, is a specific prefix required? What?)}}
 
[[Category:Equipment]]

Latest revision as of 23:04, 20 November 2014

Function Syntax

boolean have_outfit(string name )

  • name is an outfit to check for

This function returns true if you have all parts of the outfit name and meet all of the stat requirements to equip it. name can be a default outfit or a custom outfit.

Code Sample

The following code will attempt to buy herbs from the The Hippy Store.

if ( have_outfit( "Filthy Hippy Disguise" ) )
{
   outfit( "Filthy Hippy Disguise" );
   buy( 1 , $item[ herbs ] );
}
else
   print( "Cannot purchase herbs from the Hippy Store, you junkie." );

CLI Equivalent

The CLI command command "outfit" with the parameter "list" gives information on the in-game outfits you have available (but does not list custom outfits or check for whether the outfit can be equipped).

See Also

outfit() | outfit_pieces() | is_wearing_outfit() | get_outfits() | get_custom_outfits()

Special

Note that this function does not check for miscellaneous requirements such as Torso Awaregness.