Skip to content

Commit

Permalink
[MODULAR] [NO GBP] Improves the UX of synth wounds + fixes RCDs on co…
Browse files Browse the repository at this point in the history
…llapsed superstructures (#24416) (#165)

improves synth wound ux

Co-authored-by: nikothedude <[email protected]>
  • Loading branch information
Steals-The-PRs and nikothedude authored Oct 20, 2023
1 parent c9a4109 commit b5eea06
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@
var/has_enough_matter = (treating_rcd.get_matter(user) > ROBOTIC_T3_BLUNT_WOUND_RCD_COST)
var/silo_has_enough_materials = (treating_rcd.get_silo_iron() > ROBOTIC_T3_BLUNT_WOUND_RCD_SILO_COST)

if (!silo_has_enough_materials && has_enough_matter)
if (!silo_has_enough_materials && !has_enough_matter) // neither the silo, nor the rcd, has enough
user?.balloon_alert(user, "not enough matter!")
return TRUE

var/their_or_other = (user == victim ? "[user.p_their()]" : "[victim]'s")
Expand Down Expand Up @@ -291,7 +292,8 @@
set_superstructure_status(TRUE)

var/use_amount = (silo_has_enough_materials ? ROBOTIC_T3_BLUNT_WOUND_RCD_SILO_COST : ROBOTIC_T3_BLUNT_WOUND_RCD_COST)
treating_rcd.useResource(use_amount, user)
if (!treating_rcd.useResource(use_amount, user))
return TRUE

if (user)
var/misused_text = (misused ? ", though it replaced a bit more than it should've..." : "!")
Expand Down Expand Up @@ -383,3 +385,14 @@
/datum/wound/blunt/robotic/secures_internals/critical/proc/set_superstructure_status(remedied)
superstructure_remedied = remedied
ready_to_secure_internals = remedied

/datum/wound/blunt/robotic/secures_internals/critical/get_wound_step_info()
. = ..()

if (!superstructure_remedied)
. = "The superstructure must be reformed."
if (!limb_malleable())
. += " The limb must be heated to thermal overload, then manually molded with a firm grasp"
else
. += " The limb has been sufficiently heated, and can be manually molded with a firm grasp/repeated application of a low-force object"
. += " - OR an RCD may be used with little risk."
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@
var/their_or_other = (user == victim ? "[user.p_their()]" : "[victim]'s")
var/your_or_other = (user == victim ? "your" : "[victim]'s")

var/self_message = span_warning("You start prying open [your_or_other] [limb.plaintext_zone] with [crowbarring_item]...")
var/limb_can_shock_pre_sleep = (victim.stat != DEAD && limb.biological_state & BIO_WIRED)
var/shock_or_not = (limb_can_shock_pre_sleep ? ", risking electrocution" : "")
var/self_message = span_warning("You start prying open [your_or_other] [limb.plaintext_zone] with [crowbarring_item][shock_or_not]...")

user?.visible_message(span_bolddanger("[user] starts prying open [their_or_other] [limb.plaintext_zone] with [crowbarring_item]!"), self_message, ignored_mobs = list(victim))

Expand All @@ -175,7 +177,7 @@
if (!crowbarring_item.use_tool(target = victim, user = user, delay = (7 SECONDS * delay_mult), volume = 50, extra_checks = CALLBACK(src, PROC_REF(still_exists))))
return TRUE

var/limb_can_shock = (victim.stat != DEAD && limb.biological_state & BIO_WIRED)
var/limb_can_shock = (victim.stat != DEAD && limb.biological_state & BIO_WIRED) // re-define the previous shock variable because we slept
var/stunned = FALSE

var/message
Expand Down Expand Up @@ -386,3 +388,29 @@
span_notice("You finish re-soldering [your_or_other] [limb.plaintext_zone]!"))
remove_wound()
return TRUE

/// Returns a string with our current treatment step for use in health analyzers.
/datum/wound/blunt/robotic/secures_internals/proc/get_wound_step_info()
var/string

if (ready_to_resolder)
string = "Apply a welder/cautery to the limb to finalize repairs."
else if (ready_to_secure_internals)
string = "Use a screwdriver/wrench to secure the internals of the limb. This step is best performed by a qualified technician. \
In absence of one, bone gel or a crowbar may be used."

return string

/datum/wound/blunt/robotic/secures_internals/get_scanner_description(mob/user)
. = ..()

var/wound_step = get_wound_step_info()
if (wound_step)
. += "\n\n<b>Current step</b>: [span_notice(wound_step)]"

/datum/wound/blunt/robotic/secures_internals/get_simple_scanner_description(mob/user)
. = ..()

var/wound_step = get_wound_step_info()
if (wound_step)
. += "\n\n<b>Current step</b>: [span_notice(wound_step)]"

0 comments on commit b5eea06

Please sign in to comment.