diff options
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/art-data.txt | 5 | ||||
-rw-r--r-- | crawl-ref/source/art-func.h | 3 | ||||
-rw-r--r-- | crawl-ref/source/artefact.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/dat/database/wpnnoise.txt | 6 | ||||
-rw-r--r-- | crawl-ref/source/it_use3.cc | 10 |
5 files changed, 14 insertions, 14 deletions
diff --git a/crawl-ref/source/art-data.txt b/crawl-ref/source/art-data.txt index 346b282dc6..8d49c1ad8c 100644 --- a/crawl-ref/source/art-data.txt +++ b/crawl-ref/source/art-data.txt @@ -81,7 +81,10 @@ # * lev: Lets wearer evoke levitation ability. # * life: Grants negative energy resistance. # * mapping: Lets wearer evoke magic mapping ability. -# * noises: Weapon makes noises. +# * noises: Weapon makes noises. Can be given its own set of noises by +# making an entry in dat/database/wpnnoise.txt, with the +# entry's key exactly the same as the weapon's name, but all +# lowercase. # * nospell: Prevents wearer from casting spells. # * notelep: Prevents wearer from teleporting or blinking. # * poison: Grants poison resistance. diff --git a/crawl-ref/source/art-func.h b/crawl-ref/source/art-func.h index e5a54cf691..bcc19c9851 100644 --- a/crawl-ref/source/art-func.h +++ b/crawl-ref/source/art-func.h @@ -284,9 +284,6 @@ static void _SINGING_SWORD_equip(item_def *item, bool *show_msgs, bool unmeld) mpr("The Singing Sword hums in delight!", MSGCH_TALK); *show_msgs = false; - - // Make noisy_equipment() use a special speech database key. - item->props[ART_NOISE_KEY] = "Singing Sword"; } static void _SINGING_SWORD_unequip(const item_def *item, bool *show_msgs) diff --git a/crawl-ref/source/artefact.h b/crawl-ref/source/artefact.h index 0844c2fc4c..19f403d14e 100644 --- a/crawl-ref/source/artefact.h +++ b/crawl-ref/source/artefact.h @@ -12,10 +12,6 @@ #include "externs.h" -// Artefacts which make noise can use this key to use a different -// speech database key than the default. -#define ART_NOISE_KEY "art_noise_key" - // NOTE: NO_UNRANDARTS is automatically set by util/art-data.pl #define NO_UNRANDARTS 76 diff --git a/crawl-ref/source/dat/database/wpnnoise.txt b/crawl-ref/source/dat/database/wpnnoise.txt index 782ae722e6..d26029f086 100644 --- a/crawl-ref/source/dat/database/wpnnoise.txt +++ b/crawl-ref/source/dat/database/wpnnoise.txt @@ -4,8 +4,10 @@ # messages, and adding new ones really easy. # # wpnnoise.txt contains the messages of randart weapons with -# the noise property and of the Singing Sword, one of -# Crawl's fixed artefacts. +# the noise property and of the noisy unrandart weapons, +# like the Singing Sword. To make an entry for a noisy +# unrandart weapon, make the entry's key exactly the same as +# the weapon's name, but all lower case. # # For an explanation of how to read wpnnoise.txt and how to # add new messages, see monster_speech.txt in the docs diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc index 7101226165..6fb7225d66 100644 --- a/crawl-ref/source/it_use3.cc +++ b/crawl-ref/source/it_use3.cc @@ -61,10 +61,11 @@ void noisy_equipment() const item_def* weapon = you.weapon(); - if (weapon && weapon->props.exists(ART_NOISE_KEY)) + if (weapon && is_unrandom_artefact(*weapon)) { - const std::string key = weapon->props[ART_NOISE_KEY]; - msg = getSpeakString(key); + std::string name = weapon->name(DESC_PLAIN, false, true, false, false, + ISFLAG_IDENT_MASK); + msg = getSpeakString(name.c_str()); if (!msg.empty()) { // "Your Singing Sword" sounds disrespectful @@ -73,7 +74,8 @@ void noisy_equipment() msg = replace_all(msg, "@your_weapon@", "@the_weapon@"); } } - else + + if (msg.empty()) { msg = getSpeakString("noisy weapon"); if (!msg.empty()) |