A month or two ago, when I did my refactoring of CoinmasterData to simply coding of new Coinmasters, I included some musing in the PR about, perhaps, unifying how we use KoL's shop.php.
Over the years, I observe that KoL itself has settled on a few core mechanisms that it uses for new code (and much, but not all, old code).
place.php?whichplace=xxx (old things like woods.php still exist but redirect)
shop.php?whichshop=xxx
choice.php?whichchoice=xxx&option=yyy (with additional arguments, sometimes).
choice.php may have started as "like adventures", since the large majority of them are accessed by redirecting from adventure.php - but a lot of them are redirects from inv_use.php. That includes things like the combat lover's locket, the deck of every card, the genie bottle, cargo cultist shorts, latte - all of which have extra arguments.
There are also choices that are "like shops", in that you trade items for other items - wool, wax globs, burning newspapers, meteroid, fudge
shop.php is KoL's most common mechanism for trading items or meat for other items.
If they trade nothing but Meat, we use npcstores.txt and NPCPurchaseRequest, and such items appear under Purchases.
If they trade in items - possibly many kinds - including Meat - but one kind per item - we use coinmasters.txt - and CoinmasterData and CoinmasterRequest - but we integrate such as Concoctions and NPCPurchaseRequests as well.
The difficult ones trade more than one kind of item at a time to buy something. We make those into creation methods. Pixels, star chart, XO Shop, Sliemce, Grandma, Spant, and so on.
Here is grep:
Code:
AirportRequest.java10: super("shop.php", conc);
BeerGardenRequest.java10: super("shop.php", conc);
Crimbo12Request.java18: super("shop.php", conc);
Crimbo16Request.java10: super("shop.php", conc);
FiveDPrinterRequest.java17: super("shop.php", conc);
GrandmaRequest.java10: super("shop.php", conc);
JarlsbergRequest.java17: super("shop.php", conc);
JunkMagazineRequest.java10: super("shop.php", conc);
KOLHSRequest.java40: super("shop.php", conc);
KringleRequest.java10: super("shop.php", conc);
PixelRequest.java12: super("shop.php", conc);
RumpleRequest.java10: super("shop.php", conc);
SliemceRequest.java10: super("shop.php", conc);
SpantRequest.java10: super("shop.php", conc);
StarChartRequest.java17: super("shop.php", conc);
StillRequest.java16: super("shop.php", conc);
SugarSheetRequest.java17: super("shop.php", conc);
WinterGardenRequest.java10: super("shop.php", conc);
XOShopRequest.java10: super("shop.php", conc);
Some of those could be Coinmasters - sugar sheet, Nash Crosby's still, all transform a single ingredient into something else.
Coinmaster items appear both on Purchases and as Creatable and on the Coinmasters Frame
Creation method items appear on Creatable
retrieveItem can use either technique.
Now, I mused on the other PR whether we could/should have a "shop.php" framework (interface?).
Not all Coinmasters are shop.php.
Not all shop.php classes are Coinmasters.
Not all shop.php shops use "rows".
But perhaps we could simplify all sorts of code that uses shop.php by, somehow, abstracting our support for that KoL mechanism and using it in NPC shops, Coinmasters, and Creation methods.
Do we want to things like star chart, pixels, sliemce, XO shop, and so on to be Coinmasters? I dunno.
How about sugar sheets, the still, and the various choice.php things that trade in a single "currency"? I dunno.
"aesthestic" for whom? The codebase, or our users?
As I said, Coinmaster concoctions go on the Purchase frame and also the Coinmasters Frame.
Do sugar sheets or grubby wool feel like items you trade for other items or make into other items?
Probably the latter - which, I guess, makes them creation methods, rather than coinmasters.
Well, shop.php coinmasters inherit from CoinMastersRequest and call methods from that class and shop.php creation methods inherit from CreateItemRequest and call methods from NPCPurchaseRequest. They are both pretty easy to code up, these days.
I still dunno.
I can search for "grubby" on the Purchases frame.
If we made wool a coinmaster, we'd see the various things you can make from it on the search results, too.
(Try searching for "purpleheart" to see what I mean.)
What would be most intuitive and/or useful for users?