Welcome to the Builder Academy

Question Colour for combat text

13 Feb 2022 16:45 #10020 by Zuubar

I have been trying to modify the colour for combat text because currently only misses are coloured. The initial and subsequent hits for both pc and mobile are not coloured. I am currently looking at fight.c, is this the right file to look at and what are the specific lines if anyone can advise?


Please Log in or Create an account to join the conversation.

13 Feb 2022 17:20 - 13 Feb 2022 17:21 #10022 by Vatiken
Replied by Vatiken on topic Colour for combat text
These are the two functions that handle the messages during combat and both are found in fight.c.
skill_message() dam_message()

This excerpt from skill_message() shows the colour changed to CCYEL on missed hits for players who have their colour setting set to C_CMP. 
if (msg->miss_msg.attacker_msg) {             send_to_char(ch, CCYEL(ch, C_CMP));             act(msg->miss_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR);             send_to_char(ch, CCNRM(ch, C_CMP));         }

This except is from dam_message() shows us adding a coloured damage indicator to the damage message for characters who are immortal.
  /* damage message to damagee */   if (GET_LEVEL(victim) >= LVL_IMMORT)       send_to_char(victim, "\tR(%d)", dam);   buf = replace_string(dam_weapons[msgnum].to_victim,     attack_hit_text[w_type].singular, attack_hit_text[w_type].plural);   act(buf, FALSE, ch, NULL, victim, TO_VICT | TO_SLEEP);   send_to_char(victim, CCNRM(victim, C_CMP));


You can also individually colour messages in the messages file found in the misc folder using colour tags if you'd prefer and output similar to:

You have been burned to death by PLAYER!

tbaMUD developer/programmer
Last edit: 13 Feb 2022 17:21 by Vatiken.
The following user(s) said Thank You: Zuubar

Please Log in or Create an account to join the conversation.

14 Feb 2022 00:46 #10023 by Zuubar
Replied by Zuubar on topic Colour for combat text
Hi Vatiken,

Thanks for the examples, will take a look at the two listed functions.

Please Log in or Create an account to join the conversation.

Time to create page: 0.187 seconds