diff options
author | pubby <pubby8@gmail.com> | 2013-12-19 08:24:33 -0600 |
---|---|---|
committer | Shmuale Mark <shm.mark@gmail.com> | 2014-04-01 00:03:57 -0400 |
commit | f7238693c8188212c5b5b3ae9c14f05f5d075764 (patch) | |
tree | a7a085585c4bfe94a138079c49059cc85e81f661 /crawl-ref/source/lang-fake.cc | |
parent | a435e27d378553b5914e87600e9db5963337c1b8 (diff) | |
download | crawl-ref-f7238693c8188212c5b5b3ae9c14f05f5d075764.tar.gz crawl-ref-f7238693c8188212c5b5b3ae9c14f05f5d075764.zip |
Add a grunt fake language!!!
[Committer's note: You squash Grunt's and pubby's patches like
a feature!!!!!]
Diffstat (limited to 'crawl-ref/source/lang-fake.cc')
-rw-r--r-- | crawl-ref/source/lang-fake.cc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/crawl-ref/source/lang-fake.cc b/crawl-ref/source/lang-fake.cc index 42aaffa2b3..a1f566815d 100644 --- a/crawl-ref/source/lang-fake.cc +++ b/crawl-ref/source/lang-fake.cc @@ -234,6 +234,15 @@ static const char* runes[][4] = {0} }; +static const char* grunt[][4] = +{ + {"^killed$", "annihilated"}, + {"^kill$", "annihilate"}, + {"!", "..."}, + {".", "!", 0, LETTERS "0123456789"}, + {0} +}; + static void _replace_cap_variants(string &str, string a, string b, @@ -428,6 +437,39 @@ static void _wide(string &txt) txt = out; } +static void _grunt(string &txt) +{ + static const char* exact_grunt[][2] = + { + {"battlesphere", "BATTLESPHERE"}, + {"Battlesphere", "BATTLESPHERE"}, + {"battlemage", "BATTLEMAGE"}, + {"Battlemage", "BATTLEMAGE"}, + {"Battle Magician", "BATTLEMAGE"}, + {"battleaxe", "BATTLEAXE"}, + {"book of Battle", "BATTLEBOOK"}, + {"Battlelust", "BATTLELUST"}, + {"Kill them all", "RIP AND TEAR"}, + {"accepts your kill", "roars: ANNIHILATED"}, + {"appreciates your kill", "screams: ANNIHILATED"}, + {0} + }; + + const char* (*repl)[2] = exact_grunt; + for (; **repl; repl++) + { + size_t pos = 0; + string a = (*repl)[0]; + string b = (*repl)[1]; + while ((pos = txt.find(a, pos)) != string::npos) + { + txt.erase(pos, a.length()); + txt.insert(pos, b); + pos += b.length(); + } + } +} + void filter_lang(string &str) { const char* (*repl)[4]; @@ -451,6 +493,9 @@ void filter_lang(string &str) case LANG_FUTHARK: repl = runes; break; + case LANG_GRUNT: + _grunt(str); repl = grunt; + break; default: return; } |