Update of /cvsroot/crossfire/crossfire/server
In directory usw-pr-cvs1:/tmp/cvs-serv833/server
Modified Files:
c_chat.c c_misc.c c_new.c commands.c
Log Message:
Add a new command category called communications commands. Place tell,
shout and say in here. Also create emotion functions. These functions
have no real effect on the game, but make communications between players
more colorful and fun. They are mostly fluff. Included with this patch
are two new convenience functions, new_info_map_except, and
new_info_map_except2, which allow the programmer to write to an entire
map, except for certain individuals.
Tested by myself, mids, and gros, with thanks to them for fixing
something I didn't catch.
garbled 2001-09-27
Index: c_chat.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/server/c_chat.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** c_chat.c 2000/12/18 07:38:25 1.3
--- c_chat.c 2001/09/27 19:37:39 1.4
***************
*** 102,103 ****
--- 102,919 ----
}
+
+ /*
+ * This function covers basic emotions a player can have. An emotion can be
+ * one of three things currently. Directed at oneself, directed at someone,
+ * or directed at nobody. The first set is nobody, the second at someone, and
+ * the third is directed at oneself. Every emotion does not have to be
+ * filled out in every category. The default case will take care of the ones
+ * that are not. Helper functions will call basic_emote with the proper
+ * arguments, translating them into commands. Adding a new emotion can be
+ * done by editing command.c and command.h.
+ * [garbled 09-25-2001]
+ */
+
+ static int basic_emote(object *op, char *params, int emotion)
+ {
+ char buf[MAX_BUF], buf2[MAX_BUF], buf3[MAX_BUF];
+ player *pl;
+
+ if (!params) {
+ switch(emotion) {
+ case EMOTE_NOD:
+ sprintf(buf, "%s nods solemnly.", op->name);
+ sprintf(buf2, "You nod solemnly.");
+ break;
+ case EMOTE_DANCE:
+ sprintf(buf, "%s expresses himself through interpretive dance.",
+ op->name);
+ sprintf(buf2, "You dance with glee.");
+ break;
+ case EMOTE_KISS:
+ sprintf(buf, "%s makes a weird facial contortion", op->name);
+ sprintf(buf2, "All the lonely people..");
+ break;
+ case EMOTE_BOUNCE:
+ sprintf(buf, "%s bounces around.", op->name);
+ sprintf(buf2, "BOIINNNNNNGG!");
+ break;
+ case EMOTE_SMILE:
+ sprintf(buf, "%s smiles happily.", op->name);
+ sprintf(buf2, "You smile happily.");
+ break;
+ case EMOTE_CACKLE:
+ sprintf(buf, "%s throws back his head and cackles with insane "
+ "glee!", op->name);
+ sprintf(buf2, "You cackle gleefully.");
+ break;
+ case EMOTE_LAUGH:
+ sprintf(buf, "%s falls down laughing.", op->name);
+ sprintf(buf2, "You fall down laughing.");
+ break;
+ case EMOTE_GIGGLE:
+ sprintf(buf, "%s giggles.", op->name);
+ sprintf(buf2, "You giggle.");
+ break;
+ case EMOTE_SHAKE:
+ sprintf(buf, "%s shakes his head.", op->name);
+ sprintf(buf2, "You shake your head.");
+ break;
+ case EMOTE_PUKE:
+ sprintf(buf, "%s pukes.", op->name);
+ sprintf(buf2, "Bleaaaaaghhhhhhh!");
+ break;
+ case EMOTE_GROWL:
+ sprintf(buf, "%s growls.", op->name);
+ sprintf(buf2, "Grrrrrrrrr....");
+ break;
+ case EMOTE_SCREAM:
+ sprintf(buf, "%s screams at the top of his lungs!", op->name);
+ sprintf(buf2, "ARRRRRRRRRRGH!!!!!");
+ break;
+ case EMOTE_SIGH:
+ sprintf(buf, "%s sighs loudly.", op->name);
+ sprintf(buf2, "You sigh.");
+ break;
+ case EMOTE_SULK:
+ sprintf(buf, "%s sulks in the corner.", op->name);
+ sprintf(buf2, "You sulk.");
+ break;
+ case EMOTE_CRY:
+ sprintf(buf, "%s bursts into tears.", op->name);
+ sprintf(buf2, "Waaaaaaahhh..");
+ break;
+ case EMOTE_GRIN:
+ sprintf(buf, "%s grins evilly.", op->name);
+ sprintf(buf2, "You grin evilly.");
+ break;
+ case EMOTE_BOW:
+ sprintf(buf, "%s bows deeply.", op->name);
+ sprintf(buf2, "You bow deeply.");
+ break;
+ case EMOTE_CLAP:
+ sprintf(buf, "%s gives a round of applause.", op->name);
+ sprintf(buf2, "Clap, clap, clap.");
+ break;
+ case EMOTE_BLUSH:
+ sprintf(buf, "%s blushes.", op->name);
+ sprintf(buf2, "Your cheeks are burning.");
+ break;
+ case EMOTE_BURP:
+ sprintf(buf, "%s burps loudly.", op->name);
+ sprintf(buf2, "You burp loudly.");
+ break;
+ case EMOTE_CHUCKLE:
+ sprintf(buf, "%s chuckles politely.", op->name);
+ sprintf(buf2, "You chuckle politely");
+ break;
+ case EMOTE_COUGH:
+ sprintf(buf, "%s coughs loudly.", op->name);
+ sprintf(buf2, "Yuck, try to cover your mouth next time!");
+ break;
+ case EMOTE_FLIP:
+ sprintf(buf, "%s flips head over heels.", op->name);
+ sprintf(buf2, "You flip head over heels.");
+ break;
+ case EMOTE_FROWN:
+ sprintf(buf, "%s frowns.", op->name);
+ sprintf(buf2, "What's bothering you?");
+ break;
+ case EMOTE_GASP:
+ sprintf(buf, "%s gasps in astonishment.", op->name);
+ sprintf(buf2, "You gasp in astonishment.");
+ break;
+ case EMOTE_GLARE:
+ sprintf(buf, "%s glares around him.", op->name);
+ sprintf(buf2, "You glare at nothing in particular.");
+ break;
+ case EMOTE_GROAN:
+ sprintf(buf, "%s groans loudly.", op->name);
+ sprintf(buf2, "You groan loudly.");
+ break;
+ case EMOTE_HICCUP:
+ sprintf(buf, "%s hiccups.", op->name);
+ sprintf(buf2, "*HIC*");
+ break;
+ case EMOTE_LICK:
+ sprintf(buf, "%s licks his mouth and smiles.", op->name);
+ sprintf(buf2, "You lick your mouth and smile.");
+ break;
+ case EMOTE_POUT:
+ sprintf(buf, "%s pouts.", op->name);
+ sprintf(buf2, "Aww, don't take it so hard.");
+ break;
+ case EMOTE_SHIVER:
+ sprintf(buf, "%s shivers uncomfortably.", op->name);
+ sprintf(buf2, "Brrrrrrrrr.");
+ break;
+ case EMOTE_SHRUG:
+ sprintf(buf, "%s shrugs helplessly.", op->name);
+ sprintf(buf2, "You shrug.");
+ break;
+ case EMOTE_SMIRK:
+ sprintf(buf, "%s smirks.", op->name);
+ sprintf(buf2, "You smirk.");
+ break;
+ case EMOTE_SNAP:
+ sprintf(buf, "%s snaps his fingers.", op->name);
+ sprintf(buf2, "PRONTO! You snap your fingers.");
+ break;
+ case EMOTE_SNEEZE:
+ sprintf(buf, "%s sneezes.", op->name);
+ sprintf(buf2, "Gesundheit!");
+ break;
+ case EMOTE_SNICKER:
+ sprintf(buf, "%s snickers softly.", op->name);
+ sprintf(buf2, "You snicker softly.");
+ break;
+ case EMOTE_SNIFF:
+ sprintf(buf, "%s sniffs sadly.", op->name);
+ sprintf(buf2, "You sniff sadly. *SNIFF*");
+ break;
+ case EMOTE_SNORE:
+ sprintf(buf, "%s snores loudly.", op->name);
+ sprintf(buf2, "Zzzzzzzzzzzzzzz.");
+ break;
+ case EMOTE_SPIT:
+ sprintf(buf, "%s spits over his left shoulder.", op->name);
+ sprintf(buf2, "You spit over your left shoulder.");
+ break;
+ case EMOTE_STRUT:
+ sprintf(buf, "%s struts proudly.", op->name);
+ sprintf(buf2, "Strut your stuff.");
+ break;
+ case EMOTE_TWIDDLE:
+ sprintf(buf, "%s patiently twiddles his thumbs.", op->name);
+ sprintf(buf2, "You patiently twiddle your thumbs.");
+ break;
+ case EMOTE_WAVE:
+ sprintf(buf, "%s waves happily.", op->name);
+ sprintf(buf2, "You wave.");
+ break;
+ case EMOTE_WHISTLE:
+ sprintf(buf, "%s whistles appreciatively.", op->name);
+ sprintf(buf2, "You whistle appreciatively.");
+ break;
+ case EMOTE_WINK:
+ sprintf(buf, "%s winks suggestively.", op->name);
+ sprintf(buf2, "Have you got something in your eye?");
+ break;
+ case EMOTE_YAWN:
+ sprintf(buf, "%s yawns sleepily.", op->name);
+ sprintf(buf2, "You open up your yap and let out a big breeze "
+ "of stale air.");
+ break;
+ case EMOTE_CRINGE:
+ sprintf(buf, "%s cringes in terror!", op->name);
+ sprintf(buf2, "You cringe in terror.");
+ break;
+ case EMOTE_BLEED:
+ sprintf(buf, "%s is bleeding all over the carpet"
+ " - got a spare tourniquet?", op->name);
+ sprintf(buf2, "You bleed all over your nice new armour.");
+ break;
+ case EMOTE_THINK:
+ sprintf(buf, "%s closes his eyes and thinks really hard.",
+ op->name);
+ sprintf(buf2, "Anything in particular that you'd care to think "
+ "about?");
+ break;
+ default:
+ sprintf(buf, "%s dances with glee.", op->name);
+ sprintf(buf2, "You are a nut.");
+ break;
+ } /*case*/
+ new_info_map_except(NDI_WHITE, op->map, op, buf);
+ new_draw_info(NDI_UNIQUE, 0, op, buf2);
+ return(0);
+ } else {
+ for(pl=first_player;pl!=NULL;pl=pl->next) {
+ if(strncasecmp(pl->ob->name, params, MAX_NAME)==0 &&
+ pl->ob->map == op->map && pl->ob != op) {
+ switch(emotion) {
+ case EMOTE_NOD:
+ sprintf(buf, "You nod solemnly to %s.", pl->ob->name);
+ sprintf(buf2, "%s nods solemnly to you.", op->name);
+ sprintf(buf3, "%s nods solemnly to %s.", op->name,
+ pl->ob->name);
+ break;
+ case EMOTE_DANCE:
+ sprintf(buf, "You grab %s and begin doing the Cha-Cha!",
+ pl->ob->name);
+ sprintf(buf2, "%s grabs you, and begins dancing!",
+ op->name);
+ sprintf(buf3, "Yipe! %s and %s are doing the Macarena!",
+ op->name, pl->ob->name);
+ break;
+ case EMOTE_KISS:
+ sprintf(buf, "You kiss %s.", pl->ob->name);
+ sprintf(buf2, "%s kisses you.", op->name);
+ sprintf(buf3, "%s kisses %s.", op->name, pl->ob->name);
+ break;
+ case EMOTE_BOUNCE:
+ sprintf(buf, "You bounce around the room with %s.",
+ pl->ob->name);
+ sprintf(buf2, "%s bounces around the room with you.",
+ op->name);
+ sprintf(buf3, "%s bounces around the room with %s.",
+ op->name, pl->ob->name);
+ break;
+ case EMOTE_SMILE:
+ sprintf(buf, "You smile at %s.", pl->ob->name);
+ sprintf(buf2, "%s smiles at you.", op->name);
+ sprintf(buf3, "%s beams a smile at %s.", op->name,
+ pl->ob->name);
+ break;
+ case EMOTE_LAUGH:
+ sprintf(buf, "You take one look at %s and fall down "
+ "laughing.", pl->ob->name);
+ sprintf(buf2, "%s looks at you and falls down on the "
+ "ground laughing.", op->name);
+ sprintf(buf3, "%s looks at %s and falls down on the "
+ "ground laughing.", op->name, pl->ob->name);
+ break;
+ case EMOTE_SHAKE:
+ sprintf(buf, "You shake %s's hand.", pl->ob->name);
+ sprintf(buf2, "%s shakes your hand.", op->name);
+ sprintf(buf3, "%s shakes %s's hand.", op->name,
+ pl->ob->name);
+ break;
+ case EMOTE_PUKE:
+ sprintf(buf, "You puke on %s.", pl->ob->name);
+ sprintf(buf2, "%s pukes on your clothes!", op->name);
+ sprintf(buf3, "%s pukes on %s.", op->name, pl->ob->name);
+ break;
+ case EMOTE_HUG:
+ sprintf(buf, "You hug %s.", pl->ob->name);
+ sprintf(buf2, "%s hugs you.", op->name);
+ sprintf(buf3, "%s hugs %s.", op->name, pl->ob->name);
+ break;
+ case EMOTE_CRY:
+ sprintf(buf, "You cry on %s's shoulder.", pl->ob->name);
+ sprintf(buf2, "%s cries on your shoulder.", op->name);
+ sprintf(buf3, "%s cries on %s's shoulder.", op->name,
+ pl->ob->name);
+ break;
+ case EMOTE_POKE:
+ sprintf(buf, "You poke %s in the ribs.", pl->ob->name);
+ sprintf(buf2, "%s pokes you in the ribs.", op->name);
+ sprintf(buf3, "%s pokes %s in the ribs.", op->name,
+ pl->ob->name);
+ break;
+ case EMOTE_ACCUSE:
+ sprintf(buf, "You look accusingly at %s.", pl->ob->name);
+ sprintf(buf2, "%s looks accusingly at you.", op->name);
+ sprintf(buf3, "%s looks accusingly at %s.", op->name,
+ pl->ob->name);
+ break;
+ case EMOTE_GRIN:
+ sprintf(buf, "You grin at %s.", pl->ob->name);
+ sprintf(buf2, "%s grins evilly at you.", op->name);
+ sprintf(buf3, "%s grins evilly at %s.", op->name,
+ pl->ob->name);
+ break;
+ case EMOTE_BOW:
+ sprintf(buf, "You bow before %s.", pl->ob->name);
+ sprintf(buf2, "%s bows before you.", op->name);
+ sprintf(buf3, "%s bows before %s.", op->name,
+ pl->ob->name);
+ break;
+ case EMOTE_FROWN:
+ sprintf(buf, "You frown darkly at %s.", pl->ob->name);
+ sprintf(buf2, "%s frowns darkly at you.", op->name);
+ sprintf(buf3, "%s frowns darkly at %s.", op->name,
+ pl->ob->name);
+ break;
+ case EMOTE_GLARE:
+ sprintf(buf, "You glare icily at %s.", pl->ob->name);
+ sprintf(buf2, "%s glares icily at you, you feel cold to"
+ " your bones.", op->name);
+ sprintf(buf3, "%s glares at %s.", op->name, pl->ob->name);
+ break;
+ case EMOTE_LICK:
+ sprintf(buf, "You lick %s.", pl->ob->name);
+ sprintf(buf2, "%s licks you.", op->name);
+ sprintf(buf3, "%s licks %s.", op->name, pl->ob->name);
+ break;
+ case EMOTE_SHRUG:
+ sprintf(buf, "You shrug at %s.", pl->ob->name);
+ sprintf(buf2, "%s shrugs at you.", op->name);
+ sprintf(buf3, "%s shrugs at %s.", op->name, pl->ob->name);
+ break;
+ case EMOTE_SLAP:
+ sprintf(buf, "You slap %s.", pl->ob->name);
+ sprintf(buf2, "You are slapped by %s.", op->name);
+ sprintf(buf3, "%s slaps %s.", op->name, pl->ob->name);
+ break;
+ case EMOTE_SNEEZE:
+ sprintf(buf, "You sneeze at %s and a film of snot shoots"
+ " onto him.", pl->ob->name);
+ sprintf(buf2, "%s sneezes on you, you feel the snot cover"
+ " you. EEEEEEW.", op->name);
+ sprintf(buf3, "%s sneezes on %s and a film of snot covers"
+ " him.", op->name, pl->ob->name);
+ break;
+ case EMOTE_SNIFF:
+ sprintf(buf, "You sniff %s.", pl->ob->name);
+ sprintf(buf2, "%s sniffs you.", op->name);
+ sprintf(buf3, "%s sniffs %s", op->name, pl->ob->name);
+ break;
+ case EMOTE_SPIT:
+ sprintf(buf, "You spit on %s.", pl->ob->name);
+ sprintf(buf2, "%s spits in your face!", op->name);
+ sprintf(buf3, "%s spits in %s's face.", op->name,
+ pl->ob->name);
+ break;
+ case EMOTE_THANK:
+ sprintf(buf, "You thank %s heartily.", pl->ob->name);
+ sprintf(buf2, "%s thanks you heartily.", op->name);
+ sprintf(buf3, "%s thanks %s heartily.", op->name,
+ pl->ob->name);
+ break;
+ case EMOTE_WAVE:
+ sprintf(buf, "You wave goodbye to %s.", pl->ob->name);
+ sprintf(buf2, "%s waves goodbye to you. Have a good"
+ "journey.", op->name);
+ sprintf(buf3, "%s waves goodbye to %s.", op->name,
+ pl->ob->name);
+ break;
+ case EMOTE_WHISTLE:
+ sprintf(buf, "You whistle at %s.", pl->ob->name);
+ sprintf(buf2, "%s whistles at you.", op->name);
+ sprintf(buf2, "%s whistles at %s.", op->name, pl->ob->name);
+ break;
+ case EMOTE_WINK:
+ sprintf(buf, "You wink suggestively at %s.", pl->ob->name);
+ sprintf(buf2, "%s winks suggestively at you.", op->name);
+ sprintf(buf2, "%s winks at %s.", op->name, pl->ob->name);
+ break;
+ case EMOTE_BEG:
+ sprintf(buf, "You beg %s for mercy.", pl->ob->name);
+ sprintf(buf2, "%s begs you for mercy! Show no quarter!",
+ op->name);
+ sprintf(buf2, "%s begs %s for mercy!", op->name,
+ pl->ob->name);
+ break;
+ case EMOTE_BLEED:
+ sprintf(buf, "You slash your wrist and bleed all over %s",
+ pl->ob->name);
+ sprintf(buf2, "%s slashes his wrist and bleeds all over"
+ " you.", op->name);
+ sprintf(buf2, "%s slashes his wrist and bleeds all "
+ "over %s.", op->name, pl->ob->name);
+ break;
+ case EMOTE_CRINGE:
+ sprintf(buf, "You cringe away from %s.", pl->ob->name);
+ sprintf(buf2, "%s cringes away from you.", op->name);
+ sprintf(buf2, "%s cringes away from %s in mortal terror.",
+ op->name, pl->ob->name);
+ break;
+ default:
+ sprintf(buf, "You are still nuts.");
+ sprintf(buf2, "You get the distinct feeling that %s is nuts.",
+ op->name);
+ sprintf(buf3, "%s is eyeing %s quizzically.", pl->ob->name,
+ op->name);
+ break;
+ } /*case*/
+ new_draw_info(NDI_UNIQUE, 0, op, buf);
+ new_draw_info(NDI_UNIQUE|NDI_WHITE, 0, pl->ob, buf2);
+ new_info_map_except2(NDI_WHITE, op->map, op, pl->ob, buf3);
+ return(0);
+ }
+ if(strncasecmp(pl->ob->name, params, MAX_NAME)==0 &&
+ pl->ob->map == op->map && pl->ob == op) {
+ switch(emotion) {
+ case EMOTE_DANCE:
+ sprintf(buf, "You skip and dance around by yourself.");
+ sprintf(buf2, "%s embraces himself and begins to dance!",
+ op->name);
+ break;
+ case EMOTE_LAUGH:
+ sprintf(buf, "Laugh at yourself all you want, the others "
+ "won't understand.");
+ sprintf(buf2, "%s is laughing at something.", op->name);
+ break;
+ case EMOTE_SHAKE:
+ sprintf(buf, "You are shaken by yourself.");
+ sprintf(buf2, "%s shakes and quivers like a bowlful of "
+ "jelly.", op->name);
+ break;
+ case EMOTE_PUKE:
+ sprintf(buf, "You puke on yourself.");
+ sprintf(buf2, "%s pukes on his clothes.", op->name);
+ break;
+ case EMOTE_HUG:
+ sprintf(buf, "You hug yourself.");
+ sprintf(buf2, "%s hugs himself.", op->name);
+ break;
+ case EMOTE_CRY:
+ sprintf(buf, "You cry to yourself.");
+ sprintf(buf2, "%s sobs quietly to himself.", op->name);
+ break;
+ case EMOTE_POKE:
+ sprintf(buf, "You poke yourself in the ribs, feeling very"
+ " silly.");
+ sprintf(buf2, "%s pokes himself in the ribs, looking very"
+ " sheepish.", op->name);
+ break;
+ case EMOTE_ACCUSE:
+ sprintf(buf, "You accuse yourself.");
+ sprintf(buf2, "%s seems to have a bad conscience.",
+ op->name);
+ break;
+ case EMOTE_BOW:
+ sprintf(buf, "You kiss your toes.");
+ sprintf(buf2, "%s folds up like a jackknife and kisses his"
+ " own toes.", op->name);
+ break;
+ case EMOTE_FROWN:
+ sprintf(buf, "You frown at yourself.");
+ sprintf(buf2, "%s frowns at himself.", op->name);
+ break;
+ case EMOTE_GLARE:
+ sprintf(buf, "You glare icily at your feet, they are "
+ "suddenly very cold.");
+ sprintf(buf2, "%s glares at his feet, what is bothering "
+ "him?", op->name);
+ break;
+ case EMOTE_LICK:
+ sprintf(buf, "You lick yourself.");
+ sprintf(buf2, "%s licks himself - YUCK.", op->name);
+ break;
+ case EMOTE_SLAP:
+ sprintf(buf, "You slap yourself, silly you.");
+ sprintf(buf2, "%s slaps himself, really strange...",
+ op->name);
+ break;
+ case EMOTE_SNEEZE:
+ sprintf(buf, "You sneeze on yourself, what a mess!");
+ sprintf(buf2, "%s sneezes, and covers himself in a slimy"
+ " substance.", op->name);
+ break;
+ case EMOTE_SNIFF:
+ sprintf(buf, "You sniff yourself.");
+ sprintf(buf2, "%s sniffs himself.", op->name);
+ break;
+ case EMOTE_SPIT:
+ sprintf(buf, "You drool all over yourself.");
+ sprintf(buf2, "%s drools all over himself.", op->name);
+ break;
+ case EMOTE_THANK:
+ sprintf(buf, "You thank yourself since nobody else "
+ "wants to!");
+ sprintf(buf2, "%s thanks himself since you won't.",
+ op->name);
+ break;
+ case EMOTE_WAVE:
+ sprintf(buf, "Are you going on adventures as well??");
+ sprintf(buf2, "%s waves goodbye to himself.", op->name);
+ break;
+ case EMOTE_WHISTLE:
+ sprintf(buf, "You whistle while you work.");
+ sprintf(buf2, "%s whistles to himself in boredom.",
+ op->name);
+ break;
+ case EMOTE_WINK:
+ sprintf(buf, "You wink at yourself?? What are you up to?");
+ sprintf(buf2, "%s winks at himself - something strange "
+ "is going on...", op->name);
+ break;
+ case EMOTE_BLEED:
+ sprintf(buf, "Very impressive! You wipe your blood all "
+ "over yourself.");
+ sprintf(buf2, "%s performs some satanic ritual while "
+ "wiping his blood on himself.", op->name);
+ break;
+ default:
+ sprintf(buf, "My god! is that LEGAL?");
+ sprintf(buf2, "You look away from %s.", op->name);
+ break;
+ }/*case*/
+ new_draw_info(NDI_UNIQUE, 0, op, buf);
+ new_info_map_except(NDI_WHITE, op->map, op, buf2);
+ return(0);
+ }/*if self*/
+ }/*for*/
+ sprintf(buf, "%s is not around.", params);
+ new_draw_info(NDI_UNIQUE, 0, op, buf);
+ return(1);
+ } /*else*/
+
+ return(0);
+ }
+
+ /*
+ * everything from here on out are just wrapper calls to basic_emote
+ */
+
+ int command_nod(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_NOD);
+ }
+
+ int command_dance(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_DANCE);
+ }
+
+ int command_kiss(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_KISS);
+ }
+
+ int command_bounce(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_BOUNCE);
+ }
+
+ int command_smile(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SMILE);
+ }
+
+ int command_cackle(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_CACKLE);
+ }
+
+ int command_laugh(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_LAUGH);
+ }
+
+ int command_giggle(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_GIGGLE);
+ }
+
+ int command_shake(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SHAKE);
+ }
+
+ int command_puke(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_PUKE);
+ }
+
+ int command_growl(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_GROWL);
+ }
+
+ int command_scream(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SCREAM);
+ }
+
+ int command_sigh(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SIGH);
+ }
+
+ int command_sulk(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SULK);
+ }
+
+ int command_hug(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_HUG);
+ }
+
+ int command_cry(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_CRY);
+ }
+
+ int command_poke(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_POKE);
+ }
+
+ int command_accuse(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_ACCUSE);
+ }
+
+ int command_grin(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_GRIN);
+ }
+
+ int command_bow(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_BOW);
+ }
+
+ int command_clap(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_CLAP);
+ }
+
+ int command_blush(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_BLUSH);
+ }
+
+ int command_burp(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_BURP);
+ }
+
+ int command_chuckle(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_CHUCKLE);
+ }
+
+ int command_cough(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_COUGH);
+ }
+
+ int command_flip(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_FLIP);
+ }
+
+ int command_frown(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_FROWN);
+ }
+
+ int command_gasp(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_GASP);
+ }
+
+ int command_glare(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_GLARE);
+ }
+
+ int command_groan(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_GROAN);
+ }
+
+ int command_hiccup(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_HICCUP);
+ }
+
+ int command_lick(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_LICK);
+ }
+
+ int command_pout(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_POUT);
+ }
+
+ int command_shiver(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SHIVER);
+ }
+
+ int command_shrug(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SHRUG);
+ }
+
+ int command_slap(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SLAP);
+ }
+
+ int command_smirk(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SMIRK);
+ }
+
+ int command_snap(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SNAP);
+ }
+
+ int command_sneeze(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SNEEZE);
+ }
+
+ int command_snicker(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SNICKER);
+ }
+
+ int command_sniff(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SNIFF);
+ }
+
+ int command_snore(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SNORE);
+ }
+
+ int command_spit(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_SPIT);
+ }
+
+ int command_strut(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_STRUT);
+ }
+
+ int command_thank(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_THANK);
+ }
+
+ int command_twiddle(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_TWIDDLE);
+ }
+
+ int command_wave(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_WAVE);
+ }
+
+ int command_whistle(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_WHISTLE);
+ }
+
+ int command_wink(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_WINK);
+ }
+
+ int command_yawn(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_YAWN);
+ }
+
+ int command_beg(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_BEG);
+ }
+
+ int command_bleed(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_BLEED);
+ }
+
+ int command_cringe(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_CRINGE);
+ }
+
+ int command_think(object *op, char *params)
+ {
+ basic_emote(op, params, EMOTE_THINK);
+ }
Index: c_misc.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/server/c_misc.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** c_misc.c 2001/07/14 04:11:18 1.12
--- c_misc.c 2001/09/27 19:37:39 1.13
***************
*** 697,700 ****
--- 697,705 ----
new_draw_info(NDI_UNIQUE, 0,op, " Wiz commands:");
break;
+ case 2:
+ ap= CommunicationCommands;
+ size= CommunicationCommandSize;
+ new_draw_info(NDI_UNIQUE, 0, op, " Communication commands:");
+ break;
default:
ap =Commands;
***************
*** 768,771 ****
--- 773,777 ----
if (!strcmp(params, "commands")) {
show_commands(op, 0);
+ show_commands(op, 2); /* show comm commands */
if (QUERY_FLAG(op, FLAG_WIZ))
show_commands(op, 1);
Index: c_new.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/server/c_new.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** c_new.c 2000/12/18 07:38:25 1.2
--- c_new.c 2001/09/27 19:37:39 1.3
***************
*** 79,83 ****
if (!csp)
csp = find_command_element(command, Commands, CommandsSize);
!
if (!csp && QUERY_FLAG(pl, FLAG_WIZ))
csp = find_command_element(command, WizCommands, WizCommandsSize);
--- 79,84 ----
if (!csp)
csp = find_command_element(command, Commands, CommandsSize);
! if (!csp)
! csp = find_command_element(command, CommunicationCommands, CommunicationCommandSize);
if (!csp && QUERY_FLAG(pl, FLAG_WIZ))
csp = find_command_element(command, WizCommands, WizCommandsSize);
Index: commands.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/server/commands.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** commands.c 2001/07/14 04:11:18 1.12
--- commands.c 2001/09/27 19:37:39 1.13
***************
*** 89,94 ****
{"rotateshoottype", command_rotateshoottype, 0.0},
{"rotatespells", command_rotatespells, 0.0},
- {"say", command_say, 0.0},
- {"shout", command_shout, 0.0},
{"shutdown", command_shutdown, 0.0},
{"skills", command_skills, 0.0}, /* shows player list of skills */
--- 89,92 ----
***************
*** 102,106 ****
{"strings", command_strings, 0.0},
{"take", command_take, 1.0},
- {"tell", command_tell, 0.0},
{"throw", command_throw, 1.0},
{"time", command_time, 0.0},
--- 100,103 ----
***************
*** 127,130 ****
--- 124,190 ----
const int CommandsSize =sizeof(Commands) / sizeof(CommArray_s);
+ CommArray_s CommunicationCommands [] = {
+ /* begin emotions */
+ {"tell", command_tell, 0.0},
+ {"say", command_say, 0.0},
+ {"shout", command_shout, 0.0},
+ {"nod", command_nod, 0.0},
+ {"dance", command_dance, 0.0},
+ {"kiss", command_kiss, 0.0},
+ {"bounce", command_bounce, 0.0},
+ {"smile", command_smile, 0.0},
+ {"cackle", command_cackle, 0.0},
+ {"laugh", command_laugh, 0.0},
+ {"giggle", command_giggle, 0.0},
+ {"shake", command_shake, 0.0},
+ {"puke", command_puke, 0.0},
+ {"growl", command_growl, 0.0},
+ {"scream", command_scream, 0.0},
+ {"sigh", command_sigh, 0.0},
+ {"sulk", command_sulk, 0.0},
+ {"hug", command_hug, 0.0},
+ {"cry", command_cry, 0.0},
+ {"poke", command_poke, 0.0},
+ {"accuse", command_accuse, 0.0},
+ {"grin", command_grin, 0.0},
+ {"bow", command_bow, 0.0},
+ {"clap", command_clap, 0.0},
+ {"blush", command_blush, 0.0},
+ {"burp", command_burp, 0.0},
+ {"chuckle", command_chuckle, 0.0},
+ {"cough", command_cough, 0.0},
+ {"flip", command_flip, 0.0},
+ {"frown", command_frown, 0.0},
+ {"gasp", command_gasp, 0.0},
+ {"glare", command_glare, 0.0},
+ {"groan", command_groan, 0.0},
+ {"hiccup", command_hiccup, 0.0},
+ {"lick", command_lick, 0.0},
+ {"pout", command_pout, 0.0},
+ {"shiver", command_shiver, 0.0},
+ {"shrug", command_shrug, 0.0},
+ {"slap", command_slap, 0.0},
+ {"smirk", command_smirk, 0.0},
+ {"snap", command_snap, 0.0},
+ {"sneeze", command_sneeze, 0.0},
+ {"snicker", command_snicker, 0.0},
+ {"sniff", command_sniff, 0.0},
+ {"snore", command_snore, 0.0},
+ {"spit", command_spit, 0.0},
+ {"strut", command_strut, 0.0},
+ {"thank", command_thank, 0.0},
+ {"twiddle", command_twiddle, 0.0},
+ {"wave", command_wave, 0.0},
+ {"whistle", command_whistle, 0.0},
+ {"wink", command_wink, 0.0},
+ {"yawn", command_yawn, 0.0},
+ {"beg", command_beg, 0.0},
+ {"bleed", command_bleed, 0.0},
+ {"cringe", command_cringe, 0.0},
+ {"think", command_think, 0.0},
+ };
+
+ const int CommunicationCommandSize = sizeof(CommunicationCommands)/ sizeof(CommArray_s);
+
CommArray_s NewServerCommands [] = {
{"run", command_run, 1.0},
***************
*** 211,214 ****
--- 271,275 ----
{
qsort((char *)Commands, CommandsSize, sizeof(CommArray_s), compare_A);
+ qsort((char *)CommunicationCommands, CommunicationCommandSize, sizeof(CommArray_s), compare_A);
qsort((char *)WizCommands, WizCommandsSize, sizeof(CommArray_s), compare_A);
qsort((char *)NewServerCommands, NewServerCommandSize, sizeof(CommArray_s), compare_A);
***************
*** 268,274 ****
(void *)Commands, CommandsSize,
sizeof(CommArray_s), compare_A);
if (asp)
return asp->func;
! return NULL;
}
--- 329,346 ----
(void *)Commands, CommandsSize,
sizeof(CommArray_s), compare_A);
+ printf("Getting asp for command string %s\n", cmd);
if (asp)
return asp->func;
! else
! {
! printf("Now we are here\n");
! asp =(CommArray_s *)bsearch((void *)&dummy,
! (void *)CommunicationCommands, CommunicationCommandSize,
! sizeof(CommArray_s), compare_A);
! if (asp)
! return asp->func;
! else
! return NULL;
! };
}
|