[MIRROR] Miscellaneous Robotic Limb Fixes [MDB IGNORE] (#24339)

* Miscellaneous Robotic Limb Fixes

* Update android.dm

* Apply suggestions from code review

* Update robot_bodyparts.dm

---------

Co-authored-by: GPeckman <21979502+GPeckman@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-10-15 19:53:52 -07:00
committed by GitHub
co-authored by GPeckman Bloop
parent 4756ac8467
commit abb2bcde43
6 changed files with 48 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
@@ -939,6 +939,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
@@ -22,6 +22,7 @@
TRAIT_NOBLOOD,
TRAIT_NO_DNA_COPY,
TRAIT_NO_TRANSFORMATION_STING,
TRAIT_NOCRITDAMAGE,
)
inherent_biotypes = MOB_ROBOTIC|MOB_HUMANOID
@@ -235,8 +235,50 @@
/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(
/* SKYRAT EDIT REMOVAL BEGIN - Synths are not immune to temperature
TRAIT_RESISTCOLD,
TRAIT_RESISTHEAT,
SKYRAT EDIT REMOVAL END */
TRAIT_RESISTLOWPRESSURE,
TRAIT_RESISTHIGHPRESSURE,
), AUGMENTATION_TRAIT)
else
owner.remove_traits(list(
/* SKYRAT EDIT REMOVAL BEGIN - Synths are not immune to temperature
TRAIT_RESISTCOLD,
TRAIT_RESISTHEAT,
SKYRAT EDIT REMOVAL END */
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