Intro:
I've been working on aspects of this project ever since Crimbo Town (Island?) 2024 emerged from the mists last mid-December.
I added support for modeling the three shops as coinmasters, rather than mixing methods, took a break to work on CyberRealm, but returned, with a vengeance, to this project.
I've made substantial progress, and things are looking good (to me), but there are still various aspects to be implemented.
For at least 10 years, KoL has been using "shop.php" for all the various NPC shops that players can shop in.
KoLmafia supports 139 of them. The user experience varies among them, but here are the common features, under the hood:
There is a shop name - visible, but not used internally.
There is an internal "shopid" - "whichshop=xxxxx"
Everything is a purchase - "action=buyitem"
Every item you can purchase is on a "row" - "whichrow=ROW"
Every item has from 1 - 5 "costs" - Meat or up to 5 items.
The yield can be more than 1 of an item.
You can purchase multiple of an item - "quantity=XXX"
KoLmafia models shops in three ways:
1) An npcstore - items have a single cost, which is Meat
2) A coinmaster - items have a single cost, which is a currency.
If the currency is a cost, this is a "buy"
If the currency is what you are buying, this is a "sell"
A coinmaster can have multiple currencies, but only one is used per item.
3) A "mixing method" - items can have multiple costs and, most likely, nothing looks like a "currency".
Examples:
1) The General Store sells everything for Meat.
This is an npcstore
2) The Applecalypse Store sells items for Chroner
This is a coinmaster.
3) The Dungeoneer Associate Vending Machine sells items for fat loot tokens.
This is a coinmaster
4) Cosmic Ray's Bazaar sells items for various items, but at most one kind per - including fat loot tokens.
This is a coinmaster
3) The Armory and Leggery sells everything for Meat - unless you have a pulverized Standard reward, in which case you can use it to buy a previous year's Standard reward.
This is an npcstore AND a coinmaster with multiple currencies.
4) The Black Market sells lots of stuff for Meat, except you can buy a Red Zeppelin Ticket for Meat OR a precious diamond - exactly once.
This is an npcstore AND a coinmaster.
5) The Star Chart trades stars, lines, and a star chart for items.
This is a mixing method
Observations:
Row numbers are unique across KoL - each row is associated with a particular shopid.
A shop can sell the same item for Meat OR an item - The Black Market
A shop can sell the same item for multiple different costs - the mini kiwitini from the Kiwi Kwiki Mart
Multiple shops can sell the same item - Vending Machine and Cosmic Ray's Bazaar both sell Legend keys for fat loot tokens.
Shops may require a path (Cosmic Ray), quest progress (Black Market), item (Star Chart), access (Dedigitizer),
Available items may depend on quest progress (Black Market), current inventory (Armory & Leggery), daily limit (Kiwi Kwiki Mart), permanent limit (Terrified Eagle Inn).
The "multiple recipes for the same item" has been an issue for years.
The latest example - the mini kiwitini - brought it to my attention again.
The Primordial Soup Kitchen is another example; there are 3 recipes for each advanced soup - one for each basic soup as an ingredient.
Ways to access shops in the KoL GUI (and scripts):
1) The Mall Search Frame will display user stores, NPC stores, and Coinmasters.
2) "acquire" will purchase from all three sources.
3) "create" will purchase from NPC stores and Coinmasters, and will invoke mixing methods.
4) The Usable panels in the Inventory Manager Frame - Food/Booze/Potions - will "create" for you - and display the required ingredients.
5) "coinmaster buy" and "coinmaster sell" will get items from the specific coinmaster you select.
6) The Coinmasters Frame will show you all available buy and/or sell rows - including ingredients - and let you select which recipe you want to use.
I've been interested in simplifying how KoLmafia implements shop.php stores for a long time.
This came to a head for the Crimbo 24 stores.
They sure looked like they could be coinmasters - with multiple currencies - but the Cafe and Bar each had a single offering which took all five currencies, and the Factory offered items that took either a single currency or two of the five types of currency.
Rather than make them into three different mixing methods, I decided to extend coinmasters to allow items to be purchased by more than one kind of currency.
And so this project began.
I've been working on aspects of this project ever since Crimbo Town (Island?) 2024 emerged from the mists last mid-December.
I added support for modeling the three shops as coinmasters, rather than mixing methods, took a break to work on CyberRealm, but returned, with a vengeance, to this project.
I've made substantial progress, and things are looking good (to me), but there are still various aspects to be implemented.
For at least 10 years, KoL has been using "shop.php" for all the various NPC shops that players can shop in.
KoLmafia supports 139 of them. The user experience varies among them, but here are the common features, under the hood:
There is a shop name - visible, but not used internally.
There is an internal "shopid" - "whichshop=xxxxx"
Everything is a purchase - "action=buyitem"
Every item you can purchase is on a "row" - "whichrow=ROW"
Every item has from 1 - 5 "costs" - Meat or up to 5 items.
The yield can be more than 1 of an item.
You can purchase multiple of an item - "quantity=XXX"
KoLmafia models shops in three ways:
1) An npcstore - items have a single cost, which is Meat
2) A coinmaster - items have a single cost, which is a currency.
If the currency is a cost, this is a "buy"
If the currency is what you are buying, this is a "sell"
A coinmaster can have multiple currencies, but only one is used per item.
3) A "mixing method" - items can have multiple costs and, most likely, nothing looks like a "currency".
Examples:
1) The General Store sells everything for Meat.
This is an npcstore
2) The Applecalypse Store sells items for Chroner
This is a coinmaster.
3) The Dungeoneer Associate Vending Machine sells items for fat loot tokens.
This is a coinmaster
4) Cosmic Ray's Bazaar sells items for various items, but at most one kind per - including fat loot tokens.
This is a coinmaster
3) The Armory and Leggery sells everything for Meat - unless you have a pulverized Standard reward, in which case you can use it to buy a previous year's Standard reward.
This is an npcstore AND a coinmaster with multiple currencies.
4) The Black Market sells lots of stuff for Meat, except you can buy a Red Zeppelin Ticket for Meat OR a precious diamond - exactly once.
This is an npcstore AND a coinmaster.
5) The Star Chart trades stars, lines, and a star chart for items.
This is a mixing method
Observations:
Row numbers are unique across KoL - each row is associated with a particular shopid.
A shop can sell the same item for Meat OR an item - The Black Market
A shop can sell the same item for multiple different costs - the mini kiwitini from the Kiwi Kwiki Mart
Multiple shops can sell the same item - Vending Machine and Cosmic Ray's Bazaar both sell Legend keys for fat loot tokens.
Shops may require a path (Cosmic Ray), quest progress (Black Market), item (Star Chart), access (Dedigitizer),
Available items may depend on quest progress (Black Market), current inventory (Armory & Leggery), daily limit (Kiwi Kwiki Mart), permanent limit (Terrified Eagle Inn).
The "multiple recipes for the same item" has been an issue for years.
The latest example - the mini kiwitini - brought it to my attention again.
The Primordial Soup Kitchen is another example; there are 3 recipes for each advanced soup - one for each basic soup as an ingredient.
Ways to access shops in the KoL GUI (and scripts):
1) The Mall Search Frame will display user stores, NPC stores, and Coinmasters.
2) "acquire" will purchase from all three sources.
3) "create" will purchase from NPC stores and Coinmasters, and will invoke mixing methods.
4) The Usable panels in the Inventory Manager Frame - Food/Booze/Potions - will "create" for you - and display the required ingredients.
5) "coinmaster buy" and "coinmaster sell" will get items from the specific coinmaster you select.
6) The Coinmasters Frame will show you all available buy and/or sell rows - including ingredients - and let you select which recipe you want to use.
I've been interested in simplifying how KoLmafia implements shop.php stores for a long time.
This came to a head for the Crimbo 24 stores.
They sure looked like they could be coinmasters - with multiple currencies - but the Cafe and Bar each had a single offering which took all five currencies, and the Factory offered items that took either a single currency or two of the five types of currency.
Rather than make them into three different mixing methods, I decided to extend coinmasters to allow items to be purchased by more than one kind of currency.
And so this project began.