void improve_spirits() {
if(stills_available() < 1)
return;
item [item] upgrade;
upgrade[$item[bottle of gin]] = $item[bottle of Calcutta Emerald];
upgrade[$item[bottle of rum]] = $item[bottle of Lieutenant Freeman];
upgrade[$item[bottle of tequila]] = $item[bottle of Jorge Sinsonte];
upgrade[$item[bottle of vodka]] = $item[bottle of Definit];
upgrade[$item[bottle of whiskey]] = $item[bottle of Domesticated Turkey];
upgrade[$item[boxed wine]] = $item[boxed champagne];
upgrade[$item[grapefruit]] = $item[tangerine];
upgrade[$item[lemon]] = $item[kiwi];
upgrade[$item[olive]] = $item[cocktail onion];
upgrade[$item[orange]] = $item[kumquat];
upgrade[$item[soda water]] = $item[tonic water];
upgrade[$item[strawberry]] = $item[raspberry];
upgrade[$item[bottle of sewage schnapps]] = $item[bottle of Ooze-O];
upgrade[$item[bottle of sake]] = $item[bottle of Pete's Sake];
item best;
int profit = 0;
int test_profit;
foreach key in upgrade {
if(historical_age(upgrade[key])>1) mall_price(upgrade[key]);
if(historical_age(key)>1) mall_price(key);
test_profit = historical_price(upgrade[key]) - historical_price(key);
if(test_profit > profit) {
best = key;
profit = test_profit;
}
}
print("Creating " + stills_available()+ " " +upgrade[best]+ " to sell @ "+historical_price(upgrade[best]), "blue");
retrieve_item(stills_available(), best);
create(stills_available(), upgrade[best]);
put_shop(historical_price(upgrade[best]), 0, upgrade[best]);
}