/* Notes:
   Use voice_names[ch->vocalizing] to display the user's current voice on
   channels or in say, etc.
   
   I have not yet implemented having voice save over logout or copyover. 
   When I do (should be the next couple days), I'll upload it here as an
   update. In the meantime, if you go to use this, just add the proper
   stuff to save.c and you should be good.
   
   No credits required here -- it's basically just the SWR language code
   picked apart and reformed.
   
   When you have finished compiling, you will need to:
   
   cedit voice create
   cedit voice level 1
   cedit savecmds
   
   Last updated November 11, 2016
   --Merryweather */
   
/* Helpfile

Syntax: voice <setting>
        voice (without a setting, resets to "unremarkable")

The voice system is designed to give your character and his/her communications
a context. Some settings are more for the way your natural voice sounds, while
others are situational -- moments where sounding fearful or amused is vital to
how your character is perceived by listeners. 

Setting options:

amusedly           angrily           anxiously      bewilderedly         
calmly             coldly            deeply         embarrassedly
excitedly          fearfully         gently         gruffly
hoarsely           irritatedly       loudly         meekly
monotonously       nasally           quietly        sarcastically
sighingly          solemnly          squeakily      suavely
suggestively       surprisedly       teasingly      tiredly
uneasily           warmly            wryly */

/* Add to your Global Constants in mud.h */

extern	int	    const	voice_array      [];
extern	char *	const	voice_names      [];

/* Add underneath your language definitions in mud.h */

#define VOICE_NONE               BV00
#define VOICE_CALMLY             BV01
#define VOICE_DEEPLY             BV02
#define VOICE_WRYLY              BV03
#define VOICE_GENTLY             BV04
#define VOICE_LOUDLY             BV05
#define VOICE_QUIETLY            BV06
#define VOICE_MEEKLY             BV07
#define VOICE_WARMLY             BV08
#define VOICE_MONOTONOUSLY       BV09
#define VOICE_NASALLY            BV10
#define VOICE_GRUFFLY            BV11
#define VOICE_HOARSELY           BV12
#define VOICE_COLDLY             BV13
#define VOICE_SUAVELY            BV14
#define VOICE_TEASINGLY          BV15
#define VOICE_AMUSEDLY           BV16
#define VOICE_ANGRILY            BV17
#define VOICE_IRRITATEDLY        BV18
#define VOICE_ANXIOUSLY          BV19
#define VOICE_EMBARRASSEDLY      BV20
#define VOICE_BEWILDEREDLY       BV21
#define VOICE_SOLEMNLY           BV22
#define VOICE_EXCITEDLY          BV23
#define VOICE_FEARFULLY          BV24
#define VOICE_SARCASTICALLY      BV25
#define VOICE_SIGHINGLY          BV26
#define VOICE_SQUEAKILY          BV27
#define VOICE_SUGGESTIVELY       BV28
#define VOICE_SURPRISEDLY        BV29
#define VOICE_TIREDLY            BV30
#define VOICE_UNEASILY           BV31
#define VOICE_UNKNOWN       0  /* Anything that doesnt fit a category */
#define VALID_VOICES    ( VOICE_NONE | VOICE_ABASHED | VOICE_ABRUPT \
                 | VOICE_ABSENTMINDED | VOICE_ACCUSING | VOICE_AGGRAVATED \
				 | VOICE_AGGRESSIVE | VOICE_AMUSED | VOICE_ANGRY | VOICE_ANNOYED \
				 | VOICE_ANNOYING | VOICE_ANXIOUS | VOICE_APOLOGETIC | VOICE_APPRECIATIVE \
				 | VOICE_APPROVING | VOICE_ARGUMENTATIVE | VOICE_ARROGANT | VOICE_ASHAMED \
				 | VOICE_AWED | VOICE_AWKWARD | VOICE_BASHFUL | VOICE_BELLIGERENT \
				 | VOICE_BEWILDERED | VOICE_BITTER | VOICE_BLUNT | VOICE_BORED \
				 | VOICE_BRASH | VOICE_BRAVE | VOICE_BREATHLESS | VOICE_BOLD \
				 | VOICE_BRISK | VOICE_BROKEN )
				 
/* Add to char_data in mud.h */

	int 		vocalizing;
	

/* Add voice.c to your Makefile, and create the file voice.c in your src folder
   with the following contents: */

/* Voice/tone code adapted from the SWR FOTE language code by 
   Merryweather. Last updated November 10th, 2016. */
 
#include <sys/types.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "mud.h"

char * const voice_names[] = {
"unremarkably", "calmly", "deeply", "wryly", "gently", "loudly", "quietly", "meekly", "warmly", "monotonously", "nasally", "gruffly", "hoarsely", "coldly", "suavely", "teasingly", "amusedly", "angrily", "irritatedly", "anxiously", "embarrassedly", "bewilderedly", "solemnly", "excitedly", "fearfully", "sarcastically", "sighingly", "squeakily", "suggestively", "surprisedly", "tiredly", "uneasily", "unknown"
};

int const voice_array[] = { 
VOICE_NONE, VOICE_CALMLY, VOICE_DEEPLY, VOICE_WRYLY, VOICE_GENTLY, VOICE_LOUDLY, VOICE_QUIETLY, VOICE_MEEKLY, VOICE_WARMLY, VOICE_MONOTONOUSLY, VOICE_NASALLY, VOICE_GRUFFLY, VOICE_HOARSELY, VOICE_COLDLY, VOICE_SUAVELY, VOICE_TEASINGLY, VOICE_AMUSEDLY, VOICE_ANGRILY, VOICE_IRRITATEDLY, VOICE_ANXIOUSLY, VOICE_EMBARRASSEDLY, VOICE_BEWILDEREDLY, VOICE_SOLEMNLY, VOICE_EXCITEDLY, VOICE_FEARFULLY, VOICE_SARCASTICALLY, VOICE_SIGHINGLY, VOICE_SQUEAKILY, VOICE_SUGGESTIVELY, VOICE_SURPRISEDLY, VOICE_TIREDLY, VOICE_UNEASILY, VOICE_UNKNOWN
};

void do_voice( CHAR_DATA *ch, char *argument )
{
	int voices;
	char arg[MAX_INPUT_LENGTH];
	
	argument = one_argument(argument, arg );
	
	for ( voices = 0; voice_array[voices] != VOICE_UNKNOWN; voices++ )
		if ( !str_prefix( arg, voice_names[voices] ) )	
			{
				ch->vocalizing = voices;
				set_char_color( AT_SAY, ch );
				ch_printf( ch, "You will now speak %s.\n\r", voice_names[voices] );
				return;
			}
	set_char_color( AT_SAY, ch );
	send_to_char( "That is not a tone of voice you can use.\n\r", ch );
}