From 3af0aa2489a9af4dbdab09812185317fe3341358 Mon Sep 17 00:00:00 2001 From: XDTM Date: Mon, 18 Dec 2017 22:20:07 +0100 Subject: [PATCH 01/17] [Ready Again]Refactors disabilities into lists, allowing for independent disability sources --- code/__DEFINES/stat.dm | 25 +++ code/_onclick/item_attack.dm | 5 + code/datums/antagonists/changeling.dm | 2 +- code/datums/brain_damage/mild.dm | 4 +- code/datums/brain_damage/severe.dm | 44 +++--- .../diseases/advance/symptoms/vision.dm | 15 +- code/datums/martial/sleeping_carp.dm | 2 +- code/datums/mutations.dm | 1 - code/datums/mutations/body.dm | 8 +- code/datums/mutations/sight.dm | 8 +- code/datums/mutations/speech.dm | 4 +- .../gamemodes/changeling/powers/tiny_prick.dm | 16 +- .../clock_items/wraith_spectacles.dm | 25 +-- .../clock_structures/ocular_warden.dm | 2 +- code/game/gamemodes/cult/runes.dm | 2 +- code/game/machinery/computer/cloning.dm | 2 +- code/game/machinery/computer/dna_console.dm | 4 +- code/game/machinery/dna_scanner.dm | 2 +- code/game/objects/items.dm | 10 +- code/game/objects/items/defib.dm | 4 +- code/game/objects/items/devices/flashlight.dm | 4 +- code/game/objects/items/devices/scanners.dm | 11 +- code/game/objects/items/dna_injector.dm | 4 +- code/game/objects/items/grenades/grenade.dm | 2 +- code/game/objects/items/handcuffs.dm | 2 +- code/game/objects/items/kitchen.dm | 4 +- code/game/objects/items/melee/misc.dm | 2 +- code/game/objects/items/melee/transforming.dm | 2 +- code/game/objects/items/pneumaticCannon.dm | 2 +- code/game/objects/items/shields.dm | 145 ++++++++++++++++++ code/game/objects/items/storage/book.dm | 2 +- code/game/objects/items/stunbaton.dm | 2 +- code/game/objects/items/teleprod.dm | 2 +- code/game/objects/items/tools/screwdriver.dm | 4 +- code/game/objects/items/twohanded.dm | 2 +- .../objects/structures/petrified_statue.dm | 4 +- code/modules/assembly/flash.dm | 2 +- code/modules/assembly/mousetrap.dm | 145 ++++++++++++++++++ code/modules/clothing/glasses/_glasses.dm | 2 +- code/modules/events/disease_outbreak.dm | 14 ++ .../mining/lavaland/necropolis_chests.dm | 2 +- code/modules/mob/living/blood.dm | 8 +- code/modules/mob/living/brain/brain_item.dm | 4 +- code/modules/mob/living/carbon/carbon.dm | 16 +- .../mob/living/carbon/carbon_defense.dm | 8 +- code/modules/mob/living/carbon/human/death.dm | 4 +- .../mob/living/carbon/human/human_defense.dm | 5 + .../mob/living/carbon/human/interactive.dm | 2 +- .../mob/living/carbon/human/inventory.dm | 2 +- .../mob/living/carbon/human/species.dm | 20 ++- .../carbon/human/species_types/golems.dm | 2 +- .../mob/living/carbon/human/status_procs.dm | 4 +- .../mob/living/carbon/human/update_icons.dm | 2 +- .../mob/living/carbon/monkey/combat.dm | 7 + .../mob/living/carbon/monkey/update_icons.dm | 2 +- .../modules/mob/living/carbon/status_procs.dm | 37 +---- .../modules/mob/living/carbon/update_icons.dm | 2 +- code/modules/mob/living/life.dm | 8 +- code/modules/mob/living/living.dm | 7 +- code/modules/mob/living/living_defense.dm | 45 +++++- code/modules/mob/living/living_defines.dm | 2 + code/modules/mob/living/say.dm | 2 +- .../hostile/megafauna/colossus.dm | 6 +- code/modules/mob/living/status_procs.dm | 73 +++++++++ code/modules/mob/mob_defines.dm | 1 - code/modules/mob/status_procs.dm | 37 ++--- code/modules/paperwork/paper.dm | 4 +- code/modules/paperwork/paperplane.dm | 2 +- code/modules/projectiles/gun.dm | 2 +- .../projectiles/guns/ballistic/revolver.dm | 2 +- code/modules/projectiles/pins.dm | 2 +- .../chemistry/reagents/drink_reagents.dm | 2 +- .../chemistry/reagents/medicine_reagents.dm | 14 +- .../chemistry/reagents/toxin_reagents.dm | 2 +- .../spells/spell_types/construct_spells.dm | 6 +- code/modules/spells/spell_types/genetic.dm | 32 +++- code/modules/surgery/bodyparts/bodyparts.dm | 2 +- code/modules/surgery/bodyparts/head.dm | 2 +- code/modules/surgery/eye_surgery.dm | 4 +- code/modules/surgery/lipoplasty.dm | 2 +- code/modules/surgery/organs/ears.dm | 4 +- 81 files changed, 711 insertions(+), 221 deletions(-) diff --git a/code/__DEFINES/stat.dm b/code/__DEFINES/stat.dm index 331bc6765f..208970ff9f 100644 --- a/code/__DEFINES/stat.dm +++ b/code/__DEFINES/stat.dm @@ -10,6 +10,7 @@ //mob disabilities stat +<<<<<<< HEAD #define BLIND 1 #define MUTE 2 #define DEAF 4 @@ -20,6 +21,30 @@ #define CLUMSY 256 #define DUMB 512 #define MONKEYLIKE 1024 //sets IsAdvancedToolUser to FALSE +======= +#define BLIND "blind" +#define MUTE "mute" +#define DEAF "deaf" +#define NEARSIGHT "nearsighted" +#define FAT "fat" +#define HUSK "husk" +#define NOCLONE "noclone" +#define CLUMSY "clumsy" +#define DUMB "dumb" +#define MONKEYLIKE "monkeylike" //sets IsAdvancedToolUser to FALSE +#define PACIFISM "pacifism" + +// common disability sources +#define EYE_DAMAGE "eye_damage" +#define GENETIC_MUTATION "genetic" +#define STATUE_MUTE "statue" +#define CHANGELING_DRAIN "drain" +#define OBESITY "obesity" +#define MAGIC_DISABILITY "magic" +#define STASIS_MUTE "stasis" +#define GENETICS_SPELL "genetics_spell" +#define TRAUMA_DISABILITY "trauma" +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) // bitflags for machine stat variable #define BROKEN 1 diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 859c957a43..134e33224f 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -58,6 +58,11 @@ SendSignal(COMSIG_ITEM_ATTACK, M, user) if(flags_1 & NOBLUDGEON_1) return +<<<<<<< HEAD +======= + if(user.has_disability(PACIFISM)) + return +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) if(!force) playsound(loc, 'sound/weapons/tap.ogg', get_clamped_volume(), 1, -1) else if(hitsound) diff --git a/code/datums/antagonists/changeling.dm b/code/datums/antagonists/changeling.dm index e98bfed782..1eddc725d2 100644 --- a/code/datums/antagonists/changeling.dm +++ b/code/datums/antagonists/changeling.dm @@ -223,7 +223,7 @@ if(verbose) to_chat(user, "[target] is not compatible with our biology.") return - if((target.disabilities & NOCLONE) || (target.disabilities & HUSK)) + if((target.has_disability(NOCLONE)) || (target.has_disability(NOCLONE))) if(verbose) to_chat(user, "DNA of [target] is ruined beyond usability!") return diff --git a/code/datums/brain_damage/mild.dm b/code/datums/brain_damage/mild.dm index 6bfa149aa7..29d08b4ce1 100644 --- a/code/datums/brain_damage/mild.dm +++ b/code/datums/brain_damage/mild.dm @@ -42,7 +42,7 @@ lose_text = "You feel smart again." /datum/brain_trauma/mild/dumbness/on_gain() - owner.disabilities |= DUMB + owner.add_disability(DUMB, TRAUMA_DISABILITY) ..() /datum/brain_trauma/mild/dumbness/on_life() @@ -54,7 +54,7 @@ ..() /datum/brain_trauma/mild/dumbness/on_lose() - owner.disabilities &= ~DUMB + owner.remove_disability(DUMB, TRAUMA_DISABILITY) owner.derpspeech = 0 ..() diff --git a/code/datums/brain_damage/severe.dm b/code/datums/brain_damage/severe.dm index 08cee65085..a36d4b9fb8 100644 --- a/code/datums/brain_damage/severe.dm +++ b/code/datums/brain_damage/severe.dm @@ -12,17 +12,11 @@ lose_text = "You suddenly remember how to speak." /datum/brain_trauma/severe/mute/on_gain() - owner.disabilities |= MUTE - ..() - -//no fiddling with genetics to get out of this one -/datum/brain_trauma/severe/mute/on_life() - if(!(owner.disabilities & MUTE)) - on_gain() + owner.add_disability(MUTE, TRAUMA_DISABILITY) ..() /datum/brain_trauma/severe/mute/on_lose() - owner.disabilities &= ~MUTE + owner.remove_disability(MUTE, TRAUMA_DISABILITY) ..() /datum/brain_trauma/severe/blindness @@ -33,17 +27,11 @@ lose_text = "Your vision returns." /datum/brain_trauma/severe/blindness/on_gain() - owner.become_blind() - ..() - -//no fiddling with genetics to get out of this one -/datum/brain_trauma/severe/blindness/on_life() - if(!(owner.disabilities & BLIND)) - on_gain() + owner.become_blind(TRAUMA_DISABILITY) ..() /datum/brain_trauma/severe/blindness/on_lose() - owner.cure_blind() + owner.cure_blind(TRAUMA_DISABILITY) ..() /datum/brain_trauma/severe/paralysis @@ -109,7 +97,7 @@ stress -= 4 /datum/brain_trauma/severe/monophobia/proc/check_alone() - if(owner.disabilities & BLIND) + if(owner.has_disability(BLIND)) return TRUE for(var/mob/M in oview(owner, 7)) if(!isliving(M)) //ghosts ain't people @@ -171,9 +159,27 @@ lose_text = "You feel in control of your hands again." /datum/brain_trauma/severe/discoordination/on_gain() - owner.disabilities |= MONKEYLIKE + owner.add_disability(MONKEYLIKE, TRAUMA_DISABILITY) ..() /datum/brain_trauma/severe/discoordination/on_lose() - owner.disabilities &= ~MONKEYLIKE + owner.remove_disability(MONKEYLIKE, TRAUMA_DISABILITY) ..() +<<<<<<< HEAD +======= + +/datum/brain_trauma/severe/pacifism + name = "Traumatic Non-Violence" + desc = "Patient is extremely unwilling to harm others in violent ways." + scan_desc = "pacific syndrome" + gain_text = "You feel oddly peaceful." + lose_text = "You no longer feel compelled to not harm." + +/datum/brain_trauma/severe/pacifism/on_gain() + owner.add_disability(PACIFISM, TRAUMA_DISABILITY) + ..() + +/datum/brain_trauma/severe/pacifism/on_lose() + owner.remove_disability(PACIFISM, TRAUMA_DISABILITY) + ..() +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) diff --git a/code/datums/diseases/advance/symptoms/vision.dm b/code/datums/diseases/advance/symptoms/vision.dm index 728dfa01d0..39d853a758 100644 --- a/code/datums/diseases/advance/symptoms/vision.dm +++ b/code/datums/diseases/advance/symptoms/vision.dm @@ -58,11 +58,12 @@ Bonus M.blur_eyes(20) M.adjust_eye_damage(5) if(eyes.eye_damage >= 10) - M.become_nearsighted() + M.become_nearsighted(EYE_DAMAGE) if(prob(eyes.eye_damage - 10 + 1)) if(!remove_eyes) - if(M.become_blind()) + if(!M.has_disability(BLIND)) to_chat(M, "You go blind!") + M.become_blind(EYE_DAMAGE) else M.visible_message("[M]'s eyes fall off their sockets!", "Your eyes fall off their sockets!") eyes.Remove(M) @@ -111,16 +112,16 @@ Bonus return switch(A.stage) if(4, 5) //basically oculine - if(M.disabilities & BLIND) + if(M.has_disability(BLIND, EYE_DAMAGE)) if(prob(20)) to_chat(M, "Your vision slowly returns...") - M.cure_blind() - M.cure_nearsighted() + M.cure_blind(EYE_DAMAGE) + M.cure_nearsighted(EYE_DAMAGE) M.blur_eyes(35) - else if(M.disabilities & NEARSIGHT) + else if(M.has_disability(NEARSIGHT, EYE_DAMAGE)) to_chat(M, "The blackness in your peripheral vision fades.") - M.cure_nearsighted() + M.cure_nearsighted(EYE_DAMAGE) M.blur_eyes(10) else if(M.eye_blind || M.eye_blurry) diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index f3a1f53dd2..0a4309e708 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -197,7 +197,7 @@ /obj/item/twohanded/bostaff/attack(mob/target, mob/living/user) add_fingerprint(user) - if((CLUMSY in user.disabilities) && prob(50)) + if((user.has_disability(CLUMSY)) && prob(50)) to_chat(user, "You club yourself over the head with [src].") user.Knockdown(60) if(ishuman(user)) diff --git a/code/datums/mutations.dm b/code/datums/mutations.dm index 170c0a2a7f..a171cf91da 100644 --- a/code/datums/mutations.dm +++ b/code/datums/mutations.dm @@ -8,7 +8,6 @@ GLOBAL_LIST_EMPTY(mutations_list) GLOB.mutations_list[name] = src /datum/mutation/human - var/dna_block var/quality var/get_chance = 100 diff --git a/code/datums/mutations/body.dm b/code/datums/mutations/body.dm index 23b91add58..015004eef6 100644 --- a/code/datums/mutations/body.dm +++ b/code/datums/mutations/body.dm @@ -85,12 +85,12 @@ /datum/mutation/human/clumsy/on_acquiring(mob/living/carbon/human/owner) if(..()) return - owner.disabilities |= CLUMSY + owner.add_disability(CLUMSY, GENETIC_MUTATION) /datum/mutation/human/clumsy/on_losing(mob/living/carbon/human/owner) if(..()) return - owner.disabilities &= ~CLUMSY + owner.remove_disability(CLUMSY, GENETIC_MUTATION) //Tourettes causes you to randomly stand in place and shout. @@ -124,12 +124,12 @@ /datum/mutation/human/deaf/on_acquiring(mob/living/carbon/human/owner) if(..()) return - owner.disabilities |= DEAF + owner.add_disability(DEAF, GENETIC_MUTATION) /datum/mutation/human/deaf/on_losing(mob/living/carbon/human/owner) if(..()) return - owner.disabilities &= ~DEAF + owner.remove_disability(DEAF, GENETIC_MUTATION) //Monified turns you into a monkey. diff --git a/code/datums/mutations/sight.dm b/code/datums/mutations/sight.dm index dee26166dd..60f5d75c5e 100644 --- a/code/datums/mutations/sight.dm +++ b/code/datums/mutations/sight.dm @@ -7,12 +7,12 @@ /datum/mutation/human/nearsight/on_acquiring(mob/living/carbon/human/owner) if(..()) return - owner.become_nearsighted() + owner.become_nearsighted(GENETIC_MUTATION) /datum/mutation/human/nearsight/on_losing(mob/living/carbon/human/owner) if(..()) return - owner.cure_nearsighted() + owner.cure_nearsighted(GENETIC_MUTATION) //Blind makes you blind. Who knew? @@ -24,12 +24,12 @@ /datum/mutation/human/blind/on_acquiring(mob/living/carbon/human/owner) if(..()) return - owner.become_blind() + owner.become_blind(GENETIC_MUTATION) /datum/mutation/human/blind/on_losing(mob/living/carbon/human/owner) if(..()) return - owner.cure_blind() + owner.cure_blind(GENETIC_MUTATION) //X-Ray Vision lets you see through walls. diff --git a/code/datums/mutations/speech.dm b/code/datums/mutations/speech.dm index 3b4b38bbcc..dc1333024a 100644 --- a/code/datums/mutations/speech.dm +++ b/code/datums/mutations/speech.dm @@ -30,12 +30,12 @@ /datum/mutation/human/mute/on_acquiring(mob/living/carbon/human/owner) if(..()) return - owner.disabilities |= MUTE + owner.add_disability(MUTE, GENETIC_MUTATION) /datum/mutation/human/mute/on_losing(mob/living/carbon/human/owner) if(..()) return - owner.disabilities &= ~MUTE + owner.remove_disability(MUTE, GENETIC_MUTATION) /datum/mutation/human/smile diff --git a/code/game/gamemodes/changeling/powers/tiny_prick.dm b/code/game/gamemodes/changeling/powers/tiny_prick.dm index 4fdd84040e..e3f486a2f1 100644 --- a/code/game/gamemodes/changeling/powers/tiny_prick.dm +++ b/code/game/gamemodes/changeling/powers/tiny_prick.dm @@ -20,7 +20,7 @@ to_chat(user, "We prepare our sting, use alt+click or middle mouse button on target to sting them.") var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) changeling.chosen_sting = src - + user.hud_used.lingstingdisplay.icon_state = sting_icon user.hud_used.lingstingdisplay.invisibility = 0 @@ -28,7 +28,7 @@ to_chat(user, "We retract our sting, we can't sting anyone for now.") var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) changeling.chosen_sting = null - + user.hud_used.lingstingdisplay.icon_state = null user.hud_used.lingstingdisplay.invisibility = INVISIBILITY_ABSTRACT @@ -90,7 +90,7 @@ /obj/effect/proc_holder/changeling/sting/transformation/can_sting(mob/user, mob/living/carbon/target) if(!..()) return - if((target.disabilities & HUSK) || !iscarbon(target) || (NOTRANSSTING in target.dna.species.species_traits)) + if((target.has_disability(HUSK)) || !iscarbon(target) || (NOTRANSSTING in target.dna.species.species_traits)) to_chat(user, "Our sting appears ineffective against its DNA.") return 0 return 1 @@ -129,9 +129,11 @@ /obj/effect/proc_holder/changeling/sting/false_armblade/can_sting(mob/user, mob/target) if(!..()) return - if((target.disabilities & HUSK) || !target.has_dna()) - to_chat(user, "Our sting appears ineffective against its DNA.") - return 0 + if(isliving(target)) + var/mob/living/L = target + if((L.has_disability(HUSK)) || !L.has_dna()) + to_chat(user, "Our sting appears ineffective against its DNA.") + return 0 return 1 /obj/effect/proc_holder/changeling/sting/false_armblade/sting_action(mob/user, mob/target) @@ -207,7 +209,7 @@ /obj/effect/proc_holder/changeling/sting/blind/sting_action(mob/user, mob/living/carbon/target) add_logs(user, target, "stung", "blind sting") to_chat(target, "Your eyes burn horrifically!") - target.become_nearsighted() + target.become_nearsighted(EYE_DAMAGE) target.blind_eyes(20) target.blur_eyes(40) return TRUE diff --git a/code/game/gamemodes/clock_cult/clock_items/wraith_spectacles.dm b/code/game/gamemodes/clock_cult/clock_items/wraith_spectacles.dm index fc734ac426..b579326fcc 100644 --- a/code/game/gamemodes/clock_cult/clock_items/wraith_spectacles.dm +++ b/code/game/gamemodes/clock_cult/clock_items/wraith_spectacles.dm @@ -32,7 +32,7 @@ if(ishuman(loc)) var/mob/living/carbon/human/H = loc if(src == H.glasses && !up) - if(H.disabilities & BLIND) + if(H.has_disability(BLIND)) to_chat(H, "\"You're blind, idiot. Stop embarrassing yourself.\"") return if(blind_cultist(H)) @@ -51,7 +51,7 @@ to_chat(victim, "\"It looks like Nar-Sie's dogs really don't value their eyes.\"") to_chat(victim, "Your eyes explode with horrific pain!") victim.emote("scream") - victim.become_blind() + victim.become_blind(EYE_DAMAGE) victim.adjust_blurriness(30) victim.adjust_blindness(30) return TRUE @@ -76,7 +76,7 @@ ..() if(slot != slot_glasses || up) return - if(user.disabilities & BLIND) + if(user.has_disability(BLIND)) to_chat(user, "\"You're blind, idiot. Stop embarrassing yourself.\"" ) return if(blind_cultist(user)) //Cultists instantly go blind @@ -115,11 +115,11 @@ var/obj/item/clothing/glasses/wraith_spectacles/WS = L.glasses desc = "[glasses_right && !WS.up ? "":""]You are [glasses_right ? "":"not "]wearing wraith spectacles[glasses_right && !WS.up ? "!":"."]
\ You have taken [W.eye_damage_done] eye damage from them.
" - if(L.disabilities & NEARSIGHT) + if(L.has_disability(NEARSIGHT)) desc += "You are nearsighted!
" else if(glasses_right && !WS.up) desc += "You will become nearsighted at [W.nearsight_breakpoint] eye damage.
" - if(L.disabilities & BLIND) + if(L.has_disability(BLIND)) desc += "You are blind!" else if(glasses_right && !WS.up) desc += "You will become blind at [W.blind_breakpoint] eye damage." @@ -142,8 +142,8 @@ apply_eye_damage(H) else if(GLOB.ratvar_awakens) - H.cure_nearsighted() - H.cure_blind() + H.cure_nearsighted(list(EYE_DAMAGE)) + H.cure_blind(list(EYE_DAMAGE)) H.adjust_eye_damage(-eye_damage_done) eye_damage_done = 0 else if(prob(50) && eye_damage_done) @@ -153,17 +153,20 @@ qdel(src) /datum/status_effect/wraith_spectacles/proc/apply_eye_damage(mob/living/carbon/human/H) - if(H.disabilities & BLIND) + if(H.has_disability(BLIND)) return H.adjust_eye_damage(0.5) eye_damage_done += 0.5 if(eye_damage_done >= 20) H.adjust_blurriness(2) if(eye_damage_done >= nearsight_breakpoint) - if(H.become_nearsighted()) - to_chat(H, "Your vision doubles, then trebles. Darkness begins to close in. You can't keep this up!") + if(!H.has_disability(NEARSIGHT)) + to_chat(H, "Your vision doubles, then trembles. Darkness begins to close in. You can't keep this up!") + H.become_nearsighted(EYE_DAMAGE) if(eye_damage_done >= blind_breakpoint) - if(H.become_blind()) + if(!H.has_disability(BLIND)) to_chat(H, "A piercing white light floods your vision. Suddenly, all goes dark!") + H.become_blind(EYE_DAMAGE) + if(prob(min(20, 5 + eye_damage_done))) to_chat(H, "Your eyes continue to burn.") diff --git a/code/game/gamemodes/clock_cult/clock_structures/ocular_warden.dm b/code/game/gamemodes/clock_cult/clock_structures/ocular_warden.dm index c7aea3df7e..76e942037c 100644 --- a/code/game/gamemodes/clock_cult/clock_structures/ocular_warden.dm +++ b/code/game/gamemodes/clock_cult/clock_structures/ocular_warden.dm @@ -110,7 +110,7 @@ if(!(BI.resistance_flags & ON_FIRE)) BI.fire_act() continue - if(is_servant_of_ratvar(L) || (L.disabilities & BLIND) || L.null_rod_check()) + if(is_servant_of_ratvar(L) || (L.has_disability(BLIND)) || L.null_rod_check()) continue if(L.stat || L.restrained() || L.buckled || L.lying) continue diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 33d5f49661..8472c6c7cf 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -115,7 +115,7 @@ structure_check() searches for nearby cultist structures required for the invoca continue if(ishuman(L)) var/mob/living/carbon/human/H = L - if((H.disabilities & MUTE) || H.silent) + if((H.has_disability(MUTE)) || H.silent) continue if(L.stat) continue diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 7814e05138..c4a4d118b3 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -449,7 +449,7 @@ scantemp = "Subject's brain is not responding to scanning stimuli." playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) return - if((mob_occupant.disabilities & NOCLONE) && (src.scanner.scan_level < 2)) + if((mob_occupant.has_disability(NOCLONE)) && (src.scanner.scan_level < 2)) scantemp = "Subject no longer contains the fundamental materials required to create a living clone." playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0) return diff --git a/code/game/machinery/computer/dna_console.dm b/code/game/machinery/computer/dna_console.dm index 9fa196bd46..e5bd141d05 100644 --- a/code/game/machinery/computer/dna_console.dm +++ b/code/game/machinery/computer/dna_console.dm @@ -81,7 +81,7 @@ if(connected && connected.is_operational()) if(connected.occupant) //set occupant_status message viable_occupant = connected.occupant - if(viable_occupant.has_dna() && (!(RADIMMUNE in viable_occupant.dna.species.species_traits)) && (!(viable_occupant.disabilities & NOCLONE) || (connected.scan_level == 3))) //occupant is viable for dna modification + if(viable_occupant.has_dna() && (!(RADIMMUNE in viable_occupant.dna.species.species_traits)) && (!(viable_occupant.has_disability(NOCLONE)) || (connected.scan_level == 3))) //occupant is viable for dna modification occupant_status += "[viable_occupant.name] => " switch(viable_occupant.stat) if(CONSCIOUS) @@ -527,7 +527,7 @@ var/mob/living/carbon/viable_occupant = null if(connected) viable_occupant = connected.occupant - if(!istype(viable_occupant) || !viable_occupant.dna || (viable_occupant.disabilities & NOCLONE)) + if(!istype(viable_occupant) || !viable_occupant.dna || (viable_occupant.has_disability(NOCLONE))) viable_occupant = null return viable_occupant diff --git a/code/game/machinery/dna_scanner.dm b/code/game/machinery/dna_scanner.dm index d1189ff8b8..29df5e4949 100644 --- a/code/game/machinery/dna_scanner.dm +++ b/code/game/machinery/dna_scanner.dm @@ -100,7 +100,7 @@ var/mob/living/mob_occupant = get_mob_or_brainmob(occupant) if(istype(mob_occupant)) if(locate_computer(/obj/machinery/computer/cloning)) - if(!mob_occupant.suiciding && !(mob_occupant.disabilities & NOCLONE) && !mob_occupant.hellbound) + if(!mob_occupant.suiciding && !(mob_occupant.has_disability(NOCLONE)) && !mob_occupant.hellbound) mob_occupant.notify_ghost_cloning("Your corpse has been placed into a cloning scanner. Re-enter your corpse if you want to be cloned!", source = src) // DNA manipulators cannot operate on severed heads or brains diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index a74b246282..52933c4fbe 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -536,9 +536,9 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) M.adjust_blurriness(15) if(M.stat != DEAD) to_chat(M, "Your eyes start to bleed profusely!") - if(!(M.disabilities & (NEARSIGHT | BLIND))) - if(M.become_nearsighted()) - to_chat(M, "You become nearsighted!") + if(!(M.has_disability(BLIND) || M.has_disability(NEARSIGHT))) + to_chat(M, "You become nearsighted!") + M.become_nearsighted(EYE_DAMAGE) if(prob(50)) if(M.stat != DEAD) if(M.drop_all_held_items()) @@ -547,8 +547,8 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) M.Unconscious(20) M.Knockdown(40) if (prob(eyes.eye_damage - 10 + 1)) - if(M.become_blind()) - to_chat(M, "You go blind!") + M.become_blind(EYE_DAMAGE) + to_chat(M, "You go blind!") /obj/item/clean_blood() . = ..() diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index e501e24c6a..22cd62a962 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -393,7 +393,7 @@ /obj/item/twohanded/shockpaddles/proc/can_defib(mob/living/carbon/human/H) var/obj/item/organ/brain/BR = H.getorgan(/obj/item/organ/brain) - return (!H.suiciding && !(H.disabilities & NOCLONE) && !H.hellbound && ((world.time - H.timeofdeath) < tlimit) && (H.getBruteLoss() < 180) && (H.getFireLoss() < 180) && H.getorgan(/obj/item/organ/heart) && BR && !BR.damaged_brain) + return (!H.suiciding && !(H.has_disability(NOCLONE)) && !H.hellbound && ((world.time - H.timeofdeath) < tlimit) && (H.getBruteLoss() < 180) && (H.getFireLoss() < 180) && H.getorgan(/obj/item/organ/heart) && BR && !BR.damaged_brain) /obj/item/twohanded/shockpaddles/proc/shock_touching(dmg, mob/H) if(isliving(H.pulledby)) //CLEAR! @@ -514,7 +514,7 @@ shock_touching(30, H) var/failed - if (H.suiciding || (H.disabilities & NOCLONE)) + if (H.suiciding || (H.has_disability(NOCLONE))) failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Recovery of patient impossible. Further attempts futile." else if (H.hellbound) failed = "[req_defib ? "[defib]" : "[src]"] buzzes: Resuscitation failed - Patient's soul appears to be on another plane of existence. Further attempts futile." diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index f656d55afd..7a40d8f3a2 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -48,7 +48,7 @@ add_fingerprint(user) if(istype(M) && on && user.zone_selected in list("eyes", "mouth")) - if((user.disabilities & (CLUMSY | DUMB)) && prob(50)) //too dumb to use flashlight properly + if((user.has_disability(CLUMSY) || user.has_disability(DUMB)) && prob(50)) //too dumb to use flashlight properly return ..() //just hit them in the head if(!user.IsAdvancedToolUser()) @@ -82,7 +82,7 @@ else user.visible_message("[user] directs [src] to [M]'s eyes.", \ "You direct [src] to [M]'s eyes.") - if(M.stat == DEAD || (M.disabilities & BLIND) || !M.flash_act(visual = 1)) //mob is dead or fully blind + if(M.stat == DEAD || (M.has_disability(BLIND)) || !M.flash_act(visual = 1)) //mob is dead or fully blind to_chat(user, "[M]'s pupils don't react to the light!") else if(M.dna && M.dna.check_mutation(XRAY)) //mob has X-RAY vision to_chat(user, "[M]'s pupils give an eerie glow!") diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 9a60bb0edb..6e67ca886b 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -85,7 +85,7 @@ GAS ANALYZER /obj/item/device/healthanalyzer/attack(mob/living/M, mob/living/carbon/human/user) // Clumsiness/brain damage check - if ((user.disabilities & (CLUMSY | DUMB)) && prob(50)) + if ((user.has_disability(CLUMSY) || user.has_disability(DUMB)) && prob(50)) to_chat(user, "You stupidly try to analyze the floor's vitals!") user.visible_message("[user] has analyzed the floor's vitals!") to_chat(user, "Analyzing results for The floor:\n\tOverall status: Healthy") @@ -181,9 +181,12 @@ GAS ANALYZER to_chat(user, "\t==EAR STATUS==") if(istype(ears)) var/healthy = TRUE - if(C.disabilities & DEAF) + if(C.has_disability(DEAF, GENETIC_MUTATION)) healthy = FALSE to_chat(user, "\tSubject is genetically deaf.") + else if(C.has_disability(DEAF)) + healthy = FALSE + to_chat(user, "\tSubject is deaf.") else if(ears.ear_damage) to_chat(user, "\tSubject has [ears.ear_damage > UNHEALING_EAR_DAMAGE? "permanent ": "temporary "]hearing damage.") @@ -199,10 +202,10 @@ GAS ANALYZER to_chat(user, "\t==EYE STATUS==") if(istype(eyes)) var/healthy = TRUE - if(C.disabilities & BLIND) + if(C.has_disability(BLIND)) to_chat(user, "\tSubject is blind.") healthy = FALSE - if(C.disabilities & NEARSIGHT) + if(C.has_disability(NEARSIGHT)) to_chat(user, "\tSubject is nearsighted.") healthy = FALSE if(eyes.eye_damage > 30) diff --git a/code/game/objects/items/dna_injector.dm b/code/game/objects/items/dna_injector.dm index 9644d827ea..19008b43a6 100644 --- a/code/game/objects/items/dna_injector.dm +++ b/code/game/objects/items/dna_injector.dm @@ -31,7 +31,7 @@ /obj/item/dnainjector/proc/inject(mob/living/carbon/M, mob/user) prepare() - if(M.has_dna() && !(RADIMMUNE in M.dna.species.species_traits) && !(M.disabilities & NOCLONE)) + if(M.has_dna() && !(RADIMMUNE in M.dna.species.species_traits) && !(M.has_disability(NOCLONE))) M.radiation += rand(20/(damage_coeff ** 2),50/(damage_coeff ** 2)) var/log_msg = "[key_name(user)] injected [key_name(M)] with the [name]" for(var/datum/mutation/human/HM in remove_mutations) @@ -313,7 +313,7 @@ to_chat(user, "You can't modify [M]'s DNA while [M.p_theyre()] dead.") return FALSE - if(M.has_dna() && !(M.disabilities & NOCLONE)) + if(M.has_dna() && !(M.has_disability(NOCLONE))) M.radiation += rand(20/(damage_coeff ** 2),50/(damage_coeff ** 2)) var/log_msg = "[key_name(user)] injected [key_name(M)] with the [name]" var/endtime = world.time+duration diff --git a/code/game/objects/items/grenades/grenade.dm b/code/game/objects/items/grenades/grenade.dm index e444ecce25..257007aba9 100644 --- a/code/game/objects/items/grenades/grenade.dm +++ b/code/game/objects/items/grenades/grenade.dm @@ -24,7 +24,7 @@ qdel(src) /obj/item/grenade/proc/clown_check(mob/living/carbon/human/user) - if(user.disabilities & CLUMSY && prob(50)) + if(user.has_disability(CLUMSY) && prob(50)) to_chat(user, "Huh? How does this thing work?") preprime(user, 5, FALSE) return FALSE diff --git a/code/game/objects/items/handcuffs.dm b/code/game/objects/items/handcuffs.dm index 886a248c8c..1dd2b1b1de 100644 --- a/code/game/objects/items/handcuffs.dm +++ b/code/game/objects/items/handcuffs.dm @@ -26,7 +26,7 @@ /obj/item/restraints/handcuffs/attack(mob/living/carbon/C, mob/living/carbon/human/user) if(!istype(C)) return - if(user.disabilities & CLUMSY && prob(50)) + if(user.has_disability(CLUMSY) && prob(50)) to_chat(user, "Uh... how do those things work?!") apply_cuffs(user,user) return diff --git a/code/game/objects/items/kitchen.dm b/code/game/objects/items/kitchen.dm index 5a8fcda09b..0a9e356014 100644 --- a/code/game/objects/items/kitchen.dm +++ b/code/game/objects/items/kitchen.dm @@ -44,7 +44,7 @@ forkload = null else if(user.zone_selected == "eyes") - if(user.disabilities & CLUMSY && prob(50)) + if(user.has_disability(CLUMSY) && prob(50)) M = user return eyestab(M,user) else @@ -70,7 +70,7 @@ /obj/item/kitchen/knife/attack(mob/living/carbon/M, mob/living/carbon/user) if(user.zone_selected == "eyes") - if(user.disabilities & CLUMSY && prob(50)) + if(user.has_disability(CLUMSY) && prob(50)) M = user return eyestab(M,user) else diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index 6e21251b6e..6fb173b905 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -99,7 +99,7 @@ return ..() add_fingerprint(user) - if((CLUMSY in user.disabilities) && prob(50)) + if((user.has_disability(CLUMSY)) && prob(50)) to_chat(user, "You club yourself over the head.") user.Knockdown(60 * force) if(ishuman(user)) diff --git a/code/game/objects/items/melee/transforming.dm b/code/game/objects/items/melee/transforming.dm index b63c5bcefa..94f7de09bc 100644 --- a/code/game/objects/items/melee/transforming.dm +++ b/code/game/objects/items/melee/transforming.dm @@ -72,6 +72,6 @@ to_chat(user, "[src] [active ? "is now active":"can now be concealed"].") /obj/item/melee/transforming/proc/clumsy_transform_effect(mob/living/user) - if(user.disabilities & CLUMSY && prob(50)) + if(user.has_disability(CLUMSY) && prob(50)) to_chat(user, "You accidentally cut yourself with [src], like a doofus!") user.take_bodypart_damage(5,5) diff --git a/code/game/objects/items/pneumaticCannon.dm b/code/game/objects/items/pneumaticCannon.dm index 9bf0b949c0..b901d04815 100644 --- a/code/game/objects/items/pneumaticCannon.dm +++ b/code/game/objects/items/pneumaticCannon.dm @@ -147,7 +147,7 @@ if(tank && !tank.air_contents.remove(gasPerThrow * pressureSetting)) to_chat(user, "\The [src] lets out a weak hiss and doesn't react!") return - if(user.disabilities & CLUMSY && prob(75) && clumsyCheck) + if(user.has_disability(CLUMSY) && prob(75) && clumsyCheck) user.visible_message("[user] loses their grip on [src], causing it to go off!", "[src] slips out of your hands and goes off!") user.dropItemToGround(src, TRUE) if(prob(10)) diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm index 57306f498c..a746ed1778 100644 --- a/code/game/objects/items/shields.dm +++ b/code/game/objects/items/shields.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /obj/item/shield name = "shield" block_chance = 50 @@ -140,3 +141,147 @@ slot_flags = null to_chat(user, "[src] can now be concealed.") add_fingerprint(user) +======= +/obj/item/shield + name = "shield" + block_chance = 50 + armor = list(melee = 50, bullet = 50, laser = 50, energy = 0, bomb = 30, bio = 0, rad = 0, fire = 80, acid = 70) + +/obj/item/shield/riot + name = "riot shield" + desc = "A shield adept at blocking blunt objects from connecting with the torso of the shield wielder." + icon = 'icons/obj/items_and_weapons.dmi' + icon_state = "riot" + lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi' + slot_flags = SLOT_BACK + force = 10 + throwforce = 5 + throw_speed = 2 + throw_range = 3 + w_class = WEIGHT_CLASS_BULKY + materials = list(MAT_GLASS=7500, MAT_METAL=1000) + attack_verb = list("shoved", "bashed") + var/cooldown = 0 //shield bash cooldown. based on world.time + + +/obj/item/shield/riot/attackby(obj/item/W, mob/user, params) + if(istype(W, /obj/item/melee/baton)) + if(cooldown < world.time - 25) + user.visible_message("[user] bashes [src] with [W]!") + playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1) + cooldown = world.time + else + return ..() + +/obj/item/shield/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) + if(attack_type == THROWN_PROJECTILE_ATTACK) + final_block_chance += 30 + if(attack_type == LEAP_ATTACK) + final_block_chance = 100 + return ..() + +/obj/item/shield/riot/roman + name = "roman shield" + desc = "Bears an inscription on the inside: \"Romanes venio domus\"." + icon_state = "roman_shield" + item_state = "roman_shield" + lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi' + +/obj/item/shield/riot/buckler + name = "wooden buckler" + desc = "A medieval wooden buckler." + icon_state = "buckler" + item_state = "buckler" + lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi' + materials = list() + resistance_flags = FLAMMABLE + block_chance = 30 + +/obj/item/shield/energy + name = "energy combat shield" + desc = "A shield capable of stopping most melee attacks. Protects user from almost all energy projectiles. It can be retracted, expanded, and stored anywhere." + icon = 'icons/obj/items_and_weapons.dmi' + icon_state = "eshield0" // eshield1 for expanded + lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi' + force = 3 + throwforce = 3 + throw_speed = 3 + throw_range = 5 + w_class = WEIGHT_CLASS_TINY + attack_verb = list("shoved", "bashed") + var/active = 0 + +/obj/item/shield/energy/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) + return 0 + +/obj/item/shield/energy/IsReflect() + return (active) + +/obj/item/shield/energy/attack_self(mob/living/carbon/human/user) + if(user.has_disability(CLUMSY) && prob(50)) + to_chat(user, "You beat yourself in the head with [src].") + user.take_bodypart_damage(5) + active = !active + icon_state = "eshield[active]" + + if(active) + force = 10 + throwforce = 8 + throw_speed = 2 + w_class = WEIGHT_CLASS_BULKY + playsound(user, 'sound/weapons/saberon.ogg', 35, 1) + to_chat(user, "[src] is now active.") + else + force = 3 + throwforce = 3 + throw_speed = 3 + w_class = WEIGHT_CLASS_TINY + playsound(user, 'sound/weapons/saberoff.ogg', 35, 1) + to_chat(user, "[src] can now be concealed.") + add_fingerprint(user) + +/obj/item/shield/riot/tele + name = "telescopic shield" + desc = "An advanced riot shield made of lightweight materials that collapses for easy storage." + icon = 'icons/obj/items_and_weapons.dmi' + icon_state = "teleriot0" + lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi' + slot_flags = null + force = 3 + throwforce = 3 + throw_speed = 3 + throw_range = 4 + w_class = WEIGHT_CLASS_NORMAL + var/active = 0 + +/obj/item/shield/riot/tele/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) + if(active) + return ..() + return 0 + +/obj/item/shield/riot/tele/attack_self(mob/living/user) + active = !active + icon_state = "teleriot[active]" + playsound(src.loc, 'sound/weapons/batonextend.ogg', 50, 1) + + if(active) + force = 8 + throwforce = 5 + throw_speed = 2 + w_class = WEIGHT_CLASS_BULKY + slot_flags = SLOT_BACK + to_chat(user, "You extend \the [src].") + else + force = 3 + throwforce = 3 + throw_speed = 3 + w_class = WEIGHT_CLASS_NORMAL + slot_flags = null + to_chat(user, "[src] can now be concealed.") + add_fingerprint(user) +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm index ef04fc48f5..a06d1a509e 100644 --- a/code/game/objects/items/storage/book.dm +++ b/code/game/objects/items/storage/book.dm @@ -94,7 +94,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", to_chat(user, "You don't have the dexterity to do this!") return - if (user.disabilities & CLUMSY && prob(50)) + if (user.has_disability(CLUMSY) && prob(50)) to_chat(user, "[src] slips out of your hand and hits your head.") user.take_bodypart_damage(10) user.Unconscious(400) diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm index ab82f92c2d..128a313525 100644 --- a/code/game/objects/items/stunbaton.dm +++ b/code/game/objects/items/stunbaton.dm @@ -108,7 +108,7 @@ add_fingerprint(user) /obj/item/melee/baton/attack(mob/M, mob/living/carbon/human/user) - if(status && user.disabilities & CLUMSY && prob(50)) + if(status && user.has_disability(CLUMSY) && prob(50)) user.visible_message("[user] accidentally hits themself with [src]!", \ "You accidentally hit yourself with [src]!") user.Knockdown(stunforce*3) diff --git a/code/game/objects/items/teleprod.dm b/code/game/objects/items/teleprod.dm index 92e7a8e9ba..c780d32917 100644 --- a/code/game/objects/items/teleprod.dm +++ b/code/game/objects/items/teleprod.dm @@ -8,7 +8,7 @@ /obj/item/melee/baton/cattleprod/teleprod/attack(mob/living/carbon/M, mob/living/carbon/user)//handles making things teleport when hit ..() - if(status && user.disabilities & CLUMSY && prob(50)) + if(status && user.has_disability(CLUMSY) && prob(50)) user.visible_message("[user] accidentally hits themself with [src]!", \ "You accidentally hit yourself with [src]!") if(do_teleport(user, get_turf(user), 50))//honk honk diff --git a/code/game/objects/items/tools/screwdriver.dm b/code/game/objects/items/tools/screwdriver.dm index 08f22b7e46..8fd37a3b38 100644 --- a/code/game/objects/items/tools/screwdriver.dm +++ b/code/game/objects/items/tools/screwdriver.dm @@ -75,7 +75,7 @@ return ..() if(user.zone_selected != "eyes" && user.zone_selected != "head") return ..() - if(user.disabilities & CLUMSY && prob(50)) + if(user.has_disability(CLUMSY) && prob(50)) M = user return eyestab(M,user) @@ -105,7 +105,7 @@ item_state = "drill" lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' - materials = list(MAT_METAL=150,MAT_SILVER=50,MAT_TITANIUM=25) //done for balance reasons, making them high value for research, but harder to get + materials = list(MAT_METAL=150,MAT_SILVER=50,MAT_TITANIUM=25) //done for balance reasons, making them high value for research, but harder to get force = 8 //might or might not be too high, subject to change w_class = WEIGHT_CLASS_SMALL throwforce = 8 diff --git a/code/game/objects/items/twohanded.dm b/code/game/objects/items/twohanded.dm index c11d41eaa8..dc61944b4f 100644 --- a/code/game/objects/items/twohanded.dm +++ b/code/game/objects/items/twohanded.dm @@ -302,7 +302,7 @@ unwield() return ..() - if(user.disabilities & CLUMSY && (wielded) && prob(40)) + if(user.has_disability(CLUMSY) && (wielded) && prob(40)) impale(user) return if((wielded) && prob(50)) diff --git a/code/game/objects/structures/petrified_statue.dm b/code/game/objects/structures/petrified_statue.dm index 36233bc155..d2bee1af36 100644 --- a/code/game/objects/structures/petrified_statue.dm +++ b/code/game/objects/structures/petrified_statue.dm @@ -17,7 +17,7 @@ L.buckled.unbuckle_mob(L,force=1) L.visible_message("[L]'s skin rapidly turns to marble!", "Your body freezes up! Can't... move... can't... think...") L.forceMove(src) - L.disabilities |= MUTE + L.add_disability(MUTE, STATUE_MUTE) L.faction += "mimic" //Stops mimics from instaqdeling people in statues L.status_flags |= GODMODE obj_integrity = L.health + 100 //stoning damaged mobs will result in easier to shatter statues @@ -59,7 +59,7 @@ if(petrified_mob) petrified_mob.status_flags &= ~GODMODE petrified_mob.forceMove(loc) - petrified_mob.disabilities &= ~MUTE + petrified_mob.remove_disability(MUTE, STATUE_MUTE) petrified_mob.take_overall_damage((petrified_mob.health - obj_integrity + 100)) //any new damage the statue incurred is transfered to the mob petrified_mob.faction -= "mimic" petrified_mob = null diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index 81f2c75660..8feff99df4 100644 --- a/code/modules/assembly/flash.dm +++ b/code/modules/assembly/flash.dm @@ -30,7 +30,7 @@ holder.update_icon() /obj/item/device/assembly/flash/proc/clown_check(mob/living/carbon/human/user) - if(user.disabilities & CLUMSY && prob(50)) + if(user.has_disability(CLUMSY) && prob(50)) flash_carbon(user, user, 15, 0) return 0 return 1 diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index e8ee742e56..ca697cdbf6 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /obj/item/device/assembly/mousetrap name = "mousetrap" desc = "A handy little spring-loaded trap for catching pesty rodents." @@ -140,3 +141,147 @@ /obj/item/device/assembly/mousetrap/armed icon_state = "mousetraparmed" armed = TRUE +======= +/obj/item/device/assembly/mousetrap + name = "mousetrap" + desc = "A handy little spring-loaded trap for catching pesty rodents." + icon_state = "mousetrap" + materials = list(MAT_METAL=100) + attachable = 1 + var/armed = 0 + + +/obj/item/device/assembly/mousetrap/examine(mob/user) + ..() + if(armed) + to_chat(user, "The mousetrap is armed!") + else + to_chat(user, "The mousetrap is not armed.") + +/obj/item/device/assembly/mousetrap/activate() + if(..()) + armed = !armed + if(!armed) + if(ishuman(usr)) + var/mob/living/carbon/human/user = usr + if((user.has_disability(DUMB) || user.has_disability(CLUMSY)) && prob(50)) + to_chat(user, "Your hand slips, setting off the trigger!") + pulse(0) + update_icon() + if(usr) + playsound(usr.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -3) + +/obj/item/device/assembly/mousetrap/describe() + return "The pressure switch is [armed?"primed":"safe"]." + +/obj/item/device/assembly/mousetrap/update_icon() + if(armed) + icon_state = "mousetraparmed" + else + icon_state = "mousetrap" + if(holder) + holder.update_icon() + +/obj/item/device/assembly/mousetrap/proc/triggered(mob/target, type = "feet") + if(!armed) + return + var/obj/item/bodypart/affecting = null + if(ishuman(target)) + var/mob/living/carbon/human/H = target + if(PIERCEIMMUNE in H.dna.species.species_traits) + playsound(src.loc, 'sound/effects/snap.ogg', 50, 1) + armed = 0 + update_icon() + pulse(0) + return 0 + switch(type) + if("feet") + if(!H.shoes) + affecting = H.get_bodypart(pick("l_leg", "r_leg")) + H.Knockdown(60) + if("l_hand", "r_hand") + if(!H.gloves) + affecting = H.get_bodypart(type) + H.Stun(60) + if(affecting) + if(affecting.receive_damage(1, 0)) + H.update_damage_overlays() + else if(ismouse(target)) + var/mob/living/simple_animal/mouse/M = target + visible_message("SPLAT!") + M.splat() + playsound(src.loc, 'sound/effects/snap.ogg', 50, 1) + armed = 0 + update_icon() + pulse(0) + + +/obj/item/device/assembly/mousetrap/attack_self(mob/living/carbon/human/user) + if(!armed) + to_chat(user, "You arm [src].") + else + if((user.has_disability(DUMB) || user.has_disability(CLUMSY)) && prob(50)) + var/which_hand = "l_hand" + if(!(user.active_hand_index % 2)) + which_hand = "r_hand" + triggered(user, which_hand) + user.visible_message("[user] accidentally sets off [src], breaking their fingers.", \ + "You accidentally trigger [src]!") + return + to_chat(user, "You disarm [src].") + armed = !armed + update_icon() + playsound(user.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -3) + + +/obj/item/device/assembly/mousetrap/attack_hand(mob/living/carbon/human/user) + if(armed) + if((user.has_disability(DUMB) || user.has_disability(CLUMSY)) && prob(50)) + var/which_hand = "l_hand" + if(!(user.active_hand_index % 2)) + which_hand = "r_hand" + triggered(user, which_hand) + user.visible_message("[user] accidentally sets off [src], breaking their fingers.", \ + "You accidentally trigger [src]!") + return + ..() + + +/obj/item/device/assembly/mousetrap/Crossed(atom/movable/AM as mob|obj) + if(armed) + if(ismob(AM)) + var/mob/MM = AM + if(!(MM.movement_type & FLYING)) + if(ishuman(AM)) + var/mob/living/carbon/H = AM + if(H.m_intent == MOVE_INTENT_RUN) + triggered(H) + H.visible_message("[H] accidentally steps on [src].", \ + "You accidentally step on [src]") + else if(ismouse(MM)) + triggered(MM) + else if(AM.density) // For mousetrap grenades, set off by anything heavy + triggered(AM) + ..() + + +/obj/item/device/assembly/mousetrap/on_found(mob/finder) + if(armed) + finder.visible_message("[finder] accidentally sets off [src], breaking their fingers.", \ + "You accidentally trigger [src]!") + triggered(finder, (finder.active_hand_index % 2 == 0) ? "r_hand" : "l_hand") + return 1 //end the search! + return 0 + + +/obj/item/device/assembly/mousetrap/hitby(A as mob|obj) + if(!armed) + return ..() + visible_message("[src] is triggered by [A].") + triggered(null) + + +/obj/item/device/assembly/mousetrap/armed + icon_state = "mousetraparmed" + armed = 1 +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 29990a299b..ddb1cf5545 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -41,7 +41,7 @@ /obj/item/clothing/glasses/proc/thermal_overload() if(ishuman(src.loc)) var/mob/living/carbon/human/H = src.loc - if(!(H.disabilities & BLIND)) + if(!(H.has_disability(BLIND))) if(H.glasses == src) to_chat(H, "[src] overloads and blinds you!") H.flash_act(visual = 1) diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm index eb7625e08c..db2b1ee561 100644 --- a/code/modules/events/disease_outbreak.dm +++ b/code/modules/events/disease_outbreak.dm @@ -41,6 +41,7 @@ continue var/datum/disease/D +<<<<<<< HEAD if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work. if(!H.dna || (H.disabilities & BLIND)) //A blindness disease would be the worst. continue @@ -49,6 +50,19 @@ DS.strain_data["name"] = H.real_name DS.strain_data["UI"] = H.dna.uni_identity DS.strain_data["SE"] = H.dna.struc_enzymes +======= + if(!advanced_virus) + if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work. + if(!H.dna || (H.has_disability(BLIND))) //A blindness disease would be the worst. + continue + D = new virus_type() + var/datum/disease/dnaspread/DS = D + DS.strain_data["name"] = H.real_name + DS.strain_data["UI"] = H.dna.uni_identity + DS.strain_data["SE"] = H.dna.struc_enzymes + else + D = new virus_type() +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) else D = new virus_type() D.carrier = TRUE diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index 9d6d522c11..c8c042e30b 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -656,7 +656,7 @@ playsound(user, 'sound/magic/clockwork/fellowship_armory.ogg', 35, TRUE, frequency = 90000 - (active * 30000)) /obj/item/melee/transforming/cleaving_saw/clumsy_transform_effect(mob/living/user) - if(user.disabilities & CLUMSY && prob(50)) + if(user.has_disability(CLUMSY) && prob(50)) to_chat(user, "You accidentally cut yourself with [src], like a doofus!") user.take_bodypart_damage(10) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index 45f26d55c3..c1ea547b34 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -16,7 +16,7 @@ /mob/living/carbon/monkey/handle_blood() - if(bodytemperature >= 225 && !(disabilities & NOCLONE)) //cryosleep or husked people do not pump the blood. + if(bodytemperature >= 225 && !(has_disability(NOCLONE))) //cryosleep or husked people do not pump the blood. //Blood regeneration if there is some space if(blood_volume < BLOOD_VOLUME_NORMAL) blood_volume += 0.1 // regenerate blood VERY slowly @@ -28,7 +28,7 @@ bleed_rate = 0 return - if(bodytemperature >= 225 && !(disabilities & NOCLONE)) //cryosleep or husked people do not pump the blood. + if(bodytemperature >= 225 && !(has_disability(NOCLONE))) //cryosleep or husked people do not pump the blood. //Blood regeneration if there is some space if(blood_volume < BLOOD_VOLUME_NORMAL && !(NOHUNGER in dna.species.species_traits)) @@ -201,13 +201,13 @@ return "blood" /mob/living/carbon/monkey/get_blood_id() - if(!(disabilities & NOCLONE)) + if(!(has_disability(NOCLONE))) return "blood" /mob/living/carbon/human/get_blood_id() if(dna.species.exotic_blood) return dna.species.exotic_blood - else if((NOBLOOD in dna.species.species_traits) || (disabilities & NOCLONE)) + else if((NOBLOOD in dna.species.species_traits) || (has_disability(NOCLONE))) return return "blood" diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index db48302f49..c745de747e 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -79,8 +79,8 @@ if(!brainmob.stored_dna) brainmob.stored_dna = new /datum/dna/stored(brainmob) C.dna.copy_dna(brainmob.stored_dna) - if(L.disabilities & NOCLONE) - brainmob.disabilities |= NOCLONE //This is so you can't just decapitate a husked guy and clone them without needing to get a new body + if(L.has_disability(NOCLONE)) + brainmob.disabilities[NOCLONE] = L.disabilities[NOCLONE] var/obj/item/organ/zombie_infection/ZI = L.getorganslot(ORGAN_SLOT_ZOMBIE) if(ZI) brainmob.set_species(ZI.old_species) //For if the brain is cloned diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index edb82e7ad4..4b2a6f64d5 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -157,6 +157,11 @@ if(!throwable_mob.buckled) thrown_thing = throwable_mob stop_pulling() +<<<<<<< HEAD +======= + if(has_disability(PACIFISM)) + to_chat(src, "You gently let go of [throwable_mob].") +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors var/turf/end_T = get_turf(target) if(start_T && end_T) @@ -168,6 +173,13 @@ thrown_thing = I dropItemToGround(I) +<<<<<<< HEAD +======= + if(has_disability(PACIFISM) && I.throwforce) + to_chat(src, "You set [I] down gently on the ground.") + return + +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) if(thrown_thing) visible_message("[src] has thrown [thrown_thing].") add_logs(src, thrown_thing, "has thrown") @@ -403,7 +415,7 @@ dropItemToGround(I) var/modifier = 0 - if(disabilities & CLUMSY) + if(has_disability(CLUMSY)) modifier -= 40 //Clumsy people are more likely to hit themselves -Honk! switch(rand(1,100)+modifier) //91-100=Nothing special happens @@ -512,7 +524,7 @@ health = maxHealth - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute update_stat() if(((maxHealth - total_burn) < HEALTH_THRESHOLD_DEAD) && stat == DEAD ) - become_husk() + become_husk("burn") med_hud_set_health() /mob/living/carbon/update_sight() diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 0bfa287a09..a6d4f3536b 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -306,11 +306,15 @@ if(eyes.eye_damage > 20) if(prob(eyes.eye_damage - 20)) - if(become_nearsighted()) + if(!has_disability(NEARSIGHT)) to_chat(src, "Your eyes start to burn badly!") + become_nearsighted(EYE_DAMAGE) + else if(prob(eyes.eye_damage - 25)) - if(become_blind()) + if(!has_disability(BLIND)) to_chat(src, "You can't see anything!") + become_blind(EYE_DAMAGE) + else to_chat(src, "Your eyes are really starting to hurt. This can't be good for you!") if(has_bane(BANE_LIGHT)) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 4b1afe0780..4453c33436 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -48,7 +48,7 @@ /mob/living/carbon/proc/Drain() - become_husk() - disabilities |= NOCLONE + become_husk(CHANGELING_DRAIN) + add_disability(NOCLONE, CHANGELING_DRAIN) blood_volume = 0 return 1 diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index a515ef23b1..7cdcad35bb 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -140,8 +140,13 @@ return ..() /mob/living/carbon/human/grabbedby(mob/living/carbon/user, supress_message = 0) +<<<<<<< HEAD if(user == src && pulling && !pulling.anchored && grab_state >= GRAB_AGGRESSIVE && isliving(pulling)) vore_attack(user, pulling) +======= + if(user == src && pulling && !pulling.anchored && grab_state >= GRAB_AGGRESSIVE && (has_disability(FAT)) && ismonkey(pulling)) + devour_mob(pulling) +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) else ..() diff --git a/code/modules/mob/living/carbon/human/interactive.dm b/code/modules/mob/living/carbon/human/interactive.dm index 38dfad5787..8c913349c5 100644 --- a/code/modules/mob/living/carbon/human/interactive.dm +++ b/code/modules/mob/living/carbon/human/interactive.dm @@ -339,7 +339,7 @@ if(TRAITS & TRAIT_SMART) smartness = 75 else if(TRAITS & TRAIT_DUMB) - disabilities |= CLUMSY + add_disability(CLUMSY, GENETIC_MUTATION) smartness = 25 if(TRAITS & TRAIT_MEAN) diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 4f41c2d40c..640447fc4d 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -187,7 +187,7 @@ if(G.tint) update_tint() if(G.vision_correction) - if(disabilities & NEARSIGHT) + if(has_disability(NEARSIGHT)) overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1) adjust_eye_damage(0) if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view || !isnull(G.lighting_alpha)) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 0b02a2c711..1f30562dcf 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -312,7 +312,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(!HD) //Decapitated return - if(H.disabilities & HUSK) + if(H.has_disability(HUSK)) return var/datum/sprite_accessory/S var/list/standing = list() @@ -453,7 +453,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) var/obj/item/bodypart/head/HD = H.get_bodypart("head") - if(HD && !(H.disabilities & HUSK)) + if(HD && !(H.has_disability(HUSK))) // lipstick if(H.lip_style && (LIPS in species_traits)) var/mutable_appearance/lip_overlay = mutable_appearance('icons/mob/human_face.dmi', "lips_[H.lip_style]", -BODY_LAYER) @@ -724,7 +724,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(S.center) accessory_overlay = center_image(accessory_overlay, S.dimension_x, S.dimension_y) - if(!(H.disabilities & HUSK)) + if(!(H.has_disability(HUSK))) if(!forced_colour) switch(S.color_src) if(MUTCOLORS) @@ -1103,16 +1103,16 @@ GLOBAL_LIST_EMPTY(roundstart_races) /datum/species/proc/handle_digestion(mob/living/carbon/human/H) //The fucking FAT mutation is the dumbest shit ever. It makes the code so difficult to work with - if(H.disabilities & FAT)//I share your pain, past coder. + if(H.has_disability(FAT))//I share your pain, past coder. if(H.overeatduration < 100) to_chat(H, "You feel fit again!") - H.disabilities &= ~FAT + H.remove_disability(FAT, OBESITY) H.update_inv_w_uniform() H.update_inv_wear_suit() else if(H.overeatduration > 500) to_chat(H, "You suddenly feel blubbery!") - H.disabilities |= FAT + H.add_disability(FAT, OBESITY) H.update_inv_w_uniform() H.update_inv_wear_suit() @@ -1269,7 +1269,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) . += (health_deficiency / 25) if((hungry >= 70) && !flight) //Being hungry won't stop you from using flightpack controls/flapping your wings although it probably will in the wing case but who cares. . += hungry / 50 - if(H.disabilities & FAT) + if(H.has_disability(FAT)) . += (1.5 - flight) if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT) . += (BODYTEMP_COLD_DAMAGE_LIMIT - H.bodytemperature) / COLD_SLOWDOWN_FACTOR @@ -1315,6 +1315,12 @@ GLOBAL_LIST_EMPTY(roundstart_races) /datum/species/proc/harm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style) +<<<<<<< HEAD +======= + if(user.has_disability(PACIFISM)) + to_chat(user, "You don't want to harm [target]!") + return FALSE +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) if(target.check_block()) target.visible_message("[target] blocks [user]'s attack!") return 0 diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm index d2c83fa39f..25be12a0ff 100644 --- a/code/modules/mob/living/carbon/human/species_types/golems.dm +++ b/code/modules/mob/living/carbon/human/species_types/golems.dm @@ -725,7 +725,7 @@ /obj/structure/cloth_pile/proc/revive() if(QDELETED(src) || QDELETED(cloth_golem)) //QDELETED also checks for null, so if no cloth golem is set this won't runtime return - if(cloth_golem.suiciding || cloth_golem.disabilities & NOCLONE) + if(cloth_golem.suiciding || cloth_golem.has_disability(NOCLONE)) QDEL_NULL(cloth_golem) return diff --git a/code/modules/mob/living/carbon/human/status_procs.dm b/code/modules/mob/living/carbon/human/status_procs.dm index aca6973355..cf3d676e90 100644 --- a/code/modules/mob/living/carbon/human/status_procs.dm +++ b/code/modules/mob/living/carbon/human/status_procs.dm @@ -11,12 +11,12 @@ amount = dna.species.spec_stun(src,amount) return ..() -/mob/living/carbon/human/cure_husk() +/mob/living/carbon/human/cure_husk(list/sources) . = ..() if(.) update_hair() -/mob/living/carbon/human/become_husk() +/mob/living/carbon/human/become_husk(source) if(istype(dna.species, /datum/species/skeleton)) //skeletons shouldn't be husks. cure_husk() return diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 7264e9ad95..14f294fd90 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -609,7 +609,7 @@ generate/load female uniform sprites matching all previously decided variables if(BP.dmg_overlay_type) . += "-[BP.dmg_overlay_type]" - if(disabilities & HUSK) + if(has_disability(HUSK)) . += "-husk" /mob/living/carbon/human/load_limb_from_cache() diff --git a/code/modules/mob/living/carbon/monkey/combat.dm b/code/modules/mob/living/carbon/monkey/combat.dm index d6afdbdbc2..089a242347 100644 --- a/code/modules/mob/living/carbon/monkey/combat.dm +++ b/code/modules/mob/living/carbon/monkey/combat.dm @@ -120,7 +120,14 @@ /mob/living/carbon/monkey/proc/should_target(var/mob/living/L) if(L == src) +<<<<<<< HEAD return 0 +======= + return FALSE + + if(has_disability(PACIFISM)) + return FALSE +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) if(enemies[L]) return 1 diff --git a/code/modules/mob/living/carbon/monkey/update_icons.dm b/code/modules/mob/living/carbon/monkey/update_icons.dm index 5a4ba686b2..87058ce76d 100644 --- a/code/modules/mob/living/carbon/monkey/update_icons.dm +++ b/code/modules/mob/living/carbon/monkey/update_icons.dm @@ -19,7 +19,7 @@ if(!HD) //Decapitated return - if(disabilities & HUSK) + if(has_disability(HUSK)) return var/hair_hidden = 0 diff --git a/code/modules/mob/living/carbon/status_procs.dm b/code/modules/mob/living/carbon/status_procs.dm index e46ae2f8e6..74385b895c 100644 --- a/code/modules/mob/living/carbon/status_procs.dm +++ b/code/modules/mob/living/carbon/status_procs.dm @@ -64,43 +64,8 @@ /mob/living/carbon/set_disgust(amount) disgust = Clamp(amount, 0, DISGUST_LEVEL_MAXEDOUT) -/mob/living/carbon/cure_blind() - if(disabilities & BLIND) - disabilities &= ~BLIND - adjust_blindness(-1) - return 1 -/mob/living/carbon/become_blind() - if(!(disabilities & BLIND)) - disabilities |= BLIND - blind_eyes(1) - return 1 -/mob/living/carbon/cure_nearsighted() - if(disabilities & NEARSIGHT) - disabilities &= ~NEARSIGHT - clear_fullscreen("nearsighted") - return 1 - -/mob/living/carbon/become_nearsighted() - if(!(disabilities & NEARSIGHT)) - disabilities |= NEARSIGHT - overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1) - return 1 - -/mob/living/carbon/cure_husk() - if(disabilities & HUSK) - disabilities &= ~HUSK - status_flags &= ~DISFIGURED - update_body() - return 1 - -/mob/living/carbon/become_husk() - if(disabilities & HUSK) - return - disabilities |= HUSK - status_flags |= DISFIGURED //makes them unknown - update_body() - return 1 +////////////////////////////////////////TRAUMAS///////////////////////////////////////// /mob/living/carbon/proc/get_traumas() . = list() diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index 701fa0c7bc..5034abfbbe 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -290,7 +290,7 @@ else . += "-robotic" - if(disabilities & HUSK) + if(has_disability(HUSK)) . += "-husk" diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 0aafef753f..b8423cdc46 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -126,7 +126,7 @@ /mob/living/proc/handle_disabilities() //Eyes if(eye_blind) //blindness, heals slowly over time - if(!stat && !(disabilities & BLIND)) + if(!stat && !(has_disability(BLIND))) eye_blind = max(eye_blind-1,0) if(client && !eye_blind) clear_alert("blind") @@ -137,6 +137,12 @@ eye_blurry = max(eye_blurry-1, 0) if(client && !eye_blurry) clear_fullscreen("blurry") +<<<<<<< HEAD +======= + if(has_disability(PACIFISM) && a_intent == INTENT_HARM) + to_chat(src, "You don't feel like harming anybody.") + a_intent_change(INTENT_HELP) +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) /mob/living/proc/update_damage_hud() return diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index f589ecbb20..24985f54a6 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -406,7 +406,6 @@ cure_nearsighted() cure_blind() cure_husk() - disabilities = 0 hallucination = 0 heal_overall_damage(100000, 100000, 0, 0, 1) //heal brute and burn dmg on both organic and robotic limbs, and update health right away. ExtinguishMob() @@ -812,6 +811,12 @@ if (G.trigger_guard != TRIGGER_GUARD_ALLOW_ALL && !IsAdvancedToolUser()) to_chat(src, "You don't have the dexterity to do this!") return FALSE +<<<<<<< HEAD +======= + if(has_disability(PACIFISM)) + to_chat(src, "You don't want to risk harming anyone!") + return FALSE +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) return TRUE /mob/living/carbon/proc/update_stamina() diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index f77c65225f..d99ce1b014 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -134,7 +134,16 @@ if(!(status_flags & CANPUSH)) to_chat(user, "[src] can't be grabbed more aggressively!") +<<<<<<< HEAD return 0 +======= + return FALSE + + if(user.has_disability(PACIFISM)) + to_chat(user, "You don't want to risk hurting [src]!") + return FALSE + +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) grippedby(user) //proc to upgrade a simple pull into a more aggressive grab. @@ -188,6 +197,13 @@ M.Feedstop() return // can't attack while eating! +<<<<<<< HEAD +======= + if(has_disability(PACIFISM)) + to_chat(M, "You don't want to hurt anyone!") + return FALSE + +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) if (stat != DEAD) add_logs(M, src, "attacked") M.do_attack_animation(src) @@ -201,6 +217,13 @@ M.visible_message("\The [M] [M.friendly] [src]!") return 0 else +<<<<<<< HEAD +======= + if(M.has_disability(PACIFISM)) + to_chat(M, "You don't want to hurt anyone!") + return FALSE + +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) M.do_attack_animation(src) @@ -216,6 +239,13 @@ return 0 if (M.a_intent == INTENT_HARM) +<<<<<<< HEAD +======= + if(M.has_disability(PACIFISM)) + to_chat(M, "You don't want to hurt anyone!") + return FALSE + +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) if(M.is_muzzled() || (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSMOUTH)) to_chat(M, "You can't bite with your mouth covered!") return 0 @@ -238,6 +268,13 @@ return 0 else +<<<<<<< HEAD +======= + if(L.has_disability(PACIFISM)) + to_chat(L, "You don't want to hurt anyone!") + return + +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) L.do_attack_animation(src) if(prob(90)) add_logs(L, src, "attacked") @@ -260,6 +297,12 @@ grabbedby(M) return 0 if("harm") +<<<<<<< HEAD +======= + if(M.has_disability(PACIFISM)) + to_chat(M, "You don't want to hurt anyone!") + return FALSE +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) M.do_attack_animation(src) return 1 if("disarm") @@ -347,7 +390,7 @@ //called when the mob receives a bright flash /mob/living/proc/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash) - if(get_eye_protection() < intensity && (override_blindness_check || !(disabilities & BLIND))) + if(get_eye_protection() < intensity && (override_blindness_check || !(has_disability(BLIND)))) overlay_fullscreen("flash", type) addtimer(CALLBACK(src, .proc/clear_fullscreen, "flash", 25), 25) return 1 diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 50f2ce4db0..6990262409 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -26,6 +26,8 @@ var/incorporeal_move = FALSE //FALSE is off, INCORPOREAL_MOVE_BASIC is normal, INCORPOREAL_MOVE_SHADOW is for ninjas //and INCORPOREAL_MOVE_JAUNT is blocked by holy water/salt + var/list/disabilities = list() + var/list/surgeries = list() //a list of surgery datums. generally empty, they're added when the player wants them. var/now_pushing = null //used by living/Collide() and living/PushAM() to prevent potential infinite loop. diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index b1d0484086..e21c21453a 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -285,7 +285,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( return 1 /mob/living/proc/can_speak_vocal(message) //Check AFTER handling of xeno and ling channels - if(disabilities & MUTE) + if(has_disability(MUTE)) return 0 if(is_muzzled()) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index 58e3e0837b..b8b419087f 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -558,7 +558,7 @@ Difficulty: Very Hard H.regenerate_limbs() H.regenerate_organs() H.revive(1,0) - H.disabilities |= NOCLONE //Free revives, but significantly limits your options for reviving except via the crystal + H.add_disability(NOCLONE, MAGIC_DISABILITY) //Free revives, but significantly limits your options for reviving except via the crystal H.grab_ghost(force = TRUE) /obj/machinery/anomalous_crystal/helpers //Lets ghost spawn as helpful creatures that can only heal people slightly. Incredibly fragile and they can't converse with humans @@ -719,7 +719,7 @@ Difficulty: Very Hard if(isliving(A) && holder_animal) var/mob/living/L = A L.notransform = 1 - L.disabilities |= MUTE + L.add_disability(MUTE, STASIS_MUTE) L.status_flags |= GODMODE L.mind.transfer_to(holder_animal) var/obj/effect/proc_holder/spell/targeted/exit_possession/P = new /obj/effect/proc_holder/spell/targeted/exit_possession @@ -729,7 +729,7 @@ Difficulty: Very Hard /obj/structure/closet/stasis/dump_contents(var/kill = 1) STOP_PROCESSING(SSobj, src) for(var/mob/living/L in src) - L.disabilities &= ~MUTE + L.remove_disability(MUTE, STASIS_MUTE) L.status_flags &= ~GODMODE L.notransform = 0 if(holder_animal) diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 3d50f03e17..0149c98a3e 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -137,3 +137,76 @@ to_chat(src, "[priority_absorb_key["self_message"]]") priority_absorb_key["stuns_absorbed"] += amount return TRUE + +/////////////////////////////////// DISABILITIES //////////////////////////////////// + +/mob/living/proc/add_disability(disability, source) + if(!disabilities[disability]) + disabilities[disability] = list(source) + else + disabilities[disability] |= list(source) + +/mob/living/proc/remove_disability(disability, list/sources) + if(!disabilities[disability]) + return + + if(LAZYLEN(sources)) + for(var/S in sources) + if(S in disabilities[disability]) + disabilities[disability] -= S + else + disabilities[disability] = list() + + if(!LAZYLEN(disabilities[disability])) + disabilities -= disability + +/mob/living/proc/has_disability(disability, list/sources) + if(!disabilities[disability]) + return FALSE + + . = FALSE + + if(LAZYLEN(sources)) + for(var/S in sources) + if(S in disabilities[disability]) + return TRUE + else + if(LAZYLEN(disabilities[disability])) + return TRUE + +/mob/living/proc/remove_all_disabilities() + disabilities = list() + +/////////////////////////////////// DISABILITY PROCS //////////////////////////////////// + +/mob/living/proc/cure_blind(list/sources) + remove_disability(BLIND, sources) + if(!has_disability(BLIND)) + adjust_blindness(-1) + +/mob/living/proc/become_blind(source) + if(!has_disability(BLIND)) + blind_eyes(1) + add_disability(BLIND, source) + +/mob/living/proc/cure_nearsighted(list/sources) + remove_disability(NEARSIGHT, sources) + if(!has_disability(NEARSIGHT)) + clear_fullscreen("nearsighted") + +/mob/living/proc/become_nearsighted(source) + if(!has_disability(NEARSIGHT)) + overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1) + add_disability(NEARSIGHT, source) + +/mob/living/proc/cure_husk(list/sources) + remove_disability(HUSK, sources) + if(!has_disability(HUSK)) + status_flags &= ~DISFIGURED + update_body() + +/mob/living/proc/become_husk(source) + if(!has_disability(HUSK)) + status_flags |= DISFIGURED //makes them unknown + update_body() + add_disability(HUSK, source) \ No newline at end of file diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index edbf11654b..ecbaea015f 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -32,7 +32,6 @@ var/obj/machinery/machine = null var/other_mobs = null - var/disabilities = 0 //Carbon var/atom/movable/pulling = null var/grab_state = 0 diff --git a/code/modules/mob/status_procs.dm b/code/modules/mob/status_procs.dm index 80ab6929d5..8dfadf70f5 100644 --- a/code/modules/mob/status_procs.dm +++ b/code/modules/mob/status_procs.dm @@ -160,8 +160,12 @@ overlay_fullscreen("blind", /obj/screen/fullscreen/blind) else if(eye_blind) var/blind_minimum = 0 - if((stat != CONSCIOUS && stat != SOFT_CRIT) || (disabilities & BLIND)) + if((stat != CONSCIOUS && stat != SOFT_CRIT)) blind_minimum = 1 + if(isliving(src)) + var/mob/living/L = src + if(L.has_disability(BLIND)) + blind_minimum = 1 eye_blind = max(eye_blind+amount, blind_minimum) if(!eye_blind) clear_alert("blind") @@ -177,8 +181,12 @@ overlay_fullscreen("blind", /obj/screen/fullscreen/blind) else if(eye_blind) var/blind_minimum = 0 - if((stat != CONSCIOUS && stat != SOFT_CRIT) || (disabilities & BLIND)) + if(stat != CONSCIOUS && stat != SOFT_CRIT) blind_minimum = 1 + if(isliving(src)) + var/mob/living/L = src + if(L.has_disability(BLIND)) + blind_minimum = 1 eye_blind = blind_minimum if(!eye_blind) clear_alert("blind") @@ -227,31 +235,6 @@ /mob/proc/set_disgust(amount) return -/////////////////////////////////// BLIND DISABILITY //////////////////////////////////// - -/mob/proc/cure_blind() //when we want to cure the BLIND disability only. - return - -/mob/proc/become_blind() - return - -/////////////////////////////////// NEARSIGHT DISABILITY //////////////////////////////////// - -/mob/proc/cure_nearsighted() - return - -/mob/proc/become_nearsighted() - return - - -//////////////////////////////// HUSK DISABILITY ///////////////////////////: - -/mob/proc/cure_husk() - return - -/mob/proc/become_husk() - return - diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 1fb1846f4c..00fbcdc6f7 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -93,7 +93,7 @@ return if(ishuman(usr)) var/mob/living/carbon/human/H = usr - if(H.disabilities & CLUMSY && prob(25)) + if(H.has_disability(CLUMSY) && prob(25)) to_chat(H, "You cut yourself on the paper! Ahhhh! Ahhhhh!") H.damageoverlaytemp = 9001 H.update_damage_hud() @@ -317,7 +317,7 @@ to_chat(user, "You stamp the paper with your rubber stamp.") if(P.is_hot()) - if(user.disabilities & CLUMSY && prob(10)) + if(user.has_disability(CLUMSY) && prob(10)) user.visible_message("[user] accidentally ignites themselves!", \ "You miss the paper and accidentally light yourself on fire!") user.dropItemToGround(P) diff --git a/code/modules/paperwork/paperplane.dm b/code/modules/paperwork/paperplane.dm index 2d5fcc6e3a..17e2fe2a00 100644 --- a/code/modules/paperwork/paperplane.dm +++ b/code/modules/paperwork/paperplane.dm @@ -65,7 +65,7 @@ update_icon() else if(P.is_hot()) - if(user.disabilities & CLUMSY && prob(10)) + if(user.has_disability(CLUMSY) && prob(10)) user.visible_message("[user] accidentally ignites themselves!", \ "You miss [src] and accidentally light yourself on fire!") user.dropItemToGround(P) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 42e1352b2d..e93f298999 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -158,7 +158,7 @@ //Exclude lasertag guns from the CLUMSY check. if(clumsy_check) if(istype(user)) - if (user.disabilities & CLUMSY && prob(40)) + if (user.has_disability(CLUMSY) && prob(40)) to_chat(user, "You shoot yourself in the foot with [src]!") var/shot_leg = pick("l_leg", "r_leg") process_fire(user,user,0,params, zone_override = shot_leg) diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm index 4dafbc3f3c..aeceb041c6 100644 --- a/code/modules/projectiles/guns/ballistic/revolver.dm +++ b/code/modules/projectiles/guns/ballistic/revolver.dm @@ -351,7 +351,7 @@ clumsy_check = 0 /obj/item/gun/ballistic/revolver/reverse/can_trigger_gun(mob/living/user) - if((user.disabilities & CLUMSY) || (user.mind && user.mind.assigned_role == "Clown")) + if((user.has_disability(CLUMSY)) || (user.mind && user.mind.assigned_role == "Clown")) return ..() if(process_fire(user, user, 0, zone_override = "head")) user.visible_message("[user] somehow manages to shoot [user.p_them()]self in the face!", "You somehow shoot yourself in the face! How the hell?!") diff --git a/code/modules/projectiles/pins.dm b/code/modules/projectiles/pins.dm index faf7de9010..6cbe2de450 100644 --- a/code/modules/projectiles/pins.dm +++ b/code/modules/projectiles/pins.dm @@ -129,7 +129,7 @@ // A gun with ultra-honk pin is useful for clown and useless for everyone else. /obj/item/device/firing_pin/clown/ultra/pin_auth(mob/living/user) playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1) - if(!(user.disabilities & CLUMSY) && !(user.mind && user.mind.assigned_role == "Clown")) + if(!(user.has_disability(CLUMSY)) && !(user.mind && user.mind.assigned_role == "Clown")) return 0 return 1 diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm index b62afb80c0..b164fc0696 100644 --- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm @@ -70,7 +70,7 @@ //nothing if(21 to INFINITY) if(prob(current_cycle-10)) - M.cure_nearsighted() + M.cure_nearsighted(list(EYE_DAMAGE)) ..() return diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index ddb08db032..03134784a4 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -44,7 +44,7 @@ M.adjustToxLoss(-5, 0) M.hallucination = 0 M.setBrainLoss(0) - M.disabilities = 0 + M.remove_all_disabilities() M.set_blurriness(0) M.set_blindness(0) M.SetKnockdown(0, 0) @@ -667,16 +667,16 @@ var/obj/item/organ/eyes/eyes = M.getorganslot(ORGAN_SLOT_EYES) if (!eyes) return - if(M.disabilities & BLIND) + if(M.has_disability(BLIND, EYE_DAMAGE)) if(prob(20)) to_chat(M, "Your vision slowly returns...") - M.cure_blind() - M.cure_nearsighted() + M.cure_blind(EYE_DAMAGE) + M.cure_nearsighted(EYE_DAMAGE) M.blur_eyes(35) - else if(M.disabilities & NEARSIGHT) + else if(M.has_disability(NEARSIGHT, EYE_DAMAGE)) to_chat(M, "The blackness in your peripheral vision fades.") - M.cure_nearsighted() + M.cure_nearsighted(EYE_DAMAGE) M.blur_eyes(10) else if(M.eye_blind || M.eye_blurry) M.set_blindness(0) @@ -765,7 +765,7 @@ M.visible_message("[M]'s body convulses a bit, and then falls still once more.") return M.visible_message("[M]'s body convulses a bit.") - if(!M.suiciding && !(M.disabilities & NOCLONE) && !M.hellbound) + if(!M.suiciding && !(M.has_disability(NOCLONE)) && !M.hellbound) if(!M) return if(M.notify_ghost_cloning(source = M)) diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index 711c333896..13986f5bf8 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -141,7 +141,7 @@ taste_description = "mint" /datum/reagent/toxin/minttoxin/on_mob_life(mob/living/M) - if(M.disabilities & FAT) + if(M.has_disability(FAT)) M.gib() return ..() diff --git a/code/modules/spells/spell_types/construct_spells.dm b/code/modules/spells/spell_types/construct_spells.dm index ca6a534ee0..8e9b4fb1e4 100644 --- a/code/modules/spells/spell_types/construct_spells.dm +++ b/code/modules/spells/spell_types/construct_spells.dm @@ -209,12 +209,14 @@ to_chat(target, "A freezing darkness surrounds you...") target.playsound_local(get_turf(target), 'sound/hallucinations/i_see_you1.ogg', 50, 1) user.playsound_local(get_turf(user), 'sound/effects/ghost2.ogg', 50, 1) - target.adjust_blindness(5) + target.become_blind("abyssal_gaze") addtimer(CALLBACK(src, .proc/cure_blindness, target), 40) target.bodytemperature -= 200 /obj/effect/proc_holder/spell/targeted/abyssal_gaze/proc/cure_blindness(mob/target) - target.adjust_blindness(-5) + if(isliving(target)) + var/mob/living/L = target + L.cure_blind(BLIND, "abyssal_gaze") /obj/effect/proc_holder/spell/targeted/dominate name = "Dominate" diff --git a/code/modules/spells/spell_types/genetic.dm b/code/modules/spells/spell_types/genetic.dm index c6945dab50..0982f8a01f 100644 --- a/code/modules/spells/spell_types/genetic.dm +++ b/code/modules/spells/spell_types/genetic.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /obj/effect/proc_holder/spell/targeted/genetic name = "Genetic" desc = "This spell inflicts a set of mutations and disabilities upon the target." @@ -23,10 +24,39 @@ for(var/A in mutations) target.dna.add_mutation(A) target.disabilities |= disabilities +======= +/obj/effect/proc_holder/spell/targeted/genetic + name = "Genetic" + desc = "This spell inflicts a set of mutations and disabilities upon the target." + + var/list/disabilities = list() //disabilities + var/list/mutations = list() //mutation strings + var/duration = 100 //deciseconds + /* + Disabilities + 1st bit - ? + 2nd bit - ? + 3rd bit - ? + 4th bit - ? + 5th bit - ? + 6th bit - ? + */ + +/obj/effect/proc_holder/spell/targeted/genetic/cast(list/targets,mob/user = usr) + playMagSound() + for(var/mob/living/carbon/target in targets) + if(!target.dna) + continue + for(var/A in mutations) + target.dna.add_mutation(A) + for(var/A in disabilities) + target.add_disability(A, GENETICS_SPELL) +>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) addtimer(CALLBACK(src, .proc/remove, target), duration) /obj/effect/proc_holder/spell/targeted/genetic/proc/remove(mob/living/carbon/target) if(!QDELETED(target)) for(var/A in mutations) target.dna.remove_mutation(A) - target.disabilities &= ~disabilities + for(var/A in disabilities) + target.remove_disability(A, GENETICS_SPELL) \ No newline at end of file diff --git a/code/modules/surgery/bodyparts/bodyparts.dm b/code/modules/surgery/bodyparts/bodyparts.dm index 790942d897..474075591f 100644 --- a/code/modules/surgery/bodyparts/bodyparts.dm +++ b/code/modules/surgery/bodyparts/bodyparts.dm @@ -217,7 +217,7 @@ C = owner no_update = 0 - if(C.disabilities & HUSK) + if(C.has_disability(HUSK)) species_id = "husk" //overrides species_id dmg_overlay_type = "" //no damage overlay shown when husked should_draw_gender = FALSE diff --git a/code/modules/surgery/bodyparts/head.dm b/code/modules/surgery/bodyparts/head.dm index f631400bee..464da21e44 100644 --- a/code/modules/surgery/bodyparts/head.dm +++ b/code/modules/surgery/bodyparts/head.dm @@ -61,7 +61,7 @@ C = owner real_name = C.real_name - if(C.disabilities & HUSK) + if(C.has_disability(HUSK)) real_name = "Unknown" hair_style = "Bald" facial_hair_style = "Shaved" diff --git a/code/modules/surgery/eye_surgery.dm b/code/modules/surgery/eye_surgery.dm index c8a47d2096..00a9a99bb0 100644 --- a/code/modules/surgery/eye_surgery.dm +++ b/code/modules/surgery/eye_surgery.dm @@ -23,9 +23,9 @@ /datum/surgery_step/fix_eyes/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) user.visible_message("[user] successfully fixes [target]'s eyes!", "You succeed in fixing [target]'s eyes.") - target.cure_blind() + target.cure_blind(list(EYE_DAMAGE)) target.set_blindness(0) - target.cure_nearsighted() + target.cure_nearsighted(list(EYE_DAMAGE)) target.blur_eyes(35) //this will fix itself slowly. target.set_eye_damage(0) return TRUE diff --git a/code/modules/surgery/lipoplasty.dm b/code/modules/surgery/lipoplasty.dm index 488f2e81b1..ba43a5cc3b 100644 --- a/code/modules/surgery/lipoplasty.dm +++ b/code/modules/surgery/lipoplasty.dm @@ -4,7 +4,7 @@ possible_locs = list("chest") /datum/surgery/lipoplasty/can_start(mob/user, mob/living/carbon/target) - if(target.disabilities & FAT) + if(target.has_disability(FAT)) return 1 return 0 diff --git a/code/modules/surgery/organs/ears.dm b/code/modules/surgery/organs/ears.dm index 98b2a84ac0..905f9c2e1f 100644 --- a/code/modules/surgery/organs/ears.dm +++ b/code/modules/surgery/organs/ears.dm @@ -25,7 +25,7 @@ return var/mob/living/carbon/C = owner // genetic deafness prevents the body from using the ears, even if healthy - if(C.disabilities & DEAF) + if(C.has_disability(DEAF)) deaf = max(deaf, 1) else if(C.ears && (C.ears.flags_2 & HEALS_EARS_2)) @@ -42,7 +42,7 @@ var/mob/living/carbon/C = owner - if(iscarbon(owner) && C.disabilities & DEAF) + if(iscarbon(owner) && C.has_disability(DEAF)) deaf = 1 /obj/item/organ/ears/proc/adjustEarDamage(ddmg, ddeaf) From 9ccdb75e5757eec0ac518c034cf6cf297398641b Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 18 Dec 2017 17:23:52 -0600 Subject: [PATCH 02/17] Update stat.dm --- code/__DEFINES/stat.dm | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/code/__DEFINES/stat.dm b/code/__DEFINES/stat.dm index 208970ff9f..ce84d27765 100644 --- a/code/__DEFINES/stat.dm +++ b/code/__DEFINES/stat.dm @@ -10,18 +10,6 @@ //mob disabilities stat -<<<<<<< HEAD -#define BLIND 1 -#define MUTE 2 -#define DEAF 4 -#define NEARSIGHT 8 -#define FAT 32 -#define HUSK 64 -#define NOCLONE 128 -#define CLUMSY 256 -#define DUMB 512 -#define MONKEYLIKE 1024 //sets IsAdvancedToolUser to FALSE -======= #define BLIND "blind" #define MUTE "mute" #define DEAF "deaf" @@ -44,7 +32,6 @@ #define STASIS_MUTE "stasis" #define GENETICS_SPELL "genetics_spell" #define TRAUMA_DISABILITY "trauma" ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) // bitflags for machine stat variable #define BROKEN 1 From 6c50ca9157c42aee8050b1cf97c2986201cd40a6 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 18 Dec 2017 17:24:02 -0600 Subject: [PATCH 03/17] Update item_attack.dm --- code/_onclick/item_attack.dm | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 134e33224f..8718751d81 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -58,11 +58,8 @@ SendSignal(COMSIG_ITEM_ATTACK, M, user) if(flags_1 & NOBLUDGEON_1) return -<<<<<<< HEAD -======= if(user.has_disability(PACIFISM)) return ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) if(!force) playsound(loc, 'sound/weapons/tap.ogg', get_clamped_volume(), 1, -1) else if(hitsound) From b1669b81798768ac4d59f238c060a76ed180a576 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 18 Dec 2017 17:24:16 -0600 Subject: [PATCH 04/17] Update severe.dm --- code/datums/brain_damage/severe.dm | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/datums/brain_damage/severe.dm b/code/datums/brain_damage/severe.dm index a36d4b9fb8..381515e42e 100644 --- a/code/datums/brain_damage/severe.dm +++ b/code/datums/brain_damage/severe.dm @@ -165,8 +165,6 @@ /datum/brain_trauma/severe/discoordination/on_lose() owner.remove_disability(MONKEYLIKE, TRAUMA_DISABILITY) ..() -<<<<<<< HEAD -======= /datum/brain_trauma/severe/pacifism name = "Traumatic Non-Violence" @@ -182,4 +180,3 @@ /datum/brain_trauma/severe/pacifism/on_lose() owner.remove_disability(PACIFISM, TRAUMA_DISABILITY) ..() ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) From 0b7555781657958e5c290a4ac9abc7d114bc8fea Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 18 Dec 2017 17:24:28 -0600 Subject: [PATCH 05/17] Update shields.dm --- code/game/objects/items/shields.dm | 145 ----------------------------- 1 file changed, 145 deletions(-) diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm index a746ed1778..113bc9755c 100644 --- a/code/game/objects/items/shields.dm +++ b/code/game/objects/items/shields.dm @@ -1,147 +1,3 @@ -<<<<<<< HEAD -/obj/item/shield - name = "shield" - block_chance = 50 - armor = list(melee = 50, bullet = 50, laser = 50, energy = 0, bomb = 30, bio = 0, rad = 0, fire = 80, acid = 70) - -/obj/item/shield/riot - name = "riot shield" - desc = "A shield adept at blocking blunt objects from connecting with the torso of the shield wielder." - icon = 'icons/obj/items_and_weapons.dmi' - icon_state = "riot" - lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi' - slot_flags = SLOT_BACK - force = 10 - throwforce = 5 - throw_speed = 2 - throw_range = 3 - w_class = WEIGHT_CLASS_BULKY - materials = list(MAT_GLASS=7500, MAT_METAL=1000) - attack_verb = list("shoved", "bashed") - var/cooldown = 0 //shield bash cooldown. based on world.time - - -/obj/item/shield/riot/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/melee/baton)) - if(cooldown < world.time - 25) - user.visible_message("[user] bashes [src] with [W]!") - playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1) - cooldown = world.time - else - return ..() - -/obj/item/shield/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) - if(attack_type == THROWN_PROJECTILE_ATTACK) - final_block_chance += 30 - if(attack_type == LEAP_ATTACK) - final_block_chance = 100 - return ..() - -/obj/item/shield/riot/roman - name = "roman shield" - desc = "Bears an inscription on the inside: \"Romanes venio domus\"." - icon_state = "roman_shield" - item_state = "roman_shield" - lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi' - -/obj/item/shield/riot/buckler - name = "wooden buckler" - desc = "A medieval wooden buckler." - icon_state = "buckler" - item_state = "buckler" - lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi' - materials = list() - resistance_flags = FLAMMABLE - block_chance = 30 - -/obj/item/shield/energy - name = "energy combat shield" - desc = "A shield capable of stopping most melee attacks. Protects user from almost all energy projectiles. It can be retracted, expanded, and stored anywhere." - icon = 'icons/obj/items_and_weapons.dmi' - icon_state = "eshield0" // eshield1 for expanded - lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi' - force = 3 - throwforce = 3 - throw_speed = 3 - throw_range = 5 - w_class = WEIGHT_CLASS_TINY - attack_verb = list("shoved", "bashed") - var/active = 0 - -/obj/item/shield/energy/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) - return 0 - -/obj/item/shield/energy/IsReflect() - return (active) - -/obj/item/shield/energy/attack_self(mob/living/carbon/human/user) - if(user.disabilities & CLUMSY && prob(50)) - to_chat(user, "You beat yourself in the head with [src].") - user.take_bodypart_damage(5) - active = !active - icon_state = "eshield[active]" - - if(active) - force = 10 - throwforce = 8 - throw_speed = 2 - w_class = WEIGHT_CLASS_BULKY - playsound(user, 'sound/weapons/saberon.ogg', 35, 1) - to_chat(user, "[src] is now active.") - else - force = 3 - throwforce = 3 - throw_speed = 3 - w_class = WEIGHT_CLASS_TINY - playsound(user, 'sound/weapons/saberoff.ogg', 35, 1) - to_chat(user, "[src] can now be concealed.") - add_fingerprint(user) - -/obj/item/shield/riot/tele - name = "telescopic shield" - desc = "An advanced riot shield made of lightweight materials that collapses for easy storage." - icon = 'icons/obj/items_and_weapons.dmi' - icon_state = "teleriot0" - lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi' - righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi' - slot_flags = null - force = 3 - throwforce = 3 - throw_speed = 3 - throw_range = 4 - w_class = WEIGHT_CLASS_NORMAL - var/active = 0 - -/obj/item/shield/riot/tele/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) - if(active) - return ..() - return 0 - -/obj/item/shield/riot/tele/attack_self(mob/living/user) - active = !active - icon_state = "teleriot[active]" - playsound(src.loc, 'sound/weapons/batonextend.ogg', 50, 1) - - if(active) - force = 8 - throwforce = 5 - throw_speed = 2 - w_class = WEIGHT_CLASS_BULKY - slot_flags = SLOT_BACK - to_chat(user, "You extend \the [src].") - else - force = 3 - throwforce = 3 - throw_speed = 3 - w_class = WEIGHT_CLASS_NORMAL - slot_flags = null - to_chat(user, "[src] can now be concealed.") - add_fingerprint(user) -======= /obj/item/shield name = "shield" block_chance = 50 @@ -284,4 +140,3 @@ slot_flags = null to_chat(user, "[src] can now be concealed.") add_fingerprint(user) ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) From f650d8bb5ef990649a668e59ea82515d22355b80 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 18 Dec 2017 17:24:42 -0600 Subject: [PATCH 06/17] Update mousetrap.dm --- code/modules/assembly/mousetrap.dm | 145 ----------------------------- 1 file changed, 145 deletions(-) diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index ca697cdbf6..d1b88e68e1 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -1,147 +1,3 @@ -<<<<<<< HEAD -/obj/item/device/assembly/mousetrap - name = "mousetrap" - desc = "A handy little spring-loaded trap for catching pesty rodents." - icon_state = "mousetrap" - materials = list(MAT_METAL=100) - attachable = 1 - var/armed = 0 - - -/obj/item/device/assembly/mousetrap/examine(mob/user) - ..() - if(armed) - to_chat(user, "The mousetrap is armed!") - else - to_chat(user, "The mousetrap is not armed.") - -/obj/item/device/assembly/mousetrap/activate() - if(..()) - armed = !armed - if(!armed) - if(ishuman(usr)) - var/mob/living/carbon/human/user = usr - if((user.getBrainLoss() >= 60) || user.disabilities & CLUMSY && prob(50)) - to_chat(user, "Your hand slips, setting off the trigger!") - pulse(0) - update_icon() - if(usr) - playsound(usr.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -3) - -/obj/item/device/assembly/mousetrap/describe() - return "The pressure switch is [armed?"primed":"safe"]." - -/obj/item/device/assembly/mousetrap/update_icon() - if(armed) - icon_state = "mousetraparmed" - else - icon_state = "mousetrap" - if(holder) - holder.update_icon() - -/obj/item/device/assembly/mousetrap/proc/triggered(mob/target, type = "feet") - if(!armed) - return - var/obj/item/bodypart/affecting = null - if(ishuman(target)) - var/mob/living/carbon/human/H = target - if(PIERCEIMMUNE in H.dna.species.species_traits) - playsound(src.loc, 'sound/effects/snap.ogg', 50, 1) - armed = 0 - update_icon() - pulse(0) - return 0 - switch(type) - if("feet") - if(!H.shoes) - affecting = H.get_bodypart(pick("l_leg", "r_leg")) - H.Knockdown(60) - if("l_hand", "r_hand") - if(!H.gloves) - affecting = H.get_bodypart(type) - H.Stun(60) - if(affecting) - if(affecting.receive_damage(1, 0)) - H.update_damage_overlays() - else if(ismouse(target)) - var/mob/living/simple_animal/mouse/M = target - visible_message("SPLAT!") - M.splat() - playsound(src.loc, 'sound/effects/snap.ogg', 50, 1) - armed = 0 - update_icon() - pulse(0) - - -/obj/item/device/assembly/mousetrap/attack_self(mob/living/carbon/human/user) - if(!armed) - to_chat(user, "You arm [src].") - else - if(((user.getBrainLoss() >= 60) || user.disabilities & CLUMSY) && prob(50)) - var/which_hand = "l_hand" - if(!(user.active_hand_index % 2)) - which_hand = "r_hand" - triggered(user, which_hand) - user.visible_message("[user] accidentally sets off [src], breaking their fingers.", \ - "You accidentally trigger [src]!") - return - to_chat(user, "You disarm [src].") - armed = !armed - update_icon() - playsound(user.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -3) - - -/obj/item/device/assembly/mousetrap/attack_hand(mob/living/carbon/human/user) - if(armed) - if(((user.getBrainLoss() >= 60) || user.disabilities & CLUMSY) && prob(50)) - var/which_hand = "l_hand" - if(!(user.active_hand_index % 2)) - which_hand = "r_hand" - triggered(user, which_hand) - user.visible_message("[user] accidentally sets off [src], breaking their fingers.", \ - "You accidentally trigger [src]!") - return - ..() - - -/obj/item/device/assembly/mousetrap/Crossed(atom/movable/AM as mob|obj) - if(armed) - if(ismob(AM)) - var/mob/MM = AM - if(!(MM.movement_type & FLYING)) - if(ishuman(AM)) - var/mob/living/carbon/H = AM - if(H.m_intent == MOVE_INTENT_RUN) - triggered(H) - H.visible_message("[H] accidentally steps on [src].", \ - "You accidentally step on [src]") - else if(ismouse(MM)) - triggered(MM) - else if(AM.density) // For mousetrap grenades, set off by anything heavy - triggered(AM) - ..() - - -/obj/item/device/assembly/mousetrap/on_found(mob/finder) - if(armed) - finder.visible_message("[finder] accidentally sets off [src], breaking their fingers.", \ - "You accidentally trigger [src]!") - triggered(finder, (finder.active_hand_index % 2 == 0) ? "r_hand" : "l_hand") - return 1 //end the search! - return 0 - - -/obj/item/device/assembly/mousetrap/hitby(A as mob|obj) - if(!armed) - return ..() - visible_message("[src] is triggered by [A].") - triggered(null) - - -/obj/item/device/assembly/mousetrap/armed - icon_state = "mousetraparmed" - armed = TRUE -======= /obj/item/device/assembly/mousetrap name = "mousetrap" desc = "A handy little spring-loaded trap for catching pesty rodents." @@ -284,4 +140,3 @@ /obj/item/device/assembly/mousetrap/armed icon_state = "mousetraparmed" armed = 1 ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) From fa0bcde791ac4f5e8883d9c2f236f77f0f47dd64 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 18 Dec 2017 17:24:49 -0600 Subject: [PATCH 07/17] Update disease_outbreak.dm --- code/modules/events/disease_outbreak.dm | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm index db2b1ee561..3085f1bcce 100644 --- a/code/modules/events/disease_outbreak.dm +++ b/code/modules/events/disease_outbreak.dm @@ -41,16 +41,6 @@ continue var/datum/disease/D -<<<<<<< HEAD - if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work. - if(!H.dna || (H.disabilities & BLIND)) //A blindness disease would be the worst. - continue - D = new virus_type() - var/datum/disease/dnaspread/DS = D - DS.strain_data["name"] = H.real_name - DS.strain_data["UI"] = H.dna.uni_identity - DS.strain_data["SE"] = H.dna.struc_enzymes -======= if(!advanced_virus) if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work. if(!H.dna || (H.has_disability(BLIND))) //A blindness disease would be the worst. @@ -62,9 +52,8 @@ DS.strain_data["SE"] = H.dna.struc_enzymes else D = new virus_type() ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) else D = new virus_type() D.carrier = TRUE H.AddDisease(D) - break \ No newline at end of file + break From 10eaeed06b7060d6bda2b50db739f196bb1c8b6e Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 18 Dec 2017 17:25:09 -0600 Subject: [PATCH 08/17] Update carbon.dm --- code/modules/mob/living/carbon/carbon.dm | 6 ------ 1 file changed, 6 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 4b2a6f64d5..23decdd59f 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -157,11 +157,8 @@ if(!throwable_mob.buckled) thrown_thing = throwable_mob stop_pulling() -<<<<<<< HEAD -======= if(has_disability(PACIFISM)) to_chat(src, "You gently let go of [throwable_mob].") ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors var/turf/end_T = get_turf(target) if(start_T && end_T) @@ -173,13 +170,10 @@ thrown_thing = I dropItemToGround(I) -<<<<<<< HEAD -======= if(has_disability(PACIFISM) && I.throwforce) to_chat(src, "You set [I] down gently on the ground.") return ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) if(thrown_thing) visible_message("[src] has thrown [thrown_thing].") add_logs(src, thrown_thing, "has thrown") From e4d6f4110f8a0b964e9e65a9c24a74bf83c13232 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 18 Dec 2017 17:25:33 -0600 Subject: [PATCH 09/17] Update human_defense.dm --- code/modules/mob/living/carbon/human/human_defense.dm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 7cdcad35bb..cdb714156a 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -140,13 +140,8 @@ return ..() /mob/living/carbon/human/grabbedby(mob/living/carbon/user, supress_message = 0) -<<<<<<< HEAD - if(user == src && pulling && !pulling.anchored && grab_state >= GRAB_AGGRESSIVE && isliving(pulling)) - vore_attack(user, pulling) -======= if(user == src && pulling && !pulling.anchored && grab_state >= GRAB_AGGRESSIVE && (has_disability(FAT)) && ismonkey(pulling)) devour_mob(pulling) ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) else ..() From 078c8744e05c738974e633706791a3a9a1520fe3 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 18 Dec 2017 17:25:47 -0600 Subject: [PATCH 10/17] Update species.dm --- code/modules/mob/living/carbon/human/species.dm | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 1f30562dcf..329e59e305 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1315,12 +1315,9 @@ GLOBAL_LIST_EMPTY(roundstart_races) /datum/species/proc/harm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style) -<<<<<<< HEAD -======= if(user.has_disability(PACIFISM)) to_chat(user, "You don't want to harm [target]!") return FALSE ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) if(target.check_block()) target.visible_message("[target] blocks [user]'s attack!") return 0 From 8b56d1ccdd495381b2c45016c90e0605659680bf Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 18 Dec 2017 17:26:01 -0600 Subject: [PATCH 11/17] Update combat.dm --- code/modules/mob/living/carbon/monkey/combat.dm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/code/modules/mob/living/carbon/monkey/combat.dm b/code/modules/mob/living/carbon/monkey/combat.dm index 089a242347..bd88714fd4 100644 --- a/code/modules/mob/living/carbon/monkey/combat.dm +++ b/code/modules/mob/living/carbon/monkey/combat.dm @@ -120,15 +120,10 @@ /mob/living/carbon/monkey/proc/should_target(var/mob/living/L) if(L == src) -<<<<<<< HEAD - return 0 -======= return FALSE if(has_disability(PACIFISM)) return FALSE ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) - if(enemies[L]) return 1 From 0d137f82d43fa9464eca46792124c7de1a93c1c3 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 18 Dec 2017 17:26:10 -0600 Subject: [PATCH 12/17] Update life.dm --- code/modules/mob/living/life.dm | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index b8423cdc46..41c4572103 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -137,12 +137,9 @@ eye_blurry = max(eye_blurry-1, 0) if(client && !eye_blurry) clear_fullscreen("blurry") -<<<<<<< HEAD -======= if(has_disability(PACIFISM) && a_intent == INTENT_HARM) to_chat(src, "You don't feel like harming anybody.") a_intent_change(INTENT_HELP) ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) /mob/living/proc/update_damage_hud() return From 64f003d3b1b304a85ee297be34040cc36d60ed19 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 18 Dec 2017 17:26:25 -0600 Subject: [PATCH 13/17] Update living.dm --- code/modules/mob/living/living.dm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 24985f54a6..bd6b00dea7 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -811,12 +811,9 @@ if (G.trigger_guard != TRIGGER_GUARD_ALLOW_ALL && !IsAdvancedToolUser()) to_chat(src, "You don't have the dexterity to do this!") return FALSE -<<<<<<< HEAD -======= if(has_disability(PACIFISM)) to_chat(src, "You don't want to risk harming anyone!") return FALSE ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) return TRUE /mob/living/carbon/proc/update_stamina() @@ -1059,4 +1056,4 @@ /mob/living/onTransitZ(old_z,new_z) ..() - update_z(new_z) \ No newline at end of file + update_z(new_z) From 8fef308d0aea3fa00cf3b06853a833a8948395bd Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 18 Dec 2017 17:27:04 -0600 Subject: [PATCH 14/17] Update living_defense.dm --- code/modules/mob/living/living_defense.dm | 24 ----------------------- 1 file changed, 24 deletions(-) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index d99ce1b014..4dc2b6d076 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -134,16 +134,11 @@ if(!(status_flags & CANPUSH)) to_chat(user, "[src] can't be grabbed more aggressively!") -<<<<<<< HEAD - return 0 -======= return FALSE if(user.has_disability(PACIFISM)) to_chat(user, "You don't want to risk hurting [src]!") return FALSE - ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) grippedby(user) //proc to upgrade a simple pull into a more aggressive grab. @@ -197,13 +192,9 @@ M.Feedstop() return // can't attack while eating! -<<<<<<< HEAD -======= if(has_disability(PACIFISM)) to_chat(M, "You don't want to hurt anyone!") return FALSE - ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) if (stat != DEAD) add_logs(M, src, "attacked") M.do_attack_animation(src) @@ -217,13 +208,9 @@ M.visible_message("\The [M] [M.friendly] [src]!") return 0 else -<<<<<<< HEAD -======= if(M.has_disability(PACIFISM)) to_chat(M, "You don't want to hurt anyone!") return FALSE - ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) M.do_attack_animation(src) @@ -239,13 +226,9 @@ return 0 if (M.a_intent == INTENT_HARM) -<<<<<<< HEAD -======= if(M.has_disability(PACIFISM)) to_chat(M, "You don't want to hurt anyone!") return FALSE - ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) if(M.is_muzzled() || (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSMOUTH)) to_chat(M, "You can't bite with your mouth covered!") return 0 @@ -268,13 +251,9 @@ return 0 else -<<<<<<< HEAD -======= if(L.has_disability(PACIFISM)) to_chat(L, "You don't want to hurt anyone!") return - ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) L.do_attack_animation(src) if(prob(90)) add_logs(L, src, "attacked") @@ -297,12 +276,9 @@ grabbedby(M) return 0 if("harm") -<<<<<<< HEAD -======= if(M.has_disability(PACIFISM)) to_chat(M, "You don't want to hurt anyone!") return FALSE ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) M.do_attack_animation(src) return 1 if("disarm") From cfeea088e8cc1f8af3362ff7a760cdbfaa0304b3 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 18 Dec 2017 17:27:12 -0600 Subject: [PATCH 15/17] Update genetic.dm --- code/modules/spells/spell_types/genetic.dm | 30 +--------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/code/modules/spells/spell_types/genetic.dm b/code/modules/spells/spell_types/genetic.dm index 0982f8a01f..1b60800458 100644 --- a/code/modules/spells/spell_types/genetic.dm +++ b/code/modules/spells/spell_types/genetic.dm @@ -1,30 +1,3 @@ -<<<<<<< HEAD -/obj/effect/proc_holder/spell/targeted/genetic - name = "Genetic" - desc = "This spell inflicts a set of mutations and disabilities upon the target." - - var/disabilities = 0 //bits - var/list/mutations = list() //mutation strings - var/duration = 100 //deciseconds - /* - Disabilities - 1st bit - ? - 2nd bit - ? - 3rd bit - ? - 4th bit - ? - 5th bit - ? - 6th bit - ? - */ - -/obj/effect/proc_holder/spell/targeted/genetic/cast(list/targets,mob/user = usr) - playMagSound() - for(var/mob/living/carbon/target in targets) - if(!target.dna) - continue - for(var/A in mutations) - target.dna.add_mutation(A) - target.disabilities |= disabilities -======= /obj/effect/proc_holder/spell/targeted/genetic name = "Genetic" desc = "This spell inflicts a set of mutations and disabilities upon the target." @@ -51,7 +24,6 @@ target.dna.add_mutation(A) for(var/A in disabilities) target.add_disability(A, GENETICS_SPELL) ->>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055) addtimer(CALLBACK(src, .proc/remove, target), duration) /obj/effect/proc_holder/spell/targeted/genetic/proc/remove(mob/living/carbon/target) @@ -59,4 +31,4 @@ for(var/A in mutations) target.dna.remove_mutation(A) for(var/A in disabilities) - target.remove_disability(A, GENETICS_SPELL) \ No newline at end of file + target.remove_disability(A, GENETICS_SPELL) From 7b40f3f0e0821e5cb3cd228189c57c5199e09ed3 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 25 Dec 2017 05:09:21 -0600 Subject: [PATCH 16/17] Update disease_outbreak.dm --- code/modules/events/disease_outbreak.dm | 35 ++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm index beb3fb476f..f33d8ec87a 100644 --- a/code/modules/events/disease_outbreak.dm +++ b/code/modules/events/disease_outbreak.dm @@ -13,7 +13,7 @@ var/max_severity = 3 -/datum/round_event/disease_outbreak/announce() +/datum/round_event/disease_outbreak/announce(fake) priority_announce("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", 'sound/ai/outbreak7.ogg') /datum/round_event/disease_outbreak/setup() @@ -33,7 +33,7 @@ var/turf/T = get_turf(H) if(!T) continue - if(T.z != ZLEVEL_STATION_PRIMARY) + if(!(T.z in GLOB.station_z_levels)) continue if(!H.client) continue @@ -51,7 +51,7 @@ var/datum/disease/D if(!advanced_virus) if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work. - if(!H.dna || (H.has_disability(BLIND))) //A blindness disease would be the worst. + if(!H.dna || (H.has_disability(DISABILITY_BLIND))) //A blindness disease would be the worst. continue D = new virus_type() var/datum/disease/dnaspread/DS = D @@ -64,4 +64,33 @@ D = make_virus(max_severity, max_severity) D.carrier = TRUE H.AddDisease(D) + + if(advanced_virus) + var/datum/disease/advance/A = D + var/list/name_symptoms = list() //for feedback + for(var/datum/symptom/S in A.symptoms) + name_symptoms += S.name + message_admins("An event has triggered a random advanced virus outbreak on [key_name_admin(H)]! It has these symptoms: [english_list(name_symptoms)]") + log_game("An event has triggered a random advanced virus outbreak on [key_name(H)]! It has these symptoms: [english_list(name_symptoms)]") break + +/datum/round_event/disease_outbreak/proc/make_virus(max_symptoms, max_level) + if(max_symptoms > SYMPTOM_LIMIT) + max_symptoms = SYMPTOM_LIMIT + var/datum/disease/advance/A = new(FALSE, null) + A.symptoms = list() + var/list/datum/symptom/possible_symptoms = list() + for(var/symptom in subtypesof(/datum/symptom)) + var/datum/symptom/S = symptom + if(initial(S.level) > max_level) + continue + if(initial(S.level) <= 0) //unobtainable symptoms + continue + possible_symptoms += S + for(var/i in 1 to max_symptoms) + var/datum/symptom/chosen_symptom = pick_n_take(possible_symptoms) + if(chosen_symptom) + var/datum/symptom/S = new chosen_symptom + A.symptoms += S + A.Refresh() //just in case someone already made and named the same disease + return A From 62a9649a989075aa45e2bcfb3b95d19a7da003ed Mon Sep 17 00:00:00 2001 From: LetterJay Date: Mon, 25 Dec 2017 05:23:37 -0600 Subject: [PATCH 17/17] Update disease_outbreak.dm --- code/modules/events/disease_outbreak.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm index f33d8ec87a..5c28632c89 100644 --- a/code/modules/events/disease_outbreak.dm +++ b/code/modules/events/disease_outbreak.dm @@ -51,7 +51,7 @@ var/datum/disease/D if(!advanced_virus) if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work. - if(!H.dna || (H.has_disability(DISABILITY_BLIND))) //A blindness disease would be the worst. + if(!H.dna || (H.has_disability(BLIND))) //A blindness disease would be the worst. continue D = new virus_type() var/datum/disease/dnaspread/DS = D