Miscellaneous Robotic Limb Fixes (#78905)

## About The Pull Request

In PR #76817, the damage reduction for robotic limbs was changed from
being flat to being multiplicative in nature. This wasn't supposed to
have secondary mechanical effects on robot limbs, but as always a few
slipped by. This PR just cleans up a few of these unintended mechanical
changes.

First of all, the change made robotic limbs not fully immune to space
damage. They remained immune to damage from pressure but not damage from
temperature. Now people with only robotic limbs are immune to the
temperature damage and the moodlets caused by low or high temperature. I
have tested it, and it works for people who have all robotic limbs,
people who have some robotic limbs and some missing, and even the
extreme case of a nugget with H.A.R.S. who has nothing _but_ a robotic
chest.

Due to technical limitations (`apply_damage` doesn't have a
`required_bodytype` argument), people with some robotic limbs and some
organic will still take temperature damage on their robotic limbs.

Second of all, androids are once again immune to crit damage. Normally,
crit damage is just constant oxyloss, but this obviously doesn't work
for species that don't breath. Instead, those species take a small
amount of brute damage. Prior to the damage reduction change, this meant
that Androids were effectively immune to crit damage. Now they're immune
once again.

Finally, you can now cancel surgery on robotic limbs. I don't think this
bug was actually caused by the above PR, but I decided to fix it while I
was here.

Closes #77033.
## Why It's Good For The Game

The damage reduction change was explicitly not intended to make robotic
limbs not-spaceproof, so the first change is by definition a bugfix. As
far as I know, crit damage being brute for nobreath species is a much
more recent change than the existence of androids, so I think that also
qualifies as a bugfix.
## Changelog
🆑
fix: Having all augmented limbs will make you properly spaceproof once
again.
fix: Androids are immune to crit damage again.
fix: Surgery on robotic limbs can be canceled.
/🆑
This commit is contained in:
GPeckman
2023-10-14 23:31:01 +01:00
committed by GitHub
parent 54cfc95d97
commit ead6759782
6 changed files with 44 additions and 3 deletions
@@ -33,7 +33,7 @@
///from base of /obj/item/bodypart/proc/try_attach_limb(): (new_limb, special)
#define COMSIG_CARBON_ATTACH_LIMB "carbon_attach_limb"
/// Called from bodypart being attached /obj/item/bodypart/proc/try_attach_limb(mob/living/carbon/new_owner, special)
#define COMSIG_BODYPART_ATTACHED "bodypart_removed"
#define COMSIG_BODYPART_ATTACHED "bodypart_attached"
///from base of /obj/item/bodypart/proc/try_attach_limb(): (new_limb, special)
#define COMSIG_CARBON_POST_ATTACH_LIMB "carbon_post_attach_limb"
///from /obj/item/bodypart/proc/receive_damage, sent from the limb owner (limb, brute, burn)
+2
View File
@@ -940,6 +940,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define DISEASE_TRAIT "disease"
#define SPECIES_TRAIT "species"
#define ORGAN_TRAIT "organ"
/// Trait given by augmented limbs
#define AUGMENTATION_TRAIT "augments"
/// Trait given by organ gained via abductor surgery
#define ABDUCTOR_GLAND_TRAIT "abductor_gland"
/// cannot be removed without admin intervention
@@ -66,7 +66,7 @@
return FALSE
/datum/weather/ash_storm/weather_act(mob/living/victim)
victim.adjustFireLoss(4)
victim.adjustFireLoss(4, required_bodytype = BODYTYPE_ORGANIC)
/datum/weather/ash_storm/end()
GLOB.ash_storm_sounds -= weak_sounds
@@ -21,6 +21,7 @@
TRAIT_RESISTHIGHPRESSURE,
TRAIT_RESISTLOWPRESSURE,
TRAIT_TOXIMMUNE,
TRAIT_NOCRITDAMAGE,
)
inherent_biotypes = MOB_ROBOTIC|MOB_HUMANOID
@@ -235,8 +235,46 @@
/obj/item/bodypart/chest/robot/Destroy()
QDEL_NULL(cell)
UnregisterSignal(src, COMSIG_BODYPART_ATTACHED)
return ..()
/obj/item/bodypart/chest/robot/Initialize(mapload)
. = ..()
RegisterSignal(src, COMSIG_BODYPART_ATTACHED, PROC_REF(on_attached))
RegisterSignal(src, COMSIG_BODYPART_REMOVED, PROC_REF(on_detached))
/obj/item/bodypart/chest/robot/proc/on_attached(obj/item/bodypart/chest/robot/this_bodypart, mob/living/carbon/human/new_owner)
SIGNAL_HANDLER
RegisterSignals(new_owner, list(COMSIG_CARBON_POST_ATTACH_LIMB, COMSIG_CARBON_POST_REMOVE_LIMB), PROC_REF(check_limbs))
/obj/item/bodypart/chest/robot/proc/on_detached(obj/item/bodypart/chest/robot/this_bodypart, mob/living/carbon/human/old_owner)
SIGNAL_HANDLER
UnregisterSignal(old_owner, list(COMSIG_CARBON_POST_ATTACH_LIMB, COMSIG_CARBON_POST_REMOVE_LIMB))
/obj/item/bodypart/chest/robot/proc/check_limbs()
SIGNAL_HANDLER
var/all_robotic = TRUE
for(var/obj/item/bodypart/part in owner.bodyparts)
all_robotic = all_robotic && IS_ROBOTIC_LIMB(part)
if(all_robotic)
owner.add_traits(list(
TRAIT_RESISTCOLD,
TRAIT_RESISTHEAT,
TRAIT_RESISTLOWPRESSURE,
TRAIT_RESISTHIGHPRESSURE,
), AUGMENTATION_TRAIT)
else
owner.remove_traits(list(
TRAIT_RESISTCOLD,
TRAIT_RESISTHEAT,
TRAIT_RESISTLOWPRESSURE,
TRAIT_RESISTHIGHPRESSURE,
), AUGMENTATION_TRAIT)
/obj/item/bodypart/chest/robot/attackby(obj/item/weapon, mob/user, params)
if(istype(weapon, /obj/item/stock_parts/cell))
if(cell)
+1 -1
View File
@@ -87,7 +87,7 @@
var/obj/item/tool = user.get_active_held_item()
if(step.try_op(user, target, user.zone_selected, tool, src, try_to_fail))
return TRUE
if(tool && tool.item_flags) //Mechanic organ manipulation isn't done with just surgery tools
if(tool && tool.tool_behaviour) //Mechanic organ manipulation isn't done with just surgery tools
to_chat(user, span_warning("This step requires a different tool!"))
return TRUE