I added the following code to my CounterChecker.ash, in the expensive_semi function, in order to have it consider the Haunted Storage Room as a semi-rare target location. If I set up an appropriate outfit called "copyable", it figures the expected value of the item that would be dropped by the mirror if one is wearing that outfit (well, assuming that "PVPable" is the same thing as tradeable and discardable.... I couldn't find any confirmation of that.). I also added some code to get_semirare(), to do the actual switching of the outfit when adventuring. One thing I didn't do is to update the status message that is displayed at the end of expensive_semi(). It still expects an entry for the winning location in semi_rare. But that's just cosmetic, and doesn't really bother me, personally. Also, you may notice a "FIXME" comment in the code below. None of my "copyable" outfits have more than one of any item, so again it doesn't bother me.
Also, I should take a moment to note that the long-forgotten necklace from The Wreck of the Edgar Fitzsimmons currently appears to have the best value in the mall, but it is absent from CounterChecker.ash. The giant pearl from An Octopus's Garden is also missing from CounterChecker, but that's probably not a big deal if one assumes that it is worth its autosale value of 12k, since that's well below several other semi-rares.
Anyway, here's the code I wrote for the Storage Room:
Code:
static string copyableOutfitName = "copyable";
if (
have_outfit(copyableOutfitName)
&& last_rare != $location[The Haunted Storage Room]
&& canadv($location[The Haunted Storage Room])
) {
int copyableItemCount = 0;
float piecesTotalPrice = 0.0;
foreach index, piece in outfit_pieces(copyableOutfitName) {
if (item_amount(piece) + equipped_amount(piece) < 1) {
//FIXME: correctly handle outfits with duplicate items.
copyableItemCount = 0; // force failure, since we can't equip the outfit.
break;
}
if (!piece.tradeable || !piece.discardable) {
continue;
}
copyableItemCount = copyableItemCount + 1;
if (historical_age(piece) > 1 || historical_price(piece) == 0) {
mall_price(piece);
}
piecesTotalPrice = piecesTotalPrice + historical_price(piece);
}
if (
5 <= copyableItemCount
&& expensive < piecesTotalPrice / copyableItemCount
) {
best = $location[The Haunted Storage Room];
expensive = piecesTotalPrice / copyableItemCount;
}
}