List Based on Price

Started by Rhyden, September 05, 2013, 12:34:52 PM

We can already select keywords for NPC merchant's lists.

It would be cool if you could look at listed items based on price.

eg.

list (merchant) price

the merchant has the following goods to trade:
01) a crappy wooden dagger for 5 obsidian coins, many are available.
02) a sharp wooden dagger for 15 obsidian coins, many are available.
03) a dull obsidian sword for 30 obsidian coins, many are available.
04) a serrated obsidian sword for 85 obsidian coins, a few are available.
05) a ruby-encrusted, serrated obsidian sword for 165 obsidian coins, many are available.


Perhaps another variable for listing based on lowest-highest or highest-lowest price as well?

I dig this.
Fredd-
i love being a nobles health points

I don't like the idea of re-sorting the buy list.  I think people would get confused about which context "buy #XX" will use (default or sorted).  It'd probably be a headache to code anyway. 


I'd be cool with being able to specify price ranges, though:
>list merchant above 200
>list merchant below 500
>list merchant above 200 below 500

Quote from: Marauder Moe on September 05, 2013, 12:39:59 PM
I don't like the idea of re-sorting the buy list.  I think people would get confused about which context "buy #XX" will use (default or sorted).  It'd probably be a headache to code anyway. 


I'd be cool with being able to specify price ranges, though:
>list merchant above 200
>list merchant below 500
>list merchant above 200 below 500

That might be a better idea.
Fredd-
i love being a nobles health points

Quote from: Marauder Moe on September 05, 2013, 12:39:59 PM
I think people would get confused about which context "buy #XX" will use (default or sorted).  It'd probably be a headache to code anyway. 

It's not confusing. Ebay, Amazon, and most modern internet shops do this. Lowest >>> Highest items or Highest >>> Lowest. And it'd likely be as much a headache to code as your suggestion. It's simple math, really.

Right, sorting algorithms are trivial.  But, DIKU being ancient software, the shop inventory data structures may not be trivial to deal with.  Also, consider that you'd need to make a copy of the list specifically for the player viewing the shop and mirror all the status changes that happen to the actual inventory list.  Trust me, I'm a programmer.

You don't need to rearrange the master list, necessarily, but the output would be kind of ugly.

list merchant sort hilo

10) a ruby-encrusted dildo for 500 obsidian coins
24) an enormous statue of a dragon for 400 obsidian coins
09) a jade-yadda yadda templar something or other for 300 obsidian coins
11) a blahblahblah for blahblahblah...etc. etc.

You leave the original list order intact, and the player has to make sure they've got the right item number.
Quote from: WarriorPoet
I play this game to pretend to chop muthafuckaz up with bone swords.
Quote from: SmuzI come to the GDB to roleplay being deep and wise.
Quote from: VanthSynthesis, you scare me a little bit.

That would be a bit better, though I still think that range filters would be the simplest solution.

Yeah, I was just pointing out that, whatever the sorting algorithm is doing, it doesn't need to change the relationship between the item and its number in the alphabetized list.
Quote from: WarriorPoet
I play this game to pretend to chop muthafuckaz up with bone swords.
Quote from: SmuzI come to the GDB to roleplay being deep and wise.
Quote from: VanthSynthesis, you scare me a little bit.