Can equip: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Bale
Looks good to me!
imported>Bale
mNo edit summary
Line 5: Line 5:
FunctionPage|
FunctionPage|
name={{#var:name}}|
name={{#var:name}}|
function_category=Equipment|


function1={{Function|
function1={{Function|
Line 34: Line 33:
special= Note that this only checks for stat requirements to equip an item, so, for example, checking for a chefstaff will return true if you meet the stat requirements to equip it, even if you don't have Spirit of Rigatoni or a sauce glove. (Similarly, Torso Awareness isn't checked for shirts.)|
special= Note that this only checks for stat requirements to equip an item, so, for example, checking for a chefstaff will return true if you meet the stat requirements to equip it, even if you don't have Spirit of Rigatoni or a sauce glove. (Similarly, Torso Awareness isn't checked for shirts.)|
}}
}}
[[Category:Equipment]]

Revision as of 22:10, 21 May 2010

Function Syntax

boolean can_equip(item check_me )

  • check_me is the item to check

Returns true if, based on your current stats, you are capable of equipping check_me on your character, false if you cannot. Note that this function doesn't check for whether or not you actually have the item; just whether you're capable of equipping it.

Code Sample

Check to see if the character can equip a Hippo Poncho.

if(!have_skill($skill[torso awaregness]))
   print("Cannot equip a shirt if you don't know how to find your own torso!");
if(can_equip($item[hippo poncho]))
   print("You're sexy enough to wear a hippo poncho.", "green");
else print("You're not sexy enough to wear a hippo poncho.", "red");

See Also

have_equipped()

Special

Note that this only checks for stat requirements to equip an item, so, for example, checking for a chefstaff will return true if you meet the stat requirements to equip it, even if you don't have Spirit of Rigatoni or a sauce glove. (Similarly, Torso Awareness isn't checked for shirts.)