[Ready Again]Refactors disabilities into lists, allowing for independent disability sources

This commit is contained in:
XDTM
2017-12-18 22:20:07 +01:00
committed by CitadelStationBot
parent 3df26e3be6
commit 3af0aa2489
81 changed files with 711 additions and 221 deletions
+1 -1
View File
@@ -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
+145
View File
@@ -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, "<span class='warning'>Your hand slips, setting off the trigger!</span>")
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("<span class='boldannounce'>SPLAT!</span>")
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, "<span class='notice'>You arm [src].</span>")
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("<span class='warning'>[user] accidentally sets off [src], breaking their fingers.</span>", \
"<span class='warning'>You accidentally trigger [src]!</span>")
return
to_chat(user, "<span class='notice'>You disarm [src].</span>")
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("<span class='warning'>[user] accidentally sets off [src], breaking their fingers.</span>", \
"<span class='warning'>You accidentally trigger [src]!</span>")
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("<span class='warning'>[H] accidentally steps on [src].</span>", \
"<span class='warning'>You accidentally step on [src]</span>")
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("<span class='warning'>[finder] accidentally sets off [src], breaking their fingers.</span>", \
"<span class='warning'>You accidentally trigger [src]!</span>")
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("<span class='warning'>[src] is triggered by [A].</span>")
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)
+1 -1
View File
@@ -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, "<span class='danger'>[src] overloads and blinds you!</span>")
H.flash_act(visual = 1)
+14
View File
@@ -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
@@ -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, "<span class='warning'>You accidentally cut yourself with [src], like a doofus!</span>")
user.take_bodypart_damage(10)
+4 -4
View File
@@ -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"
+2 -2
View File
@@ -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
+14 -2
View File
@@ -157,6 +157,11 @@
if(!throwable_mob.buckled)
thrown_thing = throwable_mob
stop_pulling()
<<<<<<< HEAD
=======
if(has_disability(PACIFISM))
to_chat(src, "<span class='notice'>You gently let go of [throwable_mob].</span>")
>>>>>>> 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, "<span class='notice'>You set [I] down gently on the ground.</span>")
return
>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055)
if(thrown_thing)
visible_message("<span class='danger'>[src] has thrown [thrown_thing].</span>")
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()
@@ -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, "<span class='warning'>Your eyes start to burn badly!</span>")
become_nearsighted(EYE_DAMAGE)
else if(prob(eyes.eye_damage - 25))
if(become_blind())
if(!has_disability(BLIND))
to_chat(src, "<span class='warning'>You can't see anything!</span>")
become_blind(EYE_DAMAGE)
else
to_chat(src, "<span class='warning'>Your eyes are really starting to hurt. This can't be good for you!</span>")
if(has_bane(BANE_LIGHT))
@@ -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
@@ -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
..()
@@ -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)
@@ -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))
@@ -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, "<span class='notice'>You feel fit again!</span>")
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, "<span class='danger'>You suddenly feel blubbery!</span>")
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, "<span class='warning'>You don't want to harm [target]!</span>")
return FALSE
>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055)
if(target.check_block())
target.visible_message("<span class='warning'>[target] blocks [user]'s attack!</span>")
return 0
@@ -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
@@ -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
@@ -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()
@@ -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
@@ -19,7 +19,7 @@
if(!HD) //Decapitated
return
if(disabilities & HUSK)
if(has_disability(HUSK))
return
var/hair_hidden = 0
+1 -36
View File
@@ -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()
@@ -290,7 +290,7 @@
else
. += "-robotic"
if(disabilities & HUSK)
if(has_disability(HUSK))
. += "-husk"
+7 -1
View File
@@ -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, "<span class='notice'>You don't feel like harming anybody.</span>")
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
+6 -1
View File
@@ -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, "<span class='warning'>You don't have the dexterity to do this!</span>")
return FALSE
<<<<<<< HEAD
=======
if(has_disability(PACIFISM))
to_chat(src, "<span class='notice'>You don't want to risk harming anyone!</span>")
return FALSE
>>>>>>> 146d167... [Ready Again]Refactors disabilities into lists, allowing for independent disability sources (#33055)
return TRUE
/mob/living/carbon/proc/update_stamina()
+44 -1
View File
@@ -134,7 +134,16 @@
if(!(status_flags & CANPUSH))
to_chat(user, "<span class='warning'>[src] can't be grabbed more aggressively!</span>")
<<<<<<< HEAD
return 0
=======
return FALSE
if(user.has_disability(PACIFISM))
to_chat(user, "<span class='notice'>You don't want to risk hurting [src]!</span>")
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, "<span class='notice'>You don't want to hurt anyone!</span>")
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("<span class='notice'>\The [M] [M.friendly] [src]!</span>")
return 0
else
<<<<<<< HEAD
=======
if(M.has_disability(PACIFISM))
to_chat(M, "<span class='notice'>You don't want to hurt anyone!</span>")
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, "<span class='notice'>You don't want to hurt anyone!</span>")
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, "<span class='warning'>You can't bite with your mouth covered!</span>")
return 0
@@ -238,6 +268,13 @@
return 0
else
<<<<<<< HEAD
=======
if(L.has_disability(PACIFISM))
to_chat(L, "<span class='notice'>You don't want to hurt anyone!</span>")
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, "<span class='notice'>You don't want to hurt anyone!</span>")
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
@@ -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.
+1 -1
View File
@@ -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())
@@ -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)
+73
View File
@@ -137,3 +137,76 @@
to_chat(src, "<span class='boldwarning'>[priority_absorb_key["self_message"]]</span>")
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)
-1
View File
@@ -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
+10 -27
View File
@@ -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
+2 -2
View File
@@ -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, "<span class='warning'>You cut yourself on the paper! Ahhhh! Ahhhhh!</span>")
H.damageoverlaytemp = 9001
H.update_damage_hud()
@@ -317,7 +317,7 @@
to_chat(user, "<span class='notice'>You stamp the paper with your rubber stamp.</span>")
if(P.is_hot())
if(user.disabilities & CLUMSY && prob(10))
if(user.has_disability(CLUMSY) && prob(10))
user.visible_message("<span class='warning'>[user] accidentally ignites themselves!</span>", \
"<span class='userdanger'>You miss the paper and accidentally light yourself on fire!</span>")
user.dropItemToGround(P)
+1 -1
View File
@@ -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("<span class='warning'>[user] accidentally ignites themselves!</span>", \
"<span class='userdanger'>You miss [src] and accidentally light yourself on fire!</span>")
user.dropItemToGround(P)
+1 -1
View File
@@ -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, "<span class='userdanger'>You shoot yourself in the foot with [src]!</span>")
var/shot_leg = pick("l_leg", "r_leg")
process_fire(user,user,0,params, zone_override = shot_leg)
@@ -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("<span class='warning'>[user] somehow manages to shoot [user.p_them()]self in the face!</span>", "<span class='userdanger'>You somehow shoot yourself in the face! How the hell?!</span>")
+1 -1
View File
@@ -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
@@ -70,7 +70,7 @@
//nothing
if(21 to INFINITY)
if(prob(current_cycle-10))
M.cure_nearsighted()
M.cure_nearsighted(list(EYE_DAMAGE))
..()
return
@@ -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, "<span class='warning'>Your vision slowly returns...</span>")
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, "<span class='warning'>The blackness in your peripheral vision fades.</span>")
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("<span class='warning'>[M]'s body convulses a bit, and then falls still once more.</span>")
return
M.visible_message("<span class='warning'>[M]'s body convulses a bit.</span>")
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))
@@ -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 ..()
@@ -209,12 +209,14 @@
to_chat(target, "<span class='userdanger'>A freezing darkness surrounds you...</span>")
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"
+31 -1
View File
@@ -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)
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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"
+2 -2
View File
@@ -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!", "<span class='notice'>You succeed in fixing [target]'s eyes.</span>")
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
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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)