diff options
-rw-r--r-- | crawl-ref/source/branch.cc | 18 | ||||
-rw-r--r-- | crawl-ref/source/dat/database/help.txt (renamed from crawl-ref/source/dat/help.txt) | 0 | ||||
-rw-r--r-- | crawl-ref/source/dat/database/rand_all.txt | 403 | ||||
-rw-r--r-- | crawl-ref/source/dat/database/rand_arm.txt | 505 | ||||
-rw-r--r-- | crawl-ref/source/dat/database/rand_wpn.txt | 1010 | ||||
-rw-r--r-- | crawl-ref/source/dat/database/randname.txt | 681 | ||||
-rw-r--r-- | crawl-ref/source/dat/database/shout.txt (renamed from crawl-ref/source/dat/shout.txt) | 0 | ||||
-rw-r--r-- | crawl-ref/source/dat/database/speak.txt (renamed from crawl-ref/source/dat/speak.txt) | 0 | ||||
-rw-r--r-- | crawl-ref/source/database.cc | 96 | ||||
-rw-r--r-- | crawl-ref/source/database.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/itemname.cc | 31 | ||||
-rw-r--r-- | crawl-ref/source/itemprop.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/randart.cc | 1053 | ||||
-rw-r--r-- | crawl-ref/source/randart.h | 10 | ||||
-rw-r--r-- | crawl-ref/source/xom.cc | 18 |
16 files changed, 2974 insertions, 863 deletions
diff --git a/crawl-ref/source/branch.cc b/crawl-ref/source/branch.cc index 0739562861..b8fd808aae 100644 --- a/crawl-ref/source/branch.cc +++ b/crawl-ref/source/branch.cc @@ -281,6 +281,15 @@ Branch branches[] = { NULL, NULL, NULL, NULL, 0, 'Y', true, true }, + { BRANCH_HALL_OF_ZOT, BRANCH_MAIN_DUNGEON, 5, 27, BFLAG_HAS_ORB, 0, + DNGN_ENTER_ZOT, DNGN_RETURN_FROM_ZOT, + "Zot", "the Realm of Zot", "Zot", + NULL, + false, true, BLACK, BLACK, + mons_hallzot_rare, mons_hallzot_level, + NULL, NULL, NULL, NULL, + 1, 'Z', false, true }, + { BRANCH_INFERNO, BRANCH_MAIN_DUNGEON, -1, -1, 0, 0, NUM_FEATURES, NUM_FEATURES, NULL, NULL, NULL, @@ -299,15 +308,6 @@ Branch branches[] = { NULL, NULL, NULL, NULL, 0, '0', false, false }, - { BRANCH_HALL_OF_ZOT, BRANCH_MAIN_DUNGEON, 5, 27, BFLAG_HAS_ORB, 0, - DNGN_ENTER_ZOT, DNGN_RETURN_FROM_ZOT, - "Zot", "the Realm of Zot", "Zot", - NULL, - false, true, BLACK, BLACK, - mons_hallzot_rare, mons_hallzot_level, - NULL, NULL, NULL, NULL, - 1, 'Z', false, true }, - { BRANCH_CAVERNS, BRANCH_MAIN_DUNGEON, -1, -1, 0, 0, NUM_FEATURES, NUM_FEATURES, NULL, NULL, NULL, diff --git a/crawl-ref/source/dat/help.txt b/crawl-ref/source/dat/database/help.txt index e21ab52078..e21ab52078 100644 --- a/crawl-ref/source/dat/help.txt +++ b/crawl-ref/source/dat/database/help.txt diff --git a/crawl-ref/source/dat/database/rand_all.txt b/crawl-ref/source/dat/database/rand_all.txt new file mode 100644 index 0000000000..8867886cf6 --- /dev/null +++ b/crawl-ref/source/dat/database/rand_all.txt @@ -0,0 +1,403 @@ +###################################################### +# Randart Names +# ------------- +# rand_all.txt: keywords for randart JEWELLERY and +# those used for ALL randart types +# +# This file contains the lists of keywords (and their +# weights) for keywords specific to randart jewellery +# as well as those used for all three types of +# randarts (weapons, armour, jewellery). You will find +# other ones in rand_wpn.txt and rand_arm.txt. +# See the explanation in the main file, randname.txt, +# for more details. +###################################################### +%%%% +###################################################### +# Library of keywords used (mostly) for randart jewellery. +###################################################### +jewellery_animal + +Magpie + +Firefly + +Scarab + +%%%% +jewellery_special_name + +Misfortune + +Ephemeral Luck + +Wishful Thinking + +Moodiness + +Reimbursement + +the Tempest + +Finality + +Attitude + +Lady Luck + +Temptation + +False Pretenses + +%%%% +suspicion_name + +Secrets + +Suspicion + +Mistrust + +Jealousy + +Incredulity + +Doubts + +Suspected Treachery + +w:20 +@conflict_name@ + +%%%% +###################################################### +# Library of keywords used for all randart types. +###################################################### +divine_esteem + +# good +Esteem + +Favour + +Hope + +Regard + +Approval + +Delight + +Pride + +Generosity + +Supremacy + +Benevolence + +Whim + +Favour + +# bad +Displeasure + +Envy + +w:70 +@anger_name@ + +%%%% +xom_esteem + +# chosen 20% of the time +w:40 +@divine_esteem@ + +Entertainment + +Best Wishes + +Amusement + +Dangerous Boredom + +Questionable Humour + +Ringing Laughter + +Bemusement + +Passing Interest + +Full Attention + +Everchanging Rules + +Whimsicality + +Capriciousness + +Sleight of Hands + +Flight of Fancy + +Premature Condolences + +Absentmindedness + +Malicious Joy + +Psychedelic Visions + +Fair Game + +Experimental Loan + +%%%% +time_name + +Day + +Night + +Midnight + +Twilight + +Dawn + +w:5 +Spring + +w:5 +Springtime + +w:5 +Summer + +w:5 +Summertime + +Autumn + +Winter + +Midsummer + +Midwinter + +the Solstice + +the Harvest + +Eternal Night + +Eternity + +%%%% +colour_name + +Blue + +Red + +Orange + +Purple + +%%%% +sky_or_light + +the Sun + +the Moon + +Light + +Darkness + +Dim Light + +the Shining Light + +Sunlight + +Starshine + +the Clouds + +the Sky + +the @colour_name@ Skies + +%%%% +virtue_or_vice + +w:5 +@virtue_name@ + +@valour_name@ + +@vice_name@ + +%%%% +virtue_name + +Virtue + +Truth + +Honesty + +Faith + +Hospitality + +Charity + +Patience + +Modesty + +%%%% +vice_name + +# some of the deadly sins +Sloth + +Vanity + +Gluttony + +Pride + +Greed + +# general immorality +Sin + +the Original Sin + +Lies + +Dishonesty + +Cowardice + +Dishonour + +Impatience + +Immorality + +Amorality + +Untruth + +%%%% +number_or_qualifier + +# exact numbers +the Three + +the Four + +the Five + +the Six + +the Seven + +the Eight + +the Nine + +the Ten + +the Eleven + +the Twelve + +the Thirteen + +the Fifty + +a Hundred + +a Thousand + +# vague numbers +the + +the Many + +the Countless + +# other qualifiers +the Lost + +the Forgotten + +the Forsaken + +the Hidden + +the Last + +the Lonely + +the Jolly + +the Ancient + +%%%% +thing_names + +Suns + +Moons + +Stars + +Planets + +Hells + +Lives + +Deaths + +Curses + +Blessings + +Gods + +Spirits + +Demons + +Wars + +Mice + +Eyes + +Nights + +Orbs + +Runes + +Seas + +Places + +Wishes + +Wonders + +%%%% + diff --git a/crawl-ref/source/dat/database/rand_arm.txt b/crawl-ref/source/dat/database/rand_arm.txt new file mode 100644 index 0000000000..9ecec293a2 --- /dev/null +++ b/crawl-ref/source/dat/database/rand_arm.txt @@ -0,0 +1,505 @@ +###################################################### +# Randart Names +# ------------- +# rand_arm.txt: keywords for randart ARMOUR +# +# This file contains the lists of keywords (and their +# weights) for most of the keywords used for randart +# armour. You will find others in rand_wpn.txt and +# rand_all.txt, respectively. +# +# See the explanation in the main file, randname.txt, +# for more details. +###################################################### +%%%% +armour_animal + +# bacteria +Amoeba + +# insects +Butterfly + +Cricket + +Echidna + +Ladybird + +# invertebrates +Slug + +Snail + +Gastropod + +# arachnides and clams +Tarantula + +Clam + +Barnacle + +Lobster + +# amphibia and reptiles +Tortoise + +Turtle + +Frog + +Komodo Dragon + +Dragon + +# birds +Turtledove + +Nightingale + +Meadowlark + +# mammals +Hare + +Kangaroo + +Elephant + +Zebra + +Hippo + +Monkey + +# not strictly an animal... :) +Monkey's Uncle + +%%%% +flower_name + +Lilacs + +Daffodils + +the Rose + +the Garden + +%%%% +# non-Crawl critters +critter_name + +the Slorg + +the Alphagorgon + +# from the crawl.akrasiac.org patch. +the Hot Ocelot + +Eight Boll Weevils + +%%%% +discomfort_and_inaction + +# discomfort +Minor Irritation + +Bitterness + +Negation + +Failure + +Servitude + +Submission + +# inaction +Lifelessness + +Boredom + +Ennui + +Restlessness + +Omission + +Negligence + +Inaction + +%%%% +mental_illness_armour + +Paranoia + +Claustrophobia + +Agoraphobia + +Dyspraxia + +Mental Paralysis + +%%%% +good_or_divine + +# good things +the Good + +the Leaf + +Leaves + +Music + +Birdsong + +Brilliance + +Satisfaction + +Fun + +Joy + +Happiness + +Wonder + +Surprise + +Curiosity + +Creativity + +Beauty + +Life + +Liberty + +Freedom + +Amelioration + +# divine events +Divine Compulsion + +the Invisible Hand + +Divine Intervention + +%%%% +# in contrast to "wacky_armour_name" these do have some connection to armour and protection +armour_name_shielding + +Shielding + +Impermeability + +Defence + +Death's Door + +the Gate + +the Saviour + +the Untouchables + +the Armoured One + +Exclusion + +Repulsion + +Preservation + +Conservation + +Inviolability + +%%%% +# other armour properties (beside protection) +armour_property_name + +Supple Strength + +Resist Death + +Grace + +Weightlessness + +Shadows and Fog + +Disguise + +Least Resistance + +Protective Custody + +%%%% +wacky_armour_name + +the Onion + +Vlad + +the Eternal Fruit + +Plasticity + +Baldness + +Terror + +Good Intentions + +the Arcane + +Anaesthesia + +the Armadillo + +Weirdness + +Pathos + +Loss + +Hedging + +Indemnity + +Untold Secrets + +the Earth + +Limited Liability + +Hadjma + +Hairiness + +Space + +the Vacuum + +Compression + +Decompression + +the Loofah + +Love and Death + +%%%% +# Lemuel's suggestions +celestial_bodies + +Sun + +Moon + +Stars + +Planets + +Pleiades + +Morning Star + +Evening Star + +%%%% +instrument_name + +Trumpets + +the Kettle-Drum + +the Accordion + +the Bagpipe + +the Lute + +%%%% +evil_being + +the Devil + +Demons + +Lesser Demons + +Greater Demons + +the Iron Devil + +the Devil's Advocate + +%%%% +# um, reeeeally bad weather... +weather_name + +the First Snow + +Boiling Hail + +Perpetual Drought + +the Thunderstorm + +%%%% +profession_name + +Guilds + +Guild-Master + +Apprentice + +Blacksmith + +Carpenter + +Wheelwright + +Cooper + +Fisher + +Hunter + +Ditch-Digger + +Guardian + +Beekeeper + +Gardener + +%%%% +# something for Xom +game_name + +# general games +Fun and Games + +the Great Game + +# children's games +Peek-a-Boo + +Hide-and-Seek + +Leapfrog + +# board games etc. +the Game of Life + +Card Tricks + +Hangman + +the Dice + +Jigsaw + +Whack-A-Mole + +Ladders and Snakes + +%%%% +politics_name_armour + +the King + +the Queen + +Royalty + +Nobility + +the Republic + +the Empire + +Coronation + +Commoners + +Peasants + +Townfolk + +the City + +the Country + +the Suburbs + +the Mutiny + +%%%% +other_armour_name + +w:5 +Grot + +w:5 +Grottiness + +Filth + +# magic +Magic + +Sorcery + +# other +Crawling + +the Orb + +the Orb Guardian + +the Storm King + +the Hanged Man + +Hedge Wizardry + +Feasting + +Insatiable Hunger + +Imperfection + +Trial and Error + +Misfortune + +Wrong Decisions + +Unambiguity + +the Lost Path + +Misanthrophy + +%%%% +plain_armour_name + +Forget-Me-Not + +Hero's Friend + +%%%% + diff --git a/crawl-ref/source/dat/database/rand_wpn.txt b/crawl-ref/source/dat/database/rand_wpn.txt new file mode 100644 index 0000000000..72faa9f59b --- /dev/null +++ b/crawl-ref/source/dat/database/rand_wpn.txt @@ -0,0 +1,1010 @@ +###################################################### +# Randart Names +# ------------- +# rand_wpn.txt: keywords for randart WEAPONS +# +# This file contains the lists of keywords (and their +# weights) for most of the keywords used for randart +# weapons. You will find other ones in rand_all.txt. +# See the explanation in the main file, randname.txt, +# for more details. +###################################################### +%%%% +power_or_anger + +@power_name@ + +w:7 +@conflict_name@ + +w:7 +@anger_name@ + +%%%% +power_name + +Power + +Might + +Wondrous Power + +Invincibility + +Glory + +Success + +Triumph + +Domination + +Dominance + +Victory + +Intimidation + +%%%% +conflict_name + +Conflict + +Tension + +Dischord + +Division + +Doubt + +Internal Strife + +%%%% +anger_name + +Anger + +Fury + +Righteous Anger + +Righteous Fury + +Wrath + +Brutal Revenge + +Vengeance + +%%%% +battle_or_war + +Battle + +Crusades + +War + +Eternal War + +Eternal Warrior + +# Lemuel's Suggestions +Warrior + +Doomed Warrior + +# akrasiac patch +the Pyrrhic Victory + +#killing +Blood-Lust + +Joyful Slaughter + +Wounding + +Blood + +Fear + +Pain + +Agony + +# Lemuel's suggestion +Hacking and Slashing + +# related to cutting +Truncation + +Severance + +Dullness + +Precise Incision + +#collateral effects +Mourning + +Death's Door + +the Grave + +%%%% +death_or_doom + +# death +Death + +Bloody Death + +Painful Death + +Quick Death + +Instant Death + +Imminent Death + +Sudden Death + +Slow Death + +Certain Death + +Uncertain Death + +Pain and Death + +# doom +Doom + +Premature Burial + +Peril + +Execution + +Destruction + +Evisceration + +Extermination + +# pain and misery +Infinite Pain + +Eternal Torment + +Dismemberment + +Terror + +Misery + +%%%% +strategy_or_justice + +w:2 +@strategy_name@ + +w:4 +@valour_name@ + +w:3 +@justice_name@ + +%%%% +strategy_name + +#strategy +Defence + +Defence by Offence + +Offence + +Protection + +Reinforcement + +Expedience + +Optimality + +%%%% +valour_name + +Honour + +Integrity + +Responsibility + +Watchfulness + +Duty + +Prudence + +Courage + +Valour + +Ressourcefulness + +Action + +Purpose + +Fortitude + +Defiance + +Valiance + +Courage + +Eternal Vigilance + +%%%% +justice_name + +Tender Mercy + +Cruel Justice + +Punishment + +Innocence + +Guilt + +Tortfeasance + +Extenuating Circumstances + +Absolution + +False Accusations + +Wrongful Imprisonment + +Corporal Punishment + +Capital Punishment + +%%%% +diviner_name + +Augurer + +Water Diviner + +Soothsayer + +Seeker + +%%%% +people_name + +King + +Queen + +Jester + +Fool + +Ancients + +Saviour + +Messenger + +Genius + +Coward + +@diviner_name@ + +%%%% +weapon_animal + +# insects +Pill-Bug + +Butterfly + +Wasp + +Moth + +Mosquito + +Gnat + +Blowfly + +# arachnides +Spider + +Scorpion + +# amphibes and reptiles +Rattle-Snake + +# birds +Penguin + +Puffin + +Lamprey + +# mammals +Weasel + +Goat + +Whale + +%%%% +# plants and fungi +plant_name + +Eggplant + +Turnip + +Whelk + +#fungi + +Mushroom + +Toadstool + +# ??? +Puffball + +%%%% +# undead and evil beings +evil_stuff + +Curses + +Hell's Wrath + +the Undead + +Ancient Evil + +Evil + +the Beast + +Shrieking Terror + +the Lurker + +the Crawling Thing + +the Thing + +Abomination + +Mutilation + +Deformation + +Infection + +Demonkind + +%%%% +# catastrophes etc. +catastrophe_name + +the Inferno + +Earthquakes + +# the Apocalypse +the Apocalypse + +Armageddon + +World's End + +Ragnarok + +# the Apocalyptic Riders (except Death) +Pestilence + +Plague + +Famine + +%%%% +chaos_name + +Chaos + +Chance + +Mayhem + +Havoc + +Turmoil + +Calamity + +Arbitration + +the Extremes + +Disorder + +Disaster + +Unbalance + +Disharmony + +Ambiguity + +Change + +Extremism + +%%%% +balance_or_order + +the Middle + +the Median + +Departure + +Arrival + +Ascent + +Descent + +Stasis + +Bodily Harmony + +Moderation + +Eternal Harmony + +Peace + +Equivalence + +Balance + +Harmony + +Fragile Peace + +Circularity + +Linearity + +Law + +Order + +%%%%% +economics_or_politics + +# economics +Inflation + +Deflation + +Supply + +Demand + +# politics +the Imperium + +Greatest Utility + +the Revolution + +Defenestration + +the People + +the Little People + +Wealth + +Poverty + +Reapportionment + +# akrasiac patch +Impeachment + +# umm, quoi? +Freehold + +Attainder + +Fee Simple + +Mandamus + +Breach + +Fundamental Breach + +Termination + +Sequestration + +%%%% +place_name + +Earth + +the World + +the Sea + +the Forest + +the Trees + +the Volcano + +the Equator + +the Old World + +the New World + +Distant Worlds + +the Unseen Realm + +the Spheres + +Proximity + +the Wilderness + +the Maze + +the Pit + +the Eternal Void + +%%%% +discomfort_weapon + +Unpleasantness + +Discomfort + +Disgust + +Frustration + +Chagrin + +Dismay + +Desperation + +Shame + +Embarrassment + +Annoyance + +Anxiety + +Urgency + +%%%% +mental_illness_weapon + +Psychosis + +Neurosis + +Fixation + +Megalomania + +Egomania + +Compulsion + +Fatigue + +%%%% +philosophy_or_science + +@philosophy_name@ + +@science_name@ + +%%%% +philosophy_name + +Monotheism + +Atheism + +Agnosticism + +Existentialism + +Relativism + +Absolutism + +Abstinence + +Orthodoxy + +Heresy + +Free Expression + +the Ego + +Optimism + +Pessimism + +Serendipity + +Limitation + +Levity + +%%%% +science_name + +Reason + +Unreason + +Calculation + +Instinct + +Intuition + +Circular Logic + +Context + +Articulation + +the Mind + +the Nexus + +the Beginning + +the End + +Analysis + +Infinity + +Quantum Leap + +Gravity + +Rotation + +%%%% +item_name + +# items +Orb + +Egg + +Globe + +Candle + +Candelabrum + +Key + +Ring + +# body parts +Heart + +Brain + +Tooth + +%%%% +magic_name + +the Magi + +the Archmagi + +the Warrior-Mage + +%%%% +# substances +substance_name + +Bread + +Sulphur + +Crystal + +Bloodstone + +Oozing Pus + +Ash + +Slime + +Bile + +# these don't really fit +Mana + +Yeast + +Spores + +Dust + +%%%% +# non-groupables +other_weapon_name + +the Omega Point + +Crawling + +Conversion + +Prescription + +the Open Hand + +Spontaneous Combustion + +Res Nullius + +Terra Nullius + +Desertification + +the Spinneret + +Grontol + +# akrasiac patch +Irrepressible Laughter + +%%%% +# single word monster names, to allow for combinations like <Monster>slayer +short_monster_name + +Dragon + +Hydra + +Ogre + +Spider + +Newt + +Giant + +Beetle + +Jelly + +%%%% +monster_name + +@short_monster_name@ + +@player_name@ + +@player_species@ + +Killer Bee + +Killer Klown + +Orb Guardian + +%%%% +short_killer_name + +bane + +slayer + +%%%% +killer_name + +'s Bane + +'s Death + +'s Death Toll + +'s Doom + +'s Foe + +'s Funeral + +'s Harbinger of Death + +'s Nightmare + +'s Regret + +%%%% +real_weapon_name + +Grim Tooth + +w:5 +Widowmaker + +w:5 +Widowermaker + +Lifebane + +Conservator + +Banisher + +Tormentor + +Pendulum + +Murmur + +Sarcophage + +Concordance + +Dragon's Tongue + +Arbiter + +Death Rattle + +Arcanum + +Transmigrator + +Ultimatum + +Earthworm + +Worm + +Worm's Wrath + +Leviticus + +Grim + +# Lemuel's suggestions +Eviscerator + +Undertaker + +Embalmer + +Trog's @anger_name@ + +Hellblazer + +Hell-Harrower + +%%%% +joke_weapon_name + +Secret Weapon + +Thing + +Mud Pie of Death + +Xom's @xom_esteem@ + +String + +Stringbean + +Blob + +Globulus + +Hulk + +Raisin + +Starlight + +Giant's Toothpick + +Backscratcher + +Brush + +Gram + +Grom + +Grum + +Rummage + +Omelette + +Egg + +Aubergine + +Z + +X + +Q + +Ox + +Tattletale + +Fish + +Bung + +Bingo + +# from the crawl.akrasiac.org patch +Cookie Cutter + +%%%% +plain_weapon_name + +w:15 +@short_monster_name@@short_killer_name@ + +@monster_name@@killer_name@ + +w:15 +@real_weapon_name@ + +w:5 +@joke_weapon_name@ + +%%%%
\ No newline at end of file diff --git a/crawl-ref/source/dat/database/randname.txt b/crawl-ref/source/dat/database/randname.txt new file mode 100644 index 0000000000..ad81a7d1f0 --- /dev/null +++ b/crawl-ref/source/dat/database/randname.txt @@ -0,0 +1,681 @@ +###################################################### +# Randart Names +# ------------- +# randname.txt: lookup randart type +# +# This file contains the lists of keywords (and their +# weights) for some lookup phrases of randart type, +# namely "weapon", "armour" and "jewellery" as well as +# in combination with those gods that occasionally +# gift randarts, i.e. "Trog weapon", "Okawaru weapon", +# "Okawaru armour", "Xom weapon", "Xom armour" and +# "Xom jewellery". Incidentally, they are listed in +# precisely that order. At the end of the file you +# will also find a few lists of adjectives used for +# unidentified randart appearances. +# +# The syntax for keywords is the same as that of +# monster speech (see monster_speech.txt for the full +# details). Any phrase encased in '@' symbols is one +# the database will recognise as a keyword that needs +# to be replaced. Definitions of such keywords can be +# found in 4 different places: +# +# o rand_wpn.txt – keywords used mainly for weapons +# o rand_arm.txt - keywords used mainly for armour +# o rand_all.txt - keywords used for jewellery +# as well as for all three types +# o hardcoded (randart.cc) +# +# The latter allows the use of phrases elsewhere +# defined in Crawl. The list of hardcoded keywords is +# as follows: +# +# * player_name - player-chosen character name +# * player_species - species of the character +# * branch_name – name of a random Crawl branch +# * race_name - name of a random Crawl species +# * god_name - name of a random Crawl god +# * xom_name - one of Xom's long names +# +# In the case of god_name this actually allows some +# more refined handling. In fact, the god will not be +# picked entirely at random as there are some +# restrictions to make sure that e.g. no good god is +# chosen for evil weapons, that Beogh isn't matched +# with orc slaying, or that Zin doesn't get picked for +# randarts with mutagenic properties. +# +# Note that weapons and armour use database names for +# only half of all randarts created (the others are +# entirely random names), for jewellery this is only +# the case for one in five randarts. These chances +# are hardcoded. +# +# Feel free to play around with the keywords or their +# weights. The default weight of an entry is w:10, and +# an entry is picked with a chance of its weight out +# of the sum of all weights for entries in a group. +# Consequently if you set the weight of a keyword to +# a really high value (say, 10,000) you can test how +# it looks in the game. Even better, if you have +# wizard mode compiled in (check the in-game 'V'ersion +# information) you can use the wizard command '&o' to +# create objects and '&+' to turn an ordinary object +# into a randart. +# +# Have fun! +###################################################### +%%%% +###################################################### +# 1. WEAPONS +###################################################### +weapon + +# weapon specific keywords (see rand_wpn.txt) +of @power_or_anger@ + +of @battle_or_war@ + +w:1 +of @player_name@'s @death_or_doom@ + +w:9 +of @death_or_doom@ + +w:16 +of @strategy_or_justice@ + +w:4 +of the @people_name@ + +w:8 +of the @weapon_animal@ + +w:2 +of the @plant_name@ + +w:7 +of @evil_stuff@ + +w:5 +of @catastrophe_name@ + +w:8 +of @chaos_name@ + +w:8 +of @balance_or_order@ + +of @economics_or_politics@ + +w:8 +of @branch_name@ + +w:7 +of @place_name@ + +w:5 +of @discomfort_weapon@ + +w:3 +of @mental_illness_weapon@ + +w:4 +of the @item_name@ + +w:1 +of @magic_name@ + +w:5 +of @substance_name@ + +w:7 +of @science_name@ + +w:5 +of @other_weapon_name@ + +w:30 +"@plain_weapon_name@" + +# general keywords (see rand_all.txt) +w:5 +of @time_name@ + +w:5 +of @sky_or_light@ + +w:18 +of @virtue_or_vice@ + +of @number_or_qualifier@ @thing_names@ + +w:9 +of @god_name@'s @divine_esteem@ + +# hardcoded keywords +w:1 +of @god_name@ + +of the @race_name@ + +%%%% +###################################################### +# 2. ARMOUR +###################################################### +armour + +# armour specific keywords (see rand_arm.txt) +of @armour_name_shielding@ + +w:8 +of @armour_property_name@ + +w:20 +of @wacky_armour_name@ + +of the @profession_name@ + +of @politics_name_armour@ + +w:3 +of @weather_name@ + +w:17 +of @good_or_divine@ + +w:5 +of the @celestial_bodies@ + +w:5 +of @instrument_name@ + +w:20 +of the @armour_animal@ + +w:3 +of @flower_name@ + +w:3 +of @critter_name@ + +w:5 +of @evil_being@ + +w:5 +of @mental_illness_armour@ + +of @discomfort_and_inaction@ + +of @game_name@ + +w:15 +of @other_armour_name@ + +w:1 +"@plain_armour_name@" + +# weapon specific keywords (see rand_arm.txt) +w:25 +of @philosophy_or_science@ + +w:15 +of @place_name@ + +# general keywords (see rand_all.txt) +of @time_name@ + +w:8 +of @sky_or_light@ + +w:30 +of @virtue_or_vice@ + +w:16 +of @number_or_qualifier@ @thing_names@ + +w:20 +of @god_name@'s @divine_esteem@ + +# hardcoded keywords +w:1 +of @god_name@ + +w:15 +of @branch_name@ + +%%%% +###################################################### +# 3. JEWELLERY +###################################################### +jewellery + +# jewellery specials (see rand_all.txt) +w:3 +of @jewellery_animal@ + +of @jewellery_special_name@ + +of @suspicion_name@ + +# as defined for weapons (see rand_wpn.txt) +of @people_name@ + +w:17 +of @balance_or_order@ + +w:14 +of @philosophy_name@ + +w:7 +of @mental_illness_weapon@ + +of @other_weapon_name@ + +# as defined for armour (see rand_arm.txt) +w:20 +of @armour_animal@ + +w:3 +of @flower_name@ + +w:5 +of @evil_being@ + +w:20 +of @good_or_divine@ + +w:12 +of @politics_name_armour@ + +w:1 +"@plain_armour_name@" + +# same for all three types (see rand_all.txt) +w:13 +of @time_name@ + +of @sky_or_light@ + +w:20 +of @god_name@'s @divine_esteem@ + +of Xom's @xom_esteem@ + +w:7 +of @virtue_name@ + +w:13 +of @vice_name@ + +w:20 +of @name_or_qualifier@ @thing_names@ + +%%%% +###################################################### +# GOD GIFT specials +###################################################### +# TROG (weapons only) +###################################################### +Trog weapon + +# names containing battle and death are more likely +w:25 +of @power_or_anger@ + +w:25 +of @battle_or_war@ + +w:25 +of @death_or_doom@ + +w:7 +of @strategy_name@ + +w:15 +of @justice_name@ + +w:30 +of @virtue_or_vice@ + +w:1 +of Trog + +w:20 +of Trog's @divine_esteem@ + +of Trog's @anger_name@ + +w:15 +of the @weapon_animal@ + +w:15 +of @evil_stuff@ + +of @catastrophe_name@ + +w:15 +of @chaos_name@ + +w:20 +of @balance_or_order@ + +w:20 +of @economics_or_politics@ + +w:20 +of the @race_name@ + +w:15 +of @branch_name@ + +w:15 +of @place_name@ + +w:15 +of @time_name@ + +of @sky_or_light@ + +w:20 +of @number_or_qualifier@ @thing_names@ + +of @discomfort_weapon@ + +of @mental_illness_weapon@ + +of the @item_name@ + +w:15 +of @philosophy_name@ + +of @science_name@ + +of @other_weapon_name@ + +of @monster_name@@killer_name@ + +w:30 +"@plain_weapon_name@" + +%%%% +###################################################### +# OKAWARU weapon +###################################################### +Okawaru weapon + +# basically use normal set +w:400 +@weapon@ + +# with a few special cases +w:2 +of @player_name@'s @valour_name@ + +w:3 +of Okawaru's @divine_esteem@ + +# and bonus probability for some of the more harmless themes +of @strategy_or_justice@ + +w:5 +of @philosophy_name@ + +w:3 +of @balance_or_order@ + +w:5 +of @power_name@ + +w:2 +of @virtue_name@ + +w:1 +of the @diviner_name@ + +w:5 +of the @weapon_animal@ + +w:5 +of @place_name@ + +w:2 +of @item_name@ + +%%%% +###################################################### +# OKAWARU armour +###################################################### +Okawaru armour + +# again use normal chances with a few exceptions +w:400 +@armour@ + +w:2 +of @player_name@'s @valour_name@ + +w:2 +of Okawaru's @divine_esteem@ + +w:2 +of @armour_animal@ + +w:1 +of @good_or_divine@ + +w:2 +of @armour_name_shielding@ + +w:1 +of @armour_property_name@ + +w:1 +of @wacky_armour_name@ + +w:2 +of @politics_name_armour@ + +%%%% +###################################################### +# XOM weapon +###################################################### +# Xom will basically allow everything +Xom weapon + +# increased chances (obviously!) +w:5 +of @chaos_name@ + +w:5 +of @xom_name@'s @xom_esteem@ + +w:2 +of @xom_name@'s @divine_esteem@ + +# uses the long name +w:1 +of @xom_name@ + +w:1 +of @game_name@ + +w:400 +@weapon@ + +# and why not some of the other names? +@jewellery@ + +@armour@ + +%%%% +###################################################### +# XOM armour +###################################################### +Xom armour + +# increased chances (obviously!) +w:5 +of @chaos_name@ + +w:5 +of @xom_name@'s @xom_esteem@ + +w:2 +of @xom_name@'s @divine_esteem@ + +# uses the long name +w:1 +of @xom_name@ + +w:1 +of @game_name@ + +w:1 +of @player_name@'s @killer_name@ + +w:400 +@armour@ + +# why not some other names? +# (sadly, some weapon names don't make sense even for Xom) +@jewellery@ + +%%%% +###################################################### +# XOM jewellery +###################################################### +Xom jewellery + +# increased chances (obviously!) +w:5 +of @chaos_name@ + +w:5 +of @xom_name@'s @xom_esteem@ + +w:2 +of @xom_name@'s @divine_esteem@ + +# uses the long name +w:1 +of @xom_name@ + +w:1 +of @game_name@ + +w:1 +of @player_name@'s @killer_name@ + +w:1 +of @player_name@'s @killer_name@ + +w:300 +@jewellery@ + +# why not some other names? +# (sadly, some weapon names don't make sense even for Xom) +@armour@ + +%%%% +###################################################### +# Library of randart APPEARANCE (un-identified). +###################################################### +# common to all three types of randarts +general appearance + +brightly glowing + +smoking + +twisted + +shimmering + +warped + +transparent + +encrusted + +pitted + +slimy + +polished + +fine + +crude + +ancient + +faintly glowing + +steaming + +shiny + +%%%% +weapon appearance + +iridescent + +bloodstained + +crystal + +jewelled + +ichor-stained + +# currently 16 entries, so their overall weight amounts 160 +w:160 +@general appearance@ + +%%%% +armour appearance + +faintly humming + +bloodstained + +heavily runed + +jewelled + +ichor-stained + +distressingly furry + +w:160 +@general appearance@ + +%%%% +jewellery appearance + +#specific jewels +ruby + +crystal + +diamond + +emerald + +#other descriptions +runed + +scintillating + +sparkling + +flickering + +glittering + +w:160 +@general appearance@ +%%%% + diff --git a/crawl-ref/source/dat/shout.txt b/crawl-ref/source/dat/database/shout.txt index e18fcdbd07..e18fcdbd07 100644 --- a/crawl-ref/source/dat/shout.txt +++ b/crawl-ref/source/dat/database/shout.txt diff --git a/crawl-ref/source/dat/speak.txt b/crawl-ref/source/dat/database/speak.txt index bd558d162d..bd558d162d 100644 --- a/crawl-ref/source/dat/speak.txt +++ b/crawl-ref/source/dat/database/speak.txt diff --git a/crawl-ref/source/database.cc b/crawl-ref/source/database.cc index 04accbd4f3..d222c31988 100644 --- a/crawl-ref/source/database.cc +++ b/crawl-ref/source/database.cc @@ -26,6 +26,7 @@ db_list openDBList; DBM *descriptionDB; +DBM *randartDB; // shout and speak databases are all generated from a single // text file in the data directory and stored as .db files in the @@ -59,9 +60,15 @@ SingleFileDB singleFileDBs[MAX_DBID] = #define DESC_TXT_DIR "descript" #define DESC_DB (DESC_BASE_NAME ".db") +#define DATABASE_TXT_DIR "database" +#define RANDART_BASE_NAME "randart" +#define RANDART_DB (RANDART_BASE_NAME ".db") + static std::vector<std::string> description_txt_paths(); -static void store_text_db(const std::string &in, const std::string &out); +static std::vector<std::string> randart_txt_paths(); static void generate_description_db(); +static void generate_randart_db(); +static void store_text_db(const std::string &in, const std::string &out); static DBM *get_dbm(db_id id); void databaseSystemInit() @@ -85,6 +92,25 @@ void databaseSystemInit() end(1, true, "Failed to open DB: %s", descriptionPath.c_str()); } + if (!randartDB) + { + std::string randartPath = get_savedir_path(RANDART_DB); + std::vector<std::string> textPaths = randart_txt_paths(); + + // If any of the randart text files are newer then + // aggregated randart db, then regenerate the whole db + for (int i = 0, size = textPaths.size(); i < size; i++) + if (is_newer(textPaths[i], randartPath)) + { + generate_randart_db(); + break; + } + + randartPath.erase(randartPath.length() - 3); + if (!(randartDB = openDB(randartPath.c_str()))) + end(1, true, "Failed to open DB: %s", randartPath.c_str()); + } + for (unsigned int i = 0; i < MAX_DBID; i++) { if (singleFileDBs[i].db) @@ -92,8 +118,14 @@ void databaseSystemInit() std::string dbPath = get_savedir_path( singleFileDBs[i].base_name + ".db"); - std::string dbText = datafile_path( - singleFileDBs[i].base_name + ".txt"); + + std::string filename = DATABASE_TXT_DIR; + filename += FILE_SEPARATOR; + filename += singleFileDBs[i].base_name; + filename += ".txt"; + + std::string dbText = datafile_path(filename); + std::string dbBase = get_savedir_path( singleFileDBs[i].base_name); @@ -121,6 +153,7 @@ void databaseSystemShutdown() } openDBList.clear(); descriptionDB = NULL; + randartDB = NULL; } //////////////////////////////////////////////////////////////////////////// @@ -573,6 +606,47 @@ static void generate_description_db() DO_CHMOD_PRIVATE(full_db_path.c_str()); } +static std::vector<std::string> randart_txt_paths() +{ + std::vector<std::string> txt_file_names; + std::vector<std::string> paths; + + txt_file_names.push_back("randname"); + txt_file_names.push_back("rand_wpn"); // mostly weapons + txt_file_names.push_back("rand_arm"); // mostly armour + txt_file_names.push_back("rand_all"); // jewellery and general + + for (int i = 0, size = txt_file_names.size(); i < size; i++) + { + std::string name = DATABASE_TXT_DIR; + name += FILE_SEPARATOR; + name += txt_file_names[i]; + name += ".txt"; + + std::string txt_path = datafile_path(name); + + if (!txt_path.empty()) + paths.push_back(txt_path); + } + + return (paths); +} + +static void generate_randart_db() +{ + std::string db_path = get_savedir_path(RANDART_BASE_NAME); + std::string full_db_path = get_savedir_path(RANDART_DB); + + std::vector<std::string> txt_paths = randart_txt_paths(); + + file_lock lock(get_savedir_path(RANDART_BASE_NAME ".lk"), "wb"); + unlink( full_db_path.c_str() ); + + for (int i = 0, size = txt_paths.size(); i < size; i++) + store_text_db(txt_paths[i], db_path); + DO_CHMOD_PRIVATE(full_db_path.c_str()); +} + static DBM *get_dbm(db_id id) { DBM *ret = singleFileDBs[id].db; @@ -590,7 +664,7 @@ std::string getShoutString(const std::string &monst, int num_replacements = 0; return getRandomizedStr(get_dbm(DB_SHOUT), monst, suffix, - num_replacements); + num_replacements); } ///////////////////////////////////////////////////////////////////////////// @@ -603,6 +677,20 @@ std::string getSpeakString(const std::string &monst) } ///////////////////////////////////////////////////////////////////////////// +// Randname DB specific functions. +std::string getRandNameString(const std::string &itemtype, + const std::string &suffix) +{ + if (!randartDB) + return (""); + + int num_replacements = 0; + + return getRandomizedStr(randartDB, itemtype, suffix, + num_replacements); +} + +///////////////////////////////////////////////////////////////////////////// // Help DB specific functions. std::string getHelpString(const std::string &topic) diff --git a/crawl-ref/source/database.h b/crawl-ref/source/database.h index a23773c6ce..d7fa281a7f 100644 --- a/crawl-ref/source/database.h +++ b/crawl-ref/source/database.h @@ -3,7 +3,7 @@ * Crawl * * Created by Peter Berger on 4/15/07. - * $Id:$ + * $Id$ */ @@ -60,6 +60,8 @@ std::vector<std::string> getLongDescBodiesByRegex(const std::string ®ex, std::string getShoutString(const std::string &monst, const std::string &suffix = ""); std::string getSpeakString(const std::string &monst); +std::string getRandNameString(const std::string &itemtype, + const std::string &suffix = ""); std::string getHelpString(const std::string &topic); #endif diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 109e01ee27..52527c6979 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -334,9 +334,9 @@ enum branch_type // you.where_are_you BRANCH_GEHENNA, BRANCH_COCYTUS, BRANCH_TARTARUS, + BRANCH_HALL_OF_ZOT, BRANCH_INFERNO, // unimplemented BRANCH_THE_PIT, // unimplemented - BRANCH_HALL_OF_ZOT, BRANCH_CAVERNS, // unimplemented NUM_BRANCHES }; diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 3ac3df5ee8..74b30e88d2 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -980,15 +980,15 @@ std::string item_def::name_aux( description_level_type desc, unsigned long ignore_flags) const { // Shortcuts - const int item_typ = this->sub_type; - const int it_plus = this->plus; + const int item_typ = this->sub_type; + const int it_plus = this->plus; const int item_plus2 = this->plus2; const bool know_type = ident || item_type_known(*this); - const bool dbname = desc == DESC_DBNAME; + const bool dbname = (desc == DESC_DBNAME); const bool basename = (desc == DESC_BASENAME || (dbname && !know_type)); - const bool qualname = desc == DESC_QUALNAME; + const bool qualname = (desc == DESC_QUALNAME); const bool know_curse = !basename && !qualname && !dbname @@ -1029,9 +1029,11 @@ std::string item_def::name_aux( description_level_type desc, // for the name on the main screen). If you're going to change // this behaviour, *please* make it so that there is an option // that maintains this behaviour. -- bwr + // Nor for artefacts. Again, the state should be obvious. --jpeg if (item_cursed( *this )) buff << "cursed "; - else if (Options.show_uncursed && !know_pluses) + else if (Options.show_uncursed && !know_pluses + && (!know_type || !is_artefact(*this))) buff << "uncursed "; } @@ -1163,7 +1165,7 @@ std::string item_def::name_aux( description_level_type desc, // When asking for the base item name, randartism is ignored. if (is_random_artefact( *this ) && !basename && !dbname) { - buff << randart_armour_name(*this); + buff << randart_name(*this); break; } @@ -1378,24 +1380,25 @@ std::string item_def::name_aux( description_level_type desc, break; case OBJ_JEWELLERY: + { if (basename) { if ( jewellery_is_amulet(*this) ) buff << "amulet"; - else // i.e., an amulet + else buff << "ring"; break; } - // not using {tried} here because there are some confusing - // issues to work out with how we want to handle jewellery - // artefacts and base type id. -- bwr + const bool is_randart = is_random_artefact( *this ); + if (know_curse) { if (item_cursed( *this )) buff << "cursed "; else if (Options.show_uncursed && !terse + && (!is_randart || !know_type) && (!ring_has_pluses(*this) || !know_pluses) // If the item is worn, its curse status is known, // no need to belabour the obvious. @@ -1405,9 +1408,9 @@ std::string item_def::name_aux( description_level_type desc, } } - if (is_random_artefact( *this ) && !dbname) + if (is_randart && !dbname) { - buff << randart_jewellery_name(*this); + buff << randart_name(*this); break; } @@ -1435,7 +1438,7 @@ std::string item_def::name_aux( description_level_type desc, << amulet_primary_string(this->special % 13) << " amulet"; } - else // i.e., an amulet + else // i.e., a ring { buff << ring_secondary_string(this->special / 13) << ring_primary_string(this->special % 13) @@ -1443,7 +1446,7 @@ std::string item_def::name_aux( description_level_type desc, } } break; - + } case OBJ_MISCELLANY: if ( item_typ == MISC_RUNE_OF_ZOT ) { diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 2dc8e9bcce..86e20cd1d2 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -1907,6 +1907,10 @@ int ring_has_pluses( const item_def &item ) { ASSERT (item.base_type == OBJ_JEWELLERY); + // not known -> no pluses + if (!item_type_known(item)) + return (0); + switch (item.sub_type) { case RING_SLAYING: @@ -2448,6 +2452,8 @@ std::string item_base_name(const item_def &item) return Missile_prop[Missile_index[item.sub_type]].name; case OBJ_ARMOUR: return Armour_prop[Armour_index[item.sub_type]].name; + case OBJ_JEWELLERY: + return (jewellery_is_amulet(item) ? "amulet" : "ring"); default: return ""; } diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc index a0477e5a60..4c623f19ee 100644 --- a/crawl-ref/source/randart.cc +++ b/crawl-ref/source/randart.cc @@ -23,8 +23,13 @@ #include <stdio.h> #include "externs.h" + +#include "database.h" #include "itemname.h" #include "itemprop.h" +#include "place.h" +#include "player.h" +#include "religion.h" #include "stuff.h" #define KNOWN_PROPS_KEY "randart_known_props" @@ -34,728 +39,172 @@ in dungeon.cc and consists of giving it a few random things - plus & plus2 mainly. */ -static const char *rand_wpn_names[] = { - " of Blood", - " of Death", - " of Bloody Death", - " of Pain", - " of Painful Death", - " of Pain & Death", - " of Infinite Pain", - " of Eternal Torment", - " of Power", - " of Wrath", -/* 10: */ - " of Doom", - " of Tender Mercy", - " of the Apocalypse", - " of the Jester", - " of the Ring", - " of the Fool", - " of the Gods", - " of the Imperium", - " of Destruction", - " of Armageddon", -/* 20: */ - " of Cruel Justice", - " of Righteous Anger", - " of Might", - " of the Orb", - " of Makhleb", - " of Trog", - " of Xom", - " of the Ancients", - " of Mana", - " of Nemelex Xobeh", -/* 30: */ - " of the Magi", - " of the Archmagi", - " of the King", - " of the Queen", - " of the Spheres", - " of Circularity", - " of Linearity", - " of Conflict", - " of Battle", - " of Honour", -/* 40: */ - " of the Butterfly", - " of the Wasp", - " of the Frog", - " of the Weasel", - " of the Troglodytes", - " of the Pill-Bug", - " of Sin", - " of Vengeance", - " of Execution", - " of Arbitration", -/* 50: */ - " of the Seeker", - " of Truth", - " of Lies", - " of the Eggplant", - " of the Turnip", - " of Chance", - " of Curses", - " of Hell's Wrath", - " of the Undead", - " of Chaos", -/* 60: */ - " of Law", - " of Life", - " of the Old World", - " of the New World", - " of the Middle World", - " of Crawl", - " of Unpleasantness", - " of Discomfort", - " of Brutal Revenge", - " of Triumph", -/* 70: */ - " of Evisceration", - " of Dismemberment", - " of Terror", - " of Fear", - " of Pride", - " of the Volcano", - " of Blood-Lust", - " of Division", - " of Eternal Harmony", - " of Peace", -/* 80: */ - " of Quick Death", - " of Instant Death", - " of Misery", - " of the Whale", - " of the Lobster", - " of the Whelk", - " of the Penguin", - " of the Puffin", - " of the Mushroom", - " of the Toadstool", -/* 90: */ - " of the Little People", - " of the Puffball", - " of Spores", - " of Optimality", - " of Pareto-Optimality", - " of Greatest Utility", - " of Anarcho-Capitalism", - " of Ancient Evil", - " of the Revolution", - " of the People", -/* 100: */ - " of the Elves", - " of the Dwarves", - " of the Orcs", - " of the Humans", - " of Sludge", - " of the Naga", - " of the Trolls", - " of the Ogres", - " of Equitable Redistribution", - " of Wealth", -/* 110: */ - " of Poverty", - " of Reapportionment", - " of Fragile Peace", - " of Reinforcement", - " of Beauty", - " of the Slug", - " of the Snail", - " of the Gastropod", - " of Corporal Punishment", - " of Capital Punishment", -/* 120: */ - " of the Beast", - " of Light", - " of Darkness", - " of Day", - " of the Day", - " of Night", - " of the Night", - " of Twilight", - " of the Twilight", - " of Dawn", -/* 130: */ - " of the Dawn", - " of the Sun", - " of the Moon", - " of Distant Worlds", - " of the Unseen Realm", - " of Pandemonium", - " of the Abyss", - " of the Nexus", - " of the Gulag", - " of the Crusades", -/* 140: */ - " of Proximity", - " of Wounding", - " of Peril", - " of the Eternal Warrior", - " of the Eternal War", - " of Evil", - " of Pounding", - " of Oozing Pus", - " of Pestilence", - " of Plague", -/* 150: */ - " of Negation", - " of the Saviour", - " of Infection", - " of Defence", - " of Protection", - " of Defence by Offence", - " of Expedience", - " of Reason", - " of Unreason", - " of the Heart", -/* 160: */ - " of Offence", - " of the Leaf", - " of Leaves", - " of Winter", - " of Summer", - " of Autumn", - " of Spring", - " of Midsummer", - " of Midwinter", - " of Eternal Night", -/* 170: */ - " of Shrieking Terror", - " of the Lurker", - " of the Crawling Thing", - " of the Thing", - " \"Thing\"", - " of the Sea", - " of the Forest", - " of the Trees", - " of Earth", - " of the World", -/* 180: */ - " of Bread", - " of Yeast", - " of the Amoeba", - " of Deformation", - " of Guilt", - " of Innocence", - " of Ascent", - " of Descent", - " of Music", - " of Brilliance", -/* 190: */ - " of Disgust", - " of Feasting", - " of Sunlight", - " of Starshine", - " of the Stars", - " of Dust", - " of the Clouds", - " of the Sky", - " of Ash", - " of Slime", -/* 200: */ - " of Clarity", - " of Eternal Vigilance", - " of Purpose", - " of the Moth", - " of the Goat", - " of Fortitude", - " of Equivalence", - " of Balance", - " of Unbalance", - " of Harmony", -/* 210: */ - " of Disharmony", - " of the Inferno", - " of the Omega Point", - " of Inflation", - " of Deflation", - " of Supply", - " of Demand", - " of Gross Domestic Product", - " of Unjust Enrichment", - " of Detinue", -/* 220: */ - " of Conversion", - " of Anton Piller", - " of Mandamus", - " of Frustration", - " of Breach", - " of Fundamental Breach", - " of Termination", - " of Extermination", - " of Satisfaction", - " of Res Nullius", -/* 230: */ - " of Fee Simple", - " of Terra Nullius", - " of Context", - " of Prescription", - " of Freehold", - " of Tortfeasance", - " of Omission", - " of Negligence", - " of Pains", - " of Attainder", -/* 240: */ - " of Action", - " of Inaction", - " of Truncation", - " of Defenestration", - " of Desertification", - " of the Wilderness", - " of Psychosis", - " of Neurosis", - " of Fixation", - " of the Open Hand", -/* 250: */ - " of the Tooth", - " of Honesty", - " of Dishonesty", - " of Divine Compulsion", - " of the Invisible Hand", - " of Freedom", - " of Liberty", - " of Servitude", - " of Domination", - " of Tension", -/* 260: */ - " of Monotheism", - " of Atheism", - " of Agnosticism", - " of Existentialism", - " of the Good", - " of Relativism", - " of Absolutism", - " of Absolution", - " of Abstinence", - " of Abomination", -/* 270: */ - " of Mutilation", - " of Stasis", - " of Wonder", - " of Dullness", - " of Dim Light", - " of the Shining Light", - " of Immorality", - " of Amorality", - " of Precise Incision", - " of Orthodoxy", -/* 280: */ - " of Faith", - " of Untruth", - " of the Augurer", - " of the Water Diviner", - " of the Soothsayer", - " of Punishment", - " of Amelioration", - " of Sulphur", - " of the Egg", - " of the Globe", -/* 290: */ - " of the Candle", - " of the Candelabrum", - " of the Vampires", - " of the Orcs", - " of the Halflings", - " of World's End", - " of Blue Skies", - " of Red Skies", - " of Orange Skies", - " of Purple Skies", -/* 300: */ - " of Articulation", - " of the Mind", - " of the Spider", - " of the Lamprey", - " of the Beginning", - " of the End", - " of Severance", - " of Sequestration", - " of Mourning", - " of Death's Door", -/* 310: */ - " of the Key", - " of Earthquakes", - " of Failure", - " of Success", - " of Intimidation", - " of the Mosquito", - " of the Gnat", - " of the Blowfly", - " of the Turtle", - " of the Tortoise", -/* 320: */ - " of the Pit", - " of the Grave", - " of Submission", - " of Dominance", - " of the Messenger", - " of Crystal", - " of Gravity", - " of Levity", - " of the Slorg", - " of Surprise", -/* 330: */ - " of the Maze", - " of the Labyrinth", - " of Divine Intervention", - " of Rotation", - " of the Spinneret", - " of the Scorpion", - " of Demonkind", - " of the Genius", - " of Bloodstone", - " of Grontol", -/* 340: */ - " \"Grim Tooth\"", - " \"Widowmaker\"", - " \"Widowermaker\"", - " \"Lifebane\"", - " \"Conservator\"", - " \"Banisher\"", - " \"Tormentor\"", - " \"Secret Weapon\"", - " \"String\"", - " \"Stringbean\"", -/* 350: */ - " \"Blob\"", - " \"Globulus\"", - " \"Hulk\"", - " \"Raisin\"", - " \"Starlight\"", - " \"Giant's Toothpick\"", - " \"Pendulum\"", - " \"Backscratcher\"", - " \"Brush\"", - " \"Murmur\"", -/* 360: */ - " \"Sarcophage\"", - " \"Concordance\"", - " \"Dragon's Tongue\"", - " \"Arbiter\"", - " \"Gram\"", - " \"Grom\"", - " \"Grim\"", - " \"Grum\"", - " \"Rummage\"", - " \"Omelette\"", -/* 370: */ - " \"Egg\"", - " \"Aubergine\"", - " \"Z\"", - " \"X\"", - " \"Q\"", - " \"Ox\"", - " \"Death Rattle\"", - " \"Tattletale\"", - " \"Fish\"", - " \"Bung\"", -/* 380: */ - " \"Arcanum\"", - " \"Mud Pie of Death\"", - " \"Transmigrator\"", - " \"Ultimatum\"", - " \"Earthworm\"", - " \"Worm\"", - " \"Worm's Wrath\"", - " \"Xom's Favour\"", - " \"Bingo\"", - " \"Leviticus\"", -/* 390: */ - " of Joyful Slaughter" - - // Lemuel's new names - " \"Eviscerator\"", - " \"Undertaker\"", - " \"Embalmer\"", - " of Sudden Death", - " of Slow Death", - " of Certain Death", - " of Uncertain Death", - " \"Trog's Wrath\"", - " \"Ogre's Foe\"", - " \"Dragon's Doom\"", - " \"Hellblazer\"", - " \"Hell-Harrower\"", - " of Hacking and Slashing", - " of Anger", - " of Fury", - " of Righteous Fury", - " of the Warrior", - " of the Doomed Warrior", - " of the Warrior-Mage", - - // from the crawl.akrasiac.org patch - " of the Alphagorgon", - " \"Cookie Cutter\"", - - " of the Nine Deaths", - " of Megalomania", - " of Egomania", - " of Pyrrhic Victory", - " of Irrepressible Laughter", - " of Impeachment", -}; -static const char *rand_armour_names[] = { -/* 0: */ - " of Shielding", - " of Grace", - " of Impermeability", - " of the Onion", - " of Life", - " of Defence", - " of Nonsense", - " of Eternal Vigilance", - " of Fun", - " of Joy", - " of Death's Door", - " of the Gate", - " of Watchfulness", - " of Integrity", - " of Bodily Harmony", - " of Harmony", - " of the Untouchables", - " of Grot", - " of Grottiness", - " of Filth", - " of Wonder", - " of Wondrous Power", - " of Power", - " of Vlad", - " of the Eternal Fruit", - " of Invincibility", - " of Hide-and-Seek", - " of the Mouse", - " of the Saviour", - " of Plasticity", - " of Baldness", - " of Terror", - " of the Arcane", - " of Resist Death", - " of Anaesthesia", - " of the Guardian", - " of Inviolability", - " of the Tortoise", - " of the Turtle", - " of the Armadillo", - " of the Echidna", - " of the Armoured One", - " of Weirdness", - " of Pathos", - " of Serendipity", - " of Loss", - " of Hedging", - " of Indemnity", - " of Limitation", - " of Exclusion", - " of Repulsion", - " of Untold Secrets", - " of the Earth", - " of the Turtledove", - " of Limited Liability", - " of Responsibility", - " of Hadjma", - " of Glory", - " of Preservation", - " of Conservation", - " of Protective Custody", - " of the Clam", - " of the Barnacle", - " of the Lobster", - " of Hairiness", - " of Supple Strength", - " of Space", - " of the Vacuum", - " of Compression", - " of Decompression", - " of the Loofah", - - // Lemuel's new names - " of the Sun", - " of the Moon", - " of the Stars", - " of the Planets", - " of the Pleiades", - " of the Morning Star", - " of the Evening Star", - " of the Seven Stars", - " of the Seventy-Seven Stars", - " of Departure", - " of Arrival", - " of Change", - " of Stasis", - " of Doubt", - " of Uncertainty", - " of the Elephant", - " of the Donkey", - " of the Zebra", - " of the Hippo", - " of the Giraffe", - " of the Monkey", - " of the Monkey's Uncle", - " of Shadows and Fog", - " of Love and Death", - " of Crimes and Misdemeanours", - " of Courage", - " of Cowardice", - " of Valour", - " of the Extremes", - " of the Middle", - " of the Median", - " of Optimism", - " of Pessimism", - " of the Man with No Name", - " of Crawling", - " of Zot", - " of the Orb", - " of the Orb Guardian", - " of the Dragon", - " of the Komodo Dragon", - " of the Swamp", - " of the Islands", - " of the Lair", - " of the Beasts", - " of the Vault", - " of the Hive", - " of the Beekeeper", - " of the Garden", - " of the Gardener", - " of the Assistant Gardener", - " of War", - " of Peace", - " of Xom", - " of Xom's Laughter", - " of Xom's Questionable Humour", - " of Zin's Displeasure", - " of the Gods", - " of Atheism", - " of Agnosticism", - " of Heresy", - " of the Nightingale", - " of the Meadowlark", - " of Analysis", - " of the Ego", - " of the Id", - " of the Empty Set", - " with No Name", - " with an Unpronounceable Name", - " with a Strange-Sounding Name", - " of Trumpets", - " of the Kettle-Drum", - " of the Accordion", - " of the Hangman", - " of the Hanged Man", - " of Insatiable Hunger", - " of the Devil", - " of Demons", - " of Lesser Demons", - " of Greater Demons", - " of the Iron Devil", - " of Terror", - " of Annoyance", - " of Minor Irritation", - " of Boredom", - " of Ennui", - " of the Springtime", - " of Midsummer", - " of the Harvest", - " of First Snow", - " of Boiling Hail", - " of Perpetual Drought", - " of the Poles", - " of the Tropics", - " of the Equator", - " of the Flat Earth", - " of Premature Burial", - " of False Imprisonment", - " of Moderation", - " of Extremism", - " of Fun and Games", - " of the Great Game", - " of the Game of Life", - " of the King", - " of the Queen", - " of Royalty", - " of Nobility", - " of the Republic", - " of the Empire", - " of Commoners", - " of Peasants", - " of Townfolk", - " of the City", - " of the Country", - " of the Suburbs", - " \"Hero's Friend\"", - " of Calculation", - " of Instinct", - " of Intuition", - " of Magic", - " of Sorcery", - " of Hedge Wizardry", - " of Doom", - " of Pride", - " of Honour", - " of Dishonour", - " of Shame", - " of Embarrassment", - " of Abstract Expressionism", - " of Free Expression", - " of the Guilds", - " of the Guild-Master", - " of the Apprentice", - " of the Blacksmith", - " of the Carpenter", - " of the Wheelwright", - " of the Cooper", - " of the Fisher", - " of the Hunter", - " of the Ditch-Digger", - " of Patience", - " of Impatience", - " of Anxiety", - " of Urgency", - " \"Forget-Me-Not\"", - " of Lilacs", - " of Daffodils", - " of the Rose", - - // from the crawl.akrasiac.org patch. - " of the Hot Ocelot", - " of Eight Boll Weevils", - - " of Internal Strife", - " of Paranoia", - " of Claustrophobia", - " of Agoraphobia", - " of Dyspraxia", - " of Mental Paralysis" -}; +static bool god_fits_artefact(const god_type which_god, const item_def &item) +{ + if (which_god == GOD_NO_GOD) + return (false); + + const int brand = get_weapon_brand(item); + + if (is_evil_god(which_god) && brand == SPWPN_HOLY_WRATH) + return (false); + else if (is_good_god(which_god) && (brand == SPWPN_DRAINING + || brand == SPWPN_PAIN || brand == SPWPN_VAMPIRICISM)) + { + return (false); + } -static const char *randart_weapon_appearance[] = { - "brightly glowing ", "iridescent ", "smoking ", "bloodstained ", "twisted ", - "shimmering ", "warped ", "crystal ", "jewelled ", "transparent ", - "encrusted ", "pitted ", "slimy ", "polished ", "fine ", "crude ", - "ancient ", "ichor-stained ", "faintly glowing ", "steaming ", "shiny " -}; + switch (which_god) + { + case GOD_BEOGH: + if (brand == SPWPN_ORC_SLAYING) + return (false); + break; + + case GOD_ELYVILON: // peaceful healer god, no weapons, no berserking + if (item.base_type == OBJ_WEAPONS) + return (false); + + if (item.base_type == OBJ_JEWELLERY && item.sub_type == AMU_RAGE) + return (false); + + if (randart_wpn_property( item, RAP_ANGRY ) + || randart_wpn_property( item, RAP_BERSERK )) + { + return (false); + } + break; + + case GOD_OKAWARU: // precision fighter + if (item.base_type == OBJ_JEWELLERY && item.sub_type == AMU_INACCURACY) + return (false); + break; + + case GOD_ZIN: + if (item.base_type == OBJ_JEWELLERY && item.sub_type == RING_HUNGER) + return (false); // goes against food theme + + if (randart_wpn_property( item, RAP_MUTAGENIC )) + return (false); // goes against anti-mutagenic theme + break; + + case GOD_SIF_MUNA: + case GOD_KIKUBAAQUDGHA: + case GOD_VEHUMET: + if (randart_wpn_property( item, RAP_PREVENT_SPELLCASTING)) + return (false); + break; + + case GOD_TROG: // hates anything enhancing magic + if (item.base_type == OBJ_JEWELLERY && (item.sub_type == RING_WIZARDRY + || item.sub_type == RING_FIRE || item.sub_type == RING_ICE + || item.sub_type == RING_MAGICAL_POWER)) + { + return (false); + } + if (brand == SPWPN_PAIN) // involves magic + return (false); + + if (randart_wpn_property( item, RAP_MAGICAL_POWER)) + return (false); -static const char *randart_armour_appearance[] = { - "brightly glowing ", "faintly humming ", "smoking ", "bloodstained ", - "twisted ", "shimmering ", "warped ", "heavily runed ", "jewelled ", - "transparent ", "encrusted ", "pitted ", "slimy ", "polished ", "fine ", - "crude ", "ancient ", "ichor-stained ", "faintly glowing ", - "steaming ", "shiny ", "distressingly furry " -}; + default: + break; + } + + return (true); +} -static const char *randart_jewellery_appearance[] = { - "brightly glowing", "runed", "smoking", "ruby", "twisted", - "shimmering", "warped", "crystal", "diamond", "transparent", - "encrusted", "pitted", "slimy", "polished", "fine", "crude", - "ancient", "emerald", "faintly glowing", "steaming", "shiny", - "scintillating", "sparkling", "flickering", "glittering" -}; +static std::string replace_name_parts(const std::string name_in, + const item_def item) +{ + std::string name = name_in; + + // maybe god gift? + god_type god_gift = GOD_NO_GOD; + if (item.orig_monnum < 0) + { + int help = -item.orig_monnum - 2; + if (help > GOD_NO_GOD && help < NUM_GODS) + god_gift = static_cast<god_type>(help); + } + + // Don't allow "player's Doom" type names for god gifts (except Xom!) + if (name.find("@player_name@'s", 0) != std::string::npos + && god_gift != GOD_NO_GOD && god_gift != GOD_XOM) + { + // simply overwrite the name with one of type "god's Favour" + name = "of "; + name += god_name(god_gift, false); + name += "'s "; + name + getRandNameString("divine_esteem"); + } + name = replace_all(name, "@player_name@", you.your_name); + + name = replace_all(name, "@player_species@", + species_name(static_cast<species_type>(you.species), 1)); + + name = replace_all(name, "@race_name@", + species_name(static_cast<species_type>(random2(SP_ELF)),1)); + + if (name.find("@branch_name@", 0) != std::string::npos) + { + std::string place; + if (one_chance_in(5)) + { + switch(random2(6)) + { + case 0: + case 1: + default: + place = "the Abyss"; + break; + case 2: + case 3: + place = "Pandemonium"; + break; + case 4: + place = "the Labyrinth"; + break; + case 5: + place = "the Portal Chambers"; + break; + } + } + else + { + const branch_type branch = + static_cast<branch_type>(random2(BRANCH_INFERNO)); + place = place_name( get_packed_place(branch, 1, LEVEL_DUNGEON), + true, false ); + } + if (!place.empty()) + name = replace_all(name, "@branch_name@", place); + } + + // occasionally use long name for Xom (see religion.cc) + name = replace_all(name, "@xom_name@", god_name(GOD_XOM, coinflip())); + + if (name.find("@god_name@", 0) != std::string::npos) + { + god_type which_god; + + // God gifts will always get the gifting god's name + if (god_gift != GOD_NO_GOD) + which_god = god_gift; + else + { + do { + which_god = static_cast<god_type>(random2(NUM_GODS)); + } while (!god_fits_artefact(which_god, item)); + } + + name = replace_all(name, "@god_name@", god_name(which_god, false)); + } + + return name; +} // Remember: disallow unrandart creation in abyss/pan @@ -1679,59 +1128,42 @@ bool randart_wpn_known_prop( const item_def &item, randart_prop_type prop ) return known; } -std::string randart_name( const item_def &item ) +static std::string get_artefact_type(const int type) { - ASSERT( item.base_type == OBJ_WEAPONS ); - - if (is_unrandom_artefact( item )) + switch (type) { - const unrandart_entry *unrand = seekunrandart( item ); - return (item_type_known(item) ? unrand->name : unrand->unid_name); - } - - const long seed = calc_seed( item ); - - rng_save_excursion rng_state; - seed_rng( seed ); - - std::string result; - - if (!item_type_known(item)) - { - result += RANDOM_ELEMENT(randart_weapon_appearance); - result += item_base_name(item); - return result; + case OBJ_WEAPONS: + return "weapon"; + case OBJ_ARMOUR: + return "armour"; + case OBJ_JEWELLERY: + return "jewellery"; + default: + return "artefact"; } +} - if (coinflip()) - { - result += item_base_name(item); - result += RANDOM_ELEMENT(rand_wpn_names); - } - else +static bool pick_db_name(const int type) +{ + switch (type) { - const std::string st_p = make_name(random_int(), false); - result += item_base_name(item); - - if (one_chance_in(3)) - { - result += " of "; - result += st_p; - } - else - { - result += " \""; - result += st_p; - result += "\""; - } + case OBJ_WEAPONS: + case OBJ_ARMOUR: + return coinflip(); + case OBJ_JEWELLERY: + return one_chance_in(5); + default: + return 0; } - - return result; } -std::string randart_armour_name( const item_def &item ) +std::string randart_name( const item_def &item ) { - ASSERT( item.base_type == OBJ_ARMOUR ); + ASSERT(is_artefact(item)); + + ASSERT(item.base_type == OBJ_WEAPONS + || item.base_type == OBJ_ARMOUR + || item.base_type == OBJ_JEWELLERY); if (is_unrandom_artefact( item )) { @@ -1741,79 +1173,70 @@ std::string randart_armour_name( const item_def &item ) const long seed = calc_seed( item ); - rng_save_excursion exc; - seed_rng( seed ); - + std::string lookup; std::string result; - if (!item_type_known(item)) + // use prefix of gifting god, if applicable + bool god_gift = false; + int item_orig = 0; + if (item_type_known(item)) // god prefix not necessary for appearance { - result += RANDOM_ELEMENT(randart_armour_appearance); - result += item_base_name(item); - return result; - } - - if (coinflip()) - { - result += item_base_name(item); - result += RANDOM_ELEMENT(rand_armour_names); - } - else - { - const std::string st_p = make_name(random_int(), false); - result += item_base_name(item); - if (one_chance_in(3)) - { - result += " of "; - result += st_p; - } + item_orig = item.orig_monnum; + if (item_orig < 0) + item_orig = -item_orig - 2; else + item_orig = 0; + + if (item_orig > GOD_NO_GOD && item_orig < NUM_GODS) { - result += " \""; - result += st_p; - result += "\""; + lookup += god_name(static_cast<god_type>(item_orig), false) + " "; + god_gift = true; } } - - return result; -} - -std::string randart_jewellery_name( const item_def &item ) -{ - ASSERT( item.base_type == OBJ_JEWELLERY ); - - - if (is_unrandom_artefact( item )) - { - const unrandart_entry *unrand = seekunrandart( item ); - return (item_type_known(item) ? unrand->name : unrand->unid_name); - } - - const long seed = calc_seed( item ); - - rng_save_excursion exc; + + // get base type + lookup += get_artefact_type(item.base_type); + + rng_save_excursion rng_state; seed_rng( seed ); - std::string result; - if (!item_type_known(item)) { - result += RANDOM_ELEMENT(randart_jewellery_appearance); + std::string appear = getRandNameString(lookup, " appearance"); + if (appear.empty()) // nothing found for lookup + { + appear = getRandNameString("general appearance"); + if (appear.empty()) // still nothing found? + appear = "non-descript"; + } + result += appear; result += " "; - result += (jewellery_is_amulet(item) ? "amulet" : "ring"); - + result += item_base_name(item); return result; } - if (one_chance_in(5)) + if (pick_db_name(item.base_type)) { - result += (jewellery_is_amulet(item) ? "amulet" : "ring"); - result += RANDOM_ELEMENT(rand_armour_names); + result += item_base_name(item) + " "; + std::string name = getRandNameString(lookup); + + if (name.empty() && god_gift) // if nothing found, try god name alone + { + name = getRandNameString(god_name(static_cast<god_type>(item_orig), false)); + + if (name.empty()) // if still nothing found, try base type alone + name = getRandNameString(get_artefact_type(item.base_type).c_str()); + } + + if (name.empty()) // still nothing found? + result += "of Bugginess"; + else + result += replace_name_parts(name, item); } else { const std::string st_p = make_name(random_int(), false); - result += (jewellery_is_amulet(item) ? "amulet" : "ring"); + result += item_base_name(item); if (one_chance_in(3)) { diff --git a/crawl-ref/source/randart.h b/crawl-ref/source/randart.h index a1002b34bd..a4fdc910e5 100644 --- a/crawl-ref/source/randart.h +++ b/crawl-ref/source/randart.h @@ -35,19 +35,9 @@ void set_unique_item_status( object_class_type base_type, int type, /* *********************************************************************** * called from: itemname * *********************************************************************** */ -std::string randart_armour_name( const item_def &item ); - -/* *********************************************************************** - * called from: itemname - * *********************************************************************** */ std::string randart_name( const item_def &item ); /* *********************************************************************** - * called from: itemname - * *********************************************************************** */ -std::string randart_jewellery_name( const item_def &item ); - -/* *********************************************************************** * called from: describe * *********************************************************************** */ const char *unrandart_descrip( int which_descrip, const item_def &item ); diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 227798e990..2d84382575 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -108,15 +108,15 @@ static const char *xom_generic_beneficence[] = const char *describe_xom_favour() { return (you.piety > 160) ? "A beloved toy of Xom." : - (you.piety > 145) ? "A favourite toy of Xom." : - (you.piety > 130) ? "A very special toy of Xom." : - (you.piety > 115) ? "A special toy of Xom." : - (you.piety > 100) ? "A toy of Xom." : - (you.piety > 85) ? "A plaything of Xom." : - (you.piety > 70) ? "A special plaything of Xom." : - (you.piety > 55) ? "A very special plaything of Xom." : - (you.piety > 40) ? "A favourite plaything of Xom." : - "A beloved plaything of Xom."; + (you.piety > 145) ? "A favourite toy of Xom." : + (you.piety > 130) ? "A very special toy of Xom." : + (you.piety > 115) ? "A special toy of Xom." : + (you.piety > 100) ? "A toy of Xom." : + (you.piety > 85) ? "A plaything of Xom." : + (you.piety > 70) ? "A special plaything of Xom." : + (you.piety > 55) ? "A very special plaything of Xom." : + (you.piety > 40) ? "A favourite plaything of Xom." : + "A beloved plaything of Xom."; } bool xom_is_nice() |