And, while on the topic, of monster speech:
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3465 c06c8d41-db1a-0410-9941-cceddc491573
G7CTMQ3VNTAB73ZI3LNZHKTAJ5LEQEGG772MVFQQ5XXLCMJVORTQC 3RR5RASA63JOMIHQONIMP55RFG4AJW4GWFAUWN65OECAFTCQY3PQC INGL6QIRRFTJFPGB2BLJBFFWIJ6RQF7KDR5K5CWZY6DWKWIMKJ3AC EJKHYV2Z6UPRVYUAL4WRW33GBNHYBFPMPA57HMBX2LQKXHIUO5VQC UL7XFKMUX3WIU4O2LZANK4ECJ654UZPDBFGNXUEYZYOLKBYBCG6AC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC 3QLM46S44Z7GDLWPH3VHBMW2RSWZAOLGJMG2BDKNGUOZIM4IX6WAC J6APXOT4QOGQFONWB7G546VTVF6QG42HVOROMHF7YBDJPR4K26OAC RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC E5DMZFW6WCFAKTKKOQPYTQXZ2CGLWMVH64LRXDUI2UIG4VYUHIVQC YCL3W2PFE6ILTGBFODCSXNPDIA46KVSZP2TI7HDMYAOEJT65RIEAC 74LQ7JXVLAFSHLI7LCBKFX47CNTYSKGUQSXNX5FCIUIGCC2JTR3QC X7TRUBJTRDVUI53BROBYHF4UDC4I5SUYWBUOGQMZNN2WEZAFVGVQC RBAGQ2PB7V5YAM5KSHSZR2E3MLKDSRVM5XYGI2TIXP5QMVBOQHDQC QDTVLBRGHDTRUVT7I3O72K6TMOYAUSAJBZUHGOEFU2RKJNUPWZSQC 7Y5HSDFKA5TPLS2TWTRFMQVX6UXUDHXU5MUMXQSDFAIY4THQ3BIQC Y56C5OMUQ5XF2G6DKDV4R5MED44UOIUPTBBQVWQBUHYIXYA5MOZAC QHUJATUWL3I7TJOLOY55LPZSAU3EB5X2AKRKTBVN7VSZD527VAXQC 3ZNI2YMHYXRVEONY5CGWXSRMFSLOATZMKU7H6HRY3CC2W6OZAM7QC KR655YT3I3U5DMN5NS3FPUGMDNT4BI56K3SFF2FNJ77C45NFKL5AC BMHUBADDGIOZRVN4P3O5QKIDUYD4RFWBS7MP5X6LZWAYHUBRVD2QC 652WD4FIJ7E2WV2M2RSIJXVKZULJHKMRMH7P3DKXLUX6WLEZLY3AC AIIVH43Z5X3GTPFY4FXQRZPG6Y7QPH2KJ47VM2Q43PCGGD5MTMOAC FYD4A5TIETIV2ZLFYWGHXANU6WQFKMVREHM7OZY2TAXSBMMCDLJAC #ifndef INSULT_H#define INSULT_H#include "externs.h"const char * generic_insult(void);const char * racial_insult(void);#endifstd::string imp_taunt_str();std::string demon_taunt_str();void imp_taunt( const monsters *mons );void demon_taunt( const monsters *mons );
// insult generator// Josh Fishman (c) 2001, All Rights Reserved// This file is released under the GNU GPL, but special permission is granted// to link with Linley Henzel's Dungeon Crawl (or Crawl) without change to// Crawl's license.//// The goal of this stuff is catachronistic feel.#include "AppHdr.h"#include <string.h>#include <stdio.h>#include <stdlib.h>#include <ctype.h>#include "externs.h"#include "insult.h"#include "mon-util.h"#include "stuff.h"static const char* insults1(void);static const char* insults2(void);static const char* insults3(void);static const char* run_away(void);static const char* give_up(void);static const char* meal(void);static const char* whilst_thou_can(void);static const char* important_body_part(void);static const char* important_spiritual_part(void);static void init_cap(char *);void init_cap(char * str){if (str != NULL)str[0] = toupper( str[0] );}{char buff[80];snprintf( buff, sizeof(buff),"%s, thou %s!",random2(7) ? run_away() : give_up(),generic_insult() );init_cap( buff );// XXX: Not pretty, but stops truncation...{}else{}}{char buff[80];if (coinflip()){snprintf( buff, sizeof(buff),"%s, thou %s!",random2(3) ? give_up() : run_away(),generic_insult() );}else{switch( random2( 4 ) ){case 0:snprintf( buff, sizeof(buff),"Thy %s shall be my %s!",random2(4) ? important_body_part(): important_spiritual_part(), meal() );break;case 1:snprintf( buff, sizeof(buff),"%s, thou tasty %s!", give_up(), meal() );break;case 2:snprintf( buff, sizeof(buff),"%s %s!", run_away(), whilst_thou_can() );break;case 3:snprintf( buff, sizeof(buff),"I %s %s thy %s!",coinflip() ? "will" : "shall",coinflip() ? "feast upon" : "devour",random2(4) ? important_body_part(): important_spiritual_part() );break;default:snprintf( buff, sizeof(buff), "Thou %s!", generic_insult() );break;}}init_cap( buff );// XXX: Not pretty, but stops truncation...{}else{}}const char * generic_insult(void){static char buffer[80]; //FIXME: use string objects or whatnotstrcpy(buffer, insults1());strcat(buffer, " ");strcat(buffer, insults2());strcat(buffer, " ");strcat(buffer, insults3());return (buffer);}static const char * important_body_part(void){static const char * part_list[] = {"head","brain","heart","viscera","eyes","lungs","liver","throat","neck","skull","spine",};return (part_list[random2(sizeof(part_list) / sizeof(char *))]);}static const char * important_spiritual_part(void){static const char * part_list[] = {"soul","spirit","inner light","hope","faith","will","heart","mind","sanity","fortitude","life force",};return (part_list[random2(sizeof(part_list) / sizeof(char *))]);}static const char * meal(void){static const char * meal_list[] = {"meal","breakfast","lunch","dinner","supper","repast","snack","victuals","refection","junket","luncheon","snackling","curdle","snacklet","mouthful",};return (meal_list[random2(sizeof(meal_list) / sizeof(char *))]);}static const char * run_away(void){static const char * run_away_list[] = {"give up","quit","run away","escape","flee","fly","take thy face hence","remove thy stench","go and return not","get thee hence","back with thee","away with thee","turn tail","leave","return whence thou came","begone","get thee gone","get thee hence","slither away","slither home","slither hence","crawl home","scamper home","scamper hence","scamper away","bolt","decamp",};return (run_away_list[random2(sizeof(run_away_list) / sizeof(char *))]);}static const char * give_up(void){static const char * give_up_list[] = {"give up","give in","quit","surrender","kneel","beg for mercy","despair","submit","succumb","quail","embrace thy failure","embrace thy fall","embrace thy doom","embrace thy dedition","embrace submission","accept thy failure","accept thy fall","accept thy doom","capitulate","tremble","relinquish hope","taste defeat","despond","disclaim thyself","abandon hope","face thy requiem","face thy fugue","admit defeat","flounder",};return (give_up_list[random2(sizeof(give_up_list) / sizeof(char *))]);}static const char * whilst_thou_can(void){static const char * threat_list[] = {"whilst thou can","whilst thou may","whilst thou are able","if wit thou hast","whilst thy luck holds","before doom catcheth thee","lest death find thee","whilst thou art whole","whilst life thou hast", //jmf: hmm. screen vs. this for undead?};return (threat_list[random2(sizeof(threat_list) / sizeof(char *))]);}static const char * insults1(void){static const char * insults1_list[] = {"artless","baffled","bawdy","beslubbering","bootless","bumbling","canting","churlish","cockered","clouted","craven","currish","dankish","dissembling","droning","ducking","errant","fawning","feckless","feeble","fobbing","foppish","froward","frothy","fulsome","gleeking","goatish","gorbellied","grime-gilt","horrid","hateful","impertinent","infectious","jarring","loggerheaded","lumpish","mammering","mangled","mewling","odious","paunchy","pribbling","puking","puny","qualling","quaking","rank","pandering","pecksniffian","plume-plucked","pottle-deep","pox-marked","reeling-ripe","rough-hewn","simpering","spongy","surly","tottering","twisted","unctious","unhinged","unmuzzled","vain","venomed","villainous","warped","wayward","weedy","worthless","yeasty",};return (insults1_list[random2(sizeof(insults1_list) / sizeof(char*))]);}static const char * insults2(void){static const char * insults2_list[] = {"base-court","bat-fowling","beef-witted","beetle-headed","boil-brained","clapper-clawed","clay-brained","common-kissing","crook-pated","dismal-dreaming","ditch-delivered","dizzy-eyed","doghearted","dread-bolted","earth-vexing","elf-skinned","fat-kidneyed","fen-sucked","flap-mouthed","fly-bitten","folly-fallen","fool-born","full-gorged","guts-griping","half-faced","hasty-witted","hedge-born","hell-hated","idle-headed","ill-breeding","ill-nurtured","kobold-kissing","knotty-pated","limp-willed","milk-livered","moon-mazed","motley-minded","onion-eyed","miscreant","roguish","moldwarp","ruttish","mumble-news","saucy","nut-hook","spleeny","pigeon-egg","rude-growing","rump-fed","shard-borne","sheep-biting","sow-suckled","spur-galled","swag-bellied","tardy-gaited","tickle-brained","toad-spotted","toenail-biting","unchin-snouted","weather-bitten","weevil-witted",};return (insults2_list[random2(sizeof(insults2_list) / sizeof(char*))]);}static const char * insults3(void){static const char * insults3_list[] = {"apple-john","baggage","bandersnitch","barnacle","beggar","bladder","boar-pig","bounder","bugbear","bum-bailey","canker-blossom","clack-dish","clam","clotpole","coxcomb","codpiece","death-token","dewberry","dingleberry","flap-bat","flax-wench","flirt-gill","foot-licker","fustilarian","giglet","gnoll-tail","gudgeon","guttersnipe","haggard","harpy","hedge-pig","horn-beast","hugger-mugger","joithead","lewdster","lout","maggot-pie","malt-worm","mammet","measle","mendicant","minnow reeky","mule","nightsoil","nobody","nothing","pigeon-egg","pignut","pimple","pustule","puttock","pumpion","ratsbane","scavenger","scut","simpleton","skainsmate","slime mold","snaffler","snake-molt","strumpet","surfacer","tinkerer","tiddler","urchin","varlet","vassal","vulture","wastrel","wagtail","whey-face","wormtrail","yak-dropping","zombie-fodder",};return (insults3_list[random2(sizeof(insults3_list) / sizeof(char*))]);}// currently unused:#if 0const char * racial_insult(void){static const char * food3[] = {"snackling","crunchlet","half-meal","supper-setting","snacklet","noshlet","morsel","mug-up","bite-bait","crunch-chow","snack-pap","grub",};static const char * elf1[] = {"weakly","sickly","frail","delicate","fragile","brittle","tender","mooning","painted","lily-hearted","dandy","featherweight","flimsy","rootless","spindly","puny","shaky","prissy",};static const char * halfling3[] = {"half-pint","footstool","munchkin","side-stool","pudgelet","groundling","burrow-snipe","hole-bolter","low-roller","runt","peewee","mimicus","manikin","hop-o-thumb","knee-biter","burrow-botch","hole-pimple","hovel-pustule",};static const char * spriggan3[] = {"rat-rider","mouthfull","quarter-pint","nissette","fizzle-flop","spell-botch","feeblet","weakling","pinchbeck-pixie","ankle-biter","bootstain","nano-nebbish","sopling","shrunken violet","sissy-prig","pussyfoot","creepsneak",};static const char * dwarf2[] = {"dirt-grubbing","grit-sucking","muck-plodding","stone-broke","pelf-dandling","fault-botching","gravel-groveling","boodle-bothering","cabbage-coddling","rhino-raveling","thigh-biting","dirt-delving",};static const char * kenku2[] = {"hollow-boned","feather-brained","beak-witted","hen-pecked","lightweight","frail-limbed","bird-brained","featherweight","pigeon-toed","crow-beaked","magpie-eyed","mallardish",};static const char * minotaur3[] = {"bull-brain","cud-chewer","calf-wit","bovine",//"mooer", // of Venice"cow","cattle","meatloaf","veal","meatball","rump-roast","briscut","cretin","walking sirloin",};switch (you.species){default:break;}}#endif"serf",mprf(MSGCH_TALK, "%s %s, \"%s\"", mon_name.c_str(), voice,str.c_str() );mprf(MSGCH_TALK, "%s %s:", mon_name.c_str(), voice );mprf(MSGCH_TALK, "%s", str.c_str());if (mon_name.length() + strlen(voice) + str.length() + 5 >= 79)void demon_taunt( const monsters *mons ){std::string str = demon_taunt_str();const std::string mon_name = mons->name(DESC_CAP_THE);static const char * sound_list[] ={"says", // actually S_SILENT"shouts","barks","shouts","roars","screams","bellows","screeches","buzzes","moans","whines","croaks","growls","hisses","breathes", // S_VERY_SOFT"whispers", // S_SOFT"says", // S_NORMAL"shouts", // S_LOUD"screams" // S_VERY_LOUD};const char *voice = sound_list[ mons_shouts(mons->type) ];return (buff);}std::string demon_taunt_str()mprf(MSGCH_TALK, "%s shouts, \"%s\"", mon_name.c_str(),str.c_str() );mprf(MSGCH_TALK, "%s shouts:", mon_name.c_str() );mprf(MSGCH_TALK, "%s", str.c_str() );if (mon_name.length() + 11 + str.length() >= 79)return (buff);}void imp_taunt( const monsters *mons ){std::string str = imp_taunt_str();std::string mon_name = mons->name(DESC_CAP_THE);std::string imp_taunt_str()//// Modified for Crawl Reference by $Author$ on $Date$
static std::string get_species_insult(const std::string type){std::string lookup = "insult ";// get species genuslookup += species_name(you.species, 1, true);lookup += " ";lookup += type;std::string insult = getSpeakString(lowercase(lookup));if (insult.empty()) // species too specific?{lookup = "insult general ";lookup += type;insult = getSpeakString(lookup);}return (insult);}
msg = replace_all(msg, "@imp_taunt@", imp_taunt_str());msg = replace_all(msg, "@demon_taunt@", demon_taunt_str());
// replace with species specific insultsmsg = replace_all(msg, "@species_insult_adj1@", get_species_insult("adj1"));msg = replace_all(msg, "@species_insult_adj2@", get_species_insult("adj2"));msg = replace_all(msg, "@species_insult_noun@", get_species_insult("noun"));
if (!speakDB){std::string speakPath = get_savedir_path(SPEAK_DB);std::vector<std::string> textPaths = speak_txt_paths();// If any of the speech text files are newer then// aggregated speak db, then regenerate the whole dbfor (int i = 0, size = textPaths.size(); i < size; i++)if (is_newer(textPaths[i], speakPath)){generate_speak_db();break;}
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 std::vector<std::string> speak_txt_paths(){std::vector<std::string> txt_file_names;std::vector<std::string> paths;txt_file_names.push_back("speak"); // monster speechtxt_file_names.push_back("noise"); // noisy weapon speechtxt_file_names.push_back("insult"); // imp/demon tauntsfor (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_speak_db(){std::string db_path = get_savedir_path(SPEAK_BASE_NAME);std::string full_db_path = get_savedir_path(SPEAK_DB);std::vector<std::string> txt_paths = speak_txt_paths();file_lock lock(get_savedir_path(SPEAK_BASE_NAME ".lk"), "wb");
%%%%############################################################################################# Weapons that make noises.############################################### The Singing Sword loves to sing and sometimes talks.singing swordw:4@weapon_sings@w:1@weapon_talks@%%%%# Noisy weapons like to chatter and imitate dungeon noises.noisy weaponw:2@weapon_talks@w:1SOUND:You hear @weapon_noise@%%%%# for the Singing Sword only!weapon_sings#sings@The_weapon@ hums a little @tune_or_melody@.@The_weapon@ breaks into glorious song!@The_weapon@ sings.@The_weapon@ sings loudly.@The_weapon@ sings off-key.@The_weapon@ sings, "Tra-la-la..."@The_weapon@ sings a lullaby.@The_weapon@ whines plaintively.@The_weapon@ wails mournfully.@The_weapon@ practices its scales.@The_weapon@ lilts tunefully.@The_weapon@ yodels.@The_weapon@ hums tunelessly.@The_weapon@ makes a painfully high-pitched squeak.@The_weapon@ sings a sudden staccato note.@The_weapon@ sings a catchy @tune_or_melody@.@The_weapon@ hums a slow waltz.@The_weapon@ whistles merrily.#Beethoven@The_weapon@ goes "Da-da-da-dum".@The_weapon@ chants serenely.@The_weapon@ trills happily.@The_weapon@ chants a little melody.@The_weapon@ sings a deeply moving song.@The_weapon@ hums an eerie @tune_or_melody@.@The_weapon@ hums a slow and mournful tune.@The_weapon@ launches into yet another solo.@The_weapon@ strikes up a merry @tune_or_melody@.@The_weapon@ emits a series of high-pitched trills.@The_weapon@ composes a new song.@The_weapon@ makes a sound as if to clear its throat.@The_weapon@ sings a quivering drawn-out note.@The_weapon@ sings a little jingle.@The_weapon@ strikes up a funeral march.@The_weapon@ merrily whistles a melody.In a hysterical voice, @the_weapon@ strikes up a march.@The_weapon@ sings @several@ chords at once.@The_weapon@ trains the @kind_of_scales@ scales.@The_weapon@ pulls out all the stops.@The_weapon@ sets up a furious crescendo.@The_weapon@ plays a requiem for the unknown sword.@The_weapon@ strikes up a @dance@.@The_weapon@ intones @an_aria_or_fugue@.@The_weapon@ @nearly_or_clearly@ @hits_or_misses@ the concert pitch.#imitates instruments@The_weapon@ makes a twanging sound.@The_weapon@ chimes melodiously.@The_weapon@ chimes harmoniously.@The_weapon@ makes beautiful music.@The_weapon@ produces a loud orchestral chord.@The_weapon@ tinkles.@The_weapon@ rings like a bell.@The_weapon@ imitates a saxophone.@The_weapon@ chimes like a gong.@The_weapon@ applauds itself.@The_weapon@ goes toot-toot!@The_weapon@ does a drum roll.@The_weapon@ holds a dissonant chord.@The_weapon@ beats time.#speaks@The_weapon@ says, "Hi! I'm the Singing Sword!"@The_weapon@ shouts, "Sing along with me!"@The_weapon@ shouts, "One, two, three..."@The_weapon@ spouts musical wisdom.@The_weapon@ chants, "I am golden and pointed, and with blood well anointed."@The_weapon@ dictates a lengthy tome entitled 'The Well-Tempered Blade'.@The_weapon@ @points_out@ the lack of singing @not_swords@.@The_weapon@ embarks on a lenghty monologue about murderous music.@The_weapon@ curses its smith: "I was supposed to be the Stinging Sword!"@The_weapon@ muses how they don't make such fine swords anymore.@The_weapon@ tries to improvise rhymes, and fails miserably.@The_weapon@ complains about @double_or_triple@ swords.@The_weapon@ derides short swords.@The_weapon@ yells, "Ploughshares to swords!" and giggles.@The_weapon@ chants, "Rather stab than club, rather slice than rub!"# end Singing Sword
# general chatter for noisy weapons,# including Singing Swordweapon_talks#speaks@Your_weapon@ shouts, "Whoopee!"@Your_weapon@ argues with itself.@Your_weapon@ complains about the scenery.@Your_weapon@ says, "I'm bored."@Your_weapon@ shouts out instructions!@Your_weapon@ says, "Ssh! Did you hear that?"@Your_weapon@ cheers you on.@Your_weapon@ calls out a warning!@Your_weapon@ hurls insults at you.@Your_weapon@ chatters happily.@Your_weapon@ recites a poem.@Your_weapon@ prattles on and on.@Your_weapon@ regales you with its life story.@Your_weapon@ speaks gibberish.@Your_weapon@ raves incoherently.@Your_weapon@ shouts, "Help!"@Your_weapon@ happily shouts, "Violence is virtue, silence is sin."@Your_weapon@ says, "They will have to pry me from your cold, dead hands."@Your_weapon@ longs back for the days in the arena.#song by the Misfits@Your_weapon@ asks plaintively, "Mommy, can I go out and kill tonight?"@Your_weapon@ cries, "Don't ditch me yet! I promise to be forever silent."@Your_weapon@ amuses itself with detailed descriptions of past executions.@Your_weapon@ wails, "I am too young to rust!"@Your_weapon@ wishes everyone in the dungeon @unpleasant_or_sudden@ @demise_or_death@.@Your_weapon@ fumes, "Being battered, bent and broken sure is better than this boredom!"@Your_weapon@ yells, "No battle, no fun!"@Your_weapon@ shouts, "This level is mine! Um, ours."@Your_weapon@ cracks jokes of @questionable@ humour.@Your_weapon@ dwells on sagas on the glory of old.@Your_weapon@ belts out, "Dying in battle is most honourable!"@Your_weapon@ gleefully confesses its misdeeds.@Your_weapon@ groans, "That's what you call fighting?"@Your_weapon@ shouts, "Left! No, no, right!".@Your_weapon@ says, "How I wish you were a better fighter."@Your_weapon@ grouses, "Could you please kill something? I'm itching all over."@Your_weapon@ shouts, "Make war, not love!"#makes noises@Your_weapon@ growls menacingly.@Your_weapon@ sputters and hisses.@Your_weapon@ hollers!@Your_weapon@ pants and wheezes.@Your_weapon@ barks abruptly.@Your_weapon@ sighs.@Your_weapon@ wails.@Your_weapon@ howls with laughter!@Your_weapon@ laughs crazily.@Your_weapon@ burps!@Your_weapon@ goes snicker-snack!@Your_weapon@ lets out a mournful sigh.@Your_weapon@ yells in some weird language.@Your_weapon@ makes a horrible noise.@Your_weapon@ makes a deep moaning sound.@Your_weapon@ gives off a wolf whistle.@Your_weapon@ wails.@Your_weapon@ giggles.@Your_weapon@ lets out a whoop!@Your_weapon@ yawns loudly.@Your_weapon@ intones a prayer.@Your_weapon@ cries out!@Your_weapon@ swears loudly.@Your_weapon@ inquires about your family.@Your_weapon@ coughs loudly.@Your_weapon@ burbles away merrily.@Your_weapon@ gurgles.@Your_weapon@ suddenly shrieks!@Your_weapon@ cackles.@Your_weapon@ warbles.@Your_weapon@ suddenly bursts into laughter!@Your_weapon@ snorts.@Your_weapon@ comments on the weather.@Your_weapon@ makes a deep, guttural noise.@Your_weapon@ gives off a sizzling sound.@Your_weapon@ whistles innocently.@Your_weapon@ makes a popping sound.@Your_weapon@ yelps loudly!@Your_weapon@ lets out a series of bird calls.# end weapon chatter%%%%# noises for weapons with NOISES property (not Singing Sword!)weapon_noise#dungeon noisesa shout.an angry hiss.a high-pitched scream!a roar!a hideous shriek!a piteous moan.a screech!a bellow!a loud, deep croak!an angry buzzing noise.an irritating high-pitched whine.a splashing noise.a sizzling sound.a loud clanging noise!a grinding noise.a mighty clap of thunder!a hideous screaming!a bark!a rumbling sound.a crunching sound.a distant "Zot"!the distant roaring of an enraged frog.# other noises, usually not found in the dungeona voice call your name.a very strange noise.someone snoring.the sound of rushing water.someone calling for help!strange voices.a knock.maniacal laughter.snatches of song.a twanging sound.the chiming of a distant gong.the tinkle of an enormous bell.an echo.the wailing of sirens.a flourish of trumpets!# end weapon noises%%%%#synonyms for weapon noisesseveralseveralthree or foura multitude of%%%%kind_of_scalespentatonicchromaticdiatonic%%%%not_swordsclubsaxespolearms%%%%points_outpoints outremarks in passing on%%%%dancebossanovawaltzmenuet%%%%an_aria_or_fuguean ariaa fugue%%%%nearly_or_clearlynearlyclearly%%%%hits_or_misseshitsmisses%%%%tune_or_melodytunemelody%%%%unpleasant_or_suddenan unpleasanta sudden%%%%demise_or_deathdemisedeath%%%%questionablequestionabledoubtful%%%%double_or_tripledoubletriple%%%%
############################################################# As of Stone Soup 0.3 the previously hardcoded monster# speech has been outsourced. This makes changing existing# messages, and adding new ones really easy.## noise.txt contains the messages of randart weapons with# the noise property and of the Singing Sword, one of# Crawl's fixed artefacts.## For an explanation of how to read noise.txt and how to# add new messages, see monster_speech.txt in the docs# directory############################################################%%%%############################################################# The SINGING SWORD loves to sing and sometimes talks.############################################################singing swordw:4@weapon_sings@w:1@weapon_talks@%%%%############################################################# NOISY WEAPONS like to chatter and imitate dungeon noises.############################################################noisy weaponw:2@weapon_talks@w:1SOUND:You hear @weapon_noise@%%%%############################################################# for the SINGING SWORD only!############################################################weapon_sings#sings@The_weapon@ hums a little @tune_or_melody@.@The_weapon@ breaks into glorious song!@The_weapon@ sings.@The_weapon@ sings loudly.@The_weapon@ sings off-key.@The_weapon@ sings, "Tra-la-la..."@The_weapon@ sings a lullaby.@The_weapon@ whines plaintively.@The_weapon@ wails mournfully.@The_weapon@ practices its scales.@The_weapon@ lilts tunefully.@The_weapon@ yodels.@The_weapon@ hums tunelessly.@The_weapon@ makes a painfully high-pitched squeak.@The_weapon@ sings a sudden staccato note.@The_weapon@ sings a catchy @tune_or_melody@.@The_weapon@ hums a slow waltz.@The_weapon@ whistles merrily.#Beethoven@The_weapon@ goes "Da-da-da-dum".@The_weapon@ chants serenely.@The_weapon@ trills happily.@The_weapon@ chants a little melody.@The_weapon@ sings a deeply moving song.@The_weapon@ hums an eerie @tune_or_melody@.@The_weapon@ hums a slow and mournful tune.@The_weapon@ launches into yet another solo.@The_weapon@ strikes up a merry @tune_or_melody@.@The_weapon@ emits a series of high-pitched trills.@The_weapon@ composes a new song.@The_weapon@ makes a sound as if to clear its throat.@The_weapon@ sings a quivering drawn-out note.@The_weapon@ sings a little jingle.@The_weapon@ strikes up a funeral march.@The_weapon@ merrily whistles a melody.In a hysterical voice, @the_weapon@ strikes up a march.@The_weapon@ sings @several@ chords at once.@The_weapon@ trains the @kind_of_scales@ scales.@The_weapon@ pulls out all the stops.@The_weapon@ sets up a furious crescendo.@The_weapon@ plays a requiem for the unknown sword.@The_weapon@ strikes up a @dance@.@The_weapon@ intones @an_aria_or_fugue@.@The_weapon@ @nearly_or_clearly@ @hits_or_misses@ the concert pitch.#imitates instruments@The_weapon@ makes a twanging sound.@The_weapon@ chimes melodiously.@The_weapon@ chimes harmoniously.@The_weapon@ makes beautiful music.@The_weapon@ produces a loud orchestral chord.@The_weapon@ tinkles.@The_weapon@ rings like a bell.@The_weapon@ imitates a saxophone.@The_weapon@ chimes like a gong.@The_weapon@ applauds itself.@The_weapon@ goes toot-toot!@The_weapon@ does a drum roll.@The_weapon@ holds a dissonant chord.@The_weapon@ beats time.#speaks@The_weapon@ says, "Hi! I'm the Singing Sword!"@The_weapon@ shouts, "Sing along with me!"@The_weapon@ shouts, "One, two, three..."@The_weapon@ spouts musical wisdom.@The_weapon@ chants, "I am golden and pointed, and with blood well anointed."@The_weapon@ dictates a lengthy tome entitled 'The Well-Tempered Blade'.@The_weapon@ @points_out@ the lack of singing @not_swords@.@The_weapon@ embarks on a lenghty monologue about murderous music.@The_weapon@ curses its smith: "I was supposed to be the Stinging Sword!"@The_weapon@ muses how they don't make such fine swords anymore.@The_weapon@ tries to improvise rhymes, and fails miserably.@The_weapon@ complains about @double_or_triple@ swords.@The_weapon@ derides short swords.@The_weapon@ yells, "Ploughshares to swords!" and giggles.@The_weapon@ chants, "Rather stab than club, rather slice than rub!"# end Singing Sword%%%%############################################################# general chatter for noisy weapons,# including Singing Sword############################################################weapon_talks#speaks@Your_weapon@ shouts, "Whoopee!"@Your_weapon@ argues with itself.@Your_weapon@ complains about the scenery.@Your_weapon@ says, "I'm bored."@Your_weapon@ shouts out instructions!@Your_weapon@ says, "Ssh! Did you hear that?"@Your_weapon@ cheers you on.@Your_weapon@ calls out a warning!@Your_weapon@ hurls insults at you.@Your_weapon@ chatters happily.@Your_weapon@ recites a poem.@Your_weapon@ prattles on and on.@Your_weapon@ regales you with its life story.@Your_weapon@ speaks gibberish.@Your_weapon@ raves incoherently.@Your_weapon@ shouts, "Help!"@Your_weapon@ happily shouts, "Violence is virtue, silence is sin."@Your_weapon@ says, "They will have to pry me from your cold, dead hands."@Your_weapon@ longs back for the days in the arena.#song by the Misfits@Your_weapon@ asks plaintively, "Mommy, can I go out and kill tonight?"@Your_weapon@ cries, "Don't ditch me yet! I promise to be forever silent."@Your_weapon@ amuses itself with detailed descriptions of past executions.@Your_weapon@ wails, "I am too young to rust!"@Your_weapon@ wishes everyone in the dungeon @unpleasant_or_sudden@ @demise_or_death@.@Your_weapon@ fumes, "Being battered, bent and broken sure is better than this boredom!"@Your_weapon@ yells, "No battle, no fun!"@Your_weapon@ shouts, "This level is mine! Um, ours."@Your_weapon@ cracks jokes of @questionable@ humour.@Your_weapon@ dwells on sagas on the glory of old.@Your_weapon@ belts out, "Dying in battle is most honourable!"@Your_weapon@ gleefully confesses its misdeeds.@Your_weapon@ groans, "That's what you call fighting?"@Your_weapon@ shouts, "Left! No, no, right!".@Your_weapon@ says, "How I wish you were a better fighter."@Your_weapon@ grouses, "Could you please kill something? I'm itching all over."@Your_weapon@ shouts, "Make war, not love!"#makes noises@Your_weapon@ growls menacingly.@Your_weapon@ sputters and hisses.@Your_weapon@ hollers!@Your_weapon@ pants and wheezes.@Your_weapon@ barks abruptly.@Your_weapon@ sighs.@Your_weapon@ wails.@Your_weapon@ howls with laughter!@Your_weapon@ laughs crazily.@Your_weapon@ burps!@Your_weapon@ goes snicker-snack!@Your_weapon@ lets out a mournful sigh.@Your_weapon@ yells in some weird language.@Your_weapon@ makes a horrible noise.@Your_weapon@ makes a deep moaning sound.@Your_weapon@ gives off a wolf whistle.@Your_weapon@ wails.@Your_weapon@ giggles.@Your_weapon@ lets out a whoop!@Your_weapon@ yawns loudly.@Your_weapon@ intones a prayer.@Your_weapon@ cries out!@Your_weapon@ swears loudly.@Your_weapon@ inquires about your family.@Your_weapon@ coughs loudly.@Your_weapon@ burbles away merrily.@Your_weapon@ gurgles.@Your_weapon@ suddenly shrieks!@Your_weapon@ cackles.@Your_weapon@ warbles.@Your_weapon@ suddenly bursts into laughter!@Your_weapon@ snorts.@Your_weapon@ comments on the weather.@Your_weapon@ makes a deep, guttural noise.@Your_weapon@ gives off a sizzling sound.@Your_weapon@ whistles innocently.@Your_weapon@ makes a popping sound.@Your_weapon@ yelps loudly!@Your_weapon@ lets out a series of bird calls.# end weapon chatter%%%%############################################################# noises for weapons with NOISES property (not Singing Sword!)############################################################weapon_noise#dungeon noisesa shout.an angry hiss.a high-pitched scream!a roar!a hideous shriek!a piteous moan.a screech!a bellow!a loud, deep croak!an angry buzzing noise.an irritating high-pitched whine.a splashing noise.a sizzling sound.a loud clanging noise!a grinding noise.a mighty clap of thunder!a hideous screaming!a bark!a rumbling sound.a crunching sound.a distant "Zot"!the distant roaring of an enraged frog.# other noises, usually not found in the dungeona voice call your name.a very strange noise.someone snoring.the sound of rushing water.someone calling for help!strange voices.a knock.maniacal laughter.snatches of song.a twanging sound.the chiming of a distant gong.the tinkle of an enormous bell.an echo.the wailing of sirens.a flourish of trumpets!# end weapon noises%%%%############################################################# synonyms for weapon noises############################################################severalseveralthree or foura multitude of%%%%kind_of_scalespentatonicchromaticdiatonic%%%%not_swordsclubsaxespolearms%%%%points_outpoints outremarks in passing on%%%%dancebossanovawaltzmenuet%%%%an_aria_or_fuguean ariaa fugue%%%%nearly_or_clearlynearlyclearly%%%%hits_or_misseshitsmisses%%%%tune_or_melodytunemelody%%%%unpleasant_or_suddenan unpleasanta sudden%%%%demise_or_deathdemisedeath%%%%questionablequestionabledoubtful%%%%double_or_tripledoubletriple%%%%
############################################################# Outsourced monster speech.## insult.txt contains the messages imps and demons apply in# Crawl to insult players.## For an explanation of how to read insult.txt and how to# add new messages, see monster_speech.txt in the docs# directory############################################################%%%%imp_taunt@run_or_give_up@, thou @generic_insult@!%%%%run_or_give_upw:6@run_away@w:1@give_up@%%%%demon_tauntw:1@run_away@, thou @generic_insult@!w:2@give_up@, thou @generic_insult@!w:3@demon_taunt_special@%%%%demon_taunt_specialThy @body_or_spiritual_part@ shall be my @meal@!@give_up@, thou tasty @meal@!@run_away@ @whilst_thou_can@!I @will_or_shall@ @feast_or_devour@ thy @body_or_spiritual_part@!# Not currently used:#Thou @generic_insult@!%%%%body_or_spiritual_partw:3important_body_partw:1important_spiritual_part%%%%######################################################## generic insults consists of three random parts#######################################################generic_insult@insult_adjective1@ @insult_adjective2@ @insult_noun@%%%%important_body_partheadbrainheartvisceraeyeslungsliverthroatneckskullspine%%%%important_spiritual_partsoulspiritinner lighthopefaithwillheartmindsanityfortitudelife force%%%%mealmealbreakfastlunchdinnersupperrepastsnackvictualsrefectionjunketluncheonsnacklingcurdlesnackletmouthful%%%%# capitalized "flee" verbsrun_awayAway with theeBack with theeBegoneBoltCrawl homeDecampEscapeFleeFlyGet thee goneGet thee henceGive upGo and return notLeaveQuitRemove thy stenchReturn whence thou cameRun awayScamper awayScamper henceScamper homeSlither awaySlither henceSlither homeTake thy face henceTurn tail%%%%# capitalized synonyms for "give up"give_upAbandon hopeAccept thy failureAccept thy fallAccept thy doomAdmit defeatBeg for mercyCapitulateDespairDespondDisclaim thyselfEmbrace submissionEmbrace thy deditionEmbrace thy doomEmbrace thy failureEmbrace thy fallFace thy fugueFace thy requiemFlounderGive inGive upKneelQuailQuitSurrenderSuccumbSubmitTrembleRelinquish hopeTaste defeat%%%%whilst_thou_canwhilst thou canwhilst thou maywhilst thou are ableif wit thou hastwhilst thy luck holdsbefore doom catcheth theelest death find theewhilst thou art whole# screen vs. this for undead?whilst life thou hast%%%%################################################################ adjective1, usually short and/or consisting of one word only###############################################################insult_adjective1w:5@species_insult_adj1@@insult general adj1@%%%%insult general adj1artlessbaffledbawdybeslubberingbootlessbumblingcantingchurlishcockeredcloutedcravencurrishdankishdissemblingdroningduckingerrantfawningfecklessfeeblefobbingfoppishfrowardfrothyfulsomegleekinggoatishgorbelliedgrime-gilthorridhatefulimpertinentinfectiousjarringloggerheadedlumpishmammeringmangledmewlingodiouspaunchypribblingpukingpunyquallingquakingrankpanderingpecksniffianplume-pluckedpottle-deeppox-markedreeling-riperough-hewnsimperingspongysurlytotteringtwistedunctiousunhingedunmuzzledvainvenomedvillainouswarpedwaywardweedyworthlessyeasty%%%%########################################################### adjective1, Elf special##########################################################insult elf adj1weaklysicklyfraildelicatefragilebrittletendermooningpaintedlily-hearteddandyfeatherweightflimsyrootlessspindlypunyshakyprissy%%%%################################################################ adjective2, usually longer and consisting of two words###############################################################insult_adjective2w:5@species_insult_adj2@@insult general adj2@%%%%insult general adj2base-courtbat-fowlingbeef-wittedbeetle-headedboil-brainedclapper-clawedclay-brainedcommon-kissingcrook-pateddismal-dreamingditch-delivereddizzy-eyeddoghearteddread-boltedearth-vexingelf-skinnedfat-kidneyedfen-suckedflap-mouthedfly-bittenfolly-fallenfool-bornfull-gorgedguts-gripinghalf-facedhasty-wittedhedge-bornhell-hatedidle-headedill-breedingill-nurturedkobold-kissingknotty-patedlimp-willedmilk-liveredmiscreantmoon-mazedmotley-mindedmoldwarpmumble-newsnose-pickingnut-hookonion-eyedpigeon-eggroguishrude-growingrump-fedruttishsaucyshard-bornesheep-bitingsow-suckledspleenyspur-galledswag-belliedtardy-gaitedtickle-brainedtoad-spottedtoenail-bitingunchin-snoutedweather-bittenweevil-witted%%%%########################################################### adjective2, Dwarf special##########################################################insult dwarf adj2dirt-grubbinggrit-suckingmuck-ploddingstone-brokepelf-dandlingfault-botchinggravel-grovelingboodle-botheringcabbage-coddlingrhino-ravelingthigh-bitingdirt-delving%%%%########################################################### adjective2, Kenku special##########################################################insult kenku adj2hollow-bonedfeather-brainedbeak-wittedhen-peckedlightweightfrail-limbedbird-brainedfeatherweightpigeon-toedcrow-beakedmagpie-eyedmallardish%%%%################################################ noun of the insult###############################################insult_nounw:5@species_insult_noun@@insult general noun@%%%%insult general nounapple-johnbaggagebandersnitchbarnaclebeggarbladderboar-pigbounderbugbearbum-baileycanker-blossomclack-dishclamclotpolecoxcombcodpiecedeath-tokendewberrydingleberryflap-batflax-wenchflirt-gillfoot-lickerfustilariangigletgnoll-tailgudgeonguttersnipehaggardharpyhedge-pighugger-muggerjoitheadlewdsterloutmaggot-piemalt-wormmammetmeaslemendicantminnow reekymulenightsoilnobodynothingpigeon-eggpignutpimplepustuleputtockpumpionratsbanescavengerscutserfsimpletonskainsmateslime moldsnafflersnake-moltstrumpetsurfacertinkerertiddlerurchinvarletvassalvulturewastrelwagtailwhey-facewormtrailyak-droppingzombie-fodder%%%%########################################################### noun, small species special##########################################################small_foodsnacklingcrunchlethalf-mealsupper-settingsnackletnoshletmorselmug-upbite-baitcrunch-chowsnack-papgrubmouthfulhalf-pint%%%%########################################################### noun, Halfling special##########################################################insult halfling nounw:100@small_food@footstoolmunchkinside-stoolpudgeletgroundlingburrow-snipehole-bolterlow-rollerruntpeeweemimicusmanikinhop-o-thumbknee-biterburrow-botchhole-pimplehovel-pustule%%%%########################################################### noun, Spriggan special##########################################################insult spriggan nounw:100@small_food@rat-riderquarter-pintnissettefizzle-flopspell-botchfeebletweaklingpinchbeck-pixieankle-biterbootstainnano-nebbishsoplingshrunken violetsissy-prigpussyfootcreepsneak%%%%########################################################### noun, Minotaur special##########################################################insult minotaur nounbovinebriscutbull-braincud-chewercalf-witcretincowcattlehorn-beastmeatloafmeatballmooerrump-roastvealwalking sirloin%%%%
As of Dungeon Crawl Stone Soup 0.3 the previously hard-codedmonster speech has been outsourced by Matthew Cline intoshout.txt and speak.txt. This makes changing existingmessages, or adding new ones really easy. This file willhopefully help you in this endeavour.
Overview========As of Dungeon Crawl Stone Soup 0.3 the previously hard-coded monsterspeech has been outsourced by Matthew Cline into shout.txt andspeak.txt. This makes changing existing messages, or adding new onesreally easy. This file will hopefully help you in this endeavour.
speak.txt handles messages for monsters communicating, andalso the messages for weapon noises.
speak.txt handles messages for monsters communicating.insult.txt handles insults thrown at you by imps and demons.noise.txt handles messages randart weapons with the noisy property.A simple example================If you take a look through the two files, you'll see that all entrieshave basically the same structure: a key, followed by one or morevalues. Here is an example.%%%%# Friendly imps are very common so they speak very rarelyfriendly '5'w:1@The_monster@ laughs.w:1@_friendly_imp_@__NONE%%%%Let's look at this entry's components in more detail.%%%%Four percentage signs mark beginning and end of a database entry. Ifyou forget to place these, you will get buggy monster speech.# Friendly imps are very common so they speak very rarelyA '#' sign at the beginning of a line causes it to be ignored; theseare comment lines.
If you take a look through the two files, you'll see thatall entries have basically the same structure. Let's have alook at an example:
friendly '5'The first non-comment, non-blank line is interpreted as the key of anentry. Most keys are hardcoded but there's place for user defined onesas well. In this case, the key is "friendly '5'".'5' refers to the monster glyph, so the speech will not be entirelyrestricted to imps, though they are by far the most common type ofminor demons.
w:9__NONE
The rest of the entry consists of messages, separated by blanklines. This is one of them. Each may be prefixed with an optionalweight ('w:1'). A message will be chosen with a probability of itsweight out of the sum of weights for its entry. Weight defaults to 10if not specified. In this example, this particular message will beselected 1 time out of 12.
%%%%
This is the message that will be printed. The '@' markers indicatevariables that will be substituted before printing. This particularvariable "@The_monster@" is treated specially by the game; thesubstitution will change based on the monster giving the speech. Seebelow for more details.
friendly '5'The first non-comment, non-clear line is interpreted asthe key of an entry. Most keys are hardcoded but there'splace for user defined ones as well. In this case, the keyis "friendly '5'".
Key lookup is always case-insensitive. The game looks up severaldifferent keys when finding monster speech.
'5' refers to the monster glyph, so the speech will not beentirely restricted to imps, though they are by far themost common type of minor demons.On the whole there are three ways the game tries to lookfor keys in the database. First the actual monster name isused, then the monster glyph (with prefix "cap-" forcapital letters), then a group description (such as insector humanoid) defined by the monster's body shape (winged,tailed etc). The latter is entirely hardcoded, though.
1. The actual monster name.Examples: "crystal golem", "default confused moth of wrath"2. Then the monster glyph, with prefix "cap-" for capital letters.Examples: "default 'cap-J'", "default confused 'k'"3. A group description (such as 'insect' or 'humanoid') defined by themonster's body shape (winged, tailed etc). The latter is entirelyhardcoded, though.Examples: "default winged insect"
"friendly" is one of a couple of allowed prefixes,distinguishing the speech from "hostile" (default).
"friendly" is one of a couple of allowed prefixes, distinguishing thespeech from "hostile" (default). These prefixes are optional andtested in the following order:
First the database is searched for the whole prefixstring, then, reading from left to right, combinations aretested, beginning at three prefixes and ending at none, atwhich time the prefix "default" is used instead.
First the database is searched for the whole prefix string, then,reading from left to right, combinations are tested, beginning atthree prefixes and ending at none, at which time the prefix "default"is used instead.
For the last round (shape comparison, e.g. wingedhumanoid) occasionally an additional intelligence estimate("stupid", "smart") is prefixed to the search string. Ifin this last round still nothing has been found, themonster stays silent.
For the last round (shape comparison, e.g. winged humanoid)occasionally an additional intelligence estimate ("stupid", "smart")is prefixed to the search string.
For obvious reasons, weapon noises get by without any suchprefixes, and the only hardcoded keywords are"noisy weapon" for weapons with the noises property, and"singing sword" for (who'd have guessed?) the SingingSword.
If no matching keys are found after all 3 rounds, the monster stays silent.
w:9After a clear line the actual talk begins. You can skewthe probability of a given message with the weight ('w')tag. A message will be chosen with a probability of itsweight (defaults to 10 if none set) out of the sum ofweights for this entry. In this case, nine times out often a friendly imp will stay silent.
For obvious reasons, weapon noises get by without any such prefixes,and the only hardcoded keywords are "noisy weapon" for weapons withthe noises property, and "singing sword" for (who'd have guessed?) theSinging Sword.
__NONE : no message__NEXT : try the next combination of attributes__MORE : enforce a "--more--" prompt__YOU_RESIST : "You resist."__NOTHING_HAPPENS : "Nothing appears to happen."
Spacing-------
In addition, some more are defined in speak.txt andshout.txt, such as __RESIST_OR_NOTHING, __SHOUT, andothers. For the shouting messages, Crawl looks up thenoises a given monster can produce and looks for keysthat match the string, i.e. __SHOUT, __BARK and so on.
There have to be blank lines between the different messages. Ifmessages are placed directly one after another they will be printed asa block. This can be useful, e.g. for outputting first a "spell" andthen its (fake) result.
@_friendly_imp_@More variables can be defined in the form of @variable@.The "@_friendly_imp_@" above is a reference to anotherentry in the database that has the key "_friendly_imp_"(without those '@' signs) that actually has imps talking.Their speech includes messages such as the following.
The message entries themselves can be longer than a line, though Crawlwill simply truncate it should it exceed the screen width (assuming 80columns or less). The actual message length will usually differ fromthe one defining an entry as parameters can be stripped from the entryor replaced by other values, as explained in the following section.
VISUAL:@The_monster@ grins impishly at you.
Values can contain variable references, which look like textsurrounded by @@. These variables may be defined by entries inshout/speak.txt, in which case they are replaced with a random valuefrom the entry; or they may have hardcoded expansions defined by thegame.
Again, there have to be clear lines between the differentmessages. If messages are placed directly one after anotherthey will be printed as a block. This can be useful, e.g.for outputting first a "spell" and then it's (fake) result.
@monster@ : Plain monster name, e.g. "rat" or "Sigmund"@a_monster@ : Indefinite article plus monster name,or only the name if it is unique ("Sigmund").@the_monster@ : Definite article plus monster name ("the rat"),or a possessive if it is friendly ("your rat"),or only the name if it is unique ("Sigmund").@something@ : Like @monster@, with monster name replaced by "something"if the monster is invisible and the player cannot see invis.@a_something@ : similar@the_something@ : similar@player_name@ : Player name.@surface@ : Whatever the monster is standing on.@feature@ : The monster's square's feature description.@pronoun@ : it, she, he, as appropriate@possessive@ : its, her, his, as appropriate@imp_taunt@ : imp type insults (see insult.txt)@demon_taunt@ : demon type insults (see insult.txt)@says@ : synonym of 'say' that fits monster's (hardcoded)speech pattern and noise level.
The message entries themselves can be longer than a line,though Crawl will simply truncate it should it exceed thescreen width (assuming 80 columns or less). The actualmessage length will usually differ from the one defining anentry as parameters can be stripped from the entry orreplaced by other values, as explained in the followingsection.
Weapon noises are handled differently in that all of the abovereplacements don't hold. Instead you can use @The_weapon@,@the_weapon@, @Your_weapon@, @your_weapon@ and @weapon@ which will getreplaced by "The (weapon name)", "the (weapon name)", "Your (weaponname)", "your (weapon name)" and the plain weapon name,respectively. Note that the Singing Sword, being unique, cannot bereferred to by the possessive variants, so they will be replaced withone of the definite article ones.
Monster speech can be greatly customized by the use ofseveral variables. This example already includes a few.
Pre-defined variables in the database include _high_priest_,_mercenary_guard_, _wizard_, _hostile_adventurer_, _friendly_imp_,_hostile_imp_, and _tormentor_. There are also a few synonyms definedat the beginning of speak.txt such as for @ATTACK@, @pointless@,@shouts@, @wails@, and others.
The channels have been assigned different colours and aresometimes treated differently, e.g. any of MSGCH_TALK,MSGCH_SOUND and MSGCH_TALK_VISUAL will never interruptresting or travel unless specifically added in the optionsfile.
The channels have been assigned different colours and are sometimestreated differently, e.g. any of MSGCH_TALK, MSGCH_SOUND andMSGCH_TALK_VISUAL will never interrupt resting or travel unlessspecifically added in the options file.
Note that MSGCH_SOUND and MSGCH_TALK get filtered outwhen you are silenced. For similar reasons monster speechof channel SPELL is muted under silence, along withENCHANT and WARN, both of which currently only occur incombination with SPELL. To allow for silent spells alongwith fake warnings and enchantments, you can combine thesewith VISUAL and enforce output even when silenced.
Note that MSGCH_SOUND and MSGCH_TALK get filtered out when you aresilenced. For similar reasons monster speech of channel SPELL is mutedunder silence, along with ENCHANT and WARN, both of which currentlyonly occur in combination with SPELL. To allow for silent spells alongwith fake warnings and enchantments, you can combine these with VISUALand enforce output even when silenced.
Note, though, that these rarely will take effect asusually the "silenced humanoid" types will takeprecedence. In the case of silenced monsters, first thedatabase is searched for the monster key along withseveral prefixes including "silenced", and only if nomessage can be found through all iterations of monstername, glyph and group description, the search will repeatignoring the "silenced" prefix and only then these specialVISUAL cases can apply.
Note, though, that these rarely will take effect as usually the"silenced humanoid" types will take precedence. In the case ofsilenced monsters, first the database is searched for the monster keyalong with several prefixes including "silenced", and only if nomessage can be found through all iterations of monster name, glyph andgroup description, the search will repeat ignoring the "silenced"prefix and only then these special VISUAL cases can apply.
For shouts the default is also MSGCH_TALK which isautomatically changed to MSGCH_TALK_VISUAL for monstersthat can't speak (animals, usually), and manually set toMSGCH_SOUND for all those variants of "You hear a shout!"
For shouts the default is also MSGCH_TALK which is automaticallychanged to MSGCH_TALK_VISUAL for monsters that can't speak (animals,usually), and manually set to MSGCH_SOUND for all those variants of"You hear a shout!"
For weapon noises only a subset of the above is relevant,as anything including VISUAL and the channel keys SPELLand ENCHANT are considered invalid and will trigger adefault message instead. Again, the default channel isMSGCH_TALK.
For weapon noises only a subset of the above is relevant, as anythingincluding VISUAL and the channel keys SPELL and ENCHANT are consideredinvalid and will trigger a default message instead. Again, the defaultchannel is MSGCH_TALK.
@The_monster@, @surface@Like with @_friendly_imp_@ above, a number of variableshas been defined to allow for greater flexibility.Whenever the speech code encounters an '@' sign it willsearch the database for a variable of that name andexecute the necessary replacement. Note that recursivereplacement of one variable with another is possible, sotry to avoid loops. The remaining variables it was unableto find in the database are hardcoded and will be replacedbefore output.If you add a new variable make sure to also add a databaseentry for it (without those '@' marks around!); otherwiseit won't get replaced and just look weird.
Special commands and variables------------------------------
A variable that you will see all over the place is@The_monster@, which is hardcoded and will be replaced bythe monster's name. This is particularly useful for groupsof monsters that share the same speech pattern. Anothervariable you can see in this example is @surface@, whichwill be replaced by whatever the monster is standing on.
Messages may also be one of these special commands. These aren'tvariables, so they aren't surrounded by @@. They are not expanded, butrather they produce special game behavior.
@monster@ : replaced by plain monster name,e.g. "rat" or "Sigmund"@Monster@ : as above, but capitalized@the_monster@ : replaced by definite article plusmonster name, or only the name if it isunique, e.g. "the rat" or "Sigmund"@The_monster@ : as above, but capitalized@a_monster@ : replaced by indefinite article plusmonster name, if more than one can exist,e.g. "a rat" or (again) "Sigmund"@A_monster@ : as above, but capitalized
Some special keys are defined in speak.txt and shout.txt, such as__RESIST_OR_NOTHING and __SHOUT. These are normal variable expansions,and may be used as such. They are given special-looking names becauseCrawl looks up the noises a given monster can produce and looks forkeys that match the string, i.e. __SHOUT, __BARK and so on.
As an alternative there's also @the_something@,@The_something@, @a_something@, @A_something@, @something@and @Something@, all of which behave like the correspondingmonster definitions above but get replaced by "something"and "Something", respectively, should the monster beinvisible and the player be unable to see invisible.But wait, there's more!@player_name@ : replaced by player name@surface@ : replaced by whatever the monster stands on@feature@ : replaced by the monster's square's featuredescription@pronoun@ : replaced by it, she, he, as appropriate@Pronoun@ : replaced by It, She, He, as appropriate@possessive@ : replaced by its, her, his, as appropriate@Possessive@ : replaced by Its, Her, His, as appropriate@imp_taunt@ : replaced by hardcoded imp type insults@demon_taunt@ : replaced by hardcoded demon type insultsAlso, @says@ will get replaced with a synonym of 'say' thatfits a monster's (hardcoded) speech pattern and noise level.Weapon noises are handled differently in that all of theabove replacements don't hold. Instead you can use@The_weapon@, @the_weapon@, @Your_weapon@, @your_weapon@ and@weapon@ which will get replaced by "The (weapon name)","the (weapon name)", "Your (weapon name)", "your (weaponname)" and the plain weapon name, respectively. Note thatthe Singing Sword, being unique, cannot be referred to bythe possessive variants, so they will be replaced with oneof the definite article ones.
Testing your changes====================
Pre-defined variables in the database include _high_priest_,_mercenary_guard_, _wizard_, _hostile_adventurer_,_friendly_imp_, _hostile_imp_, and _tormentor_. There arealso a few synonyms defined at the beginning of speak.txtsuch as for @ATTACK@, @pointless@, @shouts@, @wails@, andothers.Weapon noises also use a number of synonyms which aredefined at the end of speak.txt.The best way to learn about how variables and other conceptscan be used is probably to see how it has been done forexisting messages.TESTING YOUR CHANGESShould you have a version of Stone Soup that has beencompiled with the WIZARD mode defined, this could greatlysimplify testing. You can check whether this is the case bypressing '&' during the game. If you are told that this isan "unknown command" you are out of luck and might considercompiling the game for yourself. You can download the sourcecode from the Crawl homepage [1].Read the "INSTALL" file in the main directory forinstructions. Should you, after reading the documentationand checking the archives of the Crawl newsgroup [2], stillhave any questions, ask away!
Get a version of Stone Soup that contains WIZARD mode. You can checkwhether this is the case by pressing '&' during the game. If you aretold that this is an "unknown command" (likely, since WIZARD buildsare generally not distributed), you will have to compile the game foryourself.
If you have WIZARD mode compiled in, you can simply answer"yes" to the safety question resulting from pressing '&',and then test to your heart's content. Pressing '&' followedby a number of other keys will execute wizard mode commandsthat are all listed in the wizard help menu (press '&?').
To build Crawl yourself, download the source code from the Crawlhomepage [1] and read the "INSTALL" file in the main directory forinstructions. Should you still have any questions after reading thedocumentation and checking the archives of the Crawl newsgroup [2],ask away!
In particular, you can create a monster with '&M', andenforce behaviour on a monster by examining it (with 'x',as usual). In wizard mode this offers several new commandssuch as 'F' (make monster friendly/unfriendly) and 's'(make monster shout). These last two are of particularinterest to monster speech designers.
If you have WIZARD mode compiled in, you can simply answer "yes" tothe safety question resulting from pressing '&', and then test to yourheart's content. Pressing '&' followed by a number of other keys willexecute wizard mode commands that are all listed in the wizard helpmenu (press '&?').
The Singing Sword and all other hardcoded artefacts can becreated with '&|'. The Elemental Staff and the spear ofVoo-Doo are examples of noisy weapons.
In particular, you can create a monster with '&M', and enforcebehaviour on a monster by examining it (with 'x', as usual). In wizardmode, examining monsters offers several new sub-commands such as 'F'(make monster friendly/unfriendly) and 's' (make monster shout). Theselast two are of particular interest to monster speech designers.
You can also temporarily increase the likelihood of a givenmessage by adding a high weight value before it, e.g. w:500,or equally temporarily push it into another channel (e.g.MSGCH_WARN) to make it more noticeable.
The Singing Sword and all other hardcoded artefacts can be createdwith '&|'. The Elemental Staff and the spear of Voo-Doo are examplesof noisy weapons.
PUBLISHING YOUR ADDITIONS AND CHANGESIf you feel that your additions really add something to thegame and would like to make them available to the generalpublic, you can post them (in the form of a diff file, or inplain text) in the newsgroup [2] or as a feature request onsourceforge.net [1].
[1] http://crawl-ref.sourceforge.nethttp://sourceforge.net/projects/crawl-ref
If you feel that your additions add something to the game and wouldlike to make them available to the general public, you can post them(in the form of a diff file, or in plain text) as a feature request onsourceforge.net [1]_ or in the newsgroup [2]_.
[2] rec.games.roguelike.miscSince this newsgroup is being shared with a number of otherroguelike games, it is generally considered polite to flagsubjects of posts pertaining only to Crawl with "-crawl-" ora similar marker.
.. [1] http://crawl-ref.sourceforge.nethttp://sourceforge.net/projects/crawl-ref
.. [2] rec.games.roguelike.miscSince this newsgroup is being shared with a number of otherroguelike games, it is generally considered polite to flagsubjects of posts pertaining only to Crawl with "-crawl-" ora similar marker.