diff --git a/code/modules/antagonists/changeling/changeling.dm b/code/modules/antagonists/changeling/changeling.dm index 171468e3d7e..de47610564c 100644 --- a/code/modules/antagonists/changeling/changeling.dm +++ b/code/modules/antagonists/changeling/changeling.dm @@ -350,12 +350,11 @@ /datum/antagonist/changeling/proc/regain_powers() emporium_action.Grant(owner.current) for(var/datum/action/changeling/power as anything in innate_powers) - if(power.needs_button) - power.Grant(owner.current) + power.Grant(owner.current) for(var/power_path in purchased_powers) var/datum/action/changeling/power = purchased_powers[power_path] - if(istype(power) && power.needs_button) + if(istype(power)) power.Grant(owner.current) /* @@ -1048,9 +1047,6 @@ /datum/outfit/changeling_space name = "Changeling (Space)" - - head = /obj/item/clothing/head/helmet/space/changeling - suit = /obj/item/clothing/suit/space/changeling l_hand = /obj/item/melee/arm_blade #undef FORMAT_CHEM_CHARGES_TEXT diff --git a/code/modules/antagonists/changeling/changeling_power.dm b/code/modules/antagonists/changeling/changeling_power.dm index f4949306ded..1e2d54eb456 100644 --- a/code/modules/antagonists/changeling/changeling_power.dm +++ b/code/modules/antagonists/changeling/changeling_power.dm @@ -7,8 +7,6 @@ background_icon_state = "bg_changeling" overlay_icon_state = "bg_changeling_border" button_icon = 'icons/mob/actions/actions_changeling.dmi' - /// For passive abilities like hivemind that dont need an action button - var/needs_button = TRUE /// Details displayed in fine print within the changling emporium var/helptext = "" /// How many changeling chems it costs to use @@ -44,8 +42,7 @@ the same goes for Remove(). if you override Remove(), call parent or else your p /datum/action/changeling/proc/on_purchase(mob/user, is_respec) if(!is_respec) SSblackbox.record_feedback("tally", "changeling_power_purchase", 1, name) - if(needs_button) - Grant(user)//how powers are added rather than the checks in mob.dm + Grant(user)//how powers are added rather than the checks in mob.dm /datum/action/changeling/Trigger(trigger_flags) var/mob/user = owner diff --git a/code/modules/antagonists/changeling/powers/defib_grasp.dm b/code/modules/antagonists/changeling/powers/defib_grasp.dm index 20ff3049c8f..135b9b243f7 100644 --- a/code/modules/antagonists/changeling/powers/defib_grasp.dm +++ b/code/modules/antagonists/changeling/powers/defib_grasp.dm @@ -4,7 +4,7 @@ we will snatch their arms off and instantly finalize our stasis." helptext = "This ability is passive, and will trigger when a defibrillator paddle is applied to our chest \ while we are dead or in stasis. Will also stun cyborgs momentarily." - needs_button = FALSE + owner_has_control = FALSE dna_cost = 0 /// Flags to pass to fully heal when we get zapped diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index bf4f8c2b3da..54027b7d8a2 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -480,78 +480,6 @@ remaining_uses-- return ..() - -/***************************************\ -|*********SPACE SUIT + HELMET***********| -\***************************************/ -/datum/action/changeling/suit/organic_space_suit - name = "Organic Space Suit" - desc = "We grow an organic suit to protect ourselves from space exposure, including regulation of temperature and oxygen needs. Costs 20 chemicals." - helptext = "We must constantly repair our form to make it space-proof, reducing chemical production while we are protected. Cannot be used in lesser form." - button_icon_state = "organic_suit" - chemical_cost = 20 - dna_cost = 2 - req_human = TRUE - - suit_type = /obj/item/clothing/suit/space/changeling - helmet_type = /obj/item/clothing/head/helmet/space/changeling - suit_name_simple = "flesh shell" - helmet_name_simple = "space helmet" - recharge_slowdown = 0.25 - blood_on_castoff = 1 - -/obj/item/clothing/suit/space/changeling - name = "flesh mass" - icon_state = "lingspacesuit_t" - icon = 'icons/obj/clothing/suits/costume.dmi' - worn_icon = 'icons/mob/clothing/suits/costume.dmi' - desc = "A huge, bulky mass of pressure and temperature-resistant organic tissue, evolved to facilitate space travel." - item_flags = DROPDEL - clothing_flags = STOPSPRESSUREDAMAGE //Not THICKMATERIAL because it's organic tissue, so if somebody tries to inject something into it, it still ends up in your blood. (also balance but muh fluff) - allowed = list(/obj/item/flashlight, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/oxygen) - armor_type = /datum/armor/space_changeling - actions_types = list() - cell = null - show_hud = FALSE - -/datum/armor/space_changeling - bio = 100 - fire = 90 - acid = 90 - -/obj/item/clothing/suit/space/changeling/Initialize(mapload) - . = ..() - ADD_TRAIT(src, TRAIT_NODROP, CHANGELING_TRAIT) - if(ismob(loc)) - loc.visible_message(span_warning("[loc.name]\'s flesh rapidly inflates, forming a bloated mass around [loc.p_their()] body!"), span_warning("We inflate our flesh, creating a spaceproof suit!"), span_hear("You hear organic matter ripping and tearing!")) - START_PROCESSING(SSobj, src) - -// seal the cell door -/obj/item/clothing/suit/space/changeling/toggle_spacesuit_cell(mob/user) - return - -/obj/item/clothing/suit/space/changeling/process(seconds_per_tick) - if(ishuman(loc)) - var/mob/living/carbon/human/H = loc - H.reagents.add_reagent(/datum/reagent/medicine/salbutamol, REAGENTS_METABOLISM * (seconds_per_tick / SSMOBS_DT)) - H.adjust_bodytemperature(temperature_setting - H.bodytemperature) // force changelings to normal temp step mode played badly - -/obj/item/clothing/head/helmet/space/changeling - name = "flesh mass" - icon = 'icons/obj/clothing/head/costume.dmi' - worn_icon = 'icons/mob/clothing/head/costume.dmi' - icon_state = "lingspacehelmet" - inhand_icon_state = null - desc = "A covering of pressure and temperature-resistant organic tissue with a glass-like chitin front." - item_flags = DROPDEL - clothing_flags = STOPSPRESSUREDAMAGE | HEADINTERNALS - armor_type = /datum/armor/space_changeling - flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH - -/obj/item/clothing/head/helmet/space/changeling/Initialize(mapload) - . = ..() - ADD_TRAIT(src, TRAIT_NODROP, CHANGELING_TRAIT) - /***************************************\ |*****************ARMOR*****************| \***************************************/ diff --git a/code/modules/antagonists/changeling/powers/void_adaption.dm b/code/modules/antagonists/changeling/powers/void_adaption.dm new file mode 100644 index 00000000000..76c0eeffc97 --- /dev/null +++ b/code/modules/antagonists/changeling/powers/void_adaption.dm @@ -0,0 +1,68 @@ +/datum/action/changeling/void_adaption + name = "Void Adaption" + desc = "We prepare our cells to resist the hostile environment outside of the station. We may freely travel wherever we wish." + helptext = "This ability is passive, and will automatically protect you in situations of extreme cold or vacuum, \ + as well as removing your need to breathe. While it is actively protecting you from temperature or pressure \ + it reduces your chemical regeneration rate." + owner_has_control = FALSE + dna_cost = 2 + + /// Traits we apply to become immune to the environment + var/static/list/gain_traits = list(TRAIT_NOBREATH, TRAIT_RESISTCOLD, TRAIT_RESISTLOWPRESSURE, TRAIT_SNOWSTORM_IMMUNE) + /// How much we slow chemical regeneration while active, in chems per second + var/recharge_slowdown = 0.25 + /// Are we currently protecting our user? + var/currently_active = FALSE + +/datum/action/changeling/void_adaption/on_purchase(mob/user, is_respec) + . = ..() + user.add_traits(gain_traits, REF(src)) + RegisterSignal(user, COMSIG_LIVING_LIFE, PROC_REF(check_environment)) + +/datum/action/changeling/void_adaption/Remove(mob/remove_from) + remove_from.remove_traits(gain_traits, REF(src)) + UnregisterSignal(remove_from, COMSIG_LIVING_LIFE) + if (currently_active) + on_removed_adaption(remove_from, "Our cells relax, despite the danger!") + return ..() + +/// Checks if we would be providing any useful benefit at present +/datum/action/changeling/void_adaption/proc/check_environment(mob/living/void_adapted) + SIGNAL_HANDLER + + var/list/active_reasons = list() + + var/datum/gas_mixture/environment = void_adapted.loc.return_air() + if (!isnull(environment)) + var/vulnerable_temperature = void_adapted.get_body_temp_cold_damage_limit() + var/affected_temperature = environment.return_temperature() + if (ishuman(void_adapted)) + var/mob/living/carbon/human/special_boy = void_adapted + var/cold_protection = special_boy.get_cold_protection(affected_temperature) + vulnerable_temperature *= (1 - cold_protection) + + var/affected_pressure = special_boy.calculate_affecting_pressure(environment.return_pressure()) + if (affected_pressure < HAZARD_LOW_PRESSURE) + active_reasons += "vacuum" + + if (affected_temperature < vulnerable_temperature) + active_reasons += "cold" + + var/should_be_active = !!length(active_reasons) + if (currently_active == should_be_active) + return + + if (!should_be_active) + on_removed_adaption(void_adapted, "Our cells relax in safer air.") + return + var/datum/antagonist/changeling/changeling_data = void_adapted.mind?.has_antag_datum(/datum/antagonist/changeling) + to_chat(void_adapted, span_changeling("Our cells harden themselves against the [pick(active_reasons)].")) + changeling_data?.chem_recharge_slowdown -= recharge_slowdown + currently_active = TRUE + +/// Called when we stop being adapted +/datum/action/changeling/void_adaption/proc/on_removed_adaption(mob/living/former, message) + var/datum/antagonist/changeling/changeling_data = former.mind?.has_antag_datum(/datum/antagonist/changeling) + to_chat(former, span_changeling(message)) + changeling_data?.chem_recharge_slowdown += recharge_slowdown + currently_active = FALSE diff --git a/code/modules/meteors/meteor_spawning.dm b/code/modules/meteors/meteor_spawning.dm index eac365bc2a8..97c359d03bf 100644 --- a/code/modules/meteors/meteor_spawning.dm +++ b/code/modules/meteors/meteor_spawning.dm @@ -109,7 +109,7 @@ new_changeling.log_message("was spawned as a midround space changeling by an event.", LOG_GAME) var/datum/antagonist/changeling/changeling_datum = locate() in player_mind.antag_datums - changeling_datum.give_power(/datum/action/changeling/suit/organic_space_suit) + changeling_datum.give_power(/datum/action/changeling/void_adaption) changeling_datum.give_power(/datum/action/changeling/weapon/arm_blade) new_changeling.equipOutfit(/datum/outfit/changeling_space) diff --git a/code/modules/mob/living/basic/basic.dm b/code/modules/mob/living/basic/basic.dm index aebb54770d7..ab8daf47635 100644 --- a/code/modules/mob/living/basic/basic.dm +++ b/code/modules/mob/living/basic/basic.dm @@ -117,13 +117,23 @@ if(speak_emote) speak_emote = string_list(speak_emote) - if(unsuitable_atmos_damage != 0) - //String assoc list returns a cached list, so this is like a static list to pass into the element below. - habitable_atmos = string_assoc_list(habitable_atmos) - AddElement(/datum/element/atmos_requirements, habitable_atmos, unsuitable_atmos_damage) + apply_atmos_requirements() + apply_temperature_requirements() + +/// Ensures this mob can take atmospheric damage if it's supposed to +/mob/living/basic/proc/apply_atmos_requirements() + if(unsuitable_atmos_damage == 0) + return + //String assoc list returns a cached list, so this is like a static list to pass into the element below. + habitable_atmos = string_assoc_list(habitable_atmos) + AddElement(/datum/element/atmos_requirements, habitable_atmos, unsuitable_atmos_damage) + +/// Ensures this mob can take temperature damage if it's supposed to +/mob/living/basic/proc/apply_temperature_requirements() + if(unsuitable_cold_damage == 0 && unsuitable_heat_damage == 0) + return + AddElement(/datum/element/basic_body_temp_sensitive, minimum_survivable_temperature, maximum_survivable_temperature, unsuitable_cold_damage, unsuitable_heat_damage) - if(unsuitable_cold_damage != 0 && unsuitable_heat_damage != 0) - AddElement(/datum/element/basic_body_temp_sensitive, minimum_survivable_temperature, maximum_survivable_temperature, unsuitable_cold_damage, unsuitable_heat_damage) /mob/living/basic/Life(seconds_per_tick = SSMOBS_DT, times_fired) . = ..() @@ -207,10 +217,24 @@ melee_attack(attack_target, modifiers) /mob/living/basic/vv_edit_var(vname, vval) + switch(vname) + if(NAMEOF(src, habitable_atmos), NAMEOF(src, unsuitable_atmos_damage)) + RemoveElement(/datum/element/atmos_requirements, habitable_atmos, unsuitable_atmos_damage) + . = TRUE + if(NAMEOF(src, minimum_survivable_temperature), NAMEOF(src, maximum_survivable_temperature), NAMEOF(src, unsuitable_cold_damage), NAMEOF(src, unsuitable_heat_damage)) + RemoveElement(/datum/element/basic_body_temp_sensitive, minimum_survivable_temperature, maximum_survivable_temperature, unsuitable_cold_damage, unsuitable_heat_damage) + . = TRUE + . = ..() - if(vname == NAMEOF(src, speed)) - datum_flags |= DF_VAR_EDITED - set_varspeed(vval) + + switch(vname) + if(NAMEOF(src, habitable_atmos), NAMEOF(src, unsuitable_atmos_damage)) + apply_atmos_requirements() + if(NAMEOF(src, minimum_survivable_temperature), NAMEOF(src, maximum_survivable_temperature), NAMEOF(src, unsuitable_cold_damage), NAMEOF(src, unsuitable_heat_damage)) + apply_temperature_requirements() + if(NAMEOF(src, speed)) + datum_flags |= DF_VAR_EDITED + set_varspeed(vval) /mob/living/basic/proc/set_varspeed(var_value) speed = var_value @@ -260,3 +284,9 @@ else if(on_fire && !isnull(last_icon_state)) return last_icon_state return null + +/mob/living/basic/get_body_temp_heat_damage_limit() + return maximum_survivable_temperature + +/mob/living/basic/get_body_temp_cold_damage_limit() + return minimum_survivable_temperature diff --git a/code/modules/unit_tests/screenshots/screenshot_antag_icons_changelingmidround.png b/code/modules/unit_tests/screenshots/screenshot_antag_icons_changelingmidround.png index ac412207c23..d8e9c548db9 100644 Binary files a/code/modules/unit_tests/screenshots/screenshot_antag_icons_changelingmidround.png and b/code/modules/unit_tests/screenshots/screenshot_antag_icons_changelingmidround.png differ diff --git a/tgstation.dme b/tgstation.dme index e0b772c84b4..1513794e5a6 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -2835,6 +2835,7 @@ #include "code\modules\antagonists\changeling\powers\strained_muscles.dm" #include "code\modules\antagonists\changeling\powers\tiny_prick.dm" #include "code\modules\antagonists\changeling\powers\transform.dm" +#include "code\modules\antagonists\changeling\powers\void_adaption.dm" #include "code\modules\antagonists\clown_ops\bananium_bomb.dm" #include "code\modules\antagonists\clown_ops\clown_weapons.dm" #include "code\modules\antagonists\clown_ops\clownop.dm"