Colour for combat text

  • Zuubar
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 3 months ago #10020 by Zuubar
Colour for combat text was created by Zuubar
Hi,

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?

Thanks! 
 

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

  • Vatiken
  • Vatiken's Avatar
  • Offline
  • Administrator
  • Administrator
  • tbaMUD Programmer
More
1 year 3 months ago - 1 year 3 months ago #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: 1 year 3 months ago by Vatiken.
The following user(s) said Thank You: Zuubar

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

  • Zuubar
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 3 months ago #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.094 seconds