item improvement(item [item] upgrade){
item best;
int profit = 0;
int test_profit;
foreach key in upgrade {
if(historical_age(upgrade[key])>2) mall_price(upgrade[key]);
if(historical_age(key)>2) mall_price(key);
test_profit = historical_price(upgrade[key]) - historical_price(key);
if(test_profit > profit) {
best = key;
profit = test_profit;
}
}
return best;
}
boolean improve_spirits() {
if(my_class() != $class[disco bandit] && my_class() != $class[accordion thief]) {
print("You're not a moxie class, so no booze refinement for you.", "blue");
return false;
}
if(stills_available() == 0) {
print("you have no uses left at the still", "#FFA500");
return false;
}
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 still = improvement(upgrade);
print("Creating " + stills_available()+ " " +upgrade[still]+ " to sell @ "+historical_price(upgrade[still]), "blue");
retrieve_item(stills_available(), still);
create(stills_available(), upgrade[still]);
cli_execute("mallsell * "+ upgrade[still]+ " @ "+ historical_price(upgrade[still]));
return true;
}
void main() {
improve_spirits();
}