diff --git a/code/__defines/xenoarcheaology.dm b/code/__defines/xenoarcheaology.dm index b0282b7682..cab10b15c6 100644 --- a/code/__defines/xenoarcheaology.dm +++ b/code/__defines/xenoarcheaology.dm @@ -112,4 +112,4 @@ #define EFFECT_VAMPIRE 20 #define EFFECT_HEALTH 21 #define EFFECT_GENERATOR 22 -//#define EFFECT_DNASWITCH 23 //Not in as of yet. +#define EFFECT_DNASWITCH 23 //Not in as of yet. diff --git a/code/modules/xenoarcheaology/effect.dm b/code/modules/xenoarcheaology/effect.dm index a737196627..2a6ab461e0 100644 --- a/code/modules/xenoarcheaology/effect.dm +++ b/code/modules/xenoarcheaology/effect.dm @@ -22,8 +22,8 @@ var/last_activation = 0 /datum/artifact_effect/Destroy() - if(master) - master = null + master = null //Master still exists even if our effect gets destroyed. No need to qdel_null. + qdel_null(active_effect) ..() /datum/artifact_effect/proc/get_master_holder() // Return the effectmaster's holder, if it is set to an effectmaster. Otherwise, master is the target object. @@ -160,6 +160,8 @@ . += "displace subjects using bluespace phenomena" if(EFFECT_VAMPIRE) . += "drain the blood of subjects, creating creatures or anomalous artifacts in the process" + if(EFFECT_DNASWITCH) + . += "mutate the cells of the organism that touches it, resulting in rampant mutations" else . += "have no previously-known anomalous properties" diff --git a/code/modules/xenoarcheaology/effects/dnaswitch.dm b/code/modules/xenoarcheaology/effects/dnaswitch.dm index 45fe4133dc..b035748b3c 100644 --- a/code/modules/xenoarcheaology/effects/dnaswitch.dm +++ b/code/modules/xenoarcheaology/effects/dnaswitch.dm @@ -1,6 +1,6 @@ /datum/artifact_effect/dnaswitch - name = "dnaswitch" - effect_type = EFFECT_ORGANIC + name = "DNA Mutator" + effect_type = EFFECT_DNASWITCH var/severity effect_state = "smoke" @@ -8,21 +8,26 @@ /datum/artifact_effect/dnaswitch/New() ..() + effect = pick(EFFECT_TOUCH, EFFECT_AURA, EFFECT_PULSE) if(effect == EFFECT_AURA) - severity = rand(5,30) + severity = rand(10,50) + else if(effect == EFFECT_PULSE) + severity = rand(5,25) else - severity = rand(25,95) + severity = rand(20,90) /datum/artifact_effect/dnaswitch/DoEffectTouch(var/mob/toucher) var/weakness = GetAnomalySusceptibility(toucher) if(ishuman(toucher) && prob(weakness * 100)) - to_chat(toucher,pick(span_green("You feel a little different."), - span_green("You feel very strange."), - span_green("Your stomach churns."), - span_green("Your skin feels loose."), - span_green("You feel a stabbing pain in your head."), - span_green("You feel a tingling sensation in your chest."), - span_green("Your entire body vibrates."))) + to_chat(toucher, span_notice(span_green("[pick( + "You feel a little different.", + "You feel very strange.", + "Your stomach churns.", + "Your skin feels loose.", + "You feel a stabbing pain in your head.", + "You feel a tingling sensation in your chest.", + "Your entire body vibrates.")]"))) + if(prob(75)) scramble(1, toucher, weakness * severity) else @@ -31,41 +36,53 @@ /datum/artifact_effect/dnaswitch/DoEffectAura() var/atom/holder = get_master_holder() + if(istype(holder, /obj/item/anobattery)) + holder = holder.loc + if(isliving(holder.loc)) + holder = holder.loc if(holder) var/turf/T = get_turf(holder) - for(var/mob/living/carbon/human/H in range(src.effectrange,T)) - var/weakness = GetAnomalySusceptibility(H) - if(prob(weakness * 100)) - if(prob(30)) - to_chat(H, pick(span_green("You feel a little different."), - span_green("You feel very strange."), - span_green("Your stomach churns."), - span_green("Your skin feels loose."), - span_green("You feel a stabbing pain in your head."), - span_green("You feel a tingling sensation in your chest."), - span_green("Your entire body vibrates."))) - if(prob(50)) - scramble(1, H, weakness * severity) - else - scramble(0, H, weakness * severity) - -/datum/artifact_effect/dnaswitch/DoEffectPulse() - var/atom/holder = get_master_holder() - if(holder) - var/turf/T = get_turf(holder) - for(var/mob/living/carbon/human/H in range(200, T)) - var/weakness = GetAnomalySusceptibility(H) - if(prob(weakness * 100)) - if(prob(75)) - to_chat(H, pick(span_green(" You feel a little different."), - span_green(" You feel very strange."), - span_green(" Your stomach churns."), - span_green(" Your skin feels loose."), - span_green(" You feel a stabbing pain in your head."), - span_green(" You feel a tingling sensation in your chest."), - span_green(" Your entire body vibrates."))) - if(prob(25)) - if(prob(75)) + if(isturf(T)) + for(var/mob/living/carbon/human/H in range(src.effectrange,T)) + var/weakness = GetAnomalySusceptibility(H) + if(prob(weakness * 100)) + if(prob(30)) + to_chat(H, span_notice(span_green("[pick( + "You feel a little different.", + "You feel very strange.", + "Your stomach churns.", + "Your skin feels loose.", + "You feel a stabbing pain in your head.", + "You feel a tingling sensation in your chest.", + "Your entire body vibrates.")]"))) + if(prob(50)) scramble(1, H, weakness * severity) else scramble(0, H, weakness * severity) + +/datum/artifact_effect/dnaswitch/DoEffectPulse() + var/atom/holder = get_master_holder() + if(istype(holder, /obj/item/anobattery)) + holder = holder.loc + if(isliving(holder.loc)) + holder = holder.loc + if(holder) + var/turf/T = get_turf(holder) + if(isturf(T)) + for(var/mob/living/carbon/human/H in range(200, T)) + var/weakness = GetAnomalySusceptibility(H) + if(prob(weakness * 100)) + if(prob(75)) + to_chat(H, span_notice(span_green("[pick( + "You feel a little different.", + "You feel very strange.", + "Your stomach churns.", + "Your skin feels loose.", + "You feel a stabbing pain in your head.", + "You feel a tingling sensation in your chest.", + "Your entire body vibrates.")]"))) + if(prob(25)) + if(prob(75)) + scramble(1, H, weakness * severity) + else + scramble(0, H, weakness * severity) diff --git a/code/modules/xenoarcheaology/tools/ano_device_battery.dm b/code/modules/xenoarcheaology/tools/ano_device_battery.dm index 475bda21ce..803539a8a1 100644 --- a/code/modules/xenoarcheaology/tools/ano_device_battery.dm +++ b/code/modules/xenoarcheaology/tools/ano_device_battery.dm @@ -9,7 +9,10 @@ var/datum/artifact_effect/battery_effect var/capacity = 500 var/stored_charge = 0 - var/effect_id = "" + +/obj/item/anobattery/Destroy() + battery_effect = null + ..() /obj/item/anobattery/advanced name = "advanced anomaly battery" @@ -47,6 +50,12 @@ ..() START_PROCESSING(SSobj, src) +/obj/item/anodevice/Destroy() + inserted_battery = null + archived_loc = null + last_user_touched = null + ..() + /obj/item/anodevice/equipped(var/mob/user, var/slot) last_user_touched = user ..()