diff -ur Rom24/src/act_comm.c rom24_colour_v2.0/src/act_comm.c --- Rom24/src/act_comm.c Thu Jul 18 13:43:07 1996 +++ rom24_colour_v2.0/src/act_comm.c Sun May 3 20:23:52 1998 @@ -100,37 +100,37 @@ send_to_char(" channel status\n\r",ch); send_to_char("---------------------\n\r",ch); - send_to_char("gossip ",ch); + send_to_char("{dgossip{x ",ch); if (!IS_SET(ch->comm,COMM_NOGOSSIP)) send_to_char("ON\n\r",ch); else send_to_char("OFF\n\r",ch); - send_to_char("auction ",ch); + send_to_char("{aauction{x ",ch); if (!IS_SET(ch->comm,COMM_NOAUCTION)) send_to_char("ON\n\r",ch); else send_to_char("OFF\n\r",ch); - send_to_char("music ",ch); + send_to_char("{emusic{x ",ch); if (!IS_SET(ch->comm,COMM_NOMUSIC)) send_to_char("ON\n\r",ch); else send_to_char("OFF\n\r",ch); - send_to_char("Q/A ",ch); + send_to_char("{qQ{x/{fA{x ",ch); if (!IS_SET(ch->comm,COMM_NOQUESTION)) send_to_char("ON\n\r",ch); else send_to_char("OFF\n\r",ch); - send_to_char("Quote ",ch); + send_to_char("{hQuote{x ",ch); if (!IS_SET(ch->comm,COMM_NOQUOTE)) send_to_char("ON\n\r",ch); else send_to_char("OFF\n\r",ch); - send_to_char("grats ",ch); + send_to_char("{tgrats{x ",ch); if (!IS_SET(ch->comm,COMM_NOGRATS)) send_to_char("ON\n\r",ch); else @@ -138,26 +138,26 @@ if (IS_IMMORTAL(ch)) { - send_to_char("god channel ",ch); + send_to_char("{igod channel{x ",ch); if(!IS_SET(ch->comm,COMM_NOWIZ)) send_to_char("ON\n\r",ch); else send_to_char("OFF\n\r",ch); } - send_to_char("shouts ",ch); + send_to_char("{tshouts{x ",ch); if (!IS_SET(ch->comm,COMM_SHOUTSOFF)) send_to_char("ON\n\r",ch); else send_to_char("OFF\n\r",ch); - send_to_char("tells ",ch); + send_to_char("{ktells{x ",ch); if (!IS_SET(ch->comm,COMM_DEAF)) send_to_char("ON\n\r",ch); else send_to_char("OFF\n\r",ch); - send_to_char("quiet mode ",ch); + send_to_char("{tquiet mode{x ",ch); if (IS_SET(ch->comm,COMM_QUIET)) send_to_char("ON\n\r",ch); else @@ -277,12 +277,12 @@ { if (IS_SET(ch->comm,COMM_NOAUCTION)) { - send_to_char("Auction channel is now ON.\n\r",ch); + send_to_char("{aAuction channel is now ON.{x\n\r",ch); REMOVE_BIT(ch->comm,COMM_NOAUCTION); } else { - send_to_char("Auction channel is now OFF.\n\r",ch); + send_to_char("{aAuction channel is now OFF.{x\n\r",ch); SET_BIT(ch->comm,COMM_NOAUCTION); } } @@ -302,7 +302,7 @@ REMOVE_BIT(ch->comm,COMM_NOAUCTION); } - sprintf( buf, "You auction '%s'\n\r", argument ); + sprintf( buf, "{aYou auction '{A%s{a'{x\n\r", argument ); send_to_char( buf, ch ); for ( d = descriptor_list; d != NULL; d = d->next ) { @@ -315,7 +315,7 @@ !IS_SET(victim->comm,COMM_NOAUCTION) && !IS_SET(victim->comm,COMM_QUIET) ) { - act_new("$n auctions '$t'", + act_new("{a$n auctions '{A$t{a'{x", ch,argument,d->character,TO_VICT,POS_DEAD); } } @@ -358,7 +358,7 @@ REMOVE_BIT(ch->comm,COMM_NOGOSSIP); - sprintf( buf, "You gossip '%s'\n\r", argument ); + sprintf( buf, "{dYou gossip '{9%s{d'{x\n\r", argument ); send_to_char( buf, ch ); for ( d = descriptor_list; d != NULL; d = d->next ) { @@ -371,7 +371,7 @@ !IS_SET(victim->comm,COMM_NOGOSSIP) && !IS_SET(victim->comm,COMM_QUIET) ) { - act_new( "$n gossips '$t'", + act_new( "{d$n gossips '{9$t{d'{x", ch,argument, d->character, TO_VICT,POS_SLEEPING ); } } @@ -413,7 +413,7 @@ REMOVE_BIT(ch->comm,COMM_NOGRATS); - sprintf( buf, "You grats '%s'\n\r", argument ); + sprintf( buf, "{tYou grats '%s'{x\n\r", argument ); send_to_char( buf, ch ); for ( d = descriptor_list; d != NULL; d = d->next ) { @@ -426,7 +426,7 @@ !IS_SET(victim->comm,COMM_NOGRATS) && !IS_SET(victim->comm,COMM_QUIET) ) { - act_new( "$n grats '$t'", + act_new( "{t$n grats '$t'{x", ch,argument, d->character, TO_VICT,POS_SLEEPING ); } } @@ -442,12 +442,12 @@ { if (IS_SET(ch->comm,COMM_NOQUOTE)) { - send_to_char("Quote channel is now ON.\n\r",ch); + send_to_char("{hQuote channel is now ON.{x\n\r",ch); REMOVE_BIT(ch->comm,COMM_NOQUOTE); } else { - send_to_char("Quote channel is now OFF.\n\r",ch); + send_to_char("{hQuote channel is now OFF.{x\n\r",ch); SET_BIT(ch->comm,COMM_NOQUOTE); } } @@ -468,7 +468,7 @@ REMOVE_BIT(ch->comm,COMM_NOQUOTE); - sprintf( buf, "You quote '%s'\n\r", argument ); + sprintf( buf, "{hYou quote '{H%s{h'{x\n\r", argument ); send_to_char( buf, ch ); for ( d = descriptor_list; d != NULL; d = d->next ) { @@ -481,7 +481,7 @@ !IS_SET(victim->comm,COMM_NOQUOTE) && !IS_SET(victim->comm,COMM_QUIET) ) { - act_new( "$n quotes '$t'", + act_new( "{h$n quotes '{H$t{h'{x", ch,argument, d->character, TO_VICT,POS_SLEEPING ); } } @@ -523,7 +523,7 @@ REMOVE_BIT(ch->comm,COMM_NOQUESTION); - sprintf( buf, "You question '%s'\n\r", argument ); + sprintf( buf, "{qYou question '{Q%s{q'{x\n\r", argument ); send_to_char( buf, ch ); for ( d = descriptor_list; d != NULL; d = d->next ) { @@ -536,7 +536,7 @@ !IS_SET(victim->comm,COMM_NOQUESTION) && !IS_SET(victim->comm,COMM_QUIET) ) { - act_new("$n questions '$t'", + act_new("{q$n questions '{Q$t{q'{x", ch,argument,d->character,TO_VICT,POS_SLEEPING); } } @@ -578,7 +578,7 @@ REMOVE_BIT(ch->comm,COMM_NOQUESTION); - sprintf( buf, "You answer '%s'\n\r", argument ); + sprintf( buf, "{fYou answer '{F%s{f'{x\n\r", argument ); send_to_char( buf, ch ); for ( d = descriptor_list; d != NULL; d = d->next ) { @@ -591,7 +591,7 @@ !IS_SET(victim->comm,COMM_NOQUESTION) && !IS_SET(victim->comm,COMM_QUIET) ) { - act_new("$n answers '$t'", + act_new("{f$n answers '{F$t{f'{x", ch,argument,d->character,TO_VICT,POS_SLEEPING); } } @@ -633,7 +633,7 @@ REMOVE_BIT(ch->comm,COMM_NOMUSIC); - sprintf( buf, "You MUSIC: '%s'\n\r", argument ); + sprintf( buf, "{eYou MUSIC: '{E%s{e'{x\n\r", argument ); send_to_char( buf, ch ); sprintf( buf, "$n MUSIC: '%s'", argument ); for ( d = descriptor_list; d != NULL; d = d->next ) @@ -647,7 +647,7 @@ !IS_SET(victim->comm,COMM_NOMUSIC) && !IS_SET(victim->comm,COMM_QUIET) ) { - act_new("$n MUSIC: '$t'", + act_new("{e$n MUSIC: '{E$t{e'{x", ch,argument,d->character,TO_VICT,POS_SLEEPING); } } @@ -688,7 +688,7 @@ REMOVE_BIT(ch->comm,COMM_NOCLAN); - sprintf( buf, "You clan '%s'\n\r", argument ); + sprintf( buf, "You clan '%s'{x\n\r", argument ); send_to_char( buf, ch ); sprintf( buf, "$n clans '%s'", argument ); for ( d = descriptor_list; d != NULL; d = d->next ) @@ -699,7 +699,7 @@ !IS_SET(d->character->comm,COMM_NOCLAN) && !IS_SET(d->character->comm,COMM_QUIET) ) { - act_new("$n clans '$t'",ch,argument,d->character,TO_VICT,POS_DEAD); + act_new("$n clans '$t'{x",ch,argument,d->character,TO_VICT,POS_DEAD); } } @@ -708,7 +708,6 @@ void do_immtalk( CHAR_DATA *ch, char *argument ) { - char buf[MAX_STRING_LENGTH]; DESCRIPTOR_DATA *d; if ( argument[0] == '\0' ) @@ -728,15 +727,14 @@ REMOVE_BIT(ch->comm,COMM_NOWIZ); - sprintf( buf, "$n: %s", argument ); - act_new("$n: $t",ch,argument,NULL,TO_CHAR,POS_DEAD); + act_new("{i[{I$n{i]: $t{x",ch,argument,NULL,TO_CHAR,POS_DEAD); for ( d = descriptor_list; d != NULL; d = d->next ) { if ( d->connected == CON_PLAYING && IS_IMMORTAL(d->character) && !IS_SET(d->character->comm,COMM_NOWIZ) ) { - act_new("$n: $t",ch,argument,d->character,TO_VICT,POS_DEAD); + act_new("{i[{I$n{i]: $t{x",ch,argument,d->character,TO_VICT,POS_DEAD); } } @@ -753,8 +751,8 @@ return; } - act( "$n says '$T'", ch, NULL, argument, TO_ROOM ); - act( "You say '$T'", ch, NULL, argument, TO_CHAR ); + act( "{6$n says '{7$T{6'{x", ch, NULL, argument, TO_ROOM ); + act( "{6You say '{7$T{6'{x", ch, NULL, argument, TO_CHAR ); return; } @@ -856,7 +854,7 @@ { act("$N seems to have misplaced $S link...try again later.", ch,NULL,victim,TO_CHAR); - sprintf(buf,"%s tells you '%s'\n\r",PERS(ch,victim),argument); + sprintf(buf,"{k%s tells you '{K%s{k'{x\n\r",PERS(ch,victim),argument); buf[0] = UPPER(buf[0]); add_buf(victim->pcdata->buffer,buf); return; @@ -885,14 +883,14 @@ act("$E is AFK, but your tell will go through when $E returns.", ch,NULL,victim,TO_CHAR); - sprintf(buf,"%s tells you '%s'\n\r",PERS(ch,victim),argument); + sprintf(buf,"{k%s tells you '{K%s{k'{x\n\r",PERS(ch,victim),argument); buf[0] = UPPER(buf[0]); add_buf(victim->pcdata->buffer,buf); return; } - act( "You tell $N '$t'", ch, argument, victim, TO_CHAR ); - act_new("$n tells you '$t'",ch,argument,victim,TO_VICT,POS_DEAD); + act( "{kYou tell $N '{K$t{k'{x", ch, argument, victim, TO_CHAR ); + act_new("{k$n tells you '{K$t{k'{x",ch,argument,victim,TO_VICT,POS_DEAD); victim->reply = ch; return; @@ -921,7 +919,7 @@ { act("$N seems to have misplaced $S link...try again later.", ch,NULL,victim,TO_CHAR); - sprintf(buf,"%s tells you '%s'\n\r",PERS(ch,victim),argument); + sprintf(buf,"{k%s tells you '{K%s{k'{x\n\r",PERS(ch,victim),argument); buf[0] = UPPER(buf[0]); add_buf(victim->pcdata->buffer,buf); return; @@ -957,14 +955,14 @@ act_new("$E is AFK, but your tell will go through when $E returns.", ch,NULL,victim,TO_CHAR,POS_DEAD); - sprintf(buf,"%s tells you '%s'\n\r",PERS(ch,victim),argument); + sprintf(buf,"{k%s tells you '{K%s{k'{x\n\r",PERS(ch,victim),argument); buf[0] = UPPER(buf[0]); add_buf(victim->pcdata->buffer,buf); return; } - act_new("You tell $N '$t'",ch,argument,victim,TO_CHAR,POS_DEAD); - act_new("$n tells you '$t'",ch,argument,victim,TO_VICT,POS_DEAD); + act_new("{kYou tell $N '{K$t{k'{x",ch,argument,victim,TO_CHAR,POS_DEAD); + act_new("{k$n tells you '{K$t{k'{x",ch,argument,victim,TO_VICT,POS_DEAD); victim->reply = ch; return; @@ -1948,4 +1946,206 @@ if ( ach->leader != NULL ) ach = ach->leader; if ( bch->leader != NULL ) bch = bch->leader; return ach == bch; +} + +/* + * ColoUr setting and unsetting, way cool, Ant Oct 94 + * revised to include config colour, Ant Feb 95 + */ +void do_colour( CHAR_DATA *ch, char *argument ) +{ + char arg[ MAX_STRING_LENGTH ]; + + if( IS_NPC( ch ) ) + { + send_to_char_bw( "ColoUr is not ON, Way Moron!\n\r", ch ); + return; + } + + argument = one_argument( argument, arg ); + + if( !*arg ) + { + if( !IS_SET( ch->act, PLR_COLOUR ) ) + { + SET_BIT( ch->act, PLR_COLOUR ); + send_to_char( "ColoUr is now ON, Way Cool!\n\r" + "Further syntax:\n\r colour {c<{xfield{c> <{xcolour{c>{x\n\r" + " colour {c<{xfield{c>{x {cbeep{x|{cnobeep{x\n\r" + "Type help {ccolour{x and {ccolour2{x for details.\n\r" + "ColoUr is brought to you by Lope, ant@solace.mh.se.\n\r", ch ); + } + else + { + send_to_char_bw( "ColoUr is now OFF, <sigh>\n\r", ch ); + REMOVE_BIT( ch->act, PLR_COLOUR ); + } + return; + } + + if( !str_cmp( arg, "default" ) ) + { + default_colour( ch ); + send_to_char_bw( "ColoUr setting set to default values.\n\r", ch ); + return; + } + + if( !str_cmp( arg, "all" ) ) + { + all_colour( ch, argument ); + return; + } + + /* + * Yes, I know this is ugly and unnessessary repetition, but its old + * and I can't justify the time to make it pretty. -Lope + */ + if( !str_cmp( arg, "text" ) ) + { + ALTER_COLOUR( text ) + } + else if( !str_cmp( arg, "auction" ) ) + { + ALTER_COLOUR( auction ) + } + else if( !str_cmp( arg, "auction_text" ) ) + { + ALTER_COLOUR( auction_text ) + } + else if( !str_cmp( arg, "gossip" ) ) + { + ALTER_COLOUR( gossip ) + } + else if( !str_cmp( arg, "gossip_text" ) ) + { + ALTER_COLOUR( gossip_text ) + } + else if( !str_cmp( arg, "music" ) ) + { + ALTER_COLOUR( music ) + } + else if( !str_cmp( arg, "music_text" ) ) + { + ALTER_COLOUR( music_text ) + } + else if( !str_cmp( arg, "question" ) ) + { + ALTER_COLOUR( question ) + } + else if( !str_cmp( arg, "question_text" ) ) + { + ALTER_COLOUR( question_text ) + } + else if( !str_cmp( arg, "answer" ) ) + { + ALTER_COLOUR( answer ) + } + else if( !str_cmp( arg, "answer_text" ) ) + { + ALTER_COLOUR( answer_text ) + } + else if( !str_cmp( arg, "quote" ) ) + { + ALTER_COLOUR( quote ) + } + else if( !str_cmp( arg, "quote_text" ) ) + { + ALTER_COLOUR( quote_text ) + } + else if( !str_cmp( arg, "immtalk_text" ) ) + { + ALTER_COLOUR( immtalk_text ) + } + else if( !str_cmp( arg, "immtalk_type" ) ) + { + ALTER_COLOUR( immtalk_type ) + } + else if( !str_cmp( arg, "info" ) ) + { + ALTER_COLOUR( info ) + } + else if( !str_cmp( arg, "say" ) ) + { + ALTER_COLOUR( say ) + } + else if( !str_cmp( arg, "say_text" ) ) + { + ALTER_COLOUR( say_text ) + } + else if( !str_cmp( arg, "tell" ) ) + { + ALTER_COLOUR( tell ) + } + else if( !str_cmp( arg, "tell_text" ) ) + { + ALTER_COLOUR( tell_text ) + } + else if( !str_cmp( arg, "reply" ) ) + { + ALTER_COLOUR( reply ) + } + else if( !str_cmp( arg, "reply_text" ) ) + { + ALTER_COLOUR( reply_text ) + } + else if( !str_cmp( arg, "gtell_text" ) ) + { + ALTER_COLOUR( gtell_text ) + } + else if( !str_cmp( arg, "gtell_type" ) ) + { + ALTER_COLOUR( gtell_type ) + } + else if( !str_cmp( arg, "wiznet" ) ) + { + ALTER_COLOUR( wiznet ) + } + else if( !str_cmp( arg, "room_title" ) ) + { + ALTER_COLOUR( room_title ) + } + else if( !str_cmp( arg, "room_text" ) ) + { + ALTER_COLOUR( room_text ) + } + else if( !str_cmp( arg, "room_exits" ) ) + { + ALTER_COLOUR( room_exits ) + } + else if( !str_cmp( arg, "room_things" ) ) + { + ALTER_COLOUR( room_things ) + } + else if( !str_cmp( arg, "prompt" ) ) + { + ALTER_COLOUR( prompt ) + } + else if( !str_cmp( arg, "fight_death" ) ) + { + ALTER_COLOUR( fight_death ) + } + else if( !str_cmp( arg, "fight_yhit" ) ) + { + ALTER_COLOUR( fight_yhit ) + } + else if( !str_cmp( arg, "fight_ohit" ) ) + { + ALTER_COLOUR( fight_ohit ) + } + else if( !str_cmp( arg, "fight_thit" ) ) + { + ALTER_COLOUR( fight_thit ) + } + else if( !str_cmp( arg, "fight_skill" ) ) + { + ALTER_COLOUR( fight_skill ) + } + else + { + send_to_char_bw( "Unrecognised Colour Parameter Not Set.\n\r", ch ); + return; + } + + send_to_char_bw( "New Colour Parameter Set.\n\r", ch ); + return; } diff -ur Rom24/src/act_info.c rom24_colour_v2.0/src/act_info.c --- Rom24/src/act_info.c Thu Jul 18 13:43:13 1996 +++ rom24_colour_v2.0/src/act_info.c Sun May 3 18:23:44 1998 @@ -1035,21 +1035,22 @@ if ( arg1[0] == '\0' || !str_cmp( arg1, "auto" ) ) { /* 'look' or 'look auto' */ - send_to_char( ch->in_room->name, ch ); + sprintf( buf, "{s%s", ch->in_room->name ); + send_to_char( buf, ch ); if (IS_IMMORTAL(ch) && (IS_NPC(ch) || IS_SET(ch->act,PLR_HOLYLIGHT))) { - sprintf(buf," [Room %d]",ch->in_room->vnum); + sprintf(buf," {r[{RRoom %d{r]",ch->in_room->vnum); send_to_char(buf,ch); } - send_to_char( "\n\r", ch ); + send_to_char( "{x\n\r", ch ); if ( arg1[0] == '\0' || ( !IS_NPC(ch) && !IS_SET(ch->comm, COMM_BRIEF) ) ) { - send_to_char( " ",ch); - send_to_char( ch->in_room->description, ch ); + sprintf( buf, "{S %s{x", ch->in_room->description ); + send_to_char( buf, ch ); } if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOEXIT) ) diff -ur Rom24/src/act_wiz.c rom24_colour_v2.0/src/act_wiz.c --- Rom24/src/act_wiz.c Thu Jul 18 13:43:26 1996 +++ rom24_colour_v2.0/src/act_wiz.c Sun May 3 20:30:02 1998 @@ -184,8 +184,11 @@ && d->character != ch) { if (IS_SET(d->character->wiznet,WIZ_PREFIX)) - send_to_char("--> ",d->character); + send_to_char("{Z--> ",d->character); + else + send_to_char( "{Z", d->character ); act_new(string,d->character,obj,ch,TO_CHAR,POS_DEAD); + send_to_char( "{x", d->character ); } } diff -ur Rom24/src/comm.c rom24_colour_v2.0/src/comm.c --- Rom24/src/comm.c Sun May 3 17:45:02 1998 +++ rom24_colour_v2.0/src/comm.c Sun May 3 20:25:06 1998 @@ -1321,6 +1321,8 @@ const char *str; const char *i; char *point; + char *pbuff; + char buffer[ MAX_STRING_LENGTH*2 ]; char doors[MAX_INPUT_LENGTH]; EXIT_DATA *pexit; bool found; @@ -1331,7 +1333,7 @@ str = ch->prompt; if (str == NULL || str[0] == '\0') { - sprintf( buf, "<%dhp %dm %dmv> %s", + sprintf( buf, "{p<%dhp %dm %dmv>{x %s", ch->hit,ch->mana,ch->move,ch->prefix); send_to_char(buf,ch); return; @@ -1339,7 +1341,7 @@ if (IS_SET(ch->comm,COMM_AFK)) { - send_to_char("<AFK> ",ch); + send_to_char("{p<AFK>{x ",ch); return; } @@ -1445,7 +1447,12 @@ while( (*point = *i) != '\0' ) ++point, ++i; } - write_to_buffer( ch->desc, buf, point - buf ); + *point = '\0'; + pbuff = buffer; + colourconv( pbuff, buf, ch ); + send_to_char( "{p", ch ); + write_to_buffer( ch->desc, buffer, 0 ); + send_to_char( "{x", ch ); if (ch->prefix[0] != '\0') write_to_buffer(ch->desc,ch->prefix,0); @@ -2306,7 +2313,7 @@ /* * Write to one char. */ -void send_to_char( const char *txt, CHAR_DATA *ch ) +void send_to_char_bw( const char *txt, CHAR_DATA *ch ) { if ( txt != NULL && ch->desc != NULL ) write_to_buffer( ch->desc, txt, strlen(txt) ); @@ -2314,21 +2321,72 @@ } /* + * Write to one char, new colour version, by Lope. + */ +void send_to_char( const char *txt, CHAR_DATA *ch ) +{ + const char *point; + char *point2; + char buf[ MAX_STRING_LENGTH*4 ]; + int skip = 0; + + buf[0] = '\0'; + point2 = buf; + if( txt && ch->desc ) + { + if( IS_SET( ch->act, PLR_COLOUR ) ) + { + for( point = txt ; *point ; point++ ) + { + if( *point == '{' ) + { + point++; + skip = colour( *point, ch, point2 ); + while( skip-- > 0 ) + ++point2; + continue; + } + *point2 = *point; + *++point2 = '\0'; + } + *point2 = '\0'; + write_to_buffer( ch->desc, buf, point2 - buf ); + } + else + { + for( point = txt ; *point ; point++ ) + { + if( *point == '{' ) + { + point++; + continue; + } + *point2 = *point; + *++point2 = '\0'; + } + *point2 = '\0'; + write_to_buffer( ch->desc, buf, point2 - buf ); + } + } + return; +} + +/* * Send a page to one char. */ -void page_to_char( const char *txt, CHAR_DATA *ch ) +void page_to_char_bw( const char *txt, CHAR_DATA *ch ) { if ( txt == NULL || ch->desc == NULL) if (ch->lines == 0 ) { - send_to_char(txt,ch); + send_to_char_bw( txt, ch ); return; } #if defined(macintosh) - send_to_char(txt,ch); + send_to_char_bw(txt,ch); #else ch->desc->showstr_head = alloc_mem(strlen(txt) + 1); strcpy(ch->desc->showstr_head,txt); @@ -2337,6 +2395,66 @@ #endif } +/* + * Page to one char, new colour version, by Lope. + */ +void page_to_char( const char *txt, CHAR_DATA *ch ) +{ + const char *point; + char *point2; + char buf[ MAX_STRING_LENGTH * 4 ]; + int skip = 0; + +#if defined(macintosh) + send_to_char( txt, ch ); +#else + buf[0] = '\0'; + point2 = buf; + if( txt && ch->desc ) + { + if( IS_SET( ch->act, PLR_COLOUR ) ) + { + for( point = txt ; *point ; point++ ) + { + if( *point == '{' ) + { + point++; + skip = colour( *point, ch, point2 ); + while( skip-- > 0 ) + ++point2; + continue; + } + *point2 = *point; + *++point2 = '\0'; + } + *point2 = '\0'; + ch->desc->showstr_head = alloc_mem( strlen( buf ) + 1 ); + strcpy( ch->desc->showstr_head, buf ); + ch->desc->showstr_point = ch->desc->showstr_head; + show_string( ch->desc, "" ); + } + else + { + for( point = txt ; *point ; point++ ) + { + if( *point == '{' ) + { + point++; + continue; + } + *point2 = *point; + *++point2 = '\0'; + } + *point2 = '\0'; + ch->desc->showstr_head = alloc_mem( strlen( buf ) + 1 ); + strcpy( ch->desc->showstr_head, buf ); + ch->desc->showstr_point = ch->desc->showstr_head; + show_string( ch->desc, "" ); + } + } +#endif + return; +} /* string pager */ void show_string(struct descriptor_data *d, char *input) @@ -2414,67 +2532,72 @@ static char * const him_her [] = { "it", "him", "her" }; static char * const his_her [] = { "its", "his", "her" }; - char buf[MAX_STRING_LENGTH]; - char fname[MAX_INPUT_LENGTH]; - CHAR_DATA *to; - CHAR_DATA *vch = (CHAR_DATA *) arg2; - OBJ_DATA *obj1 = (OBJ_DATA *) arg1; - OBJ_DATA *obj2 = (OBJ_DATA *) arg2; - const char *str; - const char *i; - char *point; - + CHAR_DATA *to; + CHAR_DATA *vch = ( CHAR_DATA * ) arg2; + OBJ_DATA *obj1 = ( OBJ_DATA * ) arg1; + OBJ_DATA *obj2 = ( OBJ_DATA * ) arg2; + const char *str; + char *i = NULL; + char *point; + char *pbuff; + char buffer[ MAX_STRING_LENGTH*2 ]; + char buf[ MAX_STRING_LENGTH ]; + char fname[ MAX_INPUT_LENGTH ]; + bool fColour = FALSE; + /* * Discard null and zero-length messages. */ - if ( format == NULL || format[0] == '\0' ) + if( !format || !*format ) return; /* discard null rooms and chars */ - if (ch == NULL || ch->in_room == NULL) + if( !ch || !ch->in_room ) return; to = ch->in_room->people; - if ( type == TO_VICT ) + if( type == TO_VICT ) { - if ( vch == NULL ) + if( !vch ) { bug( "Act: null vch with TO_VICT.", 0 ); return; } - if (vch->in_room == NULL) + if( !vch->in_room ) return; to = vch->in_room->people; } - for ( ; to != NULL; to = to->next_in_room ) + for( ; to ; to = to->next_in_room ) { - if ( to->desc == NULL || to->position < min_pos ) + if( !to->desc || to->position < min_pos ) continue; - if ( (type == TO_CHAR) && to != ch ) + if( ( type == TO_CHAR ) && to != ch ) continue; - if ( type == TO_VICT && ( to != vch || to == ch ) ) + if( type == TO_VICT && ( to != vch || to == ch ) ) continue; - if ( type == TO_ROOM && to == ch ) + if( type == TO_ROOM && to == ch ) continue; - if ( type == TO_NOTVICT && (to == ch || to == vch) ) + if( type == TO_NOTVICT && (to == ch || to == vch) ) continue; point = buf; str = format; - while ( *str != '\0' ) + while( *str != '\0' ) { - if ( *str != '$' ) + if( *str != '$' ) { *point++ = *str++; continue; } - ++str; - if ( arg2 == NULL && *str >= 'A' && *str <= 'Z' ) + fColour = TRUE; + ++str; + i = " <@@@> "; + if( !arg2 && *str >= 'A' && *str <= 'Z' ) { bug( "Act: missing arg2 for code %d.", *str ); i = " <@@@> "; @@ -2530,15 +2653,16 @@ *point++ = '\n'; *point++ = '\r'; + *point = '\0'; buf[0] = UPPER(buf[0]); - write_to_buffer( to->desc, buf, point - buf ); + pbuff = buffer; + colourconv( pbuff, buf, to ); + write_to_buffer( to->desc, buffer, 0 ); } return; } - - /* * Macintosh support functions. */ @@ -2549,3 +2673,370 @@ tp->tv_usec = 0; } #endif + +int colour( char type, CHAR_DATA *ch, char *string ) +{ + PC_DATA *col; + char code[ 20 ]; + char *p = '\0'; + + if( IS_NPC( ch ) ) + return( 0 ); + + col = ch->pcdata; + + switch( type ) + { + default: + strcpy( code, CLEAR ); + break; + case 'x': + strcpy( code, CLEAR ); + break; + case 'p': + if( col->prompt[2] ) + sprintf( code, "\e[%d;3%dm%c", col->prompt[0], col->prompt[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->prompt[0], col->prompt[1] ); + break; + case 's': + if( col->room_title[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->room_title[0], col->room_title[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->room_title[0], col->room_title[1] ); + break; + case 'S': + if( col->room_text[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->room_text[0], col->room_text[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->room_text[0], col->room_text[1] ); + break; + case 'd': + if( col->gossip[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->gossip[0], col->gossip[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->gossip[0], col->gossip[1] ); + break; + case '9': + if( col->gossip_text[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->gossip_text[0], col->gossip_text[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->gossip_text[0], col->gossip_text[1] ); + break; + case 'Z': + if( col->wiznet[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->wiznet[0], col->wiznet[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->wiznet[0], col->wiznet[1] ); + break; + case 'o': + if( col->room_exits[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->room_exits[0], col->room_exits[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->room_exits[0], col->room_exits[1] ); + break; + case 'O': + if( col->room_things[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->room_things[0], col->room_things[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->room_things[0], col->room_things[1] ); + break; + case 'i': + if( col->immtalk_text[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->immtalk_text[0], col->immtalk_text[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", + col->immtalk_text[0], col->immtalk_text[1] ); + break; + case 'I': + if( col->immtalk_type[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->immtalk_type[0], col->immtalk_type[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", + col->immtalk_type[0], col->immtalk_type[1] ); + break; + case '2': + if( col->fight_yhit[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->fight_yhit[0], col->fight_yhit[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->fight_yhit[0], col->fight_yhit[1] ); + break; + case '3': + if( col->fight_ohit[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->fight_ohit[0], col->fight_ohit[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->fight_ohit[0], col->fight_ohit[1] ); + break; + case '4': + if( col->fight_thit[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->fight_thit[0], col->fight_thit[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->fight_thit[0], col->fight_thit[1] ); + break; + case '5': + if( col->fight_skill[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->fight_skill[0], col->fight_skill[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->fight_skill[0], col->fight_skill[1] ); + break; + case '1': + if( col->fight_death[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->fight_death[0], col->fight_death[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->fight_death[0], col->fight_death[1] ); + break; + case '6': + if( col->say[2] ) + sprintf( code, "\e[%d;3%dm%c", col->say[0], col->say[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->say[0], col->say[1] ); + break; + case '7': + if( col->say_text[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->say_text[0], col->say_text[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->say_text[0], col->say_text[1] ); + break; + case 'k': + if( col->tell[2] ) + sprintf( code, "\e[%d;3%dm%c", col->tell[0], col->tell[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->tell[0], col->tell[1] ); + break; + case 'K': + if( col->tell_text[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->tell_text[0], col->tell_text[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->tell_text[0], col->tell_text[1] ); + break; + case 'l': + if( col->reply[2] ) + sprintf( code, "\e[%d;3%dm%c", col->reply[0], col->reply[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->reply[0], col->reply[1] ); + break; + case 'L': + if( col->reply_text[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->reply_text[0], col->reply_text[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->reply_text[0], col->reply_text[1] ); + break; + case 'n': + if( col->gtell_text[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->gtell_text[0], col->gtell_text[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->gtell_text[0], col->gtell_text[1] ); + break; + case 'N': + if( col->gtell_type[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->gtell_type[0], col->gtell_type[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->gtell_type[0], col->gtell_type[1] ); + break; + case 'a': + if( col->auction[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->auction[0], col->auction[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->auction[0], col->auction[1] ); + break; + case 'A': + if( col->auction_text[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->auction_text[0], col->auction_text[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->auction_text[0], col->auction_text[1] ); + break; + case 'q': + if( col->question[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->question[0], col->question[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->question[0], col->question[1] ); + break; + case 'Q': + if( col->question_text[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->question_text[0], col->question_text[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", + col->question_text[0], col->question_text[1] ); + break; + case 'f': + if( col->answer[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->answer[0], col->answer[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->answer[0], col->answer[1] ); + break; + case 'F': + if( col->answer_text[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->answer_text[0], col->answer_text[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->answer_text[0], col->answer_text[1] ); + break; + case 'e': + if( col->music[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->music[0], col->music[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->music[0], col->music[1] ); + break; + case 'E': + if( col->music_text[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->music_text[0], col->music_text[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->music_text[0], col->music_text[1] ); + break; + case 'h': + if( col->quote[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->quote[0], col->quote[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->quote[0], col->quote[1] ); + break; + case 'H': + if( col->quote_text[2] ) + sprintf( code, "\e[%d;3%dm%c", + col->quote_text[0], col->quote_text[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->quote_text[0], col->quote_text[1] ); + break; + case 'j': + if( col->info[2] ) + sprintf( code, "\e[%d;3%dm%c", col->info[0], col->info[1], '\a' ); + else + sprintf( code, "\e[%d;3%dm", col->info[0], col->info[1] ); + break; + case 'b': + strcpy( code, C_BLUE ); + break; + case 'c': + strcpy( code, C_CYAN ); + break; + case 'g': + strcpy( code, C_GREEN ); + break; + case 'm': + strcpy( code, C_MAGENTA ); + break; + case 'r': + strcpy( code, C_RED ); + break; + case 'w': + strcpy( code, C_WHITE ); + break; + case 'y': + strcpy( code, C_YELLOW ); + break; + case 'B': + strcpy( code, C_B_BLUE ); + break; + case 'C': + strcpy( code, C_B_CYAN ); + break; + case 'G': + strcpy( code, C_B_GREEN ); + break; + case 'M': + strcpy( code, C_B_MAGENTA ); + break; + case 'R': + strcpy( code, C_B_RED ); + break; + case 'W': + strcpy( code, C_B_WHITE ); + break; + case 'Y': + strcpy( code, C_B_YELLOW ); + break; + case 'D': + strcpy( code, C_D_GREY ); + break; + case '*': + sprintf( code, "%c", '\a' ); + break; + case '/': + strcpy( code, "\n\r" ); + break; + case '-': + sprintf( code, "%c", '~' ); + break; + case '{': + sprintf( code, "%c", '{' ); + break; + } + + p = code; + while( *p != '\0' ) + { + *string = *p++; + *++string = '\0'; + } + + return( strlen( code ) ); +} + +void colourconv( char *buffer, const char *txt, CHAR_DATA *ch ) +{ + const char *point; + int skip = 0; + + if( ch->desc && txt ) + { + if( IS_SET( ch->act, PLR_COLOUR ) ) + { + for( point = txt ; *point ; point++ ) + { + if( *point == '{' ) + { + point++; + skip = colour( *point, ch, buffer ); + while( skip-- > 0 ) + ++buffer; + continue; + } + *buffer = *point; + *++buffer = '\0'; + } + *buffer = '\0'; + } + else + { + for( point = txt ; *point ; point++ ) + { + if( *point == '{' ) + { + point++; + continue; + } + *buffer = *point; + *++buffer = '\0'; + } + *buffer = '\0'; + } + } + return; +} + diff -ur Rom24/src/fight.c rom24_colour_v2.0/src/fight.c --- Rom24/src/fight.c Thu Jul 18 13:43:57 1996 +++ rom24_colour_v2.0/src/fight.c Sun May 3 18:05:22 1998 @@ -2342,14 +2342,14 @@ { if (ch == victim) { - sprintf( buf1, "$n %s $melf%c",vp,punct); - sprintf( buf2, "You %s yourself%c",vs,punct); + sprintf( buf1, "{3$n %s $melf%c{x",vp,punct); + sprintf( buf2, "{2You %s yourself%c{x",vs,punct); } else { - sprintf( buf1, "$n %s $N%c", vp, punct ); - sprintf( buf2, "You %s $N%c", vs, punct ); - sprintf( buf3, "$n %s you%c", vp, punct ); + sprintf( buf1, "{3$n %s $N%c{x", vp, punct ); + sprintf( buf2, "{2You %s $N%c{x", vs, punct ); + sprintf( buf3, "{4$n %s you%c{x", vp, punct ); } } else @@ -2370,28 +2370,28 @@ { if (ch == victim) { - sprintf(buf1,"$n is unaffected by $s own %s.",attack); - sprintf(buf2,"Luckily, you are immune to that."); + sprintf(buf1,"{3$n is unaffected by $s own %s.{x",attack); + sprintf(buf2,"{2Luckily, you are immune to that.{x"); } else { - sprintf(buf1,"$N is unaffected by $n's %s!",attack); - sprintf(buf2,"$N is unaffected by your %s!",attack); - sprintf(buf3,"$n's %s is powerless against you.",attack); + sprintf(buf1,"{3$N is unaffected by $n's %s!{x",attack); + sprintf(buf2,"{2$N is unaffected by your %s!{x",attack); + sprintf(buf3,"{4$n's %s is powerless against you.{x",attack); } } else { if (ch == victim) { - sprintf( buf1, "$n's %s %s $m%c",attack,vp,punct); - sprintf( buf2, "Your %s %s you%c",attack,vp,punct); + sprintf( buf1, "{3$n's %s %s $m%c{x",attack,vp,punct); + sprintf( buf2, "{2Your %s %s you%c{x",attack,vp,punct); } else { - sprintf( buf1, "$n's %s %s $N%c", attack, vp, punct ); - sprintf( buf2, "Your %s %s $N%c", attack, vp, punct ); - sprintf( buf3, "$n's %s %s you%c", attack, vp, punct ); + sprintf( buf1, "{3$n's %s %s $N%c{x", attack, vp, punct ); + sprintf( buf2, "{2Your %s %s $N%c{x", attack, vp, punct ); + sprintf( buf3, "{4$n's %s %s you%c{x", attack, vp, punct ); } } } @@ -2426,17 +2426,17 @@ if ( IS_OBJ_STAT(obj,ITEM_NOREMOVE)) { - act("$S weapon won't budge!",ch,NULL,victim,TO_CHAR); - act("$n tries to disarm you, but your weapon won't budge!", + act("{5$S weapon won't budge!{x",ch,NULL,victim,TO_CHAR); + act("{5$n tries to disarm you, but your weapon won't budge!{x", ch,NULL,victim,TO_VICT); - act("$n tries to disarm $N, but fails.",ch,NULL,victim,TO_NOTVICT); + act("{5$n tries to disarm $N, but fails.{x",ch,NULL,victim,TO_NOTVICT); return; } - act( "$n DISARMS you and sends your weapon flying!", + act( "{5$n DISARMS you and sends your weapon flying!{x", ch, NULL, victim, TO_VICT ); - act( "You disarm $N!", ch, NULL, victim, TO_CHAR ); - act( "$n disarms $N!", ch, NULL, victim, TO_NOTVICT ); + act( "{5You disarm $N!{x", ch, NULL, victim, TO_CHAR ); + act( "{5$n disarms $N!{x", ch, NULL, victim, TO_NOTVICT ); obj_from_char( obj ); if ( IS_OBJ_STAT(obj,ITEM_NODROP) || IS_OBJ_STAT(obj,ITEM_INVENTORY) ) @@ -2628,8 +2628,8 @@ if (!IS_NPC(victim) && chance < get_skill(victim,gsn_dodge) ) { /* - act("$n tries to bash you, but you dodge it.",ch,NULL,victim,TO_VICT); - act("$N dodges your bash, you fall flat on your face.",ch,NULL,victim,TO_CHAR); + act("{5$n tries to bash you, but you dodge it.{x",ch,NULL,victim,TO_VICT); + act("{5$N dodges your bash, you fall flat on your face.{x",ch,NULL,victim,TO_CHAR); WAIT_STATE(ch,skill_table[gsn_bash].beats); return;*/ chance -= 3 * (get_skill(victim,gsn_dodge) - chance); @@ -2639,10 +2639,10 @@ if (number_percent() < chance ) { - act("$n sends you sprawling with a powerful bash!", + act("{5$n sends you sprawling with a powerful bash!{x", ch,NULL,victim,TO_VICT); - act("You slam into $N, and send $M flying!",ch,NULL,victim,TO_CHAR); - act("$n sends $N sprawling with a powerful bash.", + act("{5You slam into $N, and send $M flying!{x",ch,NULL,victim,TO_CHAR); + act("{5$n sends $N sprawling with a powerful bash.{x", ch,NULL,victim,TO_NOTVICT); check_improve(ch,gsn_bash,TRUE,1); @@ -2656,11 +2656,11 @@ else { damage(ch,victim,0,gsn_bash,DAM_BASH,FALSE); - act("You fall flat on your face!", + act("{5You fall flat on your face!{x", ch,NULL,victim,TO_CHAR); - act("$n falls flat on $s face.", + act("{5$n falls flat on $s face.{x", ch,NULL,victim,TO_NOTVICT); - act("You evade $n's bash, causing $m to fall flat on $s face.", + act("{5You evade $n's bash, causing $m to fall flat on $s face.{x", ch,NULL,victim,TO_VICT); check_improve(ch,gsn_bash,FALSE,1); ch->position = POS_RESTING; @@ -2776,10 +2776,10 @@ if (number_percent() < chance) { AFFECT_DATA af; - act("$n is blinded by the dirt in $s eyes!",victim,NULL,NULL,TO_ROOM); - act("$n kicks dirt in your eyes!",ch,NULL,victim,TO_VICT); + act("{5$n is blinded by the dirt in $s eyes!{x",victim,NULL,NULL,TO_ROOM); + act("{5$n kicks dirt in your eyes!{x",ch,NULL,victim,TO_VICT); damage(ch,victim,number_range(2,5),gsn_dirt,DAM_NONE,FALSE); - send_to_char("You can't see a thing!\n\r",victim); + send_to_char("{5You can't see a thing!{x\n\r",victim); check_improve(ch,gsn_dirt,TRUE,2); WAIT_STATE(ch,skill_table[gsn_dirt].beats); @@ -2861,9 +2861,9 @@ if (victim == ch) { - send_to_char("You fall flat on your face!\n\r",ch); + send_to_char("{5You fall flat on your face!{x\n\r",ch); WAIT_STATE(ch,2 * skill_table[gsn_trip].beats); - act("$n trips over $s own feet!",ch,NULL,NULL,TO_ROOM); + act("{5$n trips over $s own feet!{x",ch,NULL,NULL,TO_ROOM); return; } @@ -2896,9 +2896,9 @@ /* now the attack */ if (number_percent() < chance) { - act("$n trips you and you go down!",ch,NULL,victim,TO_VICT); - act("You trip $N and $N goes down!",ch,NULL,victim,TO_CHAR); - act("$n trips $N, sending $M to the ground.",ch,NULL,victim,TO_NOTVICT); + act("{5$n trips you and you go down!{x",ch,NULL,victim,TO_VICT); + act("{5You trip $N and $N goes down!{x",ch,NULL,victim,TO_CHAR); + act("{5$n trips $N, sending $M to the ground.{x",ch,NULL,victim,TO_NOTVICT); check_improve(ch,gsn_trip,TRUE,1); DAZE_STATE(victim,2 * PULSE_VIOLENCE); @@ -3250,9 +3250,9 @@ return; } - act( "You rescue $N!", ch, NULL, victim, TO_CHAR ); - act( "$n rescues you!", ch, NULL, victim, TO_VICT ); - act( "$n rescues $N!", ch, NULL, victim, TO_NOTVICT ); + act( "{5You rescue $N!{x", ch, NULL, victim, TO_CHAR ); + act( "{5$n rescues you!{x", ch, NULL, victim, TO_VICT ); + act( "{5$n rescues $N!{x", ch, NULL, victim, TO_NOTVICT ); check_improve(ch,gsn_rescue,TRUE,1); stop_fighting( fch, FALSE ); @@ -3371,9 +3371,9 @@ else { WAIT_STATE(ch,skill_table[gsn_disarm].beats); - act("You fail to disarm $N.",ch,NULL,victim,TO_CHAR); - act("$n tries to disarm you, but fails.",ch,NULL,victim,TO_VICT); - act("$n tries to disarm $N, but fails.",ch,NULL,victim,TO_NOTVICT); + act("{5You fail to disarm $N.{x",ch,NULL,victim,TO_CHAR); + act("{5$n tries to disarm you, but fails.{x",ch,NULL,victim,TO_VICT); + act("{5$n tries to disarm $N, but fails.{x",ch,NULL,victim,TO_NOTVICT); check_improve(ch,gsn_disarm,FALSE,1); } check_killer(ch,victim); @@ -3420,9 +3420,9 @@ return; } - act( "You slay $M in cold blood!", ch, NULL, victim, TO_CHAR ); - act( "$n slays you in cold blood!", ch, NULL, victim, TO_VICT ); - act( "$n slays $N in cold blood!", ch, NULL, victim, TO_NOTVICT ); + act( "{1You slay $M in cold blood!{x", ch, NULL, victim, TO_CHAR ); + act( "{1$n slays you in cold blood!{x", ch, NULL, victim, TO_VICT ); + act( "{1$n slays $N in cold blood!{x", ch, NULL, victim, TO_NOTVICT ); raw_kill( victim ); return; } diff -ur Rom24/src/handler.c rom24_colour_v2.0/src/handler.c --- Rom24/src/handler.c Sat Jul 20 01:58:35 1996 +++ rom24_colour_v2.0/src/handler.c Sun May 3 20:26:30 1998 @@ -2909,3 +2909,299 @@ return ( buf[0] != '\0' ) ? buf+1 : "none"; } + +/* + * Config Colour stuff + */ +void default_colour( CHAR_DATA *ch ) +{ + if( IS_NPC( ch ) ) + return; + + if( !ch->pcdata ) + return; + + ch->pcdata->text[1] = ( WHITE ); + ch->pcdata->auction[1] = ( YELLOW ); + ch->pcdata->auction_text[1] = ( WHITE ); + ch->pcdata->gossip[1] = ( MAGENTA ); + ch->pcdata->gossip_text[1] = ( MAGENTA ); + ch->pcdata->music[1] = ( RED ); + ch->pcdata->music_text[1] = ( RED ); + ch->pcdata->question[1] = ( YELLOW ); + ch->pcdata->question_text[1] = ( WHITE ); + ch->pcdata->answer[1] = ( YELLOW ); + ch->pcdata->answer_text[1] = ( WHITE ); + ch->pcdata->quote[1] = ( GREEN ); + ch->pcdata->quote_text[1] = ( GREEN ); + ch->pcdata->immtalk_text[1] = ( CYAN ); + ch->pcdata->immtalk_type[1] = ( YELLOW ); + ch->pcdata->info[1] = ( YELLOW ); + ch->pcdata->tell[1] = ( GREEN ); + ch->pcdata->tell_text[1] = ( GREEN ); + ch->pcdata->say[1] = ( GREEN ); + ch->pcdata->say_text[1] = ( GREEN ); + ch->pcdata->reply[1] = ( GREEN ); + ch->pcdata->reply_text[1] = ( GREEN ); + ch->pcdata->gtell_text[1] = ( GREEN ); + ch->pcdata->gtell_type[1] = ( RED ); + ch->pcdata->wiznet[1] = ( GREEN ); + ch->pcdata->room_title[1] = ( CYAN ); + ch->pcdata->room_text[1] = ( WHITE ); + ch->pcdata->room_exits[1] = ( GREEN ); + ch->pcdata->room_things[1] = ( CYAN ); + ch->pcdata->prompt[1] = ( CYAN ); + ch->pcdata->fight_death[1] = ( RED ); + ch->pcdata->fight_yhit[1] = ( GREEN ); + ch->pcdata->fight_ohit[1] = ( YELLOW ); + ch->pcdata->fight_thit[1] = ( RED ); + ch->pcdata->fight_skill[1] = ( WHITE ); + ch->pcdata->text[0] = ( NORMAL ); + ch->pcdata->auction[0] = ( BRIGHT ); + ch->pcdata->auction_text[0] = ( BRIGHT ); + ch->pcdata->gossip[0] = ( NORMAL ); + ch->pcdata->gossip_text[0] = ( BRIGHT ); + ch->pcdata->music[0] = ( NORMAL ); + ch->pcdata->music_text[0] = ( BRIGHT ); + ch->pcdata->question[0] = ( BRIGHT ); + ch->pcdata->question_text[0] = ( BRIGHT ); + ch->pcdata->answer[0] = ( BRIGHT ); + ch->pcdata->answer_text[0] = ( BRIGHT ); + ch->pcdata->quote[0] = ( NORMAL ); + ch->pcdata->quote_text[0] = ( BRIGHT ); + ch->pcdata->immtalk_text[0] = ( NORMAL ); + ch->pcdata->immtalk_type[0] = ( NORMAL ); + ch->pcdata->info[0] = ( NORMAL ); + ch->pcdata->say[0] = ( NORMAL ); + ch->pcdata->say_text[0] = ( BRIGHT ); + ch->pcdata->tell[0] = ( NORMAL ); + ch->pcdata->tell_text[0] = ( BRIGHT ); + ch->pcdata->reply[0] = ( NORMAL ); + ch->pcdata->reply_text[0] = ( BRIGHT ); + ch->pcdata->gtell_text[0] = ( NORMAL ); + ch->pcdata->gtell_type[0] = ( NORMAL ); + ch->pcdata->wiznet[0] = ( NORMAL ); + ch->pcdata->room_title[0] = ( NORMAL ); + ch->pcdata->room_text[0] = ( NORMAL ); + ch->pcdata->room_exits[0] = ( NORMAL ); + ch->pcdata->room_things[0] = ( NORMAL ); + ch->pcdata->prompt[0] = ( NORMAL ); + ch->pcdata->fight_death[0] = ( NORMAL ); + ch->pcdata->fight_yhit[0] = ( NORMAL ); + ch->pcdata->fight_ohit[0] = ( NORMAL ); + ch->pcdata->fight_thit[0] = ( NORMAL ); + ch->pcdata->fight_skill[0] = ( NORMAL ); + ch->pcdata->text[2] = 0; + ch->pcdata->auction[2] = 0; + ch->pcdata->auction_text[2] = 0; + ch->pcdata->gossip[2] = 0; + ch->pcdata->gossip_text[2] = 0; + ch->pcdata->music[2] = 0; + ch->pcdata->music_text[2] = 0; + ch->pcdata->question[2] = 0; + ch->pcdata->question_text[2] = 0; + ch->pcdata->answer[2] = 0; + ch->pcdata->answer_text[2] = 0; + ch->pcdata->quote[2] = 0; + ch->pcdata->quote_text[2] = 0; + ch->pcdata->immtalk_text[2] = 0; + ch->pcdata->immtalk_type[2] = 0; + ch->pcdata->info[2] = 1; + ch->pcdata->say[2] = 0; + ch->pcdata->say_text[2] = 0; + ch->pcdata->tell[2] = 0; + ch->pcdata->tell_text[2] = 0; + ch->pcdata->reply[2] = 0; + ch->pcdata->reply_text[2] = 0; + ch->pcdata->gtell_text[2] = 0; + ch->pcdata->gtell_type[2] = 0; + ch->pcdata->wiznet[2] = 0; + ch->pcdata->room_title[2] = 0; + ch->pcdata->room_text[2] = 0; + ch->pcdata->room_exits[2] = 0; + ch->pcdata->room_things[2] = 0; + ch->pcdata->prompt[2] = 0; + ch->pcdata->fight_death[2] = 0; + ch->pcdata->fight_yhit[2] = 0; + ch->pcdata->fight_ohit[2] = 0; + ch->pcdata->fight_thit[2] = 0; + ch->pcdata->fight_skill[2] = 0; + + return; +} + +void all_colour( CHAR_DATA *ch, char *argument ) +{ + char buf[ 100 ]; + char buf2[ 100 ]; + int colour; + int bright; + + if( IS_NPC( ch ) || !ch->pcdata ) + return; + + if( !*argument ) + return; + + if( !str_prefix( argument, "red" ) ) + { + colour = ( RED ); + bright = NORMAL; + sprintf( buf2, "Red" ); + } + if( !str_prefix( argument, "hi-red" ) ) + { + colour = ( RED ); + bright = BRIGHT; + sprintf( buf2, "Red" ); + } + else if( !str_prefix( argument, "green" ) ) + { + colour = ( GREEN ); + bright = NORMAL; + sprintf( buf2, "Green" ); + } + else if( !str_prefix( argument, "hi-green" ) ) + { + colour = ( GREEN ); + bright = BRIGHT; + sprintf( buf2, "Green" ); + } + else if( !str_prefix( argument, "yellow" ) ) + { + colour = ( YELLOW ); + bright = NORMAL; + sprintf( buf2, "Yellow" ); + } + else if( !str_prefix( argument, "hi-yellow" ) ) + { + colour = ( YELLOW ); + bright = BRIGHT; + sprintf( buf2, "Yellow" ); + } + else if( !str_prefix( argument, "blue" ) ) + { + colour = ( BLUE ); + bright = NORMAL; + sprintf( buf2, "Blue" ); + } + else if( !str_prefix( argument, "hi-blue" ) ) + { + colour = ( BLUE ); + bright = BRIGHT; + sprintf( buf2, "Blue" ); + } + else if( !str_prefix( argument, "magenta" ) ) + { + colour = ( MAGENTA ); + bright = NORMAL; + sprintf( buf2, "Magenta" ); + } + else if( !str_prefix( argument, "hi-magenta" ) ) + { + colour = ( MAGENTA ); + bright = BRIGHT; + sprintf( buf2, "Magenta" ); + } + else if( !str_prefix( argument, "cyan" ) ) + { + colour = ( CYAN ); + bright = NORMAL; + sprintf( buf2, "Cyan" ); + } + else if( !str_prefix( argument, "hi-cyan" ) ) + { + colour = ( CYAN ); + bright = BRIGHT; + sprintf( buf2, "Cyan" ); + } + else if( !str_prefix( argument, "white" ) ) + { + colour = ( WHITE ); + bright = NORMAL; + sprintf( buf2, "White" ); + } + else if( !str_prefix( argument, "hi-white" ) ) + { + colour = ( WHITE ); + bright = BRIGHT; + sprintf( buf2, "White" ); + } + else if( !str_prefix( argument, "grey" ) ) + { + colour = ( BLACK ); + bright = BRIGHT; + sprintf( buf2, "White" ); + } + else + { + send_to_char_bw( "Unrecognised colour, unchanged.\n\r", ch ); + return; + } + + ch->pcdata->text[1] = colour; + ch->pcdata->auction[1] = colour; + ch->pcdata->gossip[1] = colour; + ch->pcdata->music[1] = colour; + ch->pcdata->question[1] = colour; + ch->pcdata->answer[1] = colour; + ch->pcdata->quote[1] = colour; + ch->pcdata->quote_text[1] = colour; + ch->pcdata->immtalk_text[1] = colour; + ch->pcdata->immtalk_type[1] = colour; + ch->pcdata->info[1] = colour; + ch->pcdata->say[1] = colour; + ch->pcdata->say_text[1] = colour; + ch->pcdata->tell[1] = colour; + ch->pcdata->tell_text[1] = colour; + ch->pcdata->reply[1] = colour; + ch->pcdata->reply_text[1] = colour; + ch->pcdata->gtell_text[1] = colour; + ch->pcdata->gtell_type[1] = colour; + ch->pcdata->wiznet[1] = colour; + ch->pcdata->room_title[1] = colour; + ch->pcdata->room_text[1] = colour; + ch->pcdata->room_exits[1] = colour; + ch->pcdata->room_things[1] = colour; + ch->pcdata->prompt[1] = colour; + ch->pcdata->fight_death[1] = colour; + ch->pcdata->fight_yhit[1] = colour; + ch->pcdata->fight_ohit[1] = colour; + ch->pcdata->fight_thit[1] = colour; + ch->pcdata->fight_skill[1] = colour; + ch->pcdata->text[0] = bright; + ch->pcdata->auction[0] = bright; + ch->pcdata->gossip[0] = bright; + ch->pcdata->music[0] = bright; + ch->pcdata->question[0] = bright; + ch->pcdata->answer[0] = bright; + ch->pcdata->quote[0] = bright; + ch->pcdata->quote_text[0] = bright; + ch->pcdata->immtalk_text[0] = bright; + ch->pcdata->immtalk_type[0] = bright; + ch->pcdata->info[0] = bright; + ch->pcdata->say[0] = bright; + ch->pcdata->say_text[0] = bright; + ch->pcdata->tell[0] = bright; + ch->pcdata->tell_text[0] = bright; + ch->pcdata->reply[0] = bright; + ch->pcdata->reply_text[0] = bright; + ch->pcdata->gtell_text[0] = bright; + ch->pcdata->gtell_type[0] = bright; + ch->pcdata->wiznet[0] = bright; + ch->pcdata->room_title[0] = bright; + ch->pcdata->room_text[0] = bright; + ch->pcdata->room_exits[0] = bright; + ch->pcdata->room_things[0] = bright; + ch->pcdata->prompt[0] = bright; + ch->pcdata->fight_death[0] = bright; + ch->pcdata->fight_yhit[0] = bright; + ch->pcdata->fight_ohit[0] = bright; + ch->pcdata->fight_thit[0] = bright; + ch->pcdata->fight_skill[0] = bright; + + sprintf( buf, "All Colour settings set to %s.\n\r", buf2 ); + send_to_char_bw( buf, ch ); + + return; +} diff -ur Rom24/src/interp.c rom24_colour_v2.0/src/interp.c --- Rom24/src/interp.c Thu Jul 18 13:44:10 1996 +++ rom24_colour_v2.0/src/interp.c Sun May 3 18:35:47 1998 @@ -157,6 +157,8 @@ { "autosplit", do_autosplit, POS_DEAD, 0, LOG_NORMAL, 1 }, { "brief", do_brief, POS_DEAD, 0, LOG_NORMAL, 1 }, /* { "channels", do_channels, POS_DEAD, 0, LOG_NORMAL, 1 }, */ + { "colour", do_colour, POS_DEAD, 0, LOG_NORMAL, 1 }, + { "color", do_colour, POS_DEAD, 0, LOG_NORMAL, 1 }, { "combine", do_combine, POS_DEAD, 0, LOG_NORMAL, 1 }, { "compact", do_compact, POS_DEAD, 0, LOG_NORMAL, 1 }, { "description", do_description, POS_DEAD, 0, LOG_NORMAL, 1 }, diff -ur Rom24/src/interp.h rom24_colour_v2.0/src/interp.h --- Rom24/src/interp.h Thu Jul 18 13:44:49 1996 +++ rom24_colour_v2.0/src/interp.h Sun May 3 18:38:23 1998 @@ -95,6 +95,7 @@ DECLARE_DO_FUN( do_channels ); DECLARE_DO_FUN( do_clone ); DECLARE_DO_FUN( do_close ); +DECLARE_DO_FUN( do_colour ); DECLARE_DO_FUN( do_commands ); DECLARE_DO_FUN( do_combine ); DECLARE_DO_FUN( do_compact ); diff -ur Rom24/src/merc.h rom24_colour_v2.0/src/merc.h --- Rom24/src/merc.h Thu Jul 18 13:44:58 1996 +++ rom24_colour_v2.0/src/merc.h Sun May 3 20:23:00 1998 @@ -99,6 +99,7 @@ typedef struct shop_data SHOP_DATA; typedef struct time_info_data TIME_INFO_DATA; typedef struct weather_data WEATHER_DATA; +typedef struct colour_data COLOUR_DATA; @@ -158,6 +159,147 @@ #define AVATAR (MAX_LEVEL - 8) #define HERO LEVEL_HERO +/* + * ColoUr stuff v2.0, by Lope. + */ +#define CLEAR "\e[0m" /* Resets Colour */ +#define C_RED "\e[0;31m" /* Normal Colours */ +#define C_GREEN "\e[0;32m" +#define C_YELLOW "\e[0;33m" +#define C_BLUE "\e[0;34m" +#define C_MAGENTA "\e[0;35m" +#define C_CYAN "\e[0;36m" +#define C_WHITE "\e[0;37m" +#define C_D_GREY "\e[1;30m" /* Light Colors */ +#define C_B_RED "\e[1;31m" +#define C_B_GREEN "\e[1;32m" +#define C_B_YELLOW "\e[1;33m" +#define C_B_BLUE "\e[1;34m" +#define C_B_MAGENTA "\e[1;35m" +#define C_B_CYAN "\e[1;36m" +#define C_B_WHITE "\e[1;37m" + +#define COLOUR_NONE 7 /* White, hmm... */ +#define RED 1 /* Normal Colours */ +#define GREEN 2 +#define YELLOW 3 +#define BLUE 4 +#define MAGENTA 5 +#define CYAN 6 +#define WHITE 7 +#define BLACK 0 + +#define NORMAL 0 /* Bright/Normal colours */ +#define BRIGHT 1 + +#define ALTER_COLOUR( type ) if( !str_prefix( argument, "red" ) ) \ + { \ + ch->pcdata->type[0] = NORMAL; \ + ch->pcdata->type[1] = RED; \ + } \ + else if( !str_prefix( argument, "hi-red" ) ) \ + { \ + ch->pcdata->type[0] = BRIGHT; \ + ch->pcdata->type[1] = RED; \ + } \ + else if( !str_prefix( argument, "green" ) ) \ + { \ + ch->pcdata->type[0] = NORMAL; \ + ch->pcdata->type[1] = GREEN; \ + } \ + else if( !str_prefix( argument, "hi-green" ) ) \ + { \ + ch->pcdata->type[0] = BRIGHT; \ + ch->pcdata->type[1] = GREEN; \ + } \ + else if( !str_prefix( argument, "yellow" ) ) \ + { \ + ch->pcdata->type[0] = NORMAL; \ + ch->pcdata->type[1] = YELLOW; \ + } \ + else if( !str_prefix( argument, "hi-yellow" ) ) \ + { \ + ch->pcdata->type[0] = BRIGHT; \ + ch->pcdata->type[1] = YELLOW; \ + } \ + else if( !str_prefix( argument, "blue" ) ) \ + { \ + ch->pcdata->type[0] = NORMAL; \ + ch->pcdata->type[1] = BLUE; \ + } \ + else if( !str_prefix( argument, "hi-blue" ) ) \ + { \ + ch->pcdata->type[0] = BRIGHT; \ + ch->pcdata->type[1] = BLUE; \ + } \ + else if( !str_prefix( argument, "magenta" ) ) \ + { \ + ch->pcdata->type[0] = NORMAL; \ + ch->pcdata->type[1] = MAGENTA; \ + } \ + else if( !str_prefix( argument, "hi-magenta" ) ) \ + { \ + ch->pcdata->type[0] = BRIGHT; \ + ch->pcdata->type[1] = MAGENTA; \ + } \ + else if( !str_prefix( argument, "cyan" ) ) \ + { \ + ch->pcdata->type[0] = NORMAL; \ + ch->pcdata->type[1] = CYAN; \ + } \ + else if( !str_prefix( argument, "hi-cyan" ) ) \ + { \ + ch->pcdata->type[0] = BRIGHT; \ + ch->pcdata->type[1] = CYAN; \ + } \ + else if( !str_prefix( argument, "white" ) ) \ + { \ + ch->pcdata->type[0] = NORMAL; \ + ch->pcdata->type[1] = WHITE; \ + } \ + else if( !str_prefix( argument, "hi-white" ) ) \ + { \ + ch->pcdata->type[0] = BRIGHT; \ + ch->pcdata->type[1] = WHITE; \ + } \ + else if( !str_prefix( argument, "grey" ) ) \ + { \ + ch->pcdata->type[0] = BRIGHT; \ + ch->pcdata->type[1] = BLACK; \ + } \ + else if( !str_prefix( argument, "beep" ) ) \ + { \ + ch->pcdata->type[2] = 1; \ + } \ + else if( !str_prefix( argument, "nobeep" ) ) \ + { \ + ch->pcdata->type[2] = 0; \ + } \ + else \ + { \ + send_to_char_bw( "Unrecognised colour, unchanged.\n\r", ch ); \ + return; \ + } + +#define LOAD_COLOUR( field ) ch->pcdata->field[1] = fread_number( fp ); \ + if( ch->pcdata->field[1] > 100 ) \ + { \ + ch->pcdata->field[1] -= 100; \ + ch->pcdata->field[2] = 1; \ + } \ + else \ + { \ + ch->pcdata->field[2] = 0; \ + } \ + if( ch->pcdata->field[1] > 10 ) \ + { \ + ch->pcdata->field[1] -= 10; \ + ch->pcdata->field[0] = 1; \ + } \ + else \ + { \ + ch->pcdata->field[0] = 0; \ + } /* @@ -1229,7 +1371,8 @@ #define PLR_CANLOOT (P) #define PLR_NOSUMMON (Q) #define PLR_NOFOLLOW (R) -/* 2 bits reserved, S-T */ +#define PLR_COLOUR (T) +/* 1 bit reserved, S */ /* penalty flags */ #define PLR_PERMIT (U) @@ -1454,6 +1597,7 @@ { PC_DATA * next; BUFFER * buffer; + COLOUR_DATA * code; /* Data for coloUr configuration */ bool valid; char * pwd; char * bamfin; @@ -1476,6 +1620,45 @@ bool confirm_delete; char * alias[MAX_ALIAS]; char * alias_sub[MAX_ALIAS]; + + /* + * Colour data stuff for config. + */ + int text[3]; /* {t */ + int auction[3]; /* {a */ + int auction_text[3]; /* {A */ + int gossip[3]; /* {d */ + int gossip_text[3]; /* {9 */ + int music[3]; /* {e */ + int music_text[3]; /* {E */ + int question[3]; /* {q */ + int question_text[3]; /* {Q */ + int answer[3]; /* {f */ + int answer_text[3]; /* {F */ + int quote[3]; /* {h */ + int quote_text[3]; /* {H */ + int immtalk_text[3]; /* {i */ + int immtalk_type[3]; /* {I */ + int info[3]; /* {j */ + int say[3]; /* {6 */ + int say_text[3]; /* {7 */ + int tell[3]; /* {k */ + int tell_text[3]; /* {K */ + int reply[3]; /* {l */ + int reply_text[3]; /* {L */ + int gtell_text[3]; /* {n */ + int gtell_type[3]; /* {N */ + int wiznet[3]; /* {B */ + int room_title[3]; /* {s */ + int room_text[3]; /* {S */ + int room_exits[3]; /* {o */ + int room_things[3]; /* {O */ + int prompt[3]; /* {p */ + int fight_death[3]; /* {1 */ + int fight_yhit[3]; /* {2 */ + int fight_ohit[3]; /* {3 */ + int fight_thit[3]; /* {4 */ + int fight_skill[3]; /* {5 */ }; /* Data for generating characters -- only used during generation */ @@ -2115,6 +2298,13 @@ void act_new args( ( const char *format, CHAR_DATA *ch, const void *arg1, const void *arg2, int type, int min_pos) ); +/* + * Colour stuff by Lope + */ +int colour args( ( char type, CHAR_DATA *ch, char *string ) ); +void colourconv args( ( char *buffer, const char *txt, CHAR_DATA *ch ) ); +void send_to_char_bw args( ( const char *txt, CHAR_DATA *ch ) ); +void page_to_char_bw args( ( const char *txt, CHAR_DATA *ch ) ); /* db.c */ char * print_flags args( ( int flag )); @@ -2270,6 +2460,11 @@ char * weapon_bit_name args( ( int weapon_flags ) ); char * comm_bit_name args( ( int comm_flags ) ); char * cont_bit_name args( ( int cont_flags) ); +/* + * Colour Config + */ +void default_colour args( ( CHAR_DATA *ch ) ); +void all_colour args( ( CHAR_DATA *ch, char *argument ) ); /* interp.c */ diff -ur Rom24/src/recycle.c rom24_colour_v2.0/src/recycle.c --- Rom24/src/recycle.c Thu Jul 18 13:44:27 1996 +++ rom24_colour_v2.0/src/recycle.c Sun May 3 18:05:22 1998 @@ -639,15 +639,3 @@ { return buffer->string; } - - - - - - - - - - - - diff -ur Rom24/src/save.c rom24_colour_v2.0/src/save.c --- Rom24/src/save.c Thu Jul 18 13:44:30 1996 +++ rom24_colour_v2.0/src/save.c Sun May 3 20:26:56 1998 @@ -178,7 +178,9 @@ fprintf( fp, "LnD %s~\n", ch->long_descr ); if (ch->description[0] != '\0') fprintf( fp, "Desc %s~\n", ch->description ); - if (ch->prompt != NULL || !str_cmp(ch->prompt,"<%hhp %mm %vmv> ")) + if( ch->prompt != NULL + || !str_cmp( ch->prompt,"<%hhp %mm %vmv> " ) + || !str_cmp( ch->prompt,"{c<%hhp %mm %vmv>{x " ) ) fprintf( fp, "Prom %s~\n", ch->prompt ); fprintf( fp, "Race %s~\n", pc_race_table[ch->race].name ); if (ch->clan) @@ -277,6 +279,122 @@ ch->pcdata->condition[2], ch->pcdata->condition[3] ); + /* + * Write Colour Config Information. + */ + fprintf( fp, "Coloura %d%d%d %d%d%d %d%d%d %d%d%d %d%d%d\n", + ch->pcdata->text[2], + ch->pcdata->text[0], + ch->pcdata->text[1], + ch->pcdata->auction[2], + ch->pcdata->auction[0], + ch->pcdata->auction[1], + ch->pcdata->gossip[2], + ch->pcdata->gossip[0], + ch->pcdata->gossip[1], + ch->pcdata->music[2], + ch->pcdata->music[0], + ch->pcdata->music[1], + ch->pcdata->question[2], + ch->pcdata->question[0], + ch->pcdata->question[1] ); + fprintf( fp, "Colourb %d%d%d %d%d%d %d%d%d %d%d%d %d%d%d\n", + ch->pcdata->answer[2], + ch->pcdata->answer[0], + ch->pcdata->answer[1], + ch->pcdata->quote[2], + ch->pcdata->quote[0], + ch->pcdata->quote[1], + ch->pcdata->quote_text[2], + ch->pcdata->quote_text[0], + ch->pcdata->quote_text[1], + ch->pcdata->immtalk_text[2], + ch->pcdata->immtalk_text[0], + ch->pcdata->immtalk_text[1], + ch->pcdata->immtalk_type[2], + ch->pcdata->immtalk_type[0], + ch->pcdata->immtalk_type[1] ); + fprintf( fp, "Colourc %d%d%d %d%d%d %d%d%d %d%d%d %d%d%d\n", + ch->pcdata->info[2], + ch->pcdata->info[0], + ch->pcdata->info[1], + ch->pcdata->tell[2], + ch->pcdata->tell[0], + ch->pcdata->tell[1], + ch->pcdata->reply[2], + ch->pcdata->reply[0], + ch->pcdata->reply[1], + ch->pcdata->gtell_text[2], + ch->pcdata->gtell_text[0], + ch->pcdata->gtell_text[1], + ch->pcdata->gtell_type[2], + ch->pcdata->gtell_type[0], + ch->pcdata->gtell_type[1] ); + fprintf( fp, "Colourd %d%d%d %d%d%d %d%d%d %d%d%d %d%d%d\n", + ch->pcdata->room_title[2], + ch->pcdata->room_title[0], + ch->pcdata->room_title[1], + ch->pcdata->room_text[2], + ch->pcdata->room_text[0], + ch->pcdata->room_text[1], + ch->pcdata->room_exits[2], + ch->pcdata->room_exits[0], + ch->pcdata->room_exits[1], + ch->pcdata->room_things[2], + ch->pcdata->room_things[0], + ch->pcdata->room_things[1], + ch->pcdata->prompt[2], + ch->pcdata->prompt[0], + ch->pcdata->prompt[1] ); + fprintf( fp, "Coloure %d%d%d %d%d%d %d%d%d %d%d%d %d%d%d\n", + ch->pcdata->fight_death[2], + ch->pcdata->fight_death[0], + ch->pcdata->fight_death[1], + ch->pcdata->fight_yhit[2], + ch->pcdata->fight_yhit[0], + ch->pcdata->fight_yhit[1], + ch->pcdata->fight_ohit[2], + ch->pcdata->fight_ohit[0], + ch->pcdata->fight_ohit[1], + ch->pcdata->fight_thit[2], + ch->pcdata->fight_thit[0], + ch->pcdata->fight_thit[1], + ch->pcdata->fight_skill[2], + ch->pcdata->fight_skill[0], + ch->pcdata->fight_skill[1] ); + fprintf( fp, "Colourf %d%d%d %d%d%d %d%d%d %d%d%d %d%d%d\n", + ch->pcdata->wiznet[2], + ch->pcdata->wiznet[0], + ch->pcdata->wiznet[1], + ch->pcdata->say[2], + ch->pcdata->say[0], + ch->pcdata->say[1], + ch->pcdata->say_text[2], + ch->pcdata->say_text[0], + ch->pcdata->say_text[1], + ch->pcdata->tell_text[2], + ch->pcdata->tell_text[0], + ch->pcdata->tell_text[1], + ch->pcdata->reply_text[2], + ch->pcdata->reply_text[0], + ch->pcdata->reply_text[1] ); + fprintf( fp, "Colourg %d%d%d %d%d%d %d%d%d %d%d%d %d%d%d\n", + ch->pcdata->auction_text[2], + ch->pcdata->auction_text[0], + ch->pcdata->auction_text[1], + ch->pcdata->gossip_text[2], + ch->pcdata->gossip_text[0], + ch->pcdata->gossip_text[1], + ch->pcdata->music_text[2], + ch->pcdata->music_text[0], + ch->pcdata->music_text[1], + ch->pcdata->question_text[2], + ch->pcdata->question_text[0], + ch->pcdata->question_text[1], + ch->pcdata->answer_text[2], + ch->pcdata->answer_text[0], + ch->pcdata->answer_text[1] ); + /* write alias */ for (pos = 0; pos < MAX_ALIAS; pos++) { @@ -568,6 +686,112 @@ ch->pcdata->condition[COND_FULL] = 48; ch->pcdata->condition[COND_HUNGER] = 48; + ch->pcdata->text[0] = ( NORMAL ); + ch->pcdata->text[1] = ( WHITE ); + ch->pcdata->text[2] = 0; + ch->pcdata->auction[0] = ( BRIGHT ); + ch->pcdata->auction[1] = ( YELLOW ); + ch->pcdata->auction[2] = 0; + ch->pcdata->auction_text[0] = ( BRIGHT ); + ch->pcdata->auction_text[1] = ( WHITE ); + ch->pcdata->auction_text[2] = 0; + ch->pcdata->gossip[0] = ( NORMAL ); + ch->pcdata->gossip[1] = ( MAGENTA ); + ch->pcdata->gossip[2] = 0; + ch->pcdata->gossip_text[0] = ( BRIGHT ); + ch->pcdata->gossip_text[1] = ( MAGENTA ); + ch->pcdata->gossip_text[2] = 0; + ch->pcdata->music[0] = ( NORMAL ); + ch->pcdata->music[1] = ( RED ); + ch->pcdata->music[2] = 0; + ch->pcdata->music_text[0] = ( BRIGHT ); + ch->pcdata->music_text[1] = ( RED ); + ch->pcdata->music_text[2] = 0; + ch->pcdata->question[0] = ( BRIGHT ); + ch->pcdata->question[1] = ( YELLOW ); + ch->pcdata->question[2] = 0; + ch->pcdata->question_text[0] = ( BRIGHT ); + ch->pcdata->question_text[1] = ( WHITE ); + ch->pcdata->question_text[2] = 0; + ch->pcdata->answer[0] = ( BRIGHT ); + ch->pcdata->answer[1] = ( YELLOW ); + ch->pcdata->answer[2] = 0; + ch->pcdata->answer_text[0] = ( BRIGHT ); + ch->pcdata->answer_text[1] = ( WHITE ); + ch->pcdata->answer_text[2] = 0; + ch->pcdata->quote[0] = ( NORMAL ); + ch->pcdata->quote[1] = ( YELLOW ); + ch->pcdata->quote[2] = 0; + ch->pcdata->quote_text[0] = ( NORMAL ); + ch->pcdata->quote_text[1] = ( GREEN ); + ch->pcdata->quote_text[2] = 0; + ch->pcdata->immtalk_text[0] = ( NORMAL ); + ch->pcdata->immtalk_text[1] = ( CYAN ); + ch->pcdata->immtalk_text[2] = 0; + ch->pcdata->immtalk_type[0] = ( NORMAL ); + ch->pcdata->immtalk_type[1] = ( YELLOW ); + ch->pcdata->immtalk_type[2] = 0; + ch->pcdata->info[0] = ( BRIGHT ); + ch->pcdata->info[1] = ( YELLOW ); + ch->pcdata->info[2] = 1; + ch->pcdata->say[0] = ( NORMAL ); + ch->pcdata->say[1] = ( GREEN ); + ch->pcdata->say[2] = 0; + ch->pcdata->say_text[0] = ( BRIGHT ); + ch->pcdata->say_text[1] = ( GREEN ); + ch->pcdata->say_text[2] = 0; + ch->pcdata->tell[0] = ( NORMAL ); + ch->pcdata->tell[1] = ( GREEN ); + ch->pcdata->tell[2] = 0; + ch->pcdata->tell_text[0] = ( BRIGHT ); + ch->pcdata->tell_text[1] = ( GREEN ); + ch->pcdata->tell_text[2] = 0; + ch->pcdata->reply[0] = ( NORMAL ); + ch->pcdata->reply[1] = ( GREEN ); + ch->pcdata->reply[2] = 0; + ch->pcdata->reply_text[0] = ( BRIGHT ); + ch->pcdata->reply_text[1] = ( GREEN ); + ch->pcdata->reply_text[2] = 0; + ch->pcdata->gtell_text[0] = ( NORMAL ); + ch->pcdata->gtell_text[1] = ( GREEN ); + ch->pcdata->gtell_text[2] = 0; + ch->pcdata->gtell_type[0] = ( NORMAL ); + ch->pcdata->gtell_type[1] = ( RED ); + ch->pcdata->gtell_type[2] = 0; + ch->pcdata->wiznet[0] = ( NORMAL ); + ch->pcdata->wiznet[1] = ( GREEN ); + ch->pcdata->wiznet[2] = 0; + ch->pcdata->room_title[0] = ( NORMAL ); + ch->pcdata->room_title[1] = ( CYAN ); + ch->pcdata->room_title[2] = 0; + ch->pcdata->room_text[0] = ( NORMAL ); + ch->pcdata->room_text[1] = ( WHITE ); + ch->pcdata->room_text[2] = 0; + ch->pcdata->room_exits[0] = ( NORMAL ); + ch->pcdata->room_exits[1] = ( GREEN ); + ch->pcdata->room_exits[2] = 0; + ch->pcdata->room_things[0] = ( NORMAL ); + ch->pcdata->room_things[1] = ( CYAN ); + ch->pcdata->room_things[2] = 0; + ch->pcdata->prompt[0] = ( NORMAL ); + ch->pcdata->prompt[1] = ( CYAN ); + ch->pcdata->prompt[2] = 0; + ch->pcdata->fight_death[0] = ( BRIGHT ); + ch->pcdata->fight_death[1] = ( RED ); + ch->pcdata->fight_death[2] = 0; + ch->pcdata->fight_yhit[0] = ( NORMAL ); + ch->pcdata->fight_yhit[1] = ( GREEN ); + ch->pcdata->fight_yhit[2] = 0; + ch->pcdata->fight_ohit[0] = ( NORMAL ); + ch->pcdata->fight_ohit[1] = ( YELLOW ); + ch->pcdata->fight_ohit[2] = 0; + ch->pcdata->fight_thit[0] = ( NORMAL ); + ch->pcdata->fight_thit[1] = ( RED ); + ch->pcdata->fight_thit[2] = 0; + ch->pcdata->fight_skill[0] = ( BRIGHT ); + ch->pcdata->fight_skill[1] = ( WHITE ); + ch->pcdata->fight_skill[2] = 0; + found = FALSE; fclose( fpReserve ); @@ -884,6 +1108,7 @@ KEY( "Class", ch->class, fread_number( fp ) ); KEY( "Cla", ch->class, fread_number( fp ) ); KEY( "Clan", ch->clan, clan_lookup(fread_string(fp))); + KEY( "Comm", ch->comm, fread_flag( fp ) ); if ( !str_cmp( word, "Condition" ) || !str_cmp(word,"Cond")) { @@ -902,7 +1127,77 @@ fMatch = TRUE; break; } - KEY("Comm", ch->comm, fread_flag( fp ) ); + + if( !str_cmp( word, "Coloura" ) ) + { + LOAD_COLOUR( text ) + LOAD_COLOUR( auction ) + LOAD_COLOUR( gossip ) + LOAD_COLOUR( music ) + LOAD_COLOUR( question ) + fMatch = TRUE; + break; + } + if( !str_cmp( word, "Colourb" ) ) + { + LOAD_COLOUR( answer ) + LOAD_COLOUR( quote ) + LOAD_COLOUR( quote_text ) + LOAD_COLOUR( immtalk_text ) + LOAD_COLOUR( immtalk_type ) + fMatch = TRUE; + break; + } + if( !str_cmp( word, "Colourc" ) ) + { + LOAD_COLOUR( info ) + LOAD_COLOUR( tell ) + LOAD_COLOUR( reply ) + LOAD_COLOUR( gtell_text ) + LOAD_COLOUR( gtell_type ) + fMatch = TRUE; + break; + } + if( !str_cmp( word, "Colourd" ) ) + { + LOAD_COLOUR( room_title ) + LOAD_COLOUR( room_text ) + LOAD_COLOUR( room_exits ) + LOAD_COLOUR( room_things ) + LOAD_COLOUR( prompt ) + fMatch = TRUE; + break; + } + if( !str_cmp( word, "Coloure" ) ) + { + LOAD_COLOUR( fight_death ) + LOAD_COLOUR( fight_yhit ) + LOAD_COLOUR( fight_ohit ) + LOAD_COLOUR( fight_thit ) + LOAD_COLOUR( fight_skill ) + fMatch = TRUE; + break; + } + if( !str_cmp( word, "Colourf" ) ) + { + LOAD_COLOUR( wiznet ) + LOAD_COLOUR( say ) + LOAD_COLOUR( say_text ) + LOAD_COLOUR( tell_text ) + LOAD_COLOUR( reply_text ) + fMatch = TRUE; + break; + } + if( !str_cmp( word, "Colourg" ) ) + { + LOAD_COLOUR( auction_text ) + LOAD_COLOUR( gossip_text ) + LOAD_COLOUR( music_text ) + LOAD_COLOUR( question_text ) + LOAD_COLOUR( answer_text ) + fMatch = TRUE; + break; + } break; @@ -1120,6 +1415,7 @@ if ( !fMatch ) { bug( "Fread_char: no match.", 0 ); + bug( word, 0 ); fread_to_eol( fp ); } } diff -ur Rom24/src/tables.c rom24_colour_v2.0/src/tables.c --- Rom24/src/tables.c Thu Jul 18 13:44:41 1996 +++ rom24_colour_v2.0/src/tables.c Sun May 3 20:10:29 1998 @@ -123,6 +123,7 @@ { "can_loot", P, FALSE }, { "nosummon", Q, FALSE }, { "nofollow", R, FALSE }, + { "colour", T, FALSE }, { "permit", U, TRUE }, { "log", W, FALSE }, { "deny", X, FALSE },