diff --git a/aurorastation.dme b/aurorastation.dme index 0d59ddf337d..523a7377988 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -3107,6 +3107,7 @@ #include "code\modules\organs\subtypes\augment\augments\eye_sensors.dm" #include "code\modules\organs\subtypes\augment\augments\fluff.dm" #include "code\modules\organs\subtypes\augment\augments\fuel_cell.dm" +#include "code\modules\organs\subtypes\augment\augments\gravity_adaptations.dm" #include "code\modules\organs\subtypes\augment\augments\gustatorial_centre.dm" #include "code\modules\organs\subtypes\augment\augments\health_analyzer.dm" #include "code\modules\organs\subtypes\augment\augments\language_processor.dm" diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 57396bec26a..d34e7abb0a7 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -175,6 +175,7 @@ #define BP_AUG_FLUFF_L_HAND_BIO "left hand bioaug" #define BP_AUG_GLARE_DAMPENER "glare dampeners" #define BP_AUG_GUSTATORIAL "integrated gustatorial centre" +#define BP_AUG_GRAV_ADAPTATION "gravity adaptations" #define BP_AUG_HAIR "synthetic hair extensions" #define BP_AUG_HEALTHSCAN "integrated health scanner" #define BP_AUG_LANGUAGE "integrated language processor" diff --git a/code/__DEFINES/organs.dm b/code/__DEFINES/organs.dm index a4cd919446e..691a8c8b8ba 100644 --- a/code/__DEFINES/organs.dm +++ b/code/__DEFINES/organs.dm @@ -42,3 +42,9 @@ * Raised on an entity whose liver is attempting to filter blood. */ #define COMSIG_LIVER_FILTER_EVENT "liver_filter_event" + +/** + * Raised on an entity with the gravity weakness feature that is about to take damage from said weakness. + * Set the canceled variable to true in order to negate said weakness. + */ +#define COMSIG_GRAVITY_WEAKNESS_EVENT "gravity_weakness_event" diff --git a/code/datums/uplink/implants.dm b/code/datums/uplink/implants.dm index 0a86c0dbe83..6965ba2f5c6 100644 --- a/code/datums/uplink/implants.dm +++ b/code/datums/uplink/implants.dm @@ -76,6 +76,13 @@ desc = "An augment implanter, with a Auxiliary Heart bioaug. ONLY WORKS ON HUMANS!" path = /obj/item/device/augment_implanter/auxiliary_heart +/datum/uplink_item/item/implants/gravity_adaptations + name = "Galatean Gravity Adaptations Implanter" + bluecrystal_cost = 1 + telecrystal_cost = 1 + desc = "An augment implanter, with a Gravity Adaptations bioaug. ONLY WORKS ON OFF-WORLDERS!" + path = /obj/item/device/augment_implanter/gravity_adaptations + /datum/uplink_item/item/implants/mind_blanker name = "Galatean Mind Blanker Implanter" bluecrystal_cost = 2 diff --git a/code/game/objects/items/devices/augment_implanter.dm b/code/game/objects/items/devices/augment_implanter.dm index ccef5e89005..8d50b27e2bd 100644 --- a/code/game/objects/items/devices/augment_implanter.dm +++ b/code/game/objects/items/devices/augment_implanter.dm @@ -80,6 +80,9 @@ /obj/item/device/augment_implanter/auxiliary_heart new_augment = /obj/item/organ/internal/augment/bioaug/auxiliary_heart +/obj/item/device/augment_implanter/gravity_adaptations + new_augment = /obj/item/organ/internal/augment/bioaug/gravity_adaptations + /obj/item/device/augment_implanter/mind_blanker new_augment = /obj/item/organ/internal/augment/bioaug/mind_blanker diff --git a/code/modules/client/preference_setup/loadout/items/augments.dm b/code/modules/client/preference_setup/loadout/items/augments.dm index 09ed213c2dc..ccdebb556d9 100644 --- a/code/modules/client/preference_setup/loadout/items/augments.dm +++ b/code/modules/client/preference_setup/loadout/items/augments.dm @@ -323,6 +323,14 @@ whitelisted = list(SPECIES_HUMAN, SPECIES_HUMAN_OFFWORLD) cost = 2 +/datum/gear/augment/gravity_adaptations + display_name = "Gravity Adaptations" + description = "A suite of chemical glands, tailored genetic therapies, and skeletal reinforcements that are aimed towards Galatean Off-worlders. These bioaugmentations serve to eliminate the weakness experienced by Off-worlders in standard terrestrial gravity." + path = /obj/item/organ/internal/augment/bioaug/gravity_adaptations + origin_restriction = list(/singleton/origin_item/origin/galatea) + whitelisted = list(SPECIES_HUMAN_OFFWORLD) + cost = 1 + /datum/gear/augment/mind_blanker display_name = "Galatean Mind Blanker" description = "A small, discrete organ attached near the base of the brainstem. Any attempt to read the mind of an individual with this augment installed will fail, as will attempts at psychic brainwashing." diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index 5fa0a2ded08..d26bdb5e074 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -818,6 +818,24 @@ item_state = "legbrace" drop_sound = 'sound/items/drop/gun.ogg' +/obj/item/clothing/accessory/offworlder/bracer/on_attached(obj/item/clothing/S, mob/user) + . = ..() + if(!user) + return + + RegisterSignal(user, COMSIG_GRAVITY_WEAKNESS_EVENT, PROC_REF(negate_weakness)) + +/obj/item/clothing/accessory/offworlder/bracer/on_removed(mob/user) + . = ..() + if(!user) + return + + UnregisterSignal(user, COMSIG_GRAVITY_WEAKNESS_EVENT) + +/obj/item/clothing/accessory/offworlder/bracer/proc/negate_weakness(var/equipee, var/canceled) + SIGNAL_HANDLER + *canceled = TRUE //TODO: TCJ just make this a component I can shove onto anything. + /obj/item/clothing/accessory/offworlder/bracer/neckbrace name = "neckbrace" desc = "A lightweight polymer frame meant to brace and hold someone's neck upright comfortably." diff --git a/code/modules/mob/living/carbon/human/species/station/human/human_subspecies.dm b/code/modules/mob/living/carbon/human/species/station/human/human_subspecies.dm index 8a704e529b0..3f8de75ecd9 100644 --- a/code/modules/mob/living/carbon/human/species/station/human/human_subspecies.dm +++ b/code/modules/mob/living/carbon/human/species/station/human/human_subspecies.dm @@ -32,6 +32,11 @@ H.put_in_hands(PB) /datum/species/human/offworlder/get_species_tally(var/mob/living/carbon/human/H) + // Check via cancelable reference signal if arbitrarily anything on the character wants to negate the offworlder weakness. + var/canceled = FALSE + SEND_SIGNAL(H, COMSIG_GRAVITY_WEAKNESS_EVENT, &canceled) + if(canceled) + return 0 if(istype(H.back, /obj/item/rig/light/offworlder)) var/obj/item/rig/light/offworlder/rig = H.back @@ -46,10 +51,6 @@ if((l_leg.status & ORGAN_ROBOT) && (r_leg.status & ORGAN_ROBOT)) return - if(H.w_uniform) - var/obj/item/clothing/under/suit = H.w_uniform - if(locate(/obj/item/clothing/accessory/offworlder/bracer) in suit.accessories) - return 0 var/obj/item/organ/internal/stomach/S = H.internal_organs_by_name[BP_STOMACH] if(S) @@ -68,6 +69,12 @@ if(A && !A.has_gravity()) return + // Check via cancelable reference signal if arbitrarily anything on the character wants to negate the offworlder weakness. + var/canceled = FALSE + SEND_SIGNAL(H, COMSIG_GRAVITY_WEAKNESS_EVENT, &canceled) + if(canceled) + return + var/obj/item/organ/external/l_leg = H.get_organ(BP_L_LEG) var/obj/item/organ/external/r_leg = H.get_organ(BP_R_LEG) @@ -79,11 +86,6 @@ if(!rig.offline) return - if(H.w_uniform) - var/obj/item/clothing/under/uniform = H.w_uniform - if(locate(/obj/item/clothing/accessory/offworlder/bracer) in uniform.accessories) - return - var/obj/item/organ/internal/stomach/S = H.internal_organs_by_name[BP_STOMACH] if(S) for(var/_R in S.ingested.reagent_volumes) diff --git a/code/modules/organs/subtypes/augment/augments/auxiliary_heart.dm b/code/modules/organs/subtypes/augment/augments/auxiliary_heart.dm index af45630f3f7..d8b751103ca 100644 --- a/code/modules/organs/subtypes/augment/augments/auxiliary_heart.dm +++ b/code/modules/organs/subtypes/augment/augments/auxiliary_heart.dm @@ -12,14 +12,14 @@ if(!owner) return - RegisterSignal(owner, COMSIG_HEART_PUMP_EVENT, PROC_REF(stabilize_circulation)) + RegisterSignal(owner, COMSIG_HEART_PUMP_EVENT, PROC_REF(stabilize_circulation), override = TRUE) /obj/item/organ/internal/augment/bioaug/auxiliary_heart/replaced() . = ..() if(!owner) return - RegisterSignal(owner, COMSIG_HEART_PUMP_EVENT, PROC_REF(stabilize_circulation)) + RegisterSignal(owner, COMSIG_HEART_PUMP_EVENT, PROC_REF(stabilize_circulation), override = TRUE) /obj/item/organ/internal/augment/bioaug/auxiliary_heart/removed() . = ..() diff --git a/code/modules/organs/subtypes/augment/augments/gravity_adaptations.dm b/code/modules/organs/subtypes/augment/augments/gravity_adaptations.dm new file mode 100644 index 00000000000..cda2fe0c017 --- /dev/null +++ b/code/modules/organs/subtypes/augment/augments/gravity_adaptations.dm @@ -0,0 +1,32 @@ +/obj/item/organ/internal/augment/bioaug/gravity_adaptations + name = "gravity adaptations" + desc = "A suite of chemical glands, tailored epigenetic therapies, and skeletal reinforcements that are aimed towards Galatean Off-worlders" \ + + "These bioaugmentations serve to eliminate the weakness experienced by Off-worlders in standard terrestrial gravity." + icon_state = "mind_blanker" //It's small and just looks like a little blob of flesh, so good enough for a placeholder for chemical glands. + organ_tag = BP_AUG_GRAV_ADAPTATION + parent_organ = BP_CHEST + +/obj/item/organ/internal/augment/bioaug/gravity_adaptations/Initialize() + . = ..() + if(!owner) + return + + RegisterSignal(owner, COMSIG_GRAVITY_WEAKNESS_EVENT, PROC_REF(negate_weakness), override = TRUE) + +/obj/item/organ/internal/augment/bioaug/gravity_adaptations/replaced() + . = ..() + if(!owner) + return + + RegisterSignal(owner, COMSIG_GRAVITY_WEAKNESS_EVENT, PROC_REF(negate_weakness), override = TRUE) + +/obj/item/organ/internal/augment/bioaug/gravity_adaptations/removed() + . = ..() + if(!owner) + return + + UnregisterSignal(owner, COMSIG_GRAVITY_WEAKNESS_EVENT) + +/obj/item/organ/internal/augment/bioaug/gravity_adaptations/proc/negate_weakness(var/implantee, var/canceled) + SIGNAL_HANDLER + *canceled = TRUE //TODO: TCJ just make this a component I can shove onto anything. diff --git a/code/modules/organs/subtypes/augment/augments/mind_blanker.dm b/code/modules/organs/subtypes/augment/augments/mind_blanker.dm index 4af61eaee66..7235d68166d 100644 --- a/code/modules/organs/subtypes/augment/augments/mind_blanker.dm +++ b/code/modules/organs/subtypes/augment/augments/mind_blanker.dm @@ -11,14 +11,14 @@ if(!owner) return - RegisterSignal(owner, COMSIG_PSI_MIND_POWER, PROC_REF(cancel_power)) + RegisterSignal(owner, COMSIG_PSI_MIND_POWER, PROC_REF(cancel_power), override = TRUE) /obj/item/organ/internal/augment/bioaug/mind_blanker/replaced() . = ..() if(!owner) return - RegisterSignal(owner, COMSIG_PSI_MIND_POWER, PROC_REF(cancel_power)) + RegisterSignal(owner, COMSIG_PSI_MIND_POWER, PROC_REF(cancel_power), override = TRUE) /obj/item/organ/internal/augment/bioaug/mind_blanker/removed() . = ..() @@ -44,14 +44,14 @@ if(!owner) return - RegisterSignal(owner, COMSIG_PSI_MIND_POWER, PROC_REF(cancel_power_lethal)) + RegisterSignal(owner, COMSIG_PSI_MIND_POWER, PROC_REF(cancel_power_lethal), override = TRUE) /obj/item/organ/internal/augment/bioaug/mind_blanker_lethal/replaced() . = ..() if(!owner) return - RegisterSignal(owner, COMSIG_PSI_MIND_POWER, PROC_REF(cancel_power_lethal)) + RegisterSignal(owner, COMSIG_PSI_MIND_POWER, PROC_REF(cancel_power_lethal), override = TRUE) /obj/item/organ/internal/augment/bioaug/mind_blanker_lethal/removed() . = ..() diff --git a/code/modules/organs/subtypes/augment/augments/platelet_factories.dm b/code/modules/organs/subtypes/augment/augments/platelet_factories.dm index 50de3ef94ee..9a0bcd63f2e 100644 --- a/code/modules/organs/subtypes/augment/augments/platelet_factories.dm +++ b/code/modules/organs/subtypes/augment/augments/platelet_factories.dm @@ -12,16 +12,16 @@ if(!owner) return - RegisterSignal(owner, COMSIG_HEART_PUMP_EVENT, PROC_REF(stroke_risk)) - RegisterSignal(owner, COMSIG_HEART_BLEED_EVENT, PROC_REF(reduce_bloodloss)) + RegisterSignal(owner, COMSIG_HEART_PUMP_EVENT, PROC_REF(stroke_risk), override = TRUE) + RegisterSignal(owner, COMSIG_HEART_BLEED_EVENT, PROC_REF(reduce_bloodloss), override = TRUE) /obj/item/organ/internal/augment/bioaug/platelet_factories/replaced() . = ..() if(!owner) return - RegisterSignal(owner, COMSIG_HEART_PUMP_EVENT, PROC_REF(stroke_risk)) - RegisterSignal(owner, COMSIG_HEART_BLEED_EVENT, PROC_REF(reduce_bloodloss)) + RegisterSignal(owner, COMSIG_HEART_PUMP_EVENT, PROC_REF(stroke_risk), override = TRUE) + RegisterSignal(owner, COMSIG_HEART_BLEED_EVENT, PROC_REF(reduce_bloodloss), override = TRUE) /obj/item/organ/internal/augment/bioaug/platelet_factories/removed() . = ..() diff --git a/html/changelogs/hellfirejag-gravity-adatpations-bioaug.yml b/html/changelogs/hellfirejag-gravity-adatpations-bioaug.yml new file mode 100644 index 00000000000..32fc9ade77f --- /dev/null +++ b/html/changelogs/hellfirejag-gravity-adatpations-bioaug.yml @@ -0,0 +1,6 @@ +author: Hellfirejag +delete-after: True +changes: + - rscadd: "Added a 'Gravity Adaptations' bioaug as a new loadout item available to Galatean Off-Worlders. These work similarly to hardsuits and legbraces by protecting the character from gravity sickness." + - rscadd: "Gravity Adaptations can also be bought in antag uplinks." + - refactor: "Refactored Off-worlder gravity weakness to use the new COMSIG_GRAVITY_WEAKNESS_EVENT signal, so that more things can interact with it without needing to be hardcoded."