Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TG Mirror] Miscellaneous Robotic Limb Fixes [MDB IGNORE] #75

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/datums/weather/weather_types/ash_storm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
TRAIT_NOBLOOD,
TRAIT_NO_DNA_COPY,
TRAIT_NO_TRANSFORMATION_STING,
TRAIT_NOCRITDAMAGE,
)

inherent_biotypes = MOB_ROBOTIC|MOB_HUMANOID
Expand Down
42 changes: 42 additions & 0 deletions code/modules/surgery/bodyparts/robot_bodyparts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/surgery/organ_manipulation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading