QUERY_WORN(L)

NAME
	query_worn - return mapping of worn armour

SYNOPSIS
	mapping query_worn();

LOCATION
	Any living object (/obj/living_functions.c)

RETURN VALUE
	This returns a mapping of armour types to armour objects.

DESCRIPTION
	Query_worn() returns a mapping of armour types ("armour", "boot",
	etc) to those objects of appropriate type worn by the player.  If
	a player is not wearing any armour of that type, the type does
	not appear in the return.

EXAMPLE
	sprintf("%O", this_player()->query_worn())
	-> ([ /* sizeof() == 03 */
	      "boot" : std/simple_armour#2163,
	      "amulet" : std/simple_armour#5793,
	      "armour" : std/lib/shield#19229,
	   ])

	To see if someone were wearing the Boots of Foo, necessary to gain
	entrance into a certain exclusive bar, one might do
        query_foo_boots(object player) {
	object o;

	o = player->query_worn()["boot"];
	if( o && o->id("boots of foo") )
          return 1; /* He gets to party the night away */
	return 0; /* or else he has to wait outside */
	}

NOTES
	Approved armour types are armour, boot, glove, helmet, shield, 
	amulet, cloak.

Help topics available:
add_hp add_money add_sp catch_tell heal_self
hit_player monster_died move_player query_max_sp query_money
query_attack query_npc query_objective query_gender query_possessive
query_pronoun query_gender_string query_sp query_worn query_hp
query_level query_living query_max_hp set_wet stop_fight

[START|BACK ]




[ NannyMuds main page | FAQ | Contact us ]

You are guest number 70 since January 2020.
This file was last modified: June 2000.