Feature - Implemented Fancy and Candy items

slyz

Developer
Among all the item attributes we record in tradeitems.txt, it looks like the two "secondary use" attributes users don't have access to is "fancy" and "candy".

Here is a patch that adds those two boolean fields to item proxy records:
Code:
> ash $item[ coconut shell ]

Returned: coconut shell
plural => coconut shells
descid => 330145487
image => coconut.gif
levelreq => 0
quality =>
adventures =>
muscle =>
mysticality =>
moxie =>
fullness => 0
inebriety => 0
spleen => 0
notes =>
combat => false
reusable => false
usable => false
multi => false
fancy => true
candy => false
bounty => none
bounty_count => 0
seller => none
buyer => none

The patch also adds two ASH function:
Code:
boolean is_fancy( item )
boolean is_candy( item )

I didn't commit straight away because I'm not sure we want to use both methods: should I stick to proxy record, or ASH functions?
 

Attachments

  • fancycandy.patch
    3.4 KB · Views: 29

slyz

Developer
Proxy record fields it is then. r10122.

Here is a little ASH script that gives you price info on candies:
PHP:
item [ int ] candies;

foreach it in $items[]
{
	if ( it.candy )
	{
		candies[ candies.count() ] = it;
	}
}

print( "Considering " + candies.count() + " candies..." );

int get_price( item it )
{
	if ( !it.is_tradeable() ) return it.autosell_price();
	if ( it.autosell_price() == 0 ) return it.mall_price();
	if ( it.mall_price() > max( 2 * it.autosell_price(), 100 ) ) return it.mall_price();
	return it.autosell_price();
}

sort candies by value.get_price();

for i from 1 to 30 print( candies[ i ] + " - value: " + candies[ i ].get_price()+ " meat ( autosell: " + candies[ i ].autosell_price() + " - mall: " + candies[ i ].mall_price() + " )" );
 

Theraze

Active member
It's counted "candy drops" as a valid maximization field when I tried it this week... Can't just maximize candy, but candy drops works.
 

Theraze

Active member
Type it in? Beeosity isn't in the list either, but it's a valid keyword, and one I heavily suggest using if you ever go back into a beecore run.
 

slyz

Developer
Eh, I just wanted to feed my mimic optimally, it looks like this is going to be a lot more helpful than I expected.
 
Top