Feature - Implemented Include terrarium familiar equipment in avaliable_amount()

Bale

Minion
Short version:

  • I've got a legion helicopter equipped on my slimeling
  • I switch familiars to my GGG
  • "fold loathing legion necktie"
  • Ooops, that does not work since it is incapable to taking the helicopter off of my slimeling
 

Veracity

Developer
Staff member
Hmm.

> ash available_amount( $item[ hypodermic needle] )

Returned: 0

> ash retrieve_item( 1, $item[ hypodermic needle] )

Stealing hypodermic needle from Sucky Grrl the Mosquito...
Returned: true
We have an internal function - ItemManager.getAccessibleCount() which looks at all the places you might have an item stashed that are easily accessible. I.e., no mall store, no display - and no closet UNLESS you have autoSatisfyWithCloset. It looks in inventory, equipment, your terrarium, freepulls, and in storage if you are out of ronin and in the clan stash if you are out of ronin and have autoSatisfyWithStash set to true.

We also have an internal function - ItemManager.retrieveItem - which will put the desired items into inventory. It will get items from any of the above places, and additionally will create, buy from NPCs, buy from the mall, trade with the hermit or trapper, redeem for coffee pixie sticks or game shop snacks, and so on.

We have two ASH functions which are similar:

available_amount() is like InventoryManager.getAccessibleCount() except it does not look in the terrarium and it always looks in the closet, regardless of autoSatisfyWithCloset.
retrieve_item() calls InventoryManager.retrieveItem().

I believe that available_amount() should call InventoryManager.getAccessibleCount() - which will make it look in the terrarium and obey the autosatisfyWithCloset setting. Those are good, because if you follow it up with retrieve_item(), that function will also do those things.

I will do that.

That is a different issue than the "fold" command. That explicitly looks only at inventory and your equipment. You want the "fold" command to look in the terrarium? That requires a change in the "fold" command, not in the ASH available_amount() function.
 

Veracity

Developer
Staff member
Revision 9421 makes available_amount() call InventoryManager.getAccesssibleCount().
 
I believe that available_amount() should call InventoryManager.getAccessibleCount() - which will make it look in the terrarium and obey the autosatisfyWithCloset setting. Those are good, because if you follow it up with retrieve_item(), that function will also do those things.

I will do that.
Thank you. That will be nice.

That is a different issue than the "fold" command. That explicitly looks only at inventory and your equipment. You want the "fold" command to look in the terrarium? That requires a change in the "fold" command, not in the ASH available_amount() function.

I think Bale might have posted in the wrong feature request. More likely the post was intended to go here.
 

Bale

Minion
I think Bale might have posted in the wrong feature request. More likely the post was intended to go here.

I will confess to confusion. I read that first, then I read this thread and because you implied you'd make a feature request for it, I didn't read this one carefully.
 

xKiv

Active member
Short version:

  • I've got a legion helicopter equipped on my slimeling
  • I switch familiars to my GGG
  • try; acquire legion helicopter
  • "fold loathing legion necktie"
  • Ooops, that does not work since it is incapable to taking the helicopter off of my slimeling

I think this works (removes the helicopter even from different familiar). Not sure what it does if you have some other LL form.
 

Bale

Minion
Code:
Taking Princess Vina the Slimeling out of terrarium...
Requests complete.

[COLOR="#808000"]> fold legion helicopter[/COLOR]

Taking off Loathing Legion moondial...
Equipment changed.
You acquire an item: Loathing Legion helicopter
Putting on Loathing Legion helicopter...
Equipment changed.
Putting Princess Vina the Slimeling back into terrarium...
Taking Kyubey the Li'l Xenomorph out of terrarium...
Requests complete.

[COLOR="#808000"]> fold legion necktie[/COLOR]

[COLOR="#ff0000"]You don't have anything transformable into that item![/COLOR]

[COLOR="#808000"]> acquire legion necktie[/COLOR]

[COLOR="#ff0000"]You need 1 more Loathing Legion necktie to continue.[/COLOR]

[COLOR="#808000"]> acquire legion helicopter[/COLOR]

Stealing Loathing Legion helicopter from Princess Vina the Slimeling...
Requests complete.

[COLOR="#808000"]> fold legion necktie[/COLOR]

You acquire an item: Loathing Legion necktie

Well, the acquire definitely works. This means I need to make an alias for fold which will search for any available form of the item (if the item itself is not available) and acquire it before folding. This is an reasonably solvable problem now.
 

Bale

Minion
Alias complete. I wonder if I should find a beter name for it than "fol"? It's a shame that I cannot call it fold or else it recurses, badly.

PHP:
alias fol => ashq item it = to_item($string[%%]); if(available_amount(it) > 0) retrieve_item(1, it); else foreach oth in get_related(it, "fold") if(available_amount(oth) > 0 && retrieve_item(1, oth)) cli_execute("fold "+it);

It works quite nicely.
 

Bale

Minion
It seems I couldn't stop with a good alias. I had to make it a great one. This version equips the newly folded item if it is equipment. (It only equips accessories if there's an empty accessory slot 'cause otherwise its destination isn't obvious.) Since it is obvious I want to use any newly folded equipment this seemed a good thing to do.

PHP:
alias fol => ashq item it = to_item($string[%%]); if(available_amount(it) > 0) retrieve_item(1, it); else foreach oth in get_related(it, "fold")if(available_amount(oth) > 0 && retrieve_item(1, oth)){cli_execute("fold "+it); break;} boolean fs(){foreach a in $slots[acc1,acc2,acc3] if(equipped_item(a) == $item[none]) return true; return false;}if(available_amount(it) > 0) switch(to_slot(it)){case $slot[none]: exit; case $slot[acc1]: if(!fs()) exit; default: equip(it);}
 
Top