From 12f4ddfc4601e0ea1f71c873cf205b4479a4a26d Mon Sep 17 00:00:00 2001 From: dolorous Date: Tue, 27 May 2008 01:50:34 +0000 Subject: Outsource names of roaring animals and smells. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5277 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/dat/database/miscname.txt | 41 +++++++++++++++++++++++++++++- crawl-ref/source/effects.cc | 29 ++++----------------- crawl-ref/source/misc.cc | 18 +++++++++++++ crawl-ref/source/misc.h | 4 ++- 4 files changed, 66 insertions(+), 26 deletions(-) diff --git a/crawl-ref/source/dat/database/miscname.txt b/crawl-ref/source/dat/database/miscname.txt index 24546b66c5..68bc8e631f 100644 --- a/crawl-ref/source/dat/database/miscname.txt +++ b/crawl-ref/source/dat/database/miscname.txt @@ -4,7 +4,8 @@ # miscname.txt: lookup miscellaneous names # # This file contains a list of names for miscellaneous things. -# This is currently only used for colours and writing types. +# This is currently only used for colours, writing types, +# roaring animals, and smells. # # Note that randarts may use these as well. ###################################################### @@ -158,3 +159,41 @@ writing_name @writing_adj@ @colour_name@ @writing_noun@ %%%% +roaring_animal_name + +Frog + +Pill Bug + +Millipede + +Eggplant + +Albino Dragon + +Dragon + +Human + +Slug + +%%%% +smell_name + +Coffee + +Salt + +Burning Hair + +Baking Bread + +Something Weird + +Wet Wool + +Sulphur + +Fire and Brimstone + +%%%% diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 11175a04b9..13ef639748 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -736,8 +736,8 @@ void random_uselessness(unsigned char ru, unsigned char sc_read_2) switch (ru) { case 0: - msg::stream << "The dust glows " << weird_glowing_colour() - << "!" << std::endl; + msg::stream << "The dust glows " << weird_glowing_colour() << "!" + << std::endl; break; case 1: @@ -759,32 +759,13 @@ void random_uselessness(unsigned char ru, unsigned char sc_read_2) break; case 3: - temp_rand = random2(8); - mprf("You hear the distant roaring of an enraged %s!", - (temp_rand == 0) ? "frog" : - (temp_rand == 1) ? "pill bug" : - (temp_rand == 2) ? "millipede" : - (temp_rand == 3) ? "eggplant" : - (temp_rand == 4) ? "albino dragon" : - (temp_rand == 5) ? "dragon" : - (temp_rand == 6) ? "human" - : "slug"); + msg::stream << "You hear the distant roaring of an enraged " + << weird_roaring_animal() << "!" << std::endl; break; case 4: if (player_can_smell()) - { - temp_rand = random2(8); - mprf("You smell %s", - (temp_rand == 0) ? "coffee." : - (temp_rand == 1) ? "salt." : - (temp_rand == 2) ? "burning hair!" : - (temp_rand == 3) ? "baking bread." : - (temp_rand == 4) ? "something weird." : - (temp_rand == 5) ? "wet wool." : - (temp_rand == 6) ? "sulphur." - : "fire and brimstone!"); - } + msg::stream << "You smell " << weird_smell() << "." << std::endl; break; case 5: diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 8815dfbfaa..6424b506af 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -2392,6 +2392,24 @@ std::string weird_writing() return result; } +std::string weird_roaring_animal() +{ + std::string result = getRandNameString("roaring_animal_name"); + + lowercase(result); + + return result; +} + +std::string weird_smell() +{ + std::string result = getRandNameString("smell_name"); + + lowercase(result); + + return result; +} + bool scramble(void) { if (you.attribute[ATTR_TRANSFORMATION] == TRAN_STATUE) diff --git a/crawl-ref/source/misc.h b/crawl-ref/source/misc.h index a5a09d2306..137e2d1849 100644 --- a/crawl-ref/source/misc.h +++ b/crawl-ref/source/misc.h @@ -98,13 +98,15 @@ void up_stairs(dungeon_feature_type force_stair = DNGN_UNSEEN, * *********************************************************************** */ std::string weird_glowing_colour(); - // last updated 12may2000 {dlb} /* *********************************************************************** * called from: it_use3 * *********************************************************************** */ std::string weird_writing(); +std::string weird_roaring_animal(); + +std::string weird_smell(); std::string cloud_name(cloud_type type); -- cgit v1.2.3-54-g00ecf