/* A sub-unit of the central mud soul daemon
* This handles adverb maintenance and related functions
* created by Blitz@NM-IVD
*/
#include <save.h>
#define SaveFile "/daemon/soul/adverbs.o"
static mapping AdverbPool = ([
"a" : ({ "absently", "absentmindedly", "abso-bloody-lutely", "absolutely",
"adamently", "affectionately", "again", "agreeably", "always",
"aimlessly", "amusedly", "angelically", "angrily", "annoyingly",
"appreciatively", "astonishedly", "audibly", "automatically",
"awkwardly", }),
"b" : ({ "badly", "belatedly", "belligerently", "bemusedly", "benignly",
"bitterly", "blandly", "blankly", "bluntly", "boldly", "boredly",
"bravely", "briefly", "brightly", "briskly", "broadly", "brotherly",
"busily", }),
"c" : ({ "calmly", "carefully", "carelessly", "casually", "cautiously",
"chaoticly", "charmingly", "cheerfully", "childishly", "closely",
"clumsily", "coldly", "comically", "completely", "comprehensively",
"confidently", "confusedly", "consciensciously", "conspiratorially",
"contemptuously", "contentedly", "courageously", "cowardly", "crazily",
"critically", "cruelly", "cuddlingly", "crookedly", "cunningly",
"curiously", "cutely", "cynically", }),
"d" : ({ "dangerously", "darkly", "deadly", "decliningly", "deeply",
"defiantly", "definitely", "delightfully", "dementedly", "demonically",
"depressively", "derisively", "desperately", "devilishly", "devotedly",
"dirtily", "disappointedly", "disapprovingly", "disgustedly",
"disgustingly", "disrespectfully", "doggily", "dopily", "doubtfully",
"dramatically", "drastically", "dreamily", "dryly", "dumbly", }),
"e" : ({ "eagerly", "egocentrically", "egotistically", "embarrassedly",
"emphatically", "endearingly", "enthusiastically", "erotically",
"eternally", "evilly", "excellently", "excitedly", "exhaustedly",
"expectantly", "extraneously", }),
"f" : ({ "faintly", "faithfully", "famously", "fanatically", "farewell",
"fatherly","fearfully", "ferociously", "fervently", "fiendishly",
"fiercefully", "firmly", "fitfully", "flatly", "fondly", "foolishly",
"forcefully", "forever", "forgetfully", "forgivingly", "frankly",
"frenetically", "frequently", "friendly", "frustratedly", "funnily",
"furiously", }),
"g" : ({ "generously", "gently", "gleefully", "gloomily", "goodbye",
"goodnight", "goofily", "gracefully", "grandfatherly", "grandmotherly",
"gravely", "greedily", "grimly", }),
"h" : ({ "happily", "handsomely", "hard", "harmonically", "heartbrokenly",
"heartily", "heavenly", "heavily", "helpfully", "helplessly",
"heroically", "hesitantly", "honestly", "hopefully", "horribly",
"hotly", "humbly", "humourlessly", "hungrily", "hurriedly",
"hysterically", }),
"i" : ({ "idly", "ignorantly", "immediately", "impatiently", "impishly",
"in frustration", "inanely", "incredulously", "indecently",
"infamously", "innocently", "insanely", "instantly", "intelligently",
"intently", "interestedly", "into space", "introspectively",
"invitingly", "inwardly", "ironically", }),
"j" : ({ "jealously", "jeeringly", "jokingly", "jovially",
"joyfully", }),
"k" : ({ "knowingly", "kindly", "kinkily", }),
"l" : ({ "laconically", "lamely", "lazily", "lecherously", "levelly",
"lightly", "lively", "loftily", "longingly", "loudly",
"lovingly", "lustfully", }),
"m" : ({ "madly", "magically", "manfully", "maniacally", "manically",
"matter-of-factly", "meekly", "melancholically", "menacingly",
"mercifully", "mercilessly", "merrily", "mildly", "mirthfully",
"mischievously", "mockingly", "moodily", "morosely", "motherly",
"mournfully", "musically", "mysteriously", "mystically", }),
"n" : ({ "nastily", "naughtily", "negatively", "nervously", "nicely",
"nobly", "noddingly", "noggingly", "noisily", "normally",
"nostalgically", "noticeably", }),
"o" : ({ "obnoxiously", "oddly", "officially", "often",
"omniously", }),
"p" : ({ "painfully", "passionately", "pathetically", "patiently",
"patronizingly", "perfectly", "personally", "physically", "pirately",
"pitifully", "plainly", "playfully", "pleadingly", "pleasantly",
"pointedly", "politely", "ponderously", "poorly", "positively",
"probably", "professionally", "profoundly", "profusely", "prolly",
"protectively", "proudly", "provocatively", "purplishy", }),
"q" : ({ "quackingly", "questioningly", "quickly", "quietly",
"quizzically", }),
"r" : ({ "radiantly", "randomly", "rapidly", "rebelliously", "recklessly",
"recursively", "regretfully", "reluctantly", "remotely", "repeatedly",
"reproachfully", "resignedly", "reverently", "rigoriously",
"romantically", "roughly", "royally", "rudely", "ruthlessly", }),
"s" : ({ "sadistically", "sadly", "sagely", "saintly", "sarcastically",
"satanically", "sceptically", "scornfully", "searchingly", "secretively",
"seductively", "sensually", "seriously", "sexily", "shamefully",
"shamelessly", "sharply", "sheepishly", "shrewdly", "shrilly",
"shyly", "sickly", "silently", "simultaneously", "sisterly",
"skillfully", "sleepily", "slightly", "slowly", "slyly", "smilingly",
"smoothly", "smugly", "sniffingly", "softly", "solemnly", "soothingly",
"sorrowfully", "sort of", "sothingly", "sourly", "spontaneously",
"sternly", "strangely", "strictly", "stubbornly", "stupidly", "suavely",
"subtly", "suddenly", "sufferingly", "suggestively", "superciliously",
"supportingly", "surprisingly", "surreally", "suspiciously",
"sweetly", "swiftly", "sympathetically", }),
"t" : ({ "tearfully", "teasingly", "tenderly", "terribly", "testily",
"thankfully", "theatrically", "theoretically", "thoughtfully",
"tightly", "tiredly", "totally", "tragically", "triumphantly",
"trustfully", "tunelessly", }),
"u" : ({ "unbearably", "unconditionally", "uncontrollably", "understandingly",
"uneasily", "unexpectedly", "unhappily", "unlikely", "urgently",
"utterly", }),
"v" : ({ "vaguely", "viciously", "victoriously", "vigorously",
"violently", "virtually", "voluptuously", }),
"w" : ({ "warmly", "weakly", "wearily", "whimsically", "wholeheartedly",
"wickedly", "wildly", "wisely", "wishfully", "wistfully", "wizardly",
"wobbly", "wonderingly", "wryly", }),
"x" : ({ "xenophobly", }),
"y" : ({ "yearningly", "yellowishly", }),
"z" : ({ "zanily", "zen-likely", }),
]);
private void SaveAdverbs() {
if( !archp(this_player()) ) return;
unguarded( (: write_file, SaveFile, save_variable(AdverbPool), 1 :) );
}
private void RestoreAdverbs() {
string tmp;
if( !file_exists(SaveFile) ) return;
tmp = read_file(SaveFile);
if( !sizeof(tmp) ) return;
AdverbPool = restore_variable(tmp);
}
static void create() {
RestoreAdverbs();
}
string *GetAdverbs(string group) {
string tmp;
if( !sizeof(group) ) return ({});
tmp = sprintf("%c", group[0]);
return (AdverbPool[tmp] || ({}));
}
mapping GetAdverbPool() { return copy(AdverbPool); }
int AddAdverb(string adverb) {
string tmp;
if( !sizeof(adverb) ) return 0;
if( !archp(this_player()) ) return 0;
tmp = sprintf("%c", adverb[0]);
if( !AdverbPool[tmp] ) AdverbPool[tmp] = ({ });
if( member_array(adverb, AdverbPool[tmp]) > -1 ) return 0;
AdverbPool[tmp] += ({ adverb });
SaveAdverbs();
return 1;
}
int RemoveAdverb(string adverb) {
string tmp;
if( !sizeof(adverb) ) return 0;
if( !archp(this_player()) ) return 0;
tmp = sprintf("%c", adverb[0]);
if( !AdverbPool[tmp] ) return 0;
AdverbPool[tmp] -= ({ adverb });
SaveAdverbs();
return 1;
}
varargs string GetRandomAdverb(string group) {
string tmp, *key;
int i;
if( !sizeof(group) ) {
i = sizeof(key = keys(AdverbPool));
tmp = key[random(i)];
} else tmp = group;
if( !i = sizeof(AdverbPool[tmp]) ) return 0;
return (AdverbPool[tmp][random(i)]);
}