Various TG Chat message sorting fixes (#25229)

* Fixes unsorted emotes, announcements, votes, surgery, prayers, ahelp responses

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

---------

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
S34N
2024-04-29 03:07:25 +01:00
committed by GitHub
parent 4add53d6c1
commit 2e4089dc15
28 changed files with 368 additions and 209 deletions
+33 -18
View File
@@ -27,7 +27,8 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"[user] starts the incision on [target]'s [affected.name] with \the [tool].",
"You start the incision on [target]'s [affected.name] with \the [tool]."
"You start the incision on [target]'s [affected.name] with \the [tool].",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.custom_pain("You feel a horrible pain as if from a sharp knife in your [affected.name]!")
return ..()
@@ -36,7 +37,8 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"<span class='notice'> [user] has made an incision on [target]'s [affected.name] with \the [tool].</span>",
"<span class='notice'> You have made an incision on [target]'s [affected.name] with \the [tool].</span>"
"<span class='notice'> You have made an incision on [target]'s [affected.name] with \the [tool].</span>",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.open = ORGAN_ORGANIC_OPEN
target.resume_bleeding()
@@ -46,7 +48,8 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"<span class='warning'> [user]'s hand slips, slicing open [target]'s [affected.name] in a wrong spot with \the [tool]!</span>",
"<span class='warning'> Your hand slips, slicing open [target]'s [affected.name] in a wrong spot with \the [tool]!</span>"
"<span class='warning'> Your hand slips, slicing open [target]'s [affected.name] in a wrong spot with \the [tool]!</span>",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.receive_damage(10)
return SURGERY_STEP_RETRY
@@ -68,7 +71,8 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"[user] starts clamping bleeders in [target]'s [affected.name] with \the [tool].",
"You start clamping bleeders in [target]'s [affected.name] with \the [tool]."
"You start clamping bleeders in [target]'s [affected.name] with \the [tool].",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.custom_pain("The pain in your [affected.name] is maddening!")
return ..()
@@ -77,7 +81,8 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"<span class='notice'> [user] clamps bleeders in [target]'s [affected.name] with \the [tool].</span>",
"<span class='notice'> You clamp bleeders in [target]'s [affected.name] with \the [tool].</span>"
"<span class='notice'> You clamp bleeders in [target]'s [affected.name] with \the [tool].</span>",
chat_message_type = MESSAGE_TYPE_COMBAT
)
spread_germs_to_organ(affected, user, tool)
return SURGERY_STEP_CONTINUE
@@ -86,7 +91,8 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"<span class='warning'> [user]'s hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!</span>",
"<span class='warning'> Your hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!</span>"
"<span class='warning'> Your hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!</span>",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.receive_damage(10)
return SURGERY_STEP_RETRY
@@ -114,7 +120,7 @@
if(target_zone == BODY_ZONE_PRECISE_GROIN)
msg = "[user] starts to pry open the incision and rearrange the organs in [target]'s lower abdomen with \the [tool]."
self_msg = "You start to pry open the incision and rearrange the organs in [target]'s lower abdomen with \the [tool]."
user.visible_message(msg, self_msg)
user.visible_message(msg, self_msg, chat_message_type = MESSAGE_TYPE_COMBAT)
affected.custom_pain("It feels like the skin on your [affected.name] is on fire!")
return ..()
@@ -128,7 +134,7 @@
if(target_zone == BODY_ZONE_PRECISE_GROIN)
msg = "<span class='notice'> [user] keeps the incision open on [target]'s lower abdomen with \the [tool].</span>"
self_msg = "<span class='notice'> You keep the incision open on [target]'s lower abdomen with \the [tool].</span>"
user.visible_message(msg, self_msg)
user.visible_message(msg, self_msg, chat_message_type = MESSAGE_TYPE_COMBAT)
affected.open = ORGAN_ORGANIC_ENCASED_OPEN
return SURGERY_STEP_CONTINUE
@@ -142,7 +148,7 @@
if(target_zone == BODY_ZONE_PRECISE_GROIN)
msg = "<span class='warning'>[user]'s hand slips, damaging several organs [target]'s lower abdomen with \the [tool]</span>"
self_msg = "<span class='warning'> Your hand slips, damaging several organs [target]'s lower abdomen with \the [tool]!</span>"
user.visible_message(msg, self_msg)
user.visible_message(msg, self_msg, chat_message_type = MESSAGE_TYPE_COMBAT)
target.apply_damage(12, BRUTE, affected, sharp = TRUE)
return SURGERY_STEP_RETRY
@@ -164,7 +170,8 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"[user] is beginning to cauterize the incision on [target]'s [affected.name] with \the [tool].",
"You are beginning to cauterize the incision on [target]'s [affected.name] with \the [tool]."
"You are beginning to cauterize the incision on [target]'s [affected.name] with \the [tool].",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.custom_pain("Your [affected.name] is being burned!")
return ..()
@@ -173,7 +180,8 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"<span class='notice'>[user] cauterizes the incision on [target]'s [affected.name] with \the [tool].</span>",
"<span class='notice'>You cauterize the incision on [target]'s [affected.name] with \the [tool].</span>"
"<span class='notice'>You cauterize the incision on [target]'s [affected.name] with \the [tool].</span>",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.open = ORGAN_CLOSED
affected.germ_level = 0
@@ -183,7 +191,8 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"<span class='warning'>[user]'s hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!</span>",
"<span class='warning'>Your hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!</span>"
"<span class='warning'>Your hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!</span>",
chat_message_type = MESSAGE_TYPE_COMBAT
)
target.apply_damage(3, BURN, affected)
return SURGERY_STEP_RETRY
@@ -196,7 +205,8 @@
user.visible_message(
"[user] is beginning to cauterize the incision on [target]'s [affected.name] with \the [tool].",
// give a little heads up to the surgeon that they're stopping the surgery prematurely in case that wasn't the intention.
"<span class='warning'>You are interrupting the current surgery</span>, beginning to cauterize the incision on [target]'s [affected.name] with \the [tool]."
"<span class='warning'>You are interrupting the current surgery</span>, beginning to cauterize the incision on [target]'s [affected.name] with \the [tool].",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.custom_pain("Your [affected.name] is being burned!")
return ..()
@@ -217,7 +227,8 @@
/datum/surgery_step/generic/drill/begin_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
user.visible_message(
"[user] begins to drill into the bone in [target]'s [parse_zone(target_zone)].",
"<span class='notice'>You begin to drill into the bone in [target]'s [parse_zone(target_zone)]...</span>"
"<span class='notice'>You begin to drill into the bone in [target]'s [parse_zone(target_zone)]...</span>",
chat_message_type = MESSAGE_TYPE_COMBAT
)
return ..()
@@ -229,7 +240,8 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"<span class='warning'>[user]'s [tool] doesn't get a firm grip and tears at the bone in [target]'s [parse_zone(target_zone)]!</span>",
"<span class='warning'>Your [tool] doesn't get a firm grip and tears at the bone in [target]'s [parse_zone(target_zone)]!</span>"
"<span class='warning'>Your [tool] doesn't get a firm grip and tears at the bone in [target]'s [parse_zone(target_zone)]!</span>",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.receive_damage(15)
@@ -251,7 +263,8 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"[user] is beginning to amputate [target]'s [affected.name] with \the [tool].",
"You are beginning to cut through [target]'s [affected.amputation_point] with \the [tool]."
"You are beginning to cut through [target]'s [affected.amputation_point] with \the [tool].",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.custom_pain("Your [affected.amputation_point] is being ripped apart!")
return ..()
@@ -260,7 +273,8 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"<span class='notice'> [user] amputates [target]'s [affected.name] at the [affected.amputation_point] with \the [tool].</span>",
"<span class='notice'> You amputate [target]'s [affected.name] with \the [tool].</span>"
"<span class='notice'> You amputate [target]'s [affected.name] with \the [tool].</span>",
chat_message_type = MESSAGE_TYPE_COMBAT
)
add_attack_logs(user, target, "Surgically removed [affected.name]. INTENT: [uppertext(user.a_intent)]")//log it
@@ -279,7 +293,8 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"<span class='warning'> [user]'s hand slips, sawing through the bone in [target]'s [affected.name] with \the [tool]!</span>",
"<span class='warning'> Your hand slips, sawing through the bone in [target]'s [affected.name] with \the [tool]!</span>"
"<span class='warning'> Your hand slips, sawing through the bone in [target]'s [affected.name] with \the [tool]!</span>",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.receive_damage(30)
affected.fracture()