diff --git a/crawl-ref/source/dat/database/shopname.txt b/crawl-ref/source/dat/database/shopname.txt new file mode 100644 index 000000000000..dfc31fbb8200 --- /dev/null +++ b/crawl-ref/source/dat/database/shopname.txt @@ -0,0 +1,2839 @@ +############################################################################### +# Shop and Shopkeeper Names +############################################################################### +# Part 1: Shopkeepers +# While the "traditional" name generator (same as pan lord names etc.) can +# still be used, we also have a pool of "normal-sounding" names. These are +# intended to avoid conflicts with Unique names (present or future) as I think +# uniques named things like "Dave" are at least fairly unlikely, as well as +# highlighting the fact that shopkeepers are basically civilians. They are +# also designed to sound rather like back-street junk shops you might encounter +# somewhere like London or on a market. We could certainly add names of a +# similar ilk from other countries but I would leave it to native speakers of +# those countries to match the flavour. +# We can generate fancier names for higher-value shops, and Gozag shopkeepers +# get extra fancy names, sometimes a pair of names, and so on. +############################################################################### +%%%% +# XX: Ok a lot of prefixes can be used for plain/fancy items as well +# Separate adjectives into ones that can be used for some kinds of items and then shopkeepers +# can also draw from those for *their* adjectives, as well as shopkeeper-only ones +fancy shopkeeper prefix + +Beastly + +Brilliant + +Dangerous + +Diabolical + +Dreamy + +Fabulous + +Fanc[y|iful] + +[Forg|Regr]et[table|ful] + +Learned + +Lumin[ous|ary] + +Max[i|ed|imum] + +[M|Unm]emorable + +[M|F|Fl|Bl]ighty + +Min[i|ute|imum] + +Mischievous + +[Mono|Multi]syllabic + +Monobrowed + +Mystic + +Nefarious + +[No|One|Two|Three|Four|Many|Slack]-[Eyed|Faced|Fingered|Handed|Toed] + +Overqualified + +# Could be for potions/books/weapons/armour in that order? +[Pint|Bite|Over|Under]-Sized + +Powerful + +Streetwise + +Upmarket + +Upper Class + +Quali[fied|ty] + +Quizzical + +Voluminous + +Weighty + +Yammering + +Zoological +%%%% +plain shopkeeper prefix + +Aged + +Big + +Boring + +Cheeky + +Diddly + +Dodgy + +Doodle + +Easygoing + +Fluffy + +Good[|e] + +Groovy + +Hearty + +Honest + +Ickle + +Ic[|k]y + +Jokey + +Jovial + +Keen + +Killer + +Knee High + +Lousy + +Mean + +Meek + +Neat + +Necessary + +Nice + +Old[|e] + +[O|Uno]riginal + +Pleasing + +Pukka + +Quoted + +Real + +Sketchy + +Sleepy + +Sly + +Small + +Smooth + +Sneaky + +Squishy + +Stingy + +Tight + +Underqualified + +Unkind + +Uppity + +Verbal + +Vile + +Whole + +Xenophobic + +Yappy + +Yawning + +Zippy + +Zoomy +%%%% +common english name + +Andy + +Ba[z|za|rry] + +Bill[y|ie|] + +Bob[by|bie|] + +Dan[ny|] + +Darren + +Dave[y|] + +# Couldn't resist +w:1 +Dibbler + +Dick[|y|ie] + +w:1 +Del[boy|] + +Derrick + +Greg[|ory] + +w:1 +Rod[ders|ney|] + +Fred[dy|] + +Jez[za|] + +Jim[my|bob|] + +Jo[e|sh|shua|] + +Jo[h|]n[ny|no|] + +Pete[|r] + +Phil + +Pliny + +Sam[my|antha|] + +Stev[ie|e|o|en] + +Stew[ie|] + +Tom[my|] + +Wal[ly|ter|] + +Will[|ie|iam] + +# Female names +Am[y|ie] + +Bertha + +Bet[ty|tie|sy|sie|t] + +Cat[heryn|herine|] + +Helga[r|] + +Gem[|ima|ma] + +[J|G]ill[y|] + +Jen[ny|nie|n|] + +Joan[|nie] + +Josie + +Kar[r|]en + +Kat[e|ie|y|] + +[K|C]atel[i|y]n + +Mar[y|ie] + +Mabel + +Mad[|die|ge] + +Mag[|s|gie] + +Marg[e|aret|] + +Moll[|y|ie] + +Sheila + +[S|C]her[r|][y|ie|] + +Sha[z|za|ron] + +Su[e|san|sie|zie|zy] + +T[|r]ish[|a] + +Wyn + +W[y|i]nnie +%%%% +faerie name begin + +All + +Apple + +Beetle + +Biscuit + +Bright + +Butter + +Candy + +Cotton + +Day + +Dusk + +Elder + +Egg + +Fair[y|ie|] + +Fool + +Full + +Garden + +Glitter + +Harvest + +Heart[|h] + +Ice + +Inch + +Jazz + +Joke + +Kind + +Kite + +Luna + +Moon + +Morning + +Moss + +Night + +Old + +Pebble + +Plop + +Quick + +Rainbow + +Sparkle + +Star + +Sun + +Twinkl[e|y] + +Umber + +Vole + +Well + +Worm + +Yam + +Young + +Zip + +Zoom +%%%% +faerie name end + +beam + +bless + +bug + +cake + +dew + +face + +feather + +fizz + +flame + +floss + +flower + +fluff + +[foot|feet] + +juice + +nose + +shine + +shoes + +toes + +tree + +wood + +worm +%%%% +faerie name + +@faerie name begin@@faerie name end@ +%%%% +plain shopkeeper name + +w:20 +@Classic_name@ + +@common english name@ +%%%% +fancy shopkeeper name + +@Classic_name@ + +w:15 +@common english name@ + +w:5 +@faerie name@ +%%%% +gozag shopkeeper name + +w:5 +@Classic_name@ + +w:20 +@common english name@ + +w:20 +@faerie name@ +%%%% +any shopkeeper prefix + +@plain shopkeeper prefix@ + +w:5 +@fancy shopkeeper prefix@ +%%%% +plain shopkeeper full name + +w:5 +@plain shopkeeper prefix@ @plain shopkeeper name@ + +w:2 +@plain shopkeeper name@ The @plain shopkeeper prefix@ + +@plain shopkeeper name@ +%%%% +fancy shopkeeper full name + +w:20 +@fancy shopkeeper name@ + +@fancy shopkeeper name@ The @any shopkeeper prefix@ + +@any shopkeeper prefix@ @fancy shopkeeper name@ +%%%% +# These get rather flamboyant +gozag shopkeeper full name + +w:40 +@gozag shopkeeper name@ + +w:15 +@fancy shopkeeper prefix@ @gozag shopkeeper name@ + +w:15 +@gozag shopkeeper name@ The @fancy shopkeeper prefix@ + +w:10 +@any shopkeeper prefix@ @plain shopkeeper prefix@ @gozag shopkeeper name@ + +w:5 +@gozag shopkeeper name@-@gozag shopkeeper name@ + +w:5 +@gozag shopkeeper name@ & @gozag shopkeeper name@ + +w:2 +@any shopkeeper prefix@ @gozag shopkeeper name@ & @gozag shopkeeper name@ + +w:1 +@any shopkeeper prefix@ @gozag shopkeeper name@ & @plain shopkeeper prefix@ @gozag shopkeeper name@ +%%%% +############################################################################### +# "Other intros" can function instead of a proper name, if we want things +# like "Ye Olde Gadget Shoppe". Singular is for " Gadget Shop" whereas +# plural is for " Gadgets". (Singular/plural don't really make sense +# as the distinction there but I can't think of better terms --mumra) +############################################################################### +other intro singular + +[Ye|The][ Last| Only| Real| One True| One & Only|] + +w:20 +[Ye|The] Old[e|est|] + +[|Only |Just |Yet ]Another + +# TODO: These are sort of like general shop prefixes as well, should somehow conflate? +[Ye|The|Your] [Handy|Local|Neighbourhood|Regular|Original] +%%%% +simply only + +[Simply|Only|Purely|Just] +%%%% +the best + +[Ye|The] [Best|Greatest|Most|Finest] +%%%% +other intro plural + +[Lots Of|All Kinds Of|Loadsa|All The] + +w:5 +@the best@ + +w:5 +@simply only@ @the best@ + +w:5 +@simply only@ +%%%% +of connector + +For + +O' + +Of +%%%% +and co suffix + +& [Co|Friend|Son|Daughter|Family|Partner] +%%%% +# Bob's Thing Shop or Ye Olde Thing Shop +intro singular + +@The_shopkeeper's@ + +w:1 +@The_shopkeeper@ @and co suffix@'s + +w:2 +@other intro singular@ +%%%% +# Bob's Things or Ye Best Things +intro plural + +@The_shopkeeper's@ + +w:1 +@The_shopkeeper@ @and co suffix@'s + +w:2 +@other intro plural@ +############################################################################### +# Part 2: Shops +# Shop names have an entrypoint for each value in the shop_type enum. +# In general the shop names take the simplistic form: +# "'s " +# `noun_synonym` is a synonym for object types that the shop sells e.g.: +# Gadget, Device, Machine, etc. for evokables. +# `shop_suffix` is words that can be used for shop e.g. Shop, Shoppe, Boutique. +# The suffix can be omitted when we have a known pluralised noun for the +# synonym, so "Dave's Devices" is a possible name. +# There are a few more major forms the names can take, some specific to certain +# shop types, the main forms are: +# "'s " +# This is notably used for Antique shops (of all types) where the prefix will +# specifically be an Antique synonym (Second-hand, Recycled, Bargain, etc.) +# but other shop types all have their own prefixes available, as well as +# "general" prefixes that work for all shop types. +# We have a final case where the keeper's name is *not* included (although one +# is still generated, but will only be seen if Gozag welcomes you to the shop). +# " " +# This can generate things like "Ye Olde Gadget Shoppe" that just don't work +# with a person's name in the title. +# We have plain/fancy variations of some things like prefixes and suffixes, +# however these are not controlled by the entry point or shop value directly: +# Instead the total length of shop name is limited in shopping.cc increasing +# with general fancyness, meaning we are *likely* to generate more elaborate +# names and words with fancier shops. +# Each shop type has some unique synonyms for shop (e.g. "Workshop" for +# gadgets, "Armoury" for weapons, "Tavern" for potions). Potions have a further +# sub-generator taking the tavern theme further by utilising some traditional +# "pub name" structures so we get things like "The King's Head", "The Dog And +# Partridge" and so forth. Jewellery stores, lacking a suitable number of +# unique synonyms for "shop", get their own structure so we can use synonyms +# for the vocation of "jeweller" instead. +############################################################################### +%%%% +############################################################################### +# General vocabulary that can be used by a variety of shop types +############################################################################### +plain shop prefix + +Basic + +Boring + +Common + +Down To Earth + +[Forg|Regr]ettable + +Garden + +Homely + +Humdrum + +Ordinary + +Plain + +Repetitive + +Simple + +Street + +Unmemorable + +Vanilla + +White Labelled + +Yard +%%%% +fancy shop prefix + +Artisan + +Assorted + +Boutique + +Classy + +Crafty + +Fancy + +Firsthand + +High [Class|Grade|Spec|Life|Born|Flying] + +Original + +Makers' + +Miscellaneous +%%%% +any shop prefix + +@plain shop prefix@ + +w:5 +@fancy shop prefix@ +%%%% +antique prefix + +Antiqu[e|ated|arian] + +Ancient + +Asterisked + +Bargain + +"Brand New" + +Classic[al|] + +Discount + +[|Double-]Blind + +Fixed[|-Up] + +Footnoted + +Historical + +Knockoff + +Markdown + +Old[ School| Timey|] + +Patina'd + +[Plu|Minu]ssed + +[Pre|Post|Suf]fixed + +Pre-[Owned|Loved|Used|Worn] + +Thrift[y|ed|] + +Timeless + +Trade[-only|] + +Tried & [True|Tested] + +[Value Added|Added Value] + +Vintage + +Waivered + +Weathered + +[Up|Re][furbished|conditioned|cycled|hashed] + +[Barely |Slightly |Once |][Damaged|Used|Worn] + +[Second|Third-|Fourth-|Fifth-|Sixth-|Seventh-|Eighth-|Ninth-|Tenth-]hand +%%%% +# Used for "of Foo" optionally at the end of a shop name +special suffix + +Abracadabra + +Horrors + +Mojo + +Sorcery + +Thaumat[urgy|ology] + +Tricks + +Zen +%%%% +magical adjective + +Active + +Arcane + +Buzzing + +Contaminated + +Fizzing + +Glowing + +Humming + +Magic[al|] + +Mystic[al|] + +Radiant + +Radioactive + +Reactive + +[Self|Auto]-[Working|Operating|Aware|Enabled] + +Sorcerous + +Spellbound + +Thaum[aturgical|ic] + +Trick[y|sy] + +Witchy + +Wizardly +%%%% +good adjective + +Glorious + +Elaborate +%%%% +random adverb + +Brilliantly + +Deliberately + +Elaborately + +Faintly + +Gloriously + +Over[t|]ly + +Really + +Slightly + +Very +%%%% +# Combat-related prefixes for either weapons or armour +combat adjective + +Aggressive + +[Battle|Combat|War]-[Hardened|Tested|Weathered|Worn] + +Blood[y|stained|soaked] + +Combative + +[Crimson|Ruddy] + +Sanguin[ary|eous|e] + +Scarr[ed|ing] + +Incarnadine + +Intimidating + +Military + +Rust[y|ed] +%%%% +damage synonym + +[Damage|Harm|Hurt|Pain|Death|Trouble] +############################################################################### +# General suffixes work for any shoptype, either after an singular noun or on +# their own (but should only be used on their own for general shops) +%%%% +plain shop suffix + +Franchise + +House + +Kiosk + +Land + +Market[|place] + +[Mini-|]Mart + +Outlet + +Place + +Sale + +Shack + +w:20 +Shop + +w:20 +Shoppe + +Stall + +w:20 +Store +%%%% +fancy shop suffix + +Basement + +Bazaar + +w:20 +Boutique + +Den + +w:20 +Emporium + +Fa[ir|yre] + +Festival + +Gallery + +Palace + +Parlour + +Showroom + +w:20 +Super[market|mart|store] + +Warehouse + +World + +Zoo +############################################################################### +# Vague suffixes only work after a plural: "Weapons & Things" +%%%% +vague shop suffix + +w:20 +[&|'n'|And] [Things|Stuff|More|Bits|Such|So On] + +w:20 +[&|And] [Other|Misc|Related|Similar|That Kind Of|That Sort Of] @general noun no plural@ + +Et [Al|Cetera] + +Etc[etera|] + +For [Hire|Perusal|Purchase|Rent|Sale|Trade] + +To [Browse|Buy|Cherish|Go|Hire|Keep|Love|Own|Peruse|Take Away|Take Home|Trial|Try] + +[Inc|Ltd|Plc|GmbH|LLC|Unlimited|Incorporated] +%%%% +shop suffix singular + +@plain shop suffix@ + +w:3 +@fancy shop suffix@ +%%%% +shop suffix plural + +w:30 +@shop suffix singular@ + +@vague shop suffix@ +############################################################################### +# Now we have defined some general vocabulary, beyond this point we are piecing +# terms together to make full shop names +############################################################################### +%%%% +############################################################################### +# Shop: General Store +############################################################################### +%%%% +general noun + +Department + +Essential + +Gift + +Gimcrack + +Keepsake + +Knick-Knack + +Ornament + +Souvenir + +Thing + +Thingama[bob|jig|doo] + +Trifle + +W[ha|o]t[not|sit] +%%%% +general noun no plural + +Convenience + +Junk + +Garbage + +w:30 +[Home |Trade |][Goods|Wares] + +Stuff + +Tat +%%%% +general noun singular + +w:100 +@general noun@ + +w:50 +@general noun no plural@ + +Doohickey + +Flea +%%%% +general noun plural + +w:100 +@general noun@s + +w:50 +@general noun no plural@ + +Bits + +Bits & [Bobs|Pieces] + +Doohickies + +Homewares + +Odds & Sods +%%%% +general shop suffix prefix + +Corner + +General + +One Stop + +Side Street + +Back Alley + +Local +%%%% +general shop suffix + +@shop suffix singular@ + +@general shop suffix prefix@ @shop suffix singular@ + +w:3 +@general shop suffix prefix@ + +w:1 +Tourist Trap +%%%% +general synonym suffixable + +@general noun plural@ + +@general noun singular@ + +@plain shop prefix@ +%%%% +general shop singular + +@general synonym suffixable@ @general shop suffix@ + +w:5 +@general shop suffix@ + +w:3 +@general shop suffix@ @of connector@ @general noun plural@ +%%%% +general store shop name + +@intro singular@ @general shop singular@ + +@intro plural@ @general noun plural@ + +w:5 +@intro singular@ @plain shop prefix@ @general shop singular@ + +w:5 +@intro plural@ @plain shop prefix@ @general noun plural@ + +w:2 +@general noun plural@ By @The_shopkeeper@ + +w:2 +@other intro plural@ @general noun plural@ By @The_shopkeeper@ +%%%% +############################################################################### +# Shop: Antique General Store (or General Antique Store?) +############################################################################### +antique noun + +Antique + +Artifact + +Artware + +Collectable + +Furnishing + +Vase +%%%% +antique noun singular + +w:50 +@antique noun@ + +Antiquity + +Curiosity + +Furniture + +Pottery +%%%% +antique noun plural + +w:50 +@antique noun@s + +Antiquities + +Classics + +Curiosities + +Furniture + +Potteries +%%%% +antique shop suffix + +Auction[|eer|eers| House] + +Bargain [Basement|Bin] + +Collectors + +[Coin|Dime|Dollar|Ingot|Penny|Pound] [Land|Shop|Shoppe|Store] + +Exchange + +Museum + +Pawn @shop suffix singular@ + +Potters + +Roadshow + +Trad[e|ers|ing] +%%%% +any antique shop suffix + +w:3 +@antique shop suffix@ + +w:2 +@general shop suffix prefix@ @antique shop suffix@ + +@fancy shop suffix@ + +w:5 +@general shop suffix@ +%%%% +antique shop prefix + +w:20 +@antique prefix@ + +@fancy shop prefix@ + +w:4 +@plain shop prefix@ @antique prefix@ + +w:3 +@fancy shop prefix@ @antique prefix@ + +w:2 +@antique prefix@ @plain shop prefix@ + +w:2 +@antique prefix@ @fancy shop prefix@ +%%%% +antique synonym suffixable + +w:20 +@antique noun singular@ + +w:5 +@antique noun plural@ + +w:3 +@antique prefix@ @general synonym suffixable@ +%%%% +antique shop singular + +@antique synonym suffixable@ @any antique shop suffix@ + +w:5 +@any antique shop suffix@ + +w:3 +@general shop suffix@ @of connector@ @antique noun plural@ + +w:3 +@any antique shop suffix@ @of connector@ @general noun plural@ +%%%% +############################################################################### +# Entrypoint: Antique General Store +############################################################################### +assorted antiques shop name + +@intro singular@ @antique shop singular@ + +@intro plural@ @antique noun plural@ + +w:5 +@intro singular@ @antique shop prefix@ @antique shop singular@ + +w:5 +@intro plural@ @antique shop prefix@ @antique noun plural@ + +w:2 +@antique noun plural@ By @The_shopkeeper@ + +w:2 +@other intro plural@ @antique noun plural@ By @The_shopkeeper@ +%%%% +############################################################################### +# Shop: Weapon Shop +############################################################################### +# Maybe could update this with a list from randname? (Also for armour...) +weapon adjective + +Absolute + +Blunt + +Cool + +Damaging + +Dangerous + +Dull + +Evil + +[Harm|Hurt]ful + +Murderous + +Kill[er|ing] + +Piercing + +Sharp[|ened] + +Trusty + +Weight[y|ed] +%%%% +weapon subtype + +Axe + +Blade + +Bow + +Cleaver + +Club + +Cudgel + +Dagger + +Hammer + +Mace + +Mallet + +Sword + +Tong[|ue] + +Whip +%%%% +weapon subtype singular + +w:100 +@weapon subtype@ + +Knife + +Staff +%%%% +weapon subtype plural + +w:100 +@weapon subtype@s + +Knives + +Staves +%%%% +weapon noun + +Weapon + +Armament + +Accoutrement + +Munition + +@damage synonym@ [Dealer|Causer|Inflicter] +%%%% +weapon noun singular + +w:50 +@weapon noun@ + +w:50 +@weapon noun@s + +Aegis + +Arms + +Ordnance + +[Organ|Tool|Trapping|Trapment|Instrument] Of [War|Battle|The Trade] + +w:7 +@weapon subtype singular@ & @weapon subtype singular@ + +w:2 +@weapon subtype singular@, @weapon subtype singular@ And @weapon subtype singular@ + +@damage synonym@ [Applicant|Applicator|Causer|Dealer|Inflicter] +%%%% +weapon noun plural + +w:50 +@weapon noun@s + +Ordnance + +[Organ|Tool|Trapping|Trapment|Instrument]s Of [War|Battle|The Trade] + +Weaponry + +@weapon subtype plural@ & @weapon subtype plural@ + +w:2 +@weapon subtype plural@, @weapon subtype plural@ And[ More|] @weapon subtype plural@ + +@damage synonym@ [Application|Causation|Dealing|Infliction] +%%%% +weapon shop suffix + +Abattoire + +Armoury + +Cabinet + +Castle + +Dungeon + +Fort[|ress] + +Mausoleum + +Pit + +Rack + +Range + +Smiths +%%%% +any weapon prefix + +@weapon adjective@ + +@combat adjective@ + +w:5 +@any shop prefix@ +%%%% +qualified weapon prefix + +@any weapon prefix@ + +w:5 +@random adverb@ @any weapon prefix@ +%%%% +weapon synonym singular + +@weapon noun singular@ + +@qualified weapon prefix@ @weapon noun singular@ +%%%% +weapon synonym plural + +@weapon noun plural@ + +@qualified weapon prefix@ @weapon noun plural@ +%%%% +weapon synonym suffixable + +@weapon synonym singular@ + +@weapon synonym plural@ + +@weapon adjective@ +%%%% +weapon or shop suffix + +w:5 +@weapon shop suffix@ + +@shop suffix singular@ +%%%% +weapon shop singular + +@weapon synonym suffixable@ @weapon or shop suffix@ + +w:5 +@weapon shop suffix@ + +w:3 +@weapon or shop suffix@ @of connector@ @weapon synonym plural@ +%%%% +weapon shop plural + +@weapon synonym plural@ + +w:5 +@weapon synonym plural@ @vague shop suffix@ +%%%% +############################################################################### +# Entrypoint: Weapon Store +############################################################################### +weapon shop name + +@intro singular@ @weapon shop singular@ + +@intro plural@ @weapon shop plural@ + +w:2 +@other intro plural@ @weapon synonym plural@ By @The_shopkeeper@ +%%%% +############################################################################### +# Entrypoint: Antique Weapon Store +############################################################################### +antique weapon shop name + +@intro singular@ @antique shop prefix@ @weapon shop singular@ + +@intro plural@ @antique shop prefix@ @weapon shop plural@ + +w:2 +@other intro plural@ @antique shop prefix@ @weapon synonym plural@ By @The_shopkeeper@ +%%%% +############################################################################### +# Shop: Armour Shop +############################################################################### +armour subtype + +Body[suit|wear] + +Boot + +[Foot|Hand|Head][gear|wear] + +Gauntlet + +Glove + +Hat + +Head + +Helm[et|] + +Hide + +Leather + +Mail + +Plate + +Robe + +Scale + +[Skin|Skein] +%%%% +armour noun + +w:50 +@armour subtype@ + +Armour + +[Casual|Night] [G|W]ear + +Costume + +Couture + +Fashion + +Suit + +Thread + +Wearable +%%%% +armour noun singular + +w:100 +@armour noun@ + +Cloth + +Dress + +Finery + +Gear + +Streetwear + +@damage synonym@ [Reducer|Avoider|Preventer] +%%%% +armour noun plural + +w:100 +@armour noun@s + +Clothes + +Clothing + +Dresses + +Fineries + +Gear + +@damage synonym@ [Reduction|Avoidance|Prevention] +%%%% +armour adjective + +Comfortable + +Designer + +Eyecatching + +Fashionable + +[Good|Great|Fantastic] Looking + +Loose-Fit[ted|ting|] + +On Trend + +Padded + +Protective + +Reinforced + +Streetwise + +Trendy +%%%% +armour shop suffix + +Catwalk + +Costumery + +Couturier + +Mannequins + +Pageant + +Parade + +Rack + +[|Fashion ]Show + +Tannery + +Tailor[s|] +%%%% +any plain armour prefix + +@armour adjective@ + +@combat adjective@ + +@plain shop prefix@ +%%%% +armour synonym singular + +@armour noun singular@ + +w:5 +@any plain armour prefix@ @armour noun singular@ +%%%% +armour synonym plural + +@armour noun plural@ + +w:5 +@any plain armour prefix@ @armour noun plural@ +%%%% +armour synonym suffixable + +@armour synonym singular@ + +@armour synonym plural@ + +@armour adjective@ +%%%% +armour or shop suffix + +w:5 +@armour shop suffix@ + +@shop suffix singular@ +%%%% +armour shop singular + +@armour synonym suffixable@ @armour or shop suffix@ + +w:5 +@armour shop suffix@ + +w:3 +@armour or shop suffix@ @of connector@ @armour synonym plural@ +%%%% +armour shop plural + +@armour synonym plural@ + +w:5 +@armour synonym plural@ @vague shop suffix@ +%%%% +############################################################################### +# Entrypoint: Armour Store +############################################################################### +armour shop name + +@intro singular@ @armour shop singular@ + +@intro plural@ @armour shop plural@ + +w:2 +@other intro plural@ @armour synonym plural@ By @The_shopkeeper@ +%%%% +any antique armour prefix + +@antique shop prefix@ @armour adjective@ + +@antique shop prefix@ @combat adjective@ + +@antique shop prefix@ +%%%% +############################################################################### +# Entrypoint: Antique Armour Store +############################################################################### +antique armour shop name + +@intro singular@ @any antique armour prefix@ @armour shop singular@ + +@intro plural@ @any antique armour prefix@ @armour shop plural@ + +w:2 +@other intro plural@ @any antique armour prefix@ @armour synonym plural@ By @The_shopkeeper@ +%%%% +############################################################################### +# Shop: Jewellery Shop +############################################################################### +jewellery noun + +Amulet + +[B|Sp]angle + +Bauble + +Bead + +Bracelet + +Chain + +Charm + +Choker + +Crystal + +Facet + +Fibula + +Filigree + +Garnet + +Gem[|stone] + +Heirloom + +Jewel + +Keepsake + +Locket + +Memento + +Necklace + +Objet D'Arts + +Pendant + +[Engagement |Diamond |Fashion ][Ring|Band|Circlet] + +Tiara + +Trinket + +Wedding [Gift|Present|Ring] +%%%% +jewellery noun singular + +w:50 +@jewellery noun@ + +Accessory + +Bling + +Brooch + +Jewellery + +Silverware +%%%% +jewellery noun plural + +w:50 +@jewellery noun@s + +Accessories + +Bling + +Brooches + +Jeweller[s|ies] + +Silverware +%%%% +jewellery shop suffix + +Box[| Of Delights] + +[Display|Presentation] Case + +Dealer + +Engraver + +Gemmologist + +Gilders + +[Gold|Silver]smith + +Horologist + +Jeweller + +Lapidary + +[Gold|Silver|Diamond] Mine + +Salon + +Vault + +Watchmaker +# TODO: Good suffixes are very thin on the ground here. They all seem to overlap with general/fancy shops or sound awkward. +# Some overlap with armour/clothing as well. +# What we need to do is drop the usual noun/suffix structure (at least, make it less commmon, and use the standard +# suffixes). Then use some custom structures based on synonyms for "jeweler" instead. +# Would be nice to force/detect a dual name and do "Foo & Bar Silversmiths". Also " The Silversmith" +# [gold|silver]smith, [watch|ring]maker, jewellery, diamond setter, gem dealer, gemologist, forgers +# horologist, lapidary. Foo's Jewellery & [Piercings|Customisations|Tattoos|Nails|Stylists|Spa|Jewelry Makers] +# Sparkletoes & [Co|Son] +%%%% +jewellery adjective + +Beautiful + +[Expensive|Fake][|-Looking|-Sounding] + +Fine + +Gliste[n|r]ing + +Glitter[y|ing] + +Overpriced + +Pretty + +[Star|Jewel|Gem]-[Spangled|Covered|Crusted|Crossed] + +Spangl[ed|y] +%%%% +jewellery synonym singular + +@jewellery noun singular@ + +w:3 +@jewellery adjective@ @jewellery noun singular@ + +w:3 +@magical adjective@ @jewellery noun singular@ +%%%% +jewellery synonym plural + +@jewellery noun plural@ + +w:5 +@jewellery adjective@ @jewellery noun plural@ + +w:3 +@magical adjective@ @jewellery noun plural@ +%%%% +jewellery or shop suffix + +w:5 +@jewellery shop suffix@ + +@fancy shop suffix@ +%%%% +jewellery synonym suffixable + +@jewellery synonym singular@ + +@jewellery synonym plural@ + +@jewellery adjective@ +%%%% +jewellery shop singular + +@jewellery synonym suffixable@ @jewellery or shop suffix@ + +w:5 +@jewellery shop suffix@ + +w:3 +@jewellery or shop suffix@ @of connector@ @jewellery synonym plural@ +%%%% +jewellery shop plural + +@jewellery synonym plural@ + +w:5 +@jewellery synonym plural@ @vague shop suffix@ +%%%% +############################################################################### +# Entrypoint: Jewellery Shop +############################################################################### +jewellery shop name + +@intro singular@ @jewellery shop singular@ + +@intro plural@ @jewellery shop plural@ + +w:2 +@other intro plural@ @jewellery synonym plural@ By @The_shopkeeper@ +%%%% +############################################################################### +# Shop: Potion Shop +############################################################################### +potion adjective + +Addictive + +Colourful + +Fast Acting + +Fizzy + +Healing + +Juicy + +Organic + +Quenching + +Refreshing + +Sparkling + +Tasty + +Vegan + +Watered Down +%%%% +potion noun + +Amphora + +Beverage + +Brew + +Bottle + +Cask + +Cure + +Drink + +Extraction + +Flask + +Healer + +Juice + +Liquid + +Medicine + +Milk + +[Bring|Get|Lift|Push|Pick|Ping|Send]-[Me|Em|You|U]-[Back|Down|Up|Round] + +Potion + +Quaff[|able] + +Tea + +Tincture + +Uplifter + +Water +%%%% +potion noun no plural + +Hooch + +Moonshine + +Liquid [Bliss|Comfort|Enlightenment|Gold|Silver|Visions] + +Pain Relief + +# Bad pun alert +Quaffy +%%%% +potion noun singular + +w:100 +@potion noun@ + +w:20 +@potion noun no plural@ +%%%% +potion noun plural + +w:100 +@potion noun@s + +w:50 +@potion noun no plural@ + +w:5 +Curers + +w:5 +Remedies +%%%% +tavern suffix + +Bar + +Brewery + +Distillery + +Inn[|e] + +Hotel + +Pub[be|lic House|] + +Tap + +Tavern + +[Watering |Healing |][Hole|Station] +%%%% +potion shop suffix + +w:80 +@tavern suffix@ + +Auberge + +Cafe + +Dispensary + +Hostel[|ry] + +Lab[oratory|] + +Lodge + +Lounge + +Refine[ment|ry] +%%%% +potion synonym singular + +@potion noun singular@ + +w:5 +@potion adjective@ @potion noun singular@ + +w:3 +@magical adjective@ @potion noun singular@ +%%%% +potion synonym plural + +@potion noun plural@ + +w:5 +@magical adjective@ @potion noun plural@ + +w:2 +@any shop prefix@ @potion noun plural@ + +w:1 +@antique prefix@ @potion noun plural@ +%%%% +potion or shop suffix + +w:5 +@potion shop suffix@ + +@shop suffix singular@ +%%%% +potion synonym suffixable + +@potion synonym singular@ + +@potion synonym plural@ + +@potion adjective@ +%%%% +potion shop singular + +@potion synonym suffixable@ @potion or shop suffix@ + +w:5 +@potion shop suffix@ + +w:3 +@potion or shop suffix@ @of connector@ @potion synonym plural@ +%%%% +potion shop plural + +@potion synonym plural@ + +w:5 +@potion synonym plural@ @vague shop suffix@ +%%%% +person noun + +Angel + +Emperor + +Judge + +King + +Lord + +Monarch + +Prince[|ss] + +Queen + +Ratcatcher + +Sailor +%%%% +animal noun + +Bee + +Bug + +[Cat|Kitty] + +Cormorant + +Dog[|gy] + +Duck[|y] + +Dragon + +Elephant + +Frog + +Goose + +Hen + +Ostrich + +Partridge + +Slug + +Snail + +Swallow +%%%% +body part noun + +Brain + +Ears + +Elbows + +Eye[|brow]s + +Feet + +Feathers + +Finger + +Hands + +Head + +Hide + +Legs + +Neck + +Nose + +Nostrils + +Knees + +Shoulders + +Toes + +Wings +%%%% +misc noun + +Ball + +Beehive + +Bone + +Coin + +Drum + +Grape + +Lettuce + +Onion + +Tree +%%%% +misc adjective + +Broken + +Dead + +Fat + +Lazy + +Plump + +Thirsty +%%%% +random noun + +@animal noun@ + +w:5 +@misc adjective@ @animal noun@ + +@misc noun@ + +w:5 +@misc adjective@ @misc noun@ + +@person noun@ +%%%% +person or animal + +@animal noun@ + +@person noun@ + +%%%% +ye olde + +[Ye|The][||| Old| Olde| Original] +%%%% +traditional bar name + +@ye olde@ @person or animal@'s @body part noun@ + +@ye olde@ @random noun@ [&|And] @random noun@ + +[Ye|The] @plain shopkeeper prefix@ @person or animal@ + +%%%% +############################################################################### +# Entrypoint: Potion Shop +############################################################################### +distillery shop name + +@intro singular@ @potion shop singular@ + +@intro plural@ @potion shop plural@ + +@traditional bar name@ + +w:3 +@traditional bar name@ @tavern suffix@ + +w:3 +@other intro plural@ @potion synonym plural@ By @The_shopkeeper@ +%%%% +############################################################################### +# Shop: Scroll Shop +############################################################################### +scroll noun + +Bill + +Bulletin + +Leaflet + +Note + +Notice + +Pamphlet + +Paper + +Parchment + +Paper Consumable + +Print + +Roll + +Scroll + +Ticket +%%%% +scroll noun singular + +w:100 +@scroll noun@ + +Papyrus + +Station[a|e]ry +%%%% +scroll noun plural + +w:100 +@scroll noun@s + +Papyrusses + +Station[a|e]ries +%%%% +scroll shop suffix + +Board + +Calligraphists + +Writers + +[Printing |Inking |]Press + +News[|agent|tand] + +Stationers +# TODO: It's hard to avoid crossover with books for scroll adjectives. Maybe +# We need to separate the list for ones that can apply to either and ones +# that are best suited to a specific one. +%%%% +scroll adjective + +Bulleted + +Crumpled + +Handwritten + +Faded + +Long + +Notarised + +Scrawled + +Scribbled + +Scripted +%%%% +scroll synonym singular + +@scroll noun singular@ + +w:5 +@magical adjective@ @scroll noun singular@ + +w:3 +@any shop prefix@ @scroll noun singular@ + +w:1 +@antique prefix@ @scroll noun singular@ +%%%% +scroll synonym plural + +@scroll noun plural@ + +w:5 +@magical adjective@ @scroll noun plural@ + +w:3 +@any shop prefix@ @scroll noun plural@ + +w:1 +@antique prefix@ @scroll noun plural@ +%%%% +scroll or shop suffix + +w:5 +@scroll shop suffix@ + +@shop suffix singular@ +%%%% +scroll synonym suffixable + +@scroll synonym singular@ + +@scroll synonym plural@ + +@scroll adjective@ +%%%% +scroll shop singular + +@scroll synonym suffixable@ @scroll or shop suffix@ + +w:5 +@scroll shop suffix@ + +w:3 +@scroll or shop suffix@ @of connector@ @scroll synonym plural@ +%%%% +scroll shop plural + +@scroll synonym plural@ + +w:5 +@scroll synonym plural@ @vague shop suffix@ +%%%% +############################################################################### +# Entrypoint: Scroll Shop +############################################################################### +magic scroll shop name + +@intro singular@ @scroll shop singular@ + +@intro plural@ @scroll shop plural@ + +w:2 +@other intro plural@ @scroll synonym plural@ By @The_shopkeeper@ +%%%% +############################################################################### +# Shop: Book Shop +############################################################################### +# TODO: Borrow loads more from randbook.txt +book noun + +Bible + +Book + +Catalogue + +Classic + +Digest + +Learning + +Handbook + +Incunabulum + +Read + +Reference + +Reproduction + +Text + +Tome + +Volume + +Writing + +Yarn +%%%% +book noun singular + +w:100 +@book noun@ + +Autobiograph[y|ical] +%%%% +book noun plural + +w:100 +@book noun@s + +Autobiographies +%%%% +book adjective + +Excellent + +Exemplary + +Fantastic + +Good + +Illuminating + +Interesting + +Long + +Ripping + +Satisying + +Studious + +Thoughtful + +Trans[cribed|lated] + +Voluminous +%%%% +book shop suffix + +Library + +# Maybe potions +Lounge + +Bibliotheque + +Bookshelf + +Shelf + +Encyclopedia + +[De|Re]pository + +Index +%%%% +book synonym singular + +@book noun singular@ + +w:5 +@magical adjective@ @book noun singular@ + +w:5 +@book adjective@ @book noun singular@ + +w:2 +@any shop prefix@ @book noun singular@ + +w:1 +@antique prefix@ @book noun singular@ +%%%% +book synonym plural + +@book noun plural@ + +w:5 +@magical adjective@ @book noun plural@ + +w:5 +@book adjective@ @book noun plural@ + +w:2 +@any shop prefix@ @book noun plural@ + +w:1 +@antique prefix@ @book noun plural@ +%%%% +book or shop suffix + +w:5 +@book shop suffix@ + +@shop suffix singular@ +%%%% +book synonym suffixable + +@book synonym singular@ + +@book synonym plural@ + +@book adjective@ +%%%% +book shop singular + +@book synonym suffixable@ @book or shop suffix@ + +w:5 +@book shop suffix@ + +w:3 +@book or shop suffix@ @of connector@ @book synonym plural@ +%%%% +book shop plural + +@book synonym plural@ + +w:5 +@book synonym plural@ @vague shop suffix@ +%%%% +############################################################################### +# Entrypoint: Book Shop +############################################################################### +book shop name + +@intro singular@ @book shop singular@ + +@intro plural@ @book shop plural@ + +w:2 +@other intro plural@ @book synonym plural@ By @The_shopkeeper@ +%%%% +############################################################################### +# Shop: Gadget Shop +############################################################################### +gadget noun + +Automation + +Contraption + +Gadget + +Device + +Doodad + +Evokable + +Gewgaw + +Invention + +[|Spare ]Part + +Plaything + +Pyrotechnic + +Sparkler + +Tool + +Toy + +Machine + +Wand + +Whizzbang +%%%% +gadget noun singular + +@gadget noun@ + +Automaton + +Novelty +%%%% +gadget noun plural + +@gadget noun@s + +Artifice[ry|] + +Automata + +Novelties + +Machinery +%%%% +gadget shop suffix + +Cave + +Factory + +Garage + +Grotto + +Nest + +Lab[oratory] + +Repairs + +Shed + +Work[bench|shop] +%%%% +gadget adjective + +Automat[ed|ic] + +Confusing + +Complicated + +Intricate + +Incomprehensible + +Practical + +Recharged + +Useful +%%%% +any gadget adjective + +w:15 +@gadget adjective@ + +w:5 +@magical adjective@ + +w:3 +@fancy shop prefix@ + +w:2 +@antique prefix@ + +w:1 +@plain shop prefix@ +%%%% +qualified gadjet prefix + +@any gadget adjective@ + +w:3 +@random adverb@ @any gadget adjective@ +%%%% +gadget synonym singular + +@gadget noun singular@ + +w:5 +@qualified gadjet prefix@ @gadget noun singular@ +%%%% +gadget synonym plural + +@gadget noun plural@ + +w:5 +@qualified gadjet prefix@ @gadget noun plural@ +%%%% +gadget or shop suffix + +@gadget shop suffix@ + +@shop suffix singular@ +%%%% +gadget synonym suffixable + +@gadget synonym singular@ + +@gadget synonym plural@ + +@gadget adjective@ +%%%% +gadget shop singular + +@gadget synonym suffixable@ @gadget or shop suffix@ + +w:5 +@gadget shop suffix@ + +w:3 +@gadget or shop suffix@ @of connector@ @gadget synonym plural@ +%%%% +gadget shop plural + +@gadget synonym plural@ + +w:5 +@gadget synonym plural@ @vague shop suffix@ +%%%% +############################################################################### +# Entrypoint: Gadget Shop +############################################################################### +gadget shop name + +@intro singular@ @gadget shop singular@ + +@intro plural@ @gadget shop plural@ + +w:2 +@other intro plural@ @gadget synonym plural@ By @The_shopkeeper@ diff --git a/crawl-ref/source/database.cc b/crawl-ref/source/database.cc index 7f4129c6e47f..5736440e5c72 100644 --- a/crawl-ref/source/database.cc +++ b/crawl-ref/source/database.cc @@ -124,6 +124,7 @@ static TextDB AllDBs[] = "montitle.txt", // titles for monsters (i.e. uniques) "decorlines.txt", // miscellaneous lines for walking on decoration "gizmo.txt", // name-assembling for gizmos + "shopname.txt", // fancy shop name generator }), TextDB("quotes", "descript/", @@ -700,7 +701,6 @@ static void _call_recursive_replacement(string &str, TextDB &db, break; } - string marker_full = str.substr(pos, end - pos + 1); string marker = str.substr(pos + 1, end - pos - 1); string replacement = @@ -714,7 +714,7 @@ static void _call_recursive_replacement(string &str, TextDB &db, } else { - str.replace(pos, marker_full.length(), replacement); + str.replace(pos, marker.length() + 2, replacement); // Start search from pos rather than end + 1, so that if // the replacement contains its own @foo@, we can replace diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 8e7bd8335ae4..ab99d405ea85 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -6230,16 +6230,24 @@ void place_spec_shop(const coord_def& where, shop_spec &spec, int shop_level) shop_struct& shop = env.shop[where]; const int level_number = shop_level ? shop_level : env.absdepth0; - - for (int j = 0; j < 3; j++) - shop.keeper_name[j] = 1 + random2(200); - shop.shop_name = spec.name; - shop.shop_type_name = spec.type; - shop.shop_suffix_name = spec.suffix; + shop.type = spec.sh_type == SHOP_RANDOM ? _random_shop() : spec.sh_type; shop.level = level_number * 2; - shop.type = spec.sh_type; - if (shop.type == SHOP_RANDOM) - shop.type = _random_shop(); + if (!spec.full_name.empty()) + { + shop.shop_name = spec.name; + shop.full_shop_name = spec.full_name; + } + else if (spec.name.empty() && spec.type.empty() && spec.suffix.empty()) + { + auto names = generate_shop_name(shop.type, shop.level, spec.gozag); + std::tie(shop.full_shop_name, shop.shop_name) = names; + } + else + { + shop.shop_name = spec.name; + shop.shop_type_name = spec.type; + shop.shop_suffix_name = spec.suffix; + } shop.greed = _shop_greed(shop.type, level_number, spec.greed); shop.pos = where; diff --git a/crawl-ref/source/god-abil.cc b/crawl-ref/source/god-abil.cc index eb4b1901acd3..6762454c54c4 100644 --- a/crawl-ref/source/god-abil.cc +++ b/crawl-ref/source/god-abil.cc @@ -3505,6 +3505,7 @@ static int _gozag_shop_price(int index) static void _setup_gozag_shop(int index, vector &valid_shops) { ASSERT(!you.props.exists(make_stringf(GOZAG_SHOPKEEPER_NAME_KEY, index))); + ASSERT(!you.props.exists(make_stringf(GOZAG_SHOP_NAME_KEY, index))); shop_type type = NUM_SHOPS; int choice = random2(valid_shops.size()); @@ -3513,17 +3514,11 @@ static void _setup_gozag_shop(int index, vector &valid_shops) valid_shops.erase(valid_shops.begin() + choice); you.props[make_stringf(GOZAG_SHOP_TYPE_KEY, index)].get_int() = type; - you.props[make_stringf(GOZAG_SHOPKEEPER_NAME_KEY, index)].get_string() - = make_name(); - - const bool need_suffix = type != SHOP_GENERAL - && type != SHOP_GENERAL_ANTIQUE - && type != SHOP_DISTILLERY; - you.props[make_stringf(GOZAG_SHOP_SUFFIX_KEY, index)].get_string() - = need_suffix - ? random_choose("Shoppe", "Boutique", - "Emporium", "Shop") - : ""; + auto names = generate_shop_name(type, you.experience_level, true); + you.props[make_stringf(GOZAG_SHOP_NAME_KEY, index)] + = names.first; + you.props[make_stringf(GOZAG_SHOPKEEPER_NAME_KEY, index)] + = names.second; you.props[make_stringf(GOZAG_SHOP_COST_KEY, index)].get_int() = gozag_price_for_shop(); @@ -3542,20 +3537,18 @@ static string _describe_gozag_shop(int index) const int cost = _gozag_shop_price(index); const char offer_letter = 'a' + index; + const string shop_name = - apostrophise(you.props[make_stringf(GOZAG_SHOPKEEPER_NAME_KEY, - index)].get_string()); + you.props[make_stringf(GOZAG_SHOP_NAME_KEY, + index)].get_string(); const shop_type type = _gozag_shop_type(index); const string type_name = shop_type_name(type); - const string suffix = - you.props[make_stringf(GOZAG_SHOP_SUFFIX_KEY, index)].get_string(); - return make_stringf(" [%c] %5d gold - %s %s %s", + return make_stringf(" [%c] %5d gold - %s (%s)", offer_letter, cost, shop_name.c_str(), - type_name.c_str(), - suffix.c_str()); + type_name.c_str()); } /** @@ -3591,24 +3584,15 @@ static int _gozag_choose_shop() /** * Make a vault spec for the gozag shop offer at the given index. */ -static string _gozag_shop_spec(int index) +static shop_spec _gozag_shop_spec(int index) { const shop_type type = _gozag_shop_type(index); const string name = you.props[make_stringf(GOZAG_SHOPKEEPER_NAME_KEY, index)]; + const string full_name = + you.props[make_stringf(GOZAG_SHOP_NAME_KEY, index)]; - string suffix = replace_all( - you.props[make_stringf(GOZAG_SHOP_SUFFIX_KEY, - index)] - .get_string(), " ", "_"); - if (!suffix.empty()) - suffix = " suffix:" + suffix; - - return make_stringf("%s shop name:%s%s gozag", - shoptype_to_str(type), - replace_all(name, " ", "_").c_str(), - suffix.c_str()); - + return shop_spec(type, name, "", "", -1, -1, false, true, full_name); } /** @@ -3619,13 +3603,8 @@ static string _gozag_shop_spec(int index) static void _gozag_place_shop(int index) { ASSERT(env.grid(you.pos()) == DNGN_FLOOR); - keyed_mapspec kmspec; - kmspec.set_feat(_gozag_shop_spec(index), false); - - feature_spec feat = kmspec.get_feat(); - if (!feat.shop) - die("Invalid shop spec?"); - place_spec_shop(you.pos(), *feat.shop, you.experience_level); + shop_spec spec = _gozag_shop_spec(index); + place_spec_shop(you.pos(), spec, you.experience_level); link_items(); env.markers.add(new map_feature_marker(you.pos(), DNGN_ABANDONED_SHOP)); @@ -3634,12 +3613,9 @@ static void _gozag_place_shop(int index) shop_struct *shop = shop_at(you.pos()); ASSERT(shop); - const gender_type gender = random_choose(GENDER_FEMALE, GENDER_MALE, - GENDER_NEUTRAL); - mprf(MSGCH_GOD, "%s invites you to visit %s %s%s%s.", shop->shop_name.c_str(), - decline_pronoun(gender, PRONOUN_POSSESSIVE), + decline_pronoun(GENDER_NEUTRAL, PRONOUN_POSSESSIVE), shop_type_name(shop->type).c_str(), !shop->shop_suffix_name.empty() ? " " : "", shop->shop_suffix_name.c_str()); @@ -3708,9 +3684,12 @@ bool gozag_call_merchant() for (int j = 0; j < GOZAG_MAX_SHOPS; j++) { +#if TAG_MAJOR_VERSION == 34 you.props.erase(make_stringf(GOZAG_SHOPKEEPER_NAME_KEY, j)); - you.props.erase(make_stringf(GOZAG_SHOP_TYPE_KEY, j)); you.props.erase(make_stringf(GOZAG_SHOP_SUFFIX_KEY, j)); +#endif + you.props.erase(make_stringf(GOZAG_SHOP_NAME_KEY, j)); + you.props.erase(make_stringf(GOZAG_SHOP_TYPE_KEY, j)); you.props.erase(make_stringf(GOZAG_SHOP_COST_KEY, j)); } diff --git a/crawl-ref/source/god-abil.h b/crawl-ref/source/god-abil.h index 10deaeacfc9e..186f34230249 100644 --- a/crawl-ref/source/god-abil.h +++ b/crawl-ref/source/god-abil.h @@ -44,8 +44,11 @@ const char * const GOZAG_POTIONS_KEY = "gozag_potions%d"; const char * const GOZAG_PRICE_KEY = "gozag_price%d"; const char * const GOZAG_SHOPKEEPER_NAME_KEY = "gozag_shopkeeper_%d"; -const char * const GOZAG_SHOP_TYPE_KEY = "gozag_shop_type_%d"; +#if TAG_MAJOR_VERSION == 34 const char * const GOZAG_SHOP_SUFFIX_KEY = "gozag_shop_suffix_%d"; +#endif +const char * const GOZAG_SHOP_NAME_KEY = "gozag_shop_%d"; +const char * const GOZAG_SHOP_TYPE_KEY = "gozag_shop_type_%d"; const char * const GOZAG_SHOP_COST_KEY = "gozag_shop_cost_%d"; #define GOZAG_GOLD_AURA_KEY "gozag_gold_aura_amount" diff --git a/crawl-ref/source/l-dgn.cc b/crawl-ref/source/l-dgn.cc index f17afa39cf44..23314a77ab6b 100644 --- a/crawl-ref/source/l-dgn.cc +++ b/crawl-ref/source/l-dgn.cc @@ -21,6 +21,7 @@ #include "libutil.h" #include "mapmark.h" #include "maps.h" +#include "shopping.h" #include "shout.h" #include "spl-util.h" #include "state.h" @@ -1780,6 +1781,16 @@ LUAFN(dgn_state_is_descent) return 1; } +LUAFN(dgn_shopname) +{ + const char* type_name = luaL_checkstring(ls, 1); + shop_type shop = str_to_shoptype(type_name); + int level = luaL_safe_checkint(ls, 2); + bool gozag = lua_isboolean(ls, 3) ? lua_toboolean(ls, 3) : false; + auto generated = generate_shop_name(shop, level, gozag); + PLUARET(string, generated.first.c_str()); +} + const struct luaL_reg dgn_dlib[] = { { "reset_level", _dgn_reset_level }, @@ -1898,6 +1909,8 @@ const struct luaL_reg dgn_dlib[] = { "is_descent", dgn_state_is_descent }, +{ "shopname", dgn_shopname }, + { nullptr, nullptr } }; diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index 45b8e9b78116..a15f9f25c6df 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -6091,6 +6091,7 @@ feature_spec keyed_mapspec::parse_shop(string s, int weight, int mimic, const bool gozag = strip_tag(s, "gozag"); + string full_shop_name = replace_all_of(strip_tag_prefix(s, "full_name:"), "_", " "); string shop_name = replace_all_of(strip_tag_prefix(s, "name:"), "_", " "); string shop_type_name = replace_all_of(strip_tag_prefix(s, "type:"), "_", " "); @@ -6131,7 +6132,7 @@ feature_spec keyed_mapspec::parse_shop(string s, int weight, int mimic, feature_spec fspec(-1, weight, mimic, no_mimic); fspec.shop.reset(new shop_spec(shop, shop_name, shop_type_name, shop_suffix_name, greed, - num_items, use_all, gozag)); + num_items, use_all, gozag, full_shop_name)); fspec.shop->items = items; return fspec; } diff --git a/crawl-ref/source/mapdef.h b/crawl-ref/source/mapdef.h index b345d78792d2..caf41d270108 100644 --- a/crawl-ref/source/mapdef.h +++ b/crawl-ref/source/mapdef.h @@ -799,10 +799,14 @@ struct shop_spec * stock). * */ + string full_name; /**< Overrides all other name parameters and sets the entire + name of the shop */ + shop_spec(shop_type sh, string n="", string t="", - string s="", int g=-1, int ni=-1, bool u=false, bool goz=false) + string s="", int g=-1, int ni=-1, bool u=false, bool goz=false, + string fname="") : sh_type(sh), name(n), type(t), suffix(s), - greed(g), num_items(ni), items(), use_all(u), gozag(goz) { } + greed(g), num_items(ni), items(), use_all(u), gozag(goz), full_name(fname) { } }; /** diff --git a/crawl-ref/source/scripts/shopnames.lua b/crawl-ref/source/scripts/shopnames.lua new file mode 100644 index 000000000000..ca0f95d798d1 --- /dev/null +++ b/crawl-ref/source/scripts/shopnames.lua @@ -0,0 +1,31 @@ +-- Generates a huge number of shop names to test the generator +-- Runs through the full range of "levels" (we increment 2 levels per dungeon +-- level, so 54), all shop types, and again with Gozag shops +-- Usage: +-- ./crawl -script shopnames 1> shopnames_test.txt + +local shop_types = { + "general", + "antiques", + "weapon", + "antique weapon", + "armour", + "antique armour", + "book", + "scroll", + "distillery", + "jewellery", + "gadget" +} + +for i,shop in ipairs(shop_types) do + print (shop .. ":\n") + for level = 1,54 do + print (level .. ": " .. dgn.shopname(shop, level)) + end + print ("\n" .. shop .. " (Gozag):\n") + for level = 1,54 do + print (level .. ": " .. dgn.shopname(shop, level, true)) + end + print ("\n") +end diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index 0d9d5fc2e32e..727163ce8705 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -45,6 +45,7 @@ #include "travel.h" #include "unicode.h" #include "unwind.h" +#include "database.h" ShoppingList shopping_list; @@ -1545,10 +1546,94 @@ static const char *_shop_type_suffix(shop_type type, const coord_def &where) return suffixnames[(where.x + where.y) % ARRAYSZ(suffixnames)]; } +string generate_shopkeeper_name(bool fancy, bool gozag) +{ + // Names are gnereated in varying levels of fanciness: plain, fancy, + // and Gozag. We are looking for the " shopkeeper full name" key. + string key = (gozag ? "gozag" : fancy ? "fancy" : "plain") + + string(" shopkeeper full name"); + auto generated = getMiscString(key); + string name = maybe_pick_random_substring(generated); + + // The classic name generator can still be referenced (but may be + // combined with additional prefixes, suffixes, other names.) + if (name.find("@Classic_name@") != string::npos) + name = replace_all(name, "@Classic_name@", make_name()); + + return name; +} + +pair generate_shop_name(shop_type type, int shop_level, bool gozag) +{ + // Generate an appropriately long name for the level. Level is (2 * (absdepth || XL)) + // depending on how it was generated, so it can get up to 54 with Gozag. + // We can generate some pretty succinct names so let's start at 16 and go up to 70 + // at max (any more than this would cause display issues anyway). + const uint target_max = 20 + shop_level; + const uint target_min = 20 - shop_level / 3; + const size_t target_length = random_range(target_min, target_max); + const bool fancy = shop_level >= 20; // Orc shops will qualify as "fancy" + string key = shop_type_name(type) + " shop name"; + // Have 10 tries at making a name, and veto any lengths we don't like. + // The aiming is to get the closest to the desired length preferably + // without actually being longer. + auto best = make_pair(string(""), string("")); + size_t best_name_size = 0; + for (int n=0; n<10; n++) + { + // Keeper name is additionally modified by fanciness and Gozag + auto keeper_name = generate_shopkeeper_name(fancy, gozag); + auto generated = getMiscString(key); + if (generated.empty()) + { + mprf(MSGCH_ERROR, "Empty shopkeeper name! Key: %s", key.c_str()); + continue; + } + string name = maybe_pick_random_substring(generated); + name = replace_all(name, "@The_shopkeeper's@", apostrophise(keeper_name)); + name = replace_all(name, "@The_shopkeeper@", keeper_name); + dprf("%s Target: %lu Found: %lu Keeper: %s Name: %s", name.c_str(), target_length, name.size(), keeper_name.c_str(), generated.c_str()); + + if (name.size() == target_length) + { + // Exact length, can't do any better, stop here + best = make_pair(name, keeper_name); + break; + } + else if (name.size() > target_length) + { + // Keep the name if it's the first or it's shorter than the best + // we found so far + if (best_name_size == 0 || name.size() < best_name_size) + best = make_pair(name, keeper_name); + } + // Name is within target but longer than best so prefer this one + else if (name.size() > best_name_size) + best = make_pair(name, keeper_name); + best_name_size = best.first.size(); + } + + dprf("Final: %s", best.first.c_str()); + + return best; +} + +/** + * Old name builder for shops. Still used for most vault-defined shops + * as I don't want to mess with their creation when they've overriden + * shopkeeper names, shop type names, etc. + * + * If a name has been set from the new generator during shop placement, + * we'll just return that instead. + */ string shop_name(const shop_struct& shop) { const shop_type type = shop.type; + // New builder populates this string so just return it + if (!shop.full_shop_name.empty()) + return shop.full_shop_name; + string sh_name = ""; #if TAG_MAJOR_VERSION == 34 @@ -1556,16 +1641,7 @@ string shop_name(const shop_struct& shop) if (shop.shop_name == " ") return shop.shop_type_name; #endif - if (!shop.shop_name.empty()) - sh_name += apostrophise(shop.shop_name) + " "; - else - { - uint32_t seed = static_cast(shop.keeper_name[0]) - | (static_cast(shop.keeper_name[1]) << 8) - | (static_cast(shop.keeper_name[1]) << 16); - - sh_name += apostrophise(make_name(seed)) + " "; - } + sh_name += apostrophise(shop.shop_name) + " "; if (!shop.shop_type_name.empty()) sh_name += shop.shop_type_name; diff --git a/crawl-ref/source/shopping.h b/crawl-ref/source/shopping.h index 8ec9e17350e3..57d5af13df70 100644 --- a/crawl-ref/source/shopping.h +++ b/crawl-ref/source/shopping.h @@ -34,6 +34,9 @@ shop_struct *shop_at(const coord_def& where); void destroy_shop_at(coord_def p); +string generate_shopkeeper_name(bool fancy, bool gozag); +pair generate_shop_name(const shop_type type, int shop_level, + bool gozag); string shop_name(const shop_struct& shop); string shop_type_name(shop_type type); @@ -60,7 +63,8 @@ struct shop_struct string shop_type_name; string shop_suffix_name; - FixedVector keeper_name; + // Overrides name, type, suffix, and just specifies entire shop name + string full_shop_name; vector stock; #if TAG_MAJOR_VERSION == 34 diff --git a/crawl-ref/source/tag-version.h b/crawl-ref/source/tag-version.h index ff533916e917..1c081632dd83 100644 --- a/crawl-ref/source/tag-version.h +++ b/crawl-ref/source/tag-version.h @@ -309,6 +309,7 @@ enum tag_minor_version TAG_MINOR_ENDLESS_DIVINE_SHIELD, // Make Divine Shield not expire with time TAG_MINOR_NEGATIVE_DIVINE_SHIELD, // Fix negative Divine Shield charges TAG_MINOR_MAKHLEB_REVAMP, // Handle backend of giving existing Makh worshippers mark options + TAG_MINOR_SHOP_NAME_GENERATOR, // New generator for shop names #endif NUM_TAG_MINORS, TAG_MINOR_VERSION = NUM_TAG_MINORS - 1 diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index e24f53a7b898..e1d19bfd43b0 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -2265,9 +2265,6 @@ static void unmarshall_level_vault_data(reader &th) static void marshall_shop(writer &th, const shop_struct& shop) { marshallByte(th, shop.type); - marshallByte(th, shop.keeper_name[0]); - marshallByte(th, shop.keeper_name[1]); - marshallByte(th, shop.keeper_name[2]); marshallByte(th, shop.pos.x); marshallByte(th, shop.pos.y); marshallByte(th, shop.greed); @@ -2275,6 +2272,7 @@ static void marshall_shop(writer &th, const shop_struct& shop) marshallString(th, shop.shop_name); marshallString(th, shop.shop_type_name); marshallString(th, shop.shop_suffix_name); + marshallString(th, shop.full_shop_name); _marshall_iterator(th, shop.stock.begin(), shop.stock.end(), bind(marshallItem, placeholders::_1, placeholders::_2, false)); @@ -2295,17 +2293,43 @@ static void unmarshall_shop(reader &th, shop_struct& shop) #else ASSERT(shop.type != SHOP_UNASSIGNED); #endif - shop.keeper_name[0] = unmarshallUByte(th); - shop.keeper_name[1] = unmarshallUByte(th); - shop.keeper_name[2] = unmarshallUByte(th); +#if TAG_MAJOR_VERSION == 34 + // Replicate the old code for shopkeeper names and just save it in + // shop_name field (if not populated with a non-empty string anyway) + FixedVector keeper_name = 0; + if (th.getMinorVersion() < TAG_MINOR_SHOP_NAME_GENERATOR) + { + keeper_name[0] = unmarshallUByte(th); + keeper_name[1] = unmarshallUByte(th); + // Third seed was always thrown away; see note further below + unmarshallUByte(th); + } +#endif shop.pos.x = unmarshallByte(th); shop.pos.y = unmarshallByte(th); shop.greed = unmarshallByte(th); shop.level = unmarshallByte(th); shop.shop_name = unmarshallString(th); +#if TAG_MAJOR_VERSION == 34 + if (th.getMinorVersion() < TAG_MINOR_SHOP_NAME_GENERATOR && shop.shop_name.empty()) + { + uint32_t seed = static_cast(keeper_name[0]) + | (static_cast(keeper_name[1]) << 8) + // XX: Intentionally replicated bug here; the third seed was never used + // The bug is preserved so shop names don't change during save transfers + | (static_cast(keeper_name[1]) << 16); + shop.shop_name = make_name(seed); + } +#endif shop.shop_type_name = unmarshallString(th); shop.shop_suffix_name = unmarshallString(th); #if TAG_MAJOR_VERSION == 34 + if (th.getMinorVersion() >= TAG_MINOR_SHOP_NAME_GENERATOR) + { +#endif + shop.full_shop_name = unmarshallString(th); +#if TAG_MAJOR_VERSION == 34 + } if (th.getMinorVersion() < TAG_MINOR_SHOP_HACK) shop.stock.clear(); else