From 362362ec2c287cdce66f58ecd5d89cb7bfae34ab Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 11 Feb 2024 18:02:11 +0100 Subject: [PATCH] [MIRROR] Adds an IS_CHANGELING helper (#26434) * Adds an IS_CHANGELING helper (#81228) ## About The Pull Request What it says on the tin. I also replaced checks with it everywhere I found appropriate, hopefully without accidentally breaking anything. ## Why It's Good For The Game We have a helper for most other antags, and it makes code a lot cleaner and easier to read. I'm surprised we didn't have this one already. ## Changelog :cl: code: added an IS_CHANGELING() helper and used it where applicable /:cl: * Adds an IS_CHANGELING helper * skyrat stuff --------- Co-authored-by: A miscellaneous Fern <80640114+FernandoJ8@users.noreply.github.com> Co-authored-by: jjpark-kb --- code/__DEFINES/antagonists.dm | 3 +++ code/datums/saymode.dm | 2 +- code/game/gamemodes/objective.dm | 2 +- .../abductor/equipment/gear/abductor_items.dm | 2 +- .../changeling/changeling_power.dm | 6 +++--- .../antagonists/changeling/powers/absorb.dm | 8 ++++---- .../changeling/powers/fakedeath.dm | 2 +- .../changeling/powers/lesserform.dm | 2 +- .../changeling/powers/mimic_voice.dm | 4 ++-- .../changeling/powers/mutations.dm | 6 +++--- .../changeling/powers/pheromone_receptors.dm | 6 +++--- .../antagonists/changeling/powers/shriek.dm | 2 +- .../changeling/powers/tiny_prick.dm | 18 ++++++++--------- .../changeling/powers/transform.dm | 20 +++++++++---------- .../changeling/powers/void_adaption.dm | 4 ++-- .../living/basic/guardian/guardian_creator.dm | 2 +- code/modules/mob/living/brain/brain_item.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 2 +- .../reagents/drinks/alcohol_reagents.dm | 2 +- .../chemistry/reagents/other_reagents.dm | 2 +- code/modules/unit_tests/changeling.dm | 2 +- .../code/cortical_borer_abilities.dm | 6 ++---- 22 files changed, 53 insertions(+), 52 deletions(-) diff --git a/code/__DEFINES/antagonists.dm b/code/__DEFINES/antagonists.dm index d750a0a3631..888164e5256 100644 --- a/code/__DEFINES/antagonists.dm +++ b/code/__DEFINES/antagonists.dm @@ -213,6 +213,9 @@ GLOBAL_LIST_INIT(ai_employers, list( /// Checks if the given mob is a blood cultist #define IS_CULTIST(mob) (mob?.mind?.has_antag_datum(/datum/antagonist/cult)) +/// Checks if the given mob is a changeling +#define IS_CHANGELING(mob) (mob?.mind?.has_antag_datum(/datum/antagonist/changeling)) + /// Checks if the given mob is a nuclear operative #define IS_NUKE_OP(mob) (mob?.mind?.has_antag_datum(/datum/antagonist/nukeop)) diff --git a/code/datums/saymode.dm b/code/datums/saymode.dm index 363f484a415..3598bd764ca 100644 --- a/code/datums/saymode.dm +++ b/code/datums/saymode.dm @@ -20,7 +20,7 @@ if(user.mind.has_antag_datum(/datum/antagonist/fallen_changeling)) to_chat(user, span_changeling("We're cut off from the hivemind! We've lost everything! EVERYTHING!!")) return FALSE - var/datum/antagonist/changeling/ling_sender = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/ling_sender = IS_CHANGELING(user) if(!ling_sender) return FALSE if(HAS_TRAIT(user, TRAIT_CHANGELING_HIVEMIND_MUTE)) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 4a75abef9b1..f04ff43553c 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -792,7 +792,7 @@ GLOBAL_LIST_EMPTY(possible_items) n_p ++ else if (SSticker.IsRoundInProgress()) for(var/mob/living/carbon/human/P in GLOB.player_list) - if(!(P.mind.has_antag_datum(/datum/antagonist/changeling)) && !(P.mind in owners)) + if(!(IS_CHANGELING(P)) && !(P.mind in owners)) n_p ++ target_amount = min(target_amount, n_p) diff --git a/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm b/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm index 66004140e59..14d8d737886 100644 --- a/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm +++ b/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm @@ -446,7 +446,7 @@ Congratulations! You are now trained for invasive xenobiology research!"} if(ishuman(victim)) var/mob/living/carbon/human/human_victim = victim species = span_notice("[human_victim.dna.species.name]") - if(human_victim.mind && human_victim.mind.has_antag_datum(/datum/antagonist/changeling)) + if(IS_CHANGELING(human_victim)) species = span_warning("Changeling lifeform") var/obj/item/organ/internal/heart/gland/temp = locate() in human_victim.organs if(temp) diff --git a/code/modules/antagonists/changeling/changeling_power.dm b/code/modules/antagonists/changeling/changeling_power.dm index 9e8c0fa04e9..59656fd80bd 100644 --- a/code/modules/antagonists/changeling/changeling_power.dm +++ b/code/modules/antagonists/changeling/changeling_power.dm @@ -44,7 +44,7 @@ the same goes for Remove(). if you override Remove(), call parent or else your p /datum/action/changeling/Trigger(trigger_flags) var/mob/user = owner - if(!user || !user.mind || !user.mind.has_antag_datum(/datum/antagonist/changeling)) + if(!user || !IS_CHANGELING(user)) return try_to_sting(user) @@ -61,7 +61,7 @@ the same goes for Remove(). if you override Remove(), call parent or else your p /datum/action/changeling/proc/try_to_sting(mob/living/user, mob/living/target) if(!can_sting(user, target)) return FALSE - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) if(sting_action(user, target)) sting_feedback(user, target) changeling.adjust_chemicals(-chemical_cost) @@ -81,7 +81,7 @@ the same goes for Remove(). if you override Remove(), call parent or else your p /datum/action/changeling/proc/can_sting(mob/living/user, mob/living/target) if(!can_be_used_by(user)) return FALSE - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) if(changeling.chem_charges < chemical_cost) user.balloon_alert(user, "needs [chemical_cost] chemicals!") return FALSE diff --git a/code/modules/antagonists/changeling/powers/absorb.dm b/code/modules/antagonists/changeling/powers/absorb.dm index 1fdb50a7bab..5bd0f390cb8 100644 --- a/code/modules/antagonists/changeling/powers/absorb.dm +++ b/code/modules/antagonists/changeling/powers/absorb.dm @@ -24,13 +24,13 @@ return var/mob/living/carbon/target = owner.pulling - var/datum/antagonist/changeling/changeling = owner.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(owner) return changeling.can_absorb_dna(target) /datum/action/changeling/absorb_dna/sting_action(mob/owner) SHOULD_CALL_PARENT(FALSE) // the only reason to call parent is for proper blackbox logging, and we do that ourselves in a snowflake way - var/datum/antagonist/changeling/changeling = owner.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(owner) var/mob/living/carbon/human/target = owner.pulling is_absorbing = TRUE @@ -68,7 +68,7 @@ /datum/action/changeling/absorb_dna/proc/absorb_memories(mob/living/carbon/human/target) var/datum/mind/suckedbrain = target.mind - var/datum/antagonist/changeling/changeling = owner.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(owner) for(var/memory_type in suckedbrain.memories) var/datum/memory/stolen_memory = suckedbrain.memories[memory_type] @@ -109,7 +109,7 @@ to_chat(owner, span_boldnotice("We have no more knowledge of [target]'s speech patterns.")) - var/datum/antagonist/changeling/target_ling = target.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/target_ling = IS_CHANGELING(target) if(target_ling)//If the target was a changeling, suck out their extra juice and objective points! to_chat(owner, span_boldnotice("[target] was one of us. We have absorbed their power.")) diff --git a/code/modules/antagonists/changeling/powers/fakedeath.dm b/code/modules/antagonists/changeling/powers/fakedeath.dm index 9cd406d311c..921dde35492 100644 --- a/code/modules/antagonists/changeling/powers/fakedeath.dm +++ b/code/modules/antagonists/changeling/powers/fakedeath.dm @@ -118,7 +118,7 @@ if(QDELETED(src) || QDELETED(user)) return - var/datum/antagonist/changeling/ling = user.mind?.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/ling = IS_CHANGELING(user) if(QDELETED(ling) || !(src in ling.innate_powers + ling.purchased_powers)) // checking both innate and purchased for full coverage return if(!HAS_TRAIT_FROM(user, TRAIT_DEATHCOMA, CHANGELING_TRAIT)) diff --git a/code/modules/antagonists/changeling/powers/lesserform.dm b/code/modules/antagonists/changeling/powers/lesserform.dm index 87bd7c7c8b6..55238ce762d 100644 --- a/code/modules/antagonists/changeling/powers/lesserform.dm +++ b/code/modules/antagonists/changeling/powers/lesserform.dm @@ -30,7 +30,7 @@ if(user.movement_type & VENTCRAWLING) user.balloon_alert(user, "can't transform in pipes!") return FALSE - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) var/datum/changeling_profile/chosen_form = select_form(changeling, user) if(!chosen_form) return FALSE diff --git a/code/modules/antagonists/changeling/powers/mimic_voice.dm b/code/modules/antagonists/changeling/powers/mimic_voice.dm index 3a9314a953a..9caf0abb450 100644 --- a/code/modules/antagonists/changeling/powers/mimic_voice.dm +++ b/code/modules/antagonists/changeling/powers/mimic_voice.dm @@ -9,7 +9,7 @@ // Fake Voice /datum/action/changeling/mimicvoice/sting_action(mob/user) - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) if(changeling.mimicing) changeling.mimicing = "" changeling.chem_recharge_slowdown -= 0.25 @@ -27,7 +27,7 @@ return TRUE /datum/action/changeling/mimicvoice/Remove(mob/user) - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) if(changeling?.mimicing) changeling.chem_recharge_slowdown = max(0, changeling.chem_recharge_slowdown - 0.25) changeling.mimicing = "" diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index 9c5b6a10ec9..7ad2b14448c 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -121,7 +121,7 @@ //checks if we already have an organic suit and casts it off. /datum/action/changeling/suit/proc/check_suit(mob/user) - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) if(!ishuman(user) || !changeling) return 1 var/mob/living/carbon/human/H = user @@ -154,7 +154,7 @@ user.equip_to_slot_if_possible(new suit_type(user), ITEM_SLOT_OCLOTHING, 1, 1, 1) user.equip_to_slot_if_possible(new helmet_type(user), ITEM_SLOT_HEAD, 1, 1, 1) - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) changeling.chem_recharge_slowdown += recharge_slowdown return TRUE @@ -477,7 +477,7 @@ weapon_name_simple = "shield" /datum/action/changeling/weapon/shield/sting_action(mob/user) - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) //So we can read the absorbed_count. + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) //So we can read the absorbed_count. if(!changeling) return diff --git a/code/modules/antagonists/changeling/powers/pheromone_receptors.dm b/code/modules/antagonists/changeling/powers/pheromone_receptors.dm index 8ed9c27599b..18fda4bf4ff 100644 --- a/code/modules/antagonists/changeling/powers/pheromone_receptors.dm +++ b/code/modules/antagonists/changeling/powers/pheromone_receptors.dm @@ -15,14 +15,14 @@ /datum/action/changeling/pheromone_receptors/Remove(mob/living/carbon/user) if(receptors_active) - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) changeling.chem_recharge_slowdown -= 0.25 user.remove_status_effect(/datum/status_effect/agent_pinpointer/changeling) ..() /datum/action/changeling/pheromone_receptors/sting_action(mob/living/carbon/user) ..() - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) if(!receptors_active) to_chat(user, span_warning("We search for the scent of any nearby changelings.")) changeling.chem_recharge_slowdown += 0.25 @@ -49,7 +49,7 @@ for(var/mob/living/carbon/C in GLOB.alive_mob_list) if(C != owner && C.mind) - var/datum/antagonist/changeling/antag_datum = C.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/antag_datum = IS_CHANGELING(C) if(istype(antag_datum)) var/their_loc = get_turf(C) var/distance = get_dist_euclidian(my_loc, their_loc) diff --git a/code/modules/antagonists/changeling/powers/shriek.dm b/code/modules/antagonists/changeling/powers/shriek.dm index badd18f19f0..aa204d89a16 100644 --- a/code/modules/antagonists/changeling/powers/shriek.dm +++ b/code/modules/antagonists/changeling/powers/shriek.dm @@ -16,7 +16,7 @@ for(var/mob/living/M in get_hearers_in_view(4, user)) if(iscarbon(M)) var/mob/living/carbon/C = M - if(!C.mind || !C.mind.has_antag_datum(/datum/antagonist/changeling)) + if(!IS_CHANGELING(C)) var/obj/item/organ/internal/ears/ears = C.get_organ_slot(ORGAN_SLOT_EARS) if(ears) ears.adjustEarDamage(0, 30) diff --git a/code/modules/antagonists/changeling/powers/tiny_prick.dm b/code/modules/antagonists/changeling/powers/tiny_prick.dm index f8c1bfc5160..1d82635013b 100644 --- a/code/modules/antagonists/changeling/powers/tiny_prick.dm +++ b/code/modules/antagonists/changeling/powers/tiny_prick.dm @@ -6,7 +6,7 @@ var/mob/user = owner if(!user || !user.mind) return - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) if(!changeling) return if(!changeling.chosen_sting) @@ -17,7 +17,7 @@ /datum/action/changeling/sting/proc/set_sting(mob/user) to_chat(user, span_notice("We prepare our sting. Alt+click or click the middle mouse button on a target to sting them.")) - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) changeling.chosen_sting = src changeling.lingstingdisplay.icon_state = button_icon_state @@ -25,7 +25,7 @@ /datum/action/changeling/sting/proc/unset_sting(mob/user) to_chat(user, span_warning("We retract our sting, we can't sting anyone for now.")) - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) changeling.chosen_sting = null changeling.lingstingdisplay.icon_state = null @@ -40,7 +40,7 @@ /datum/action/changeling/sting/can_sting(mob/user, mob/target) if(!..()) return - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) if(!changeling.chosen_sting) to_chat(user, "We haven't prepared our sting yet!") if(!iscarbon(target)) @@ -53,7 +53,7 @@ return // SKYRAT EDIT END if(!length(get_path_to(user, target, max_distance = changeling.sting_range, simulated_only = FALSE))) return // no path within the sting's range is found. what a weird place to use the pathfinding system - if(target.mind && target.mind.has_antag_datum(/datum/antagonist/changeling)) + if(IS_CHANGELING(target)) sting_feedback(user, target) changeling.chem_charges -= chemical_cost return 1 @@ -62,7 +62,7 @@ if(!target) return to_chat(user, span_notice("We stealthily sting [target.name].")) - if(target.mind && target.mind.has_antag_datum(/datum/antagonist/changeling)) + if(IS_CHANGELING(target)) to_chat(target, span_warning("You feel a tiny prick.")) return 1 @@ -96,7 +96,7 @@ /datum/action/changeling/sting/transformation/set_sting(mob/user) selected_dna = null - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) var/datum/changeling_profile/new_selected_dna = changeling.select_dna() if(QDELETED(src) || QDELETED(changeling) || QDELETED(user)) return @@ -200,13 +200,13 @@ /datum/action/changeling/sting/extract_dna/can_sting(mob/user, mob/target) if(..()) - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) return changeling.can_absorb_dna(target) /datum/action/changeling/sting/extract_dna/sting_action(mob/user, mob/living/carbon/human/target) ..() log_combat(user, target, "stung", "extraction sting") - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) if(!changeling.has_profile_with_dna(target.dna)) changeling.add_new_profile(target) return TRUE diff --git a/code/modules/antagonists/changeling/powers/transform.dm b/code/modules/antagonists/changeling/powers/transform.dm index 69f21b0e44e..aea06a27e1e 100644 --- a/code/modules/antagonists/changeling/powers/transform.dm +++ b/code/modules/antagonists/changeling/powers/transform.dm @@ -13,7 +13,7 @@ //ATTACK HAND IGNORING PARENT RETURN VALUE /obj/item/clothing/glasses/changeling/attack_hand(mob/user, list/modifiers) - if(loc == user && user.mind && user.mind.has_antag_datum(/datum/antagonist/changeling)) + if(loc == user && IS_CHANGELING(user)) to_chat(user, span_notice("You reabsorb [src] into your body.")) qdel(src) return @@ -25,7 +25,7 @@ //ATTACK HAND IGNORING PARENT RETURN VALUE /obj/item/clothing/under/changeling/attack_hand(mob/user, list/modifiers) - if(loc == user && user.mind && user.mind.has_antag_datum(/datum/antagonist/changeling)) + if(loc == user && IS_CHANGELING(user)) to_chat(user, span_notice("You reabsorb [src] into your body.")) qdel(src) return @@ -38,7 +38,7 @@ //ATTACK HAND IGNORING PARENT RETURN VALUE /obj/item/clothing/suit/changeling/attack_hand(mob/user, list/modifiers) - if(loc == user && user.mind && user.mind.has_antag_datum(/datum/antagonist/changeling)) + if(loc == user && IS_CHANGELING(user)) to_chat(user, span_notice("You reabsorb [src] into your body.")) qdel(src) return @@ -51,7 +51,7 @@ //ATTACK HAND IGNORING PARENT RETURN VALUE /obj/item/clothing/head/changeling/attack_hand(mob/user, list/modifiers) - if(loc == user && user.mind && user.mind.has_antag_datum(/datum/antagonist/changeling)) + if(loc == user && IS_CHANGELING(user)) to_chat(user, span_notice("You reabsorb [src] into your body.")) qdel(src) return @@ -63,7 +63,7 @@ //ATTACK HAND IGNORING PARENT RETURN VALUE /obj/item/clothing/shoes/changeling/attack_hand(mob/user, list/modifiers) - if(loc == user && user.mind && user.mind.has_antag_datum(/datum/antagonist/changeling)) + if(loc == user && IS_CHANGELING(user)) to_chat(user, span_notice("You reabsorb [src] into your body.")) qdel(src) return @@ -75,7 +75,7 @@ //ATTACK HAND IGNORING PARENT RETURN VALUE /obj/item/clothing/gloves/changeling/attack_hand(mob/user, list/modifiers) - if(loc == user && user.mind && user.mind.has_antag_datum(/datum/antagonist/changeling)) + if(loc == user && IS_CHANGELING(user)) to_chat(user, span_notice("You reabsorb [src] into your body.")) qdel(src) return @@ -87,7 +87,7 @@ //ATTACK HAND IGNORING PARENT RETURN VALUE /obj/item/clothing/mask/changeling/attack_hand(mob/user, list/modifiers) - if(loc == user && user.mind && user.mind.has_antag_datum(/datum/antagonist/changeling)) + if(loc == user && IS_CHANGELING(user)) to_chat(user, span_notice("You reabsorb [src] into your body.")) qdel(src) return @@ -100,7 +100,7 @@ //ATTACK HAND IGNORING PARENT RETURN VALUE /obj/item/changeling/attack_hand(mob/user, list/modifiers) - if(loc == user && user.mind && user.mind.has_antag_datum(/datum/antagonist/changeling)) + if(loc == user && IS_CHANGELING(user)) to_chat(user, span_notice("You reabsorb [src] into your body.")) qdel(src) return @@ -134,7 +134,7 @@ //Change our DNA to that of somebody we've absorbed. /datum/action/changeling/transform/sting_action(mob/living/carbon/human/user) - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(user) var/datum/changeling_profile/chosen_prof = changeling.select_dna() if(!chosen_prof) @@ -186,7 +186,7 @@ /datum/antagonist/changeling/proc/check_menu(mob/living/carbon/user) if(!istype(user)) return FALSE - var/datum/antagonist/changeling/changeling_datum = user.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling_datum = IS_CHANGELING(user) if(!changeling_datum) return FALSE return TRUE diff --git a/code/modules/antagonists/changeling/powers/void_adaption.dm b/code/modules/antagonists/changeling/powers/void_adaption.dm index 76c0eeffc97..934ae2f5770 100644 --- a/code/modules/antagonists/changeling/powers/void_adaption.dm +++ b/code/modules/antagonists/changeling/powers/void_adaption.dm @@ -55,14 +55,14 @@ 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) + var/datum/antagonist/changeling/changeling_data = IS_CHANGELING(void_adapted) 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) + var/datum/antagonist/changeling/changeling_data = IS_CHANGELING(former) to_chat(former, span_changeling(message)) changeling_data?.chem_recharge_slowdown += recharge_slowdown currently_active = FALSE diff --git a/code/modules/mob/living/basic/guardian/guardian_creator.dm b/code/modules/mob/living/basic/guardian/guardian_creator.dm index d01383427df..3f1f0927522 100644 --- a/code/modules/mob/living/basic/guardian/guardian_creator.dm +++ b/code/modules/mob/living/basic/guardian/guardian_creator.dm @@ -66,7 +66,7 @@ GLOBAL_LIST_INIT(guardian_radial_images, setup_guardian_radial()) if(length(guardians) && !allow_multiple) balloon_alert(user, "already have one!") return - if(user.mind && user.mind.has_antag_datum(/datum/antagonist/changeling) && !allow_changeling) + if(IS_CHANGELING(user) && !allow_changeling) to_chat(user, ling_failure) return if(used) diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index a613e2ad839..117b5f03835 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -61,7 +61,7 @@ name = initial(name) // Special check for if you're trapped in a body you can't control because it's owned by a ling. - if(brain_owner?.mind?.has_antag_datum(/datum/antagonist/changeling) && !(movement_flags & NO_ID_TRANSFER)) + if(IS_CHANGELING(brain_owner) && !(movement_flags & NO_ID_TRANSFER)) if(brainmob && !(brain_owner.stat == DEAD || (HAS_TRAIT(brain_owner, TRAIT_DEATHCOMA)))) to_chat(brainmob, span_danger("You can't feel your body! You're still just a brain!")) forceMove(brain_owner) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 378fa54b308..bc2754a135c 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -929,7 +929,7 @@ return ..() /mob/living/carbon/can_be_revived() - if(!get_organ_by_type(/obj/item/organ/internal/brain) && (!mind || !mind.has_antag_datum(/datum/antagonist/changeling)) || HAS_TRAIT(src, TRAIT_HUSK)) + if(!get_organ_by_type(/obj/item/organ/internal/brain) && (!IS_CHANGELING(src)) || HAS_TRAIT(src, TRAIT_HUSK)) return FALSE //SKYRAT EDIT ADDITION - DNR TRAIT if(HAS_TRAIT(src, TRAIT_DNR)) diff --git a/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm index 8963e21c911..b9d0cd413f7 100644 --- a/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm @@ -1213,7 +1213,7 @@ /datum/reagent/consumable/ethanol/changelingsting/on_mob_life(mob/living/carbon/target, seconds_per_tick, times_fired) . = ..() - var/datum/antagonist/changeling/changeling = target.mind?.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(target) changeling?.adjust_chemicals(metabolization_rate * REM * seconds_per_tick) /datum/reagent/consumable/ethanol/irishcarbomb diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 647ae7d9c38..5c1ef79c4d6 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -2570,7 +2570,7 @@ /datum/reagent/bz_metabolites/on_mob_life(mob/living/carbon/target, seconds_per_tick, times_fired) . = ..() if(target.mind) - var/datum/antagonist/changeling/changeling = target.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/changeling = IS_CHANGELING(target) if(changeling) changeling.adjust_chemicals(-4 * REM * seconds_per_tick) //SKYRAT EDIT - BZ-BUFF-VS-LING - ORIGINAL: changeling.adjust_chemicals(-2 * REM * seconds_per_tick) diff --git a/code/modules/unit_tests/changeling.dm b/code/modules/unit_tests/changeling.dm index 449188a75fd..4ce90eae8ce 100644 --- a/code/modules/unit_tests/changeling.dm +++ b/code/modules/unit_tests/changeling.dm @@ -8,7 +8,7 @@ /datum/unit_test/transformation_sting/Run() var/mob/living/carbon/human/ling = setup_ling() var/mob/living/carbon/human/victim = setup_victim() - var/datum/antagonist/changeling/ling_datum = ling.mind.has_antag_datum(/datum/antagonist/changeling) + var/datum/antagonist/changeling/ling_datum = IS_CHANGELING(ling) // Get the ability we're testing ling_datum.give_power(/datum/action/changeling/sting/transformation) // SKYRAT EDIT CHANGE - Transformation sting not purchasable here - ORIGINAL : ling_datum.purchase_power(/datum/action/changeling/sting/transformation) diff --git a/modular_skyrat/modules/cortical_borer/code/cortical_borer_abilities.dm b/modular_skyrat/modules/cortical_borer/code/cortical_borer_abilities.dm index 222f0f0e813..6482a604313 100644 --- a/modular_skyrat/modules/cortical_borer/code/cortical_borer_abilities.dm +++ b/modular_skyrat/modules/cortical_borer/code/cortical_borer_abilities.dm @@ -528,10 +528,8 @@ if(!(listed_human.mob_biotypes & MOB_ORGANIC) && cortical_owner.organic_restricted) continue //hosts cannot be changelings - if(listed_human.mind) - var/datum/antagonist/changeling/changeling = listed_human.mind.has_antag_datum(/datum/antagonist/changeling) - if(changeling && cortical_owner.changeling_restricted) - continue + if(IS_CHANGELING(listed_human) && cortical_owner.changeling_restricted) + continue usable_hosts += listed_human //if the list of possible hosts is one, just go straight in, no choosing