How to check if familiar equipment is present on familiar in terrarium?

ereinion

Member
Is there any way to check if any of the familiars in your terrarium has got a certain piece of familiar equipment equipped using ash? I tried with item_amount and have_equipped, but neither seems to be working.
 

slyz

Developer
Did you try available_amount() ?

EDIT:

There's also familiar_equipped_equipment(). You can do something like this:
PHP:
boolean equipped_in_terrarium( item itm )
{
	if ( itm.available_amount() == 0 )
	{
		// no need to check the Terrarium
		return false;
	}

	foreach fam in $familiars[]
	{
		if ( fam == my_familiar() )
		{
			continue;
		}

		if ( fam.familiar_equipped_equipment() == itm )
		{
			return true;
		}
	}
	return false;
}
 
Last edited:

ereinion

Member
available_amount seems to do the trick. Thanks for the help :)

I was considering something akin to your second approach, but I figured there might be a more efficient method available...
 

Bale

Minion
I use this:

PHP:
// This is the amount equipped on unequipped familiars in the terrarium
int terrarium_amount(item it) {
	return available_amount(it) - equipped_amount(it) - item_amount(it)
		- (get_property("autoSatisfyWithCloset") == "true"? closet_amount(it): 0)	// Don't include Closet
		- (get_property("autoSatisfyWithStorage") == "true"? storage_amount(it): 0)  // Don't include Hangk's Storage
		- (get_property("autoSatisfyWithStash") == "true"? stash_amount(it): 0);	// Don't include Clan Stash
}
 
Top