[MIRROR] Limb-based damage descriptions fixes and code improvement [MDB IGNORE] (#18703)

* Limb-based damage descriptions fixes and code improvement (#72236)

## About The Pull Request

The limb-based damage descriptions added by #71635 didn't work properly,
as get_majority_bodypart_damage_desc() didn't return the correct values.
I rewrote the proc altogether and changed the format of the damage
description vars (formerly burn_damage_desc and brute_damage_desc). They
are now a single associative list with each description being indexed by
it's respective damage type DEFINE
The proc now returns the correct description, avoids the duplicated code
between the brute and burn sections and can support any number of damage
types. To that end I also added Clone damage support, although no limbs
use a special description for the moment.

Oh, I also gave the robotic damage descriptions to all the robotic
limbs, for some reason only the left robot arm had it.
## Why It's Good For The Game

It makes the system function properly and correctly labels robotic
limbs.
On the side of the proc, it's more flexible this way and avoids the
redundancy. I am aware, however, that I'm using a lot of associative
lists. I'll rewrite it to reduce them if memory is deemed significant
concern in this context. It's, admittedly, probably a bit overengineered
for what it is.
## Changelog
🆑
fix: the examine text for damage now properly uses the most common
examine text out of all the mob's limbs
fix: all robotic limbs now have the robotic damage descriptions
(charring, denting)
code: improved the get_majority_bodypart_damage_desc() proc to reduce
redundancies and add support for limb-based cellular damage
/🆑

Co-authored-by: Jeremiah <42397676+jlsnow301@ users.noreply.github.com>

* Limb-based damage descriptions fixes and code improvement

Co-authored-by: A miscellaneous Fern <80640114+FernandoJ8@users.noreply.github.com>
Co-authored-by: Jeremiah <42397676+jlsnow301@ users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-01-19 15:32:47 -05:00
committed by GitHub
co-authored by Jeremiah A miscellaneous Fern
parent 92cb29c361
commit 97499a276e
4 changed files with 30 additions and 29 deletions
+1 -3
View File
@@ -125,9 +125,7 @@
var/heavy_burn_msg = "peeling away"
//Damage messages used by examine(). the desc that is most common accross all bodyparts gets shown
var/brute_damage_desc = DEFAULT_BRUTE_EXAMINE_TEXT
var/burn_damage_desc = DEFAULT_BURN_EXAMINE_TEXT
var/list/damage_examines = list(BRUTE = DEFAULT_BRUTE_EXAMINE_TEXT, BURN = DEFAULT_BURN_EXAMINE_TEXT, CLONE = DEFAULT_CLONE_EXAMINE_TEXT)
// Wounds related variables
/// The wounds currently afflicting this body part
@@ -37,8 +37,7 @@
medium_burn_msg = ROBOTIC_MEDIUM_BURN_MSG
heavy_burn_msg = ROBOTIC_HEAVY_BURN_MSG
brute_damage_desc = ROBOTIC_BRUTE_EXAMINE_TEXT
burn_damage_desc = ROBOTIC_BURN_EXAMINE_TEXT
damage_examines = list(BRUTE = ROBOTIC_BRUTE_EXAMINE_TEXT, BURN = ROBOTIC_BURN_EXAMINE_TEXT, CLONE = DEFAULT_CLONE_EXAMINE_TEXT)
disabling_threshold_percentage = 1
/obj/item/bodypart/arm/right/robot
@@ -69,6 +68,7 @@
medium_burn_msg = ROBOTIC_MEDIUM_BURN_MSG
heavy_burn_msg = ROBOTIC_HEAVY_BURN_MSG
damage_examines = list(BRUTE = ROBOTIC_BRUTE_EXAMINE_TEXT, BURN = ROBOTIC_BURN_EXAMINE_TEXT, CLONE = DEFAULT_CLONE_EXAMINE_TEXT)
/obj/item/bodypart/leg/left/robot
name = "cyborg left leg"
@@ -98,6 +98,7 @@
medium_burn_msg = ROBOTIC_MEDIUM_BURN_MSG
heavy_burn_msg = ROBOTIC_HEAVY_BURN_MSG
damage_examines = list(BRUTE = ROBOTIC_BRUTE_EXAMINE_TEXT, BURN = ROBOTIC_BURN_EXAMINE_TEXT, CLONE = DEFAULT_CLONE_EXAMINE_TEXT)
/obj/item/bodypart/leg/right/robot
name = "cyborg right leg"
@@ -127,6 +128,8 @@
medium_burn_msg = ROBOTIC_MEDIUM_BURN_MSG
heavy_burn_msg = ROBOTIC_HEAVY_BURN_MSG
damage_examines = list(BRUTE = ROBOTIC_BRUTE_EXAMINE_TEXT, BURN = ROBOTIC_BURN_EXAMINE_TEXT, CLONE = DEFAULT_CLONE_EXAMINE_TEXT)
/obj/item/bodypart/chest/robot
name = "cyborg torso"
desc = "A heavily reinforced case containing cyborg logic boards, with space for a standard power cell."
@@ -153,6 +156,8 @@
medium_burn_msg = ROBOTIC_MEDIUM_BURN_MSG
heavy_burn_msg = ROBOTIC_HEAVY_BURN_MSG
damage_examines = list(BRUTE = ROBOTIC_BRUTE_EXAMINE_TEXT, BURN = ROBOTIC_BURN_EXAMINE_TEXT, CLONE = DEFAULT_CLONE_EXAMINE_TEXT)
var/wired = FALSE
var/obj/item/stock_parts/cell/cell = null
@@ -263,6 +268,8 @@
medium_burn_msg = ROBOTIC_MEDIUM_BURN_MSG
heavy_burn_msg = ROBOTIC_HEAVY_BURN_MSG
damage_examines = list(BRUTE = ROBOTIC_BRUTE_EXAMINE_TEXT, BURN = ROBOTIC_BURN_EXAMINE_TEXT, CLONE = DEFAULT_CLONE_EXAMINE_TEXT)
var/obj/item/assembly/flash/handheld/flash1 = null
var/obj/item/assembly/flash/handheld/flash2 = null