From 7325357a481dcf9d4e458fd94a82f7be56a6a63d Mon Sep 17 00:00:00 2001 From: coiax Date: Sun, 2 Dec 2018 07:39:05 +0000 Subject: [PATCH] Scrying orb now grants sixth sense (and xray) to whoever possesses it (#41643) cl add: A wizard's scrying orb now grants both xray vision, and the ability to hear the dead to whoever possesses it. balance: However, as soon as the orb is no longer in your possession, these abilities fade. /cl This was @XDTM's idea, when he implemented near death experiences. It works even when in your backpack. This also adds the TRAIT_XRAY_VISION, for non-genetic, non-eyeball sources of xray. Why? Having a wizard talking to ghosts means it looks like he's talking to thin air. Also, this makes scrying orb a little more active in its knowledge gathering. Ghosts will have the chance to mislead the wizard with whatever they're talking about. --- code/__DEFINES/traits.dm | 4 +- code/datums/mutations/sight.dm | 2 + .../antagonists/wizard/equipment/artefact.dm | 42 ++++++++++++++----- code/modules/mob/living/carbon/carbon.dm | 10 ++--- 4 files changed, 40 insertions(+), 18 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 157d9bdfe9e..6f8b67f0bbd 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -55,6 +55,7 @@ #define TRAIT_PARALYSIS_R_ARM "para-r-arm" #define TRAIT_PARALYSIS_L_LEG "para-l-leg" #define TRAIT_PARALYSIS_R_LEG "para-r-leg" +#define TRAIT_XRAY_VISION "xray_vision" //non-mob traits #define TRAIT_PARALYSIS "paralysis" //Used for limb-based paralysis, where replacing the limb will fix it @@ -98,4 +99,5 @@ #define STASIS_MUTE "stasis" #define GENETICS_SPELL "genetics_spell" #define EYES_COVERED "eyes_covered" -#define CULT_EYES "cult_eyes" \ No newline at end of file +#define CULT_EYES "cult_eyes" +#define SCRYING_ORB "scrying-orb" diff --git a/code/datums/mutations/sight.dm b/code/datums/mutations/sight.dm index 1f23a92906b..f16dad20ddd 100644 --- a/code/datums/mutations/sight.dm +++ b/code/datums/mutations/sight.dm @@ -45,11 +45,13 @@ if(..()) return + owner.add_trait(TRAIT_XRAY_VISION, GENETIC_MUTATION) owner.update_sight() /datum/mutation/human/x_ray/on_losing(mob/living/carbon/human/owner) if(..()) return + owner.remove_trait(TRAIT_XRAY_VISION, GENETIC_MUTATION) owner.update_sight() diff --git a/code/modules/antagonists/wizard/equipment/artefact.dm b/code/modules/antagonists/wizard/equipment/artefact.dm index a98169aa671..8bc04bd1bc5 100644 --- a/code/modules/antagonists/wizard/equipment/artefact.dm +++ b/code/modules/antagonists/wizard/equipment/artefact.dm @@ -136,7 +136,7 @@ /obj/item/scrying name = "scrying orb" - desc = "An incandescent orb of otherworldly energy, staring into it gives you vision beyond mortal means." + desc = "An incandescent orb of otherworldly energy, merely holding it gives you vision and hearing beyond mortal means, and staring into it lets you see the entire universe." icon = 'icons/obj/projectiles.dmi' icon_state ="bluespace" throw_speed = 3 @@ -146,18 +146,38 @@ force = 15 hitsound = 'sound/items/welder2.ogg' - var/xray_granted = FALSE + var/mob/current_owner -/obj/item/scrying/equipped(mob/user) - if(!xray_granted && ishuman(user)) - var/mob/living/carbon/human/H = user - if(!(H.dna.check_mutation(XRAY))) - H.dna.add_mutation(XRAY) - xray_granted = TRUE +/obj/item/scrying/Initialize(mapload) + . = ..() + START_PROCESSING(SSobj, src) + +/obj/item/scrying/Destroy() + STOP_PROCESSING(SSobj, src) . = ..() +/obj/item/scrying/process() + var/mob/holder = get(loc, /mob) + if(current_owner && current_owner != holder) + + to_chat(current_owner, "Your otherworldly vision fades...") + + current_owner.remove_trait(TRAIT_SIXTHSENSE, SCRYING_ORB) + current_owner.remove_trait(TRAIT_XRAY_VISION, SCRYING_ORB) + current_owner.update_sight() + + current_owner = null + + if(!current_owner) + current_owner = holder + + to_chat(current_owner, "You can see...everything!") + + current_owner.add_trait(TRAIT_SIXTHSENSE, SCRYING_ORB) + current_owner.add_trait(TRAIT_XRAY_VISION, SCRYING_ORB) + current_owner.update_sight() + /obj/item/scrying/attack_self(mob/user) - to_chat(user, "You can see...everything!") visible_message("[user] stares into [src], their eyes glazing over.") user.ghostize(1) @@ -188,12 +208,12 @@ if(M.stat != DEAD) to_chat(user, "This artifact can only affect the dead!") return - + for(var/mob/dead/observer/ghost in GLOB.dead_mob_list) //excludes new players if(ghost.mind && ghost.mind.current == M && ghost.client) //the dead mobs list can contain clientless mobs ghost.reenter_corpse() break - + if(!M.mind || !M.client) to_chat(user, "There is no soul connected to this body...") return diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 3c0ffe23546..7a11cb7e5f6 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -590,12 +590,10 @@ see_invisible = min(G.invis_view, see_invisible) if(!isnull(G.lighting_alpha)) lighting_alpha = min(lighting_alpha, G.lighting_alpha) - if(dna) - for(var/X in dna.mutations) - var/datum/mutation/M = X - if(M.name == XRAY) - sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) - see_in_dark = max(see_in_dark, 8) + + if(has_trait(TRAIT_XRAY_VISION)) + sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) + see_in_dark = max(see_in_dark, 8) if(see_override) see_invisible = see_override