boolean turn_stuff_in(boolean getmeat) {
// turns all your stuff in for dimes/quarters (except 1 if equippable) when profitable
foreach it,n in get_inventory() {
int tot = max(0, n - to_int(can_equip(it)));
if (tot == 0 || !($coinmasters[Dimemaster,Quartersmaster] contains it.buyer) || sell_val(it) > buy_price(it.buyer,it)*200) continue;
vprint("Turning in "+tot+" "+to_string(it)+"...",3);
outfit(right_outfit(it.buyer == $coinmaster[dimemaster])); // avoid lots of checkpoint outfit switching
sell(it.buyer, tot, it);
}
if (getmeat) {
foreach it in $items[fancy seashell necklace, water pipe bomb, commemorative war stein, beer bomb]
buy(it.seller, floor(it.seller.available_tokens / sell_price(it.seller,it)), it);
if (my_path() != "Way of the Surprising Fist") {
int prior_meat = my_meat();
cli_execute("autosell * commemorative war stein; autosell * fancy seashell necklace");
if (my_meat() > prior_meat) vprint("You gained "+(my_meat()-prior_meat)+" meat!",2);
}
}
return (to_int(get_property("availableDimes")) + to_int(get_property("availableQuarters")) == 0);
}