Personalized combat messages part 2 (#52890)

Adds more "personalized" combat messages for all participants in a fight: the attacker, the victim and the spectators
This commit is contained in:
kingofkosmos
2020-08-13 17:34:57 +03:00
committed by GitHub
parent c74590fd4d
commit 3263decaad
97 changed files with 484 additions and 260 deletions
+12 -11
View File
@@ -172,21 +172,22 @@
return clamp(w_class * 6, 10, 100) // Multiply the item's weight class by 6, then clamp the value between 10 and 100
/mob/living/proc/send_item_attack_message(obj/item/I, mob/living/user, hit_area, obj/item/bodypart/hit_bodypart)
var/message_verb = "attacked"
if(length(I.attack_verb))
message_verb = "[pick(I.attack_verb)]"
else if(!I.force)
var/message_verb_continuous = length(I.attack_verb_continuous) ? "[pick(I.attack_verb_continuous)]" : "attacks"
var/message_verb_simple = length(I.attack_verb_simple) ? "[pick(I.attack_verb_simple)]" : "attack"
if(!I.force)
return
var/message_hit_area = ""
if(hit_area)
message_hit_area = " in the [hit_area]"
var/attack_message = "[src] is [message_verb][message_hit_area] with [I]!"
var/attack_message_local = "You're [message_verb][message_hit_area] with [I]!"
var/attack_message_spectator = "[src] [message_verb_continuous][message_hit_area] with [I]!"
var/attack_message_victim = "You're [message_verb_continuous][message_hit_area] with [I]!"
var/attack_message_attacker = "You [message_verb_simple] [src][message_hit_area] with [I]!"
if(user in viewers(src, null))
attack_message = "[user] [message_verb] [src][message_hit_area] with [I]!"
attack_message_local = "[user] [message_verb] you[message_hit_area] with [I]!"
attack_message_spectator = "[user] [message_verb_continuous] [src][message_hit_area] with [I]!"
attack_message_victim = "[user] [message_verb_continuous] you[message_hit_area] with [I]!"
if(user == src)
attack_message_local = "You [message_verb] yourself[message_hit_area] with [I]"
visible_message("<span class='danger'>[attack_message]</span>",\
"<span class='userdanger'>[attack_message_local]</span>", null, COMBAT_MESSAGE_RANGE)
attack_message_victim = "You [message_verb_simple] yourself[message_hit_area] with [I]"
visible_message("<span class='danger'>[attack_message_spectator]</span>",\
"<span class='userdanger'>[attack_message_victim]</span>", null, COMBAT_MESSAGE_RANGE, user)
to_chat(user, "<span class='danger'>[attack_message_attacker]</span>")
return 1