Feature simple PVP "stealable" flag

Fluxxdog

Active member
Code:
boolean is_PvP_stealable(item target){
    switch{
    case target==$item[toast]:
    case !is_tradeable(target):
    case autosell_price(target)==0: return false;
    default: return true;}}
This is a little snippet I whipped up to help make sure I closet items that can be stolen (except toast!) and was wondering if an internal function or a proxy field might be more appropriate than having who knows how many people define this function. (Other than toast, of course. Completely personal preference, but I like providing toast fresh from the crotch of an NPZR. Trust me, it's tastier than it sounds.)

Update: There are three items I've found so far that the above function would return false on because they have an autosell_price() of 0 but are actually stealable because they do not actually have a "Cannot be discarded" flag: Valentine, banana peel, useless powder

Update update: Pretty flower too

Update update update: Never mind. Unannounced update.
 
Last edited:

Fluxxdog

Active member
I've thought of both sides, really.

It does seems like something right up zlib's alley, but there seems a catch. What is and isn't stealable is basically hard coded. The toast is something that violates the meaning of stealable only from personal preference. When stuffing my closet, I should be doing something like:
Code:
foreach i in $items[] if(is_PvP_stealable(i) && i!=$item[toast]) put_closet(item_amount(i),i);
Actually, I should go do that now. ...

I would say the strongest case for including this is the inclusion of the name_length included as a proxy field.

In relation to the OP update: Is there anything that would return a true/false for "discardable"? autosell_price()==0 is actually not the same as I've been discovering.
 
Last edited:
Top