From cefe4a6a5176df4b7cee94879c2c6aa95aa73a51 Mon Sep 17 00:00:00 2001 From: PKPenguin321 Date: Thu, 7 Feb 2019 20:08:29 -0800 Subject: [PATCH] [Ready] Adds 5 new negative/minor negative mutations, mutation conflict system (#42524) * adds 5 new (minor) negative mutations also adds a mutation conflict system * removes debug comments and to_chat(world)s * addresses reviews * further review addressing, new message and a message given to the subject when a mutation fails to manifest because of conflicts * cooldown on acid flesh message --- code/__DEFINES/DNA.dm | 6 +- code/__DEFINES/status_effects.dm | 2 + code/datums/brain_damage/mild.dm | 54 ++------------ code/datums/mutations.dm | 9 +++ code/datums/mutations/body.dm | 99 +++++++++++++++++++++++++ code/datums/status_effects/debuffs.dm | 66 +++++++++++++++-- code/game/objects/items/dna_injector.dm | 44 ++++++++++- 7 files changed, 223 insertions(+), 57 deletions(-) diff --git a/code/__DEFINES/DNA.dm b/code/__DEFINES/DNA.dm index 69246ca325b..1952ed95f42 100644 --- a/code/__DEFINES/DNA.dm +++ b/code/__DEFINES/DNA.dm @@ -12,6 +12,7 @@ #define MUTATE /datum/mutation/human/bad_dna #define COUGH /datum/mutation/human/cough #define DWARFISM /datum/mutation/human/dwarfism +#define GIGANTISM /datum/mutation/human/gigantism #define CLOWNMUT /datum/mutation/human/clumsy #define TOURETTES /datum/mutation/human/tourettes #define DEAFMUT /datum/mutation/human/deaf @@ -38,11 +39,14 @@ #define INSULATED /datum/mutation/human/insulated #define SHOCKTOUCH /datum/mutation/human/shock #define OLFACTION /datum/mutation/human/olfaction +#define ACIDFLESH /datum/mutation/human/acidflesh +#define BADBLINK /datum/mutation/human/badblink +#define SPASTIC /datum/mutation/human/spastic +#define EXTRASTUN /datum/mutation/human/extrastun #define YELLING /datum/mutation/human/yelling #define GELADIKINESIS /datum/mutation/human/geladikinesis #define CRYOKINESIS /datum/mutation/human/cryokinesis - #define UI_CHANGED "ui changed" #define UE_CHANGED "ue changed" diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm index 1077c6c16cd..8ca8dd5cc85 100644 --- a/code/__DEFINES/status_effects.dm +++ b/code/__DEFINES/status_effects.dm @@ -87,6 +87,8 @@ #define STATUS_EFFECT_GONBOLAPACIFY /datum/status_effect/gonbolaPacify //Gives the user gondola traits while the gonbola is attached to them. +#define STATUS_EFFECT_SPASMS /datum/status_effect/spasms //causes random muscle spasms + ///////////// // NEUTRAL // ///////////// diff --git a/code/datums/brain_damage/mild.dm b/code/datums/brain_damage/mild.dm index ac3d8429b8d..84bb0149978 100644 --- a/code/datums/brain_damage/mild.dm +++ b/code/datums/brain_damage/mild.dm @@ -157,56 +157,12 @@ gain_text = "Your muscles feel oddly faint." lose_text = "You feel in control of your muscles again." -/datum/brain_trauma/mild/muscle_spasms/on_life() - if(prob(7)) - switch(rand(1,5)) - if(1) - if((owner.mobility_flags & MOBILITY_MOVE) && !isspaceturf(owner.loc)) - to_chat(owner, "Your leg spasms!") - step(owner, pick(GLOB.cardinals)) - if(2) - if(owner.incapacitated()) - return - var/obj/item/I = owner.get_active_held_item() - if(I) - to_chat(owner, "Your fingers spasm!") - owner.log_message("used [I] due to a Muscle Spasm", LOG_ATTACK) - I.attack_self(owner) - if(3) - var/prev_intent = owner.a_intent - owner.a_intent = INTENT_HARM +/datum/brain_trauma/mild/muscle_spasms/on_gain() + owner.apply_status_effect(STATUS_EFFECT_SPASMS) + ..() - var/range = 1 - if(istype(owner.get_active_held_item(), /obj/item/gun)) //get targets to shoot at - range = 7 - - var/list/mob/living/targets = list() - for(var/mob/M in oview(owner, range)) - if(isliving(M)) - targets += M - if(LAZYLEN(targets)) - to_chat(owner, "Your arm spasms!") - owner.log_message(" attacked someone due to a Muscle Spasm", LOG_ATTACK) //the following attack will log itself - owner.ClickOn(pick(targets)) - owner.a_intent = prev_intent - if(4) - var/prev_intent = owner.a_intent - owner.a_intent = INTENT_HARM - to_chat(owner, "Your arm spasms!") - owner.log_message("attacked [owner.p_them()]self to a Muscle Spasm", LOG_ATTACK) - owner.ClickOn(owner) - owner.a_intent = prev_intent - if(5) - if(owner.incapacitated()) - return - var/obj/item/I = owner.get_active_held_item() - var/list/turf/targets = list() - for(var/turf/T in oview(owner, 3)) - targets += T - if(LAZYLEN(targets) && I) - to_chat(owner, "Your arm spasms!") - owner.log_message("threw [I] due to a Muscle Spasm", LOG_ATTACK) - owner.throw_item(pick(targets)) +/datum/brain_trauma/mild/muscle_spasms/on_lose() + owner.remove_status_effect(STATUS_EFFECT_SPASMS) ..() /datum/brain_trauma/mild/nervous_cough diff --git a/code/datums/mutations.dm b/code/datums/mutations.dm index 2c60ce69bda..bcbfd3f315c 100644 --- a/code/datums/mutations.dm +++ b/code/datums/mutations.dm @@ -27,6 +27,7 @@ var/alias //'Mutation #49', decided every round to get some form of distinction between undiscovered mutations var/scrambled = FALSE //Wheter we can read it if it's active. To avoid cheesing with mutagen var/class //Decides player accesibility, sorta + var/list/conflicts //any mutations that might conflict. put mutation typepath defines in here. make sure to enter it both ways (so that A conflicts with B, and B with A) //MUT_NORMAL - A mutation that can be activated and deactived by completing a sequence //MUT_EXTRA - A mutation that is in the mutations tab, and can be given and taken away through though the DNA console. Has a 0 before it's name in the mutation section of the dna console //MUT_OTHER Cannot be interacted with by players through normal means. I.E. wizards mutate @@ -47,6 +48,14 @@ return TRUE if(limb_req && !H.get_bodypart(limb_req)) return TRUE + for(var/M in H.dna.mutations)//check for conflicting powers + var/datum/mutation/human/mewtayshun = M + if(LAZYLEN(mewtayshun.conflicts)) + for(var/cons in mewtayshun.conflicts) + var/datum/mutation/human/conflicter = cons + if(conflicter == type) + to_chat(H, "You feel your genes resisting something.") + return TRUE owner = H dna = H.dna dna.mutations += src diff --git a/code/datums/mutations/body.dm b/code/datums/mutations/body.dm index 4eec0f4a91c..880d3c7ba0f 100644 --- a/code/datums/mutations/body.dm +++ b/code/datums/mutations/body.dm @@ -66,6 +66,7 @@ quality = POSITIVE difficulty = 16 instability = 5 + conflicts = list(GIGANTISM) locked = TRUE // Default intert species for now, so locked from regular pool. /datum/mutation/human/dwarfism/on_acquiring(mob/living/carbon/human/owner) @@ -230,6 +231,104 @@ return owner.physiology.burn_mod *= 2 +/datum/mutation/human/badblink + name = "Spatial Instability" + desc = "The victim of the mutation has a very weak link to spatial reality, and may be displaced. Often causes extreme nausea." + quality = NEGATIVE + text_gain_indication = "The space around you twists sickeningly." + text_lose_indication = "The space around you settles back to normal." + difficulty = 18//high so it's hard to unlock and abuse + instability = 10 + var/warpchance = 0 +/datum/mutation/human/badblink/on_life() + if(prob(warpchance)) + var/warpmessage = pick( + "With a sickening 720 degree twist of their back, [owner] vanishes into thin air.", + "[owner] does some sort of strange backflip into another dimension. It looks pretty painful.", + "[owner] does a jump to the left, a step to the right, and warps out of reality.", + "[owner]'s torso starts folding inside out until it vanishes from reality, taking [owner] with it.", + "One moment, you see [owner]. The next, [owner] is gone.") + owner.visible_message(warpmessage, "You feel a wave of nausea as you fall through reality!") + var/warpdistance = rand(10,15) + do_teleport(owner, get_turf(owner), warpdistance, channel = TELEPORT_CHANNEL_FREE) + owner.adjust_disgust((warpchance * warpdistance)) + warpchance = 0 + owner.visible_message("[owner] appears out of nowhere!") + else + warpchance += 0.25 +/datum/mutation/human/acidflesh + name = "Acidic Flesh" + desc = "Subject has acidic chemicals building up underneath their skin. This is often lethal." + quality = NEGATIVE + text_gain_indication = "A horrible burning sensation envelops you as your flesh turns to acid!" + text_lose_indication = "A feeling of relief covers you as your flesh goes back to normal." + difficulty = 18//high so it's hard to unlock and use on others + var/msgcooldown = 0 +/datum/mutation/human/acidflesh/on_life() + if(prob(25)) + if(world.time > msgcooldown) + to_chat(owner, "Your acid flesh bubbles...") + msgcooldown = world.time + 200 + if(prob(15)) + owner.acid_act(rand(30,50), 10) + owner.visible_message("[owner]'s skin bubbles and pops.", "Your bubbling flesh pops! It burns!") + playsound(owner,'sound/weapons/sear.ogg', 50, 1) + +/datum/mutation/human/gigantism + name = "Gigantism"//negative version of dwarfism + desc = "The cells within the subject spread out to cover more area, making them appear larger." + quality = MINOR_NEGATIVE + difficulty = 12 + conflicts = list(DWARFISM) + +/datum/mutation/human/gigantism/on_acquiring(mob/living/carbon/human/owner) + if(..()) + return + owner.resize = 1.25 + owner.update_transform() + owner.visible_message("[owner] suddenly grows!", "Everything around you seems to shrink..") + +/datum/mutation/human/gigantism/on_losing(mob/living/carbon/human/owner) + if(..()) + return + owner.resize = 0.8 + owner.update_transform() + owner.visible_message("[owner] suddenly shrinks!", "Everything around you seems to grow..") + +/datum/mutation/human/spastic + name = "Spastic" + desc = "Subject suffers from muscle spasms." + quality = NEGATIVE + text_gain_indication = "You flinch." + text_lose_indication = "Your flinching subsides." + difficulty = 16 + +/datum/mutation/human/spastic/on_acquiring() + if(..()) + return + owner.apply_status_effect(STATUS_EFFECT_SPASMS) + +/datum/mutation/human/spastic/on_losing() + if(..()) + return + owner.remove_status_effect(STATUS_EFFECT_SPASMS) + +/datum/mutation/human/extrastun + name = "Two Left Feet" + desc = "A mutation that replaces the right foot with another left foot. It makes standing up after getting knocked down very difficult." + quality = NEGATIVE + text_gain_indication = "Your right foot feels... left." + text_lose_indication = "Your right foot feels alright." + difficulty = 16 + var/stun_cooldown = 0 + +/datum/mutation/human/extrastun/on_life() + if(world.time > stun_cooldown) + if(owner.AmountKnockdown() || owner.AmountStun()) + owner.SetKnockdown(owner.AmountKnockdown()*2) + owner.SetStun(owner.AmountStun()*2) + owner.visible_message("[owner] tries to stand up, but trips!", "You trip over your own feet!") + stun_cooldown = world.time + 300 diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 6802926e7de..2f3b3a1eb68 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -118,7 +118,7 @@ /datum/status_effect/pacify/on_creation(mob/living/new_owner, set_duration) if(isnum(set_duration)) duration = set_duration - . = ..() + . = ..() /datum/status_effect/pacify/on_apply() owner.add_trait(TRAIT_PACIFISM, "status_effect") @@ -126,7 +126,7 @@ /datum/status_effect/pacify/on_remove() owner.remove_trait(TRAIT_PACIFISM, "status_effect") - + //OTHER DEBUFFS /datum/status_effect/pacify id = "pacify" @@ -134,11 +134,11 @@ tick_interval = 1 duration = 100 alert_type = null - + /datum/status_effect/pacify/on_creation(mob/living/new_owner, set_duration) if(isnum(set_duration)) duration = set_duration - . = ..() + . = ..() /datum/status_effect/pacify/on_apply() owner.add_trait(TRAIT_PACIFISM, "status_effect") @@ -600,7 +600,7 @@ examine_text = "SUBJECTPRONOUN seems slow and unfocused." var/stun = TRUE alert_type = /obj/screen/alert/status_effect/trance - + /obj/screen/alert/status_effect/trance name = "Trance" desc = "Everything feels so distant, and you can feel your thoughts forming loops inside your head..." @@ -645,3 +645,59 @@ addtimer(CALLBACK(C, /mob/living/carbon.proc/gain_trauma, /datum/brain_trauma/hypnosis, TRAUMA_RESILIENCE_SURGERY, raw_message), 10) addtimer(CALLBACK(C, /mob/living.proc/Stun, 60, TRUE, TRUE), 15) //Take some time to think about it qdel(src) + +/datum/status_effect/spasms + id = "spasms" + status_type = STATUS_EFFECT_MULTIPLE + alert_type = null + +/datum/status_effect/spasms/tick() + if(prob(15)) + switch(rand(1,5)) + if(1) + if(owner.mobility_flags & MOBILITY_MOVE) + to_chat(owner, "Your leg spasms!") + step(owner, pick(GLOB.cardinals)) + if(2) + if(owner.incapacitated()) + return + var/obj/item/I = owner.get_active_held_item() + if(I) + to_chat(owner, "Your fingers spasm!") + owner.log_message("used [I] due to a Muscle Spasm", LOG_ATTACK) + I.attack_self(owner) + if(3) + var/prev_intent = owner.a_intent + owner.a_intent = INTENT_HARM + + var/range = 1 + if(istype(owner.get_active_held_item(), /obj/item/gun)) //get targets to shoot at + range = 7 + + var/list/mob/living/targets = list() + for(var/mob/M in oview(owner, range)) + if(isliving(M)) + targets += M + if(LAZYLEN(targets)) + to_chat(owner, "Your arm spasms!") + owner.log_message(" attacked someone due to a Muscle Spasm", LOG_ATTACK) //the following attack will log itself + owner.ClickOn(pick(targets)) + owner.a_intent = prev_intent + if(4) + var/prev_intent = owner.a_intent + owner.a_intent = INTENT_HARM + to_chat(owner, "Your arm spasms!") + owner.log_message("attacked [owner.p_them()]self to a Muscle Spasm", LOG_ATTACK) + owner.ClickOn(owner) + owner.a_intent = prev_intent + if(5) + if(owner.incapacitated()) + return + var/obj/item/I = owner.get_active_held_item() + var/list/turf/targets = list() + for(var/turf/T in oview(owner, 3)) + targets += T + if(LAZYLEN(targets) && I) + to_chat(owner, "Your arm spasms!") + owner.log_message("threw [I] due to a Muscle Spasm", LOG_ATTACK) + owner.throw_item(pick(targets)) diff --git a/code/game/objects/items/dna_injector.dm b/code/game/objects/items/dna_injector.dm index 8c2ca2b72ee..9110f9b9c45 100644 --- a/code/game/objects/items/dna_injector.dm +++ b/code/game/objects/items/dna_injector.dm @@ -98,7 +98,7 @@ name = "\improper DNA injector (Anti-X-ray)" desc = "It will make you see harder." remove_mutations = list(XRAY) - + ///////////////////////////////////// /obj/item/dnainjector/antiglasses name = "\improper DNA injector (Anti-Glasses)" @@ -328,10 +328,50 @@ name = "\improper DNA injector (Anti-Shock Touch)" remove_mutations = list(SHOCKTOUCH) +/obj/item/dnainjector/spacialinstability + name = "\improper DNA injector (Spacial Instability)" + add_mutations = list(BADBLINK) + +/obj/item/dnainjector/antispacialinstability + name = "\improper DNA injector (Anti-Spacial Instability)" + remove_mutations = list(BADBLINK) + +/obj/item/dnainjector/acidflesh + name = "\improper DNA injector (Acid Flesh)" + add_mutations = list(ACIDFLESH) + +/obj/item/dnainjector/antiacidflesh + name = "\improper DNA injector (Acid Flesh)" + remove_mutations = list(ACIDFLESH) + +/obj/item/dnainjector/gigantism + name = "\improper DNA injector (Gigantism)" + add_mutations = list(GIGANTISM) + +/obj/item/dnainjector/antigigantism + name = "\improper DNA injector (Anti-Gigantism)" + remove_mutations = list(GIGANTISM) + +/obj/item/dnainjector/spastic + name = "\improper DNA injector (Spastic)" + add_mutations = list(SPASTIC) + +/obj/item/dnainjector/antispastic + name = "\improper DNA injector (Anti-Spastic)" + remove_mutations = list(SPASTIC) + +/obj/item/dnainjector/twoleftfeet + name = "\improper DNA injector (Two Left Feet)" + add_mutations = list(EXTRASTUN) + +/obj/item/dnainjector/antitwoleftfeet + name = "\improper DNA injector (Anti-Two Left Feet)" + remove_mutations = list(EXTRASTUN) + /obj/item/dnainjector/geladikinesis name = "\improper DNA injector (Geladikinesis)" add_mutations = list(GELADIKINESIS) - + /obj/item/dnainjector/antigeladikinesis name = "\improper DNA injector (Anti-Geladikinesis)" remove_mutations = list(GELADIKINESIS)