From 60c7b28274b17894576fbe7a4b6958df968deb50 Mon Sep 17 00:00:00 2001 From: "elly1989@rocketmail.com" Date: Thu, 5 Jul 2012 07:44:18 +0000 Subject: [PATCH] Resolves issue 499. Blood runes are now totally invisible to AIs. Created defines for disabilities and sdisabilities bitflags. Thos areas of code really need attention. Why are there so many blind variables/flags D= disability bitflags are located in setup.dm Handcuff overlays now update when beepsky/ed-209s cuff you. Resolves issue 628. Took a stab at tidying up handle_regular_hud_updates() for humans. If it's all working perfectly as it appears to be I'll start doing the same for other mobs. Whomever started 'fixing' this and then just abandoned it with redundant and heavily-broken code should be ashamed :[ It was/is in a real sorry state. Resolves issue 617. Shades can no longer be weakened (stunbatons etc). Fixed an issue with one of the antag deaf-sting/rune/whatever-it-was-I-forget causing nearsightedness rather than deafness :P git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3985 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/dna.dm | 14 +- .../gamemodes/changeling/changeling_powers.dm | 8 +- code/game/gamemodes/events.dm | 2 +- code/game/gamemodes/wizard/spells.dm | 4 +- code/game/machinery/bots/ed209bot.dm | 1 + code/game/machinery/bots/secbot.dm | 3 +- code/game/magic/cultist/ritual.dm | 4 +- code/game/magic/cultist/runes.dm | 7 +- code/game/objects/devices/flashlight.dm | 2 +- code/game/objects/items/item.dm | 6 +- code/game/objects/items/weapons/grenades.dm | 6 +- .../items/weapons/implants/implantfreedom.dm | 1 + .../objects/items/weapons/surgery_tools.dm | 2 +- code/game/objects/items/weapons/tools.dm | 6 +- code/modules/chemical/Chemistry-Reagents.dm | 17 +- code/modules/clothing/glasses/glasses.dm | 4 +- .../mob/living/carbon/alien/humanoid/life.dm | 14 +- .../carbon/alien/humanoid/update_icons.dm | 12 +- .../mob/living/carbon/alien/larva/life.dm | 6 +- code/modules/mob/living/carbon/brain/life.dm | 8 +- .../mob/living/carbon/human/examine.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 22 +- code/modules/mob/living/carbon/human/life.dm | 412 +++++++----------- .../mob/living/carbon/human/update_icons.dm | 16 +- .../mob/living/carbon/human/whisper.dm | 2 +- .../mob/living/carbon/metroid/examine.dm | 2 +- .../modules/mob/living/carbon/metroid/life.dm | 4 +- .../mob/living/carbon/monkey/examine.dm | 2 +- code/modules/mob/living/carbon/monkey/life.dm | 16 +- code/modules/mob/living/living.dm | 1 + code/modules/mob/living/say.dm | 2 +- code/modules/mob/living/silicon/ai/ai.dm | 17 +- code/modules/mob/living/silicon/ai/examine.dm | 2 +- code/modules/mob/living/silicon/ai/login.dm | 2 +- .../mob/living/silicon/robot/examine.dm | 2 +- code/modules/mob/living/silicon/robot/life.dm | 6 +- .../modules/mob/living/simple_animal/shade.dm | 1 + code/modules/mob/mob.dm | 8 +- code/setup.dm | 15 +- 39 files changed, 281 insertions(+), 380 deletions(-) diff --git a/code/game/dna.dm b/code/game/dna.dm index ad034485649..455b43f6013 100644 --- a/code/game/dna.dm +++ b/code/game/dna.dm @@ -385,14 +385,14 @@ M.see_invisible = 0 if (isblockon(getblock(M.dna.struc_enzymes, 1,3),1)) - M.disabilities |= 1 + M.disabilities |= NEARSIGHTED M << "\red Your eyes feel strange." if (isblockon(getblock(M.dna.struc_enzymes, HULKBLOCK,3),2)) if(inj || prob(15)) M << "\blue Your muscles hurt." M.mutations.Add(HULK) if (isblockon(getblock(M.dna.struc_enzymes, 3,3),3)) - M.disabilities |= 2 + M.disabilities |= EPILEPSY M << "\red You get a headache." if (isblockon(getblock(M.dna.struc_enzymes, FAKEBLOCK,3),4)) M << "\red You feel strange." @@ -404,13 +404,13 @@ else randmutg(M) if (isblockon(getblock(M.dna.struc_enzymes, 5,3),5)) - M.disabilities |= 4 + M.disabilities |= COUGHING M << "\red You start coughing." if (isblockon(getblock(M.dna.struc_enzymes, CLUMSYBLOCK,3),6)) M << "\red You feel lightheaded." M.mutations.Add(CLUMSY) if (isblockon(getblock(M.dna.struc_enzymes, 7,3),7)) - M.disabilities |= 8 + M.disabilities |= TOURETTES M << "\red You twitch." if (isblockon(getblock(M.dna.struc_enzymes, XRAYBLOCK,3),8)) if(inj || prob(30)) @@ -420,21 +420,21 @@ M.see_invisible = 2 M.mutations.Add(XRAY) if (isblockon(getblock(M.dna.struc_enzymes, 9,3),9)) - M.disabilities |= 16 + M.disabilities |= NERVOUS M << "\red You feel nervous." if (isblockon(getblock(M.dna.struc_enzymes, FIREBLOCK,3),10)) if(inj || prob(30)) M << "\blue Your body feels warm." M.mutations.Add(COLD_RESISTANCE) if (isblockon(getblock(M.dna.struc_enzymes, BLINDBLOCK,3),11)) - M.sdisabilities |= 1 + M.sdisabilities |= BLIND M << "\red You can't seem to see anything." if (isblockon(getblock(M.dna.struc_enzymes, TELEBLOCK,3),12)) if(inj || prob(25)) M << "\blue You feel smarter." M.mutations.Add(TK) if (isblockon(getblock(M.dna.struc_enzymes, DEAFBLOCK,3),13)) - M.sdisabilities |= 4 + M.sdisabilities |= DEAF M.ear_deaf = 1 M << "\red You can't seem to hear anything..." diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm index cd86642da01..ea5b5ead99d 100644 --- a/code/game/gamemodes/changeling/changeling_powers.dm +++ b/code/game/gamemodes/changeling/changeling_powers.dm @@ -701,9 +701,9 @@ Tarjan shit, not recoding this -Sieve{R}*/ if(!T.changeling) T << text("\blue Your eyes cry out in pain!") - T.disabilities |= 1 + T.disabilities |= NEARSIGHTED spawn(300) - T.disabilities &= ~1 + T.disabilities &= ~NEARSIGHTED T.eye_blind = 10 T.eye_blurry = 20 @@ -744,9 +744,9 @@ Tarjan shit, not recoding this -Sieve{R}*/ feedback_add_details("changeling_powers","DS") if(!T.changeling) - T.sdisabilities |= 4 + T.sdisabilities |= DEAF spawn(300) - T.sdisabilities &= ~4 + T.sdisabilities &= ~DEAF usr.verbs -= /client/proc/changeling_deaf_sting diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 44845b684ea..23020437bd2 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -212,7 +212,7 @@ continue if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work. - if((!H.dna) || (H.sdisabilities & 1)) //A blindness disease would be the worst. + if((!H.dna) || (H.sdisabilities & BLIND)) //A blindness disease would be the worst. continue var/datum/disease/dnaspread/D = new D.strain_data["name"] = H.real_name diff --git a/code/game/gamemodes/wizard/spells.dm b/code/game/gamemodes/wizard/spells.dm index df629713141..37499c642db 100644 --- a/code/game/gamemodes/wizard/spells.dm +++ b/code/game/gamemodes/wizard/spells.dm @@ -30,9 +30,9 @@ del(B) M.canmove = 1 M << text("\blue Your eyes cry out in pain!") - M.disabilities |= 1 + M.disabilities |= NEARSIGHTED spawn(300) - M.disabilities &= ~1 + M.disabilities &= ~NEARSIGHTED M.eye_blind = 10 M.eye_blurry = 20 return diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index ac9103be52d..d0a4934f70f 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -329,6 +329,7 @@ Auto Patrol: []"}, if(istype(src.target,/mob/living/carbon)) src.target.handcuffed = new /obj/item/weapon/handcuffs(src.target) + target.update_inv_handcuffed() //update handcuff overlays mode = SECBOT_IDLE src.target = null diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index 258df537a71..f0c1b5ad773 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -270,7 +270,8 @@ Auto Patrol: []"}, return if(istype(src.target,/mob/living/carbon)) - src.target.handcuffed = new /obj/item/weapon/handcuffs(src.target) + target.handcuffed = new /obj/item/weapon/handcuffs(target) + target.update_inv_handcuffed() //update the handcuffs overlay mode = SECBOT_IDLE src.target = null diff --git a/code/game/magic/cultist/ritual.dm b/code/game/magic/cultist/ritual.dm index 7585286d55a..2dd47abe853 100644 --- a/code/game/magic/cultist/ritual.dm +++ b/code/game/magic/cultist/ritual.dm @@ -96,10 +96,10 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", // join hide technology - stun rune. Rune color: bright pink. New() ..() + var/image/blood = image(loc = src) + blood.override = 1 for(var/mob/living/silicon/ai/AI in world) if(AI.client) - var/image/blood = image('blood.dmi', loc = src, icon_state = "floor[rand(1,7)]") - blood.override = 1 AI.client.images += blood examine() diff --git a/code/game/magic/cultist/runes.dm b/code/game/magic/cultist/runes.dm index 9adbf418d15..211da017694 100644 --- a/code/game/magic/cultist/runes.dm +++ b/code/game/magic/cultist/runes.dm @@ -747,6 +747,7 @@ var/list/sacrificed = list() if (cultist.handcuffed) cultist.handcuffed.loc = cultist.loc cultist.handcuffed = null + cultist.update_inv_handcuffed() if (istype(cultist.wear_mask, /obj/item/clothing/mask/muzzle)) cultist.u_equip(cultist.wear_mask) if(istype(cultist.loc, /obj/structure/closet)&&cultist.loc:welded) @@ -810,7 +811,7 @@ var/list/sacrificed = list() C.show_message("\red The world around you suddenly becomes quiet.", 3) affected++ if(prob(1)) - C.disabilities |= 4 + C.sdisabilities |= DEAF if(affected) usr.say("Sti' kaliedir!") usr << "\red The world becomes quiet as the deafening rune dissipates into fine dust." @@ -849,9 +850,9 @@ var/list/sacrificed = list() C.eye_blurry += 50 C.eye_blind += 20 if(prob(5)) - C.disabilities |= 1 + C.disabilities |= NEARSIGHTED if(prob(10)) - C.sdisabilities |= 1 + C.sdisabilities |= BLIND C.show_message("\red Suddenly you see red flash that blinds you.", 3) affected++ if(affected) diff --git a/code/game/objects/devices/flashlight.dm b/code/game/objects/devices/flashlight.dm index acf53cdc2de..de7a0006a4f 100644 --- a/code/game/objects/devices/flashlight.dm +++ b/code/game/objects/devices/flashlight.dm @@ -67,7 +67,7 @@ O.show_message("\blue [(O==user?"You direct":"[user] directs")] [src] to [(M==user? "your":"[M]")] eyes", 1) if(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey))//robots and aliens are unaffected - if(M.stat > 1 || M.sdisabilities & 1)//mob is dead or fully blind + if(M.stat == DEAD || M.sdisabilities & BLIND)//mob is dead or fully blind if(M!=user) user.show_message(text("\red [] pupils does not react to the light!", M),1) else if(XRAY in M.mutations)//mob has X-RAY vision diff --git a/code/game/objects/items/item.dm b/code/game/objects/items/item.dm index e9f447ba32d..4134e2be4a9 100644 --- a/code/game/objects/items/item.dm +++ b/code/game/objects/items/item.dm @@ -332,7 +332,7 @@ // M = user /* M << "\red You stab yourself in the eye." - M.sdisabilities |= 1 + M.sdisabilities |= BLIND M.weakened += 4 M.adjustBruteLoss(10) */ @@ -356,7 +356,7 @@ M.eye_stat += rand(2,4) if (M.eye_stat >= 10) M.eye_blurry += 15+(0.1*M.eye_blurry) - M.disabilities |= 1 + M.disabilities |= NEARSIGHTED if(M.stat != 2) M << "\red Your eyes start to bleed profusely!" if(prob(50)) @@ -369,7 +369,7 @@ if (prob(M.eye_stat - 10 + 1)) if(M.stat != 2) M << "\red You go blind!" - M.sdisabilities |= 1 + M.sdisabilities |= BLIND return diff --git a/code/game/objects/items/weapons/grenades.dm b/code/game/objects/items/weapons/grenades.dm index 71091215d5a..7c7907ca3ca 100644 --- a/code/game/objects/items/weapons/grenades.dm +++ b/code/game/objects/items/weapons/grenades.dm @@ -213,17 +213,17 @@ CRITTER GRENADE //This really should be in mob not every check if (M.eye_stat >= 20) M << "\red Your eyes start to burn badly!" - M.disabilities |= 1 + M.disabilities |= NEARSIGHTED if(!banglet && !(istype(src , /obj/item/weapon/flashbang/clusterbang))) if (prob(M.eye_stat - 20 + 1)) M << "\red You can't see anything!" - M.sdisabilities |= 1 + M.sdisabilities |= BLIND if (M.ear_damage >= 15) M << "\red Your ears start to ring badly!" if(!banglet && !(istype(src , /obj/item/weapon/flashbang/clusterbang))) if (prob(M.ear_damage - 10 + 5)) M << "\red You can't hear anything!" - M.sdisabilities |= 4 + M.sdisabilities |= DEAF else if (M.ear_damage >= 5) M << "\red Your ears start to ring!" diff --git a/code/game/objects/items/weapons/implants/implantfreedom.dm b/code/game/objects/items/weapons/implants/implantfreedom.dm index 9338f9a5e78..f95a055eb6d 100644 --- a/code/game/objects/items/weapons/implants/implantfreedom.dm +++ b/code/game/objects/items/weapons/implants/implantfreedom.dm @@ -23,6 +23,7 @@ if (source.handcuffed) var/obj/item/weapon/W = source.handcuffed source.handcuffed = null + source.update_inv_handcuffed() if (source.client) source.client.screen -= W if (W) diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm index db7c226bc2d..c30bd93fea0 100644 --- a/code/game/objects/items/weapons/surgery_tools.dm +++ b/code/game/objects/items/weapons/surgery_tools.dm @@ -237,7 +237,7 @@ CIRCULAR SAW M.updatehealth() else M.take_organ_damage(15) - M.sdisabilities &= ~1 + M.sdisabilities &= ~BLIND M.eye_stat = 0 M:eye_op_stage = 0.0 diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index 9c4a335d00f..21c26cd518b 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -312,14 +312,14 @@ WELDINGTOOOL user << "\red Your eyes are really starting to hurt. This can't be good for you!" if (prob(user.eye_stat - 25 + 1)) user << "\red You go blind!" - user.sdisabilities |= 1 + user.sdisabilities |= BLIND else if (prob(user.eye_stat - 15 + 1)) user << "\red You go blind!" user.eye_blind = 5 user.eye_blurry = 5 - user.disabilities |= 1 + user.disabilities |= NEARSIGHTED spawn(100) - user.disabilities &= ~1 + user.disabilities &= ~NEARSIGHTED return diff --git a/code/modules/chemical/Chemistry-Reagents.dm b/code/modules/chemical/Chemistry-Reagents.dm index 00c7621430e..113e9fdf398 100644 --- a/code/modules/chemical/Chemistry-Reagents.dm +++ b/code/modules/chemical/Chemistry-Reagents.dm @@ -643,16 +643,19 @@ datum var/mob/living/carbon/human/H = M if(H.wear_mask) del (H.wear_mask) + H.update_inv_wear_mask() H << "\red Your mask melts away but protects you from the acid!" return if(H.head) del (H.head) + H.update_inv_head() H << "\red Your helmet melts into uselessness but protects you from the acid!" return - if(istype(M, /mob/living/carbon/monkey)) + else if(istype(M, /mob/living/carbon/monkey)) var/mob/living/carbon/monkey/MK = M if(MK.wear_mask) del (MK.wear_mask) + MK.update_inv_wear_mask() MK << "\red Your mask melts away but protects you from the acid!" return if(!M.unacidable) @@ -662,6 +665,7 @@ datum if(affecting) if(affecting.take_damage(25, 0)) H.UpdateDamageIcon() + H.status_flags |= DISFIGURED H.emote("scream") else M.take_organ_damage(min(15, volume * 2)) // uses min() and volume to make sure they aren't being sprayed in trace amounts (1 unit != insta rape) -- Doohl @@ -704,6 +708,7 @@ datum if(H.head) if(prob(15)) del(H.head) + H.update_inv_head() H << "\red Your helmet melts from the acid!" else H << "\red Your helmet protects you from the acid!" @@ -719,6 +724,7 @@ datum var/mob/living/carbon/monkey/MK = M if(MK.wear_mask) del (MK.wear_mask) + MK.update_inv_wear_mask() MK << "\red Your mask melts away but protects you from the acid!" return if(!MK.unacidable) @@ -731,6 +737,7 @@ datum if(affecting.take_damage(15, 0)) H.UpdateDamageIcon() H.emote("scream") + H.status_flags |= DISFIGURED else M.take_organ_damage(min(15, volume * 4)) @@ -1259,8 +1266,8 @@ datum M.sdisabilities = 0 M.eye_blurry = 0 M.eye_blind = 0 - M.disabilities &= ~1 - M.sdisabilities &= ~1 +// M.disabilities &= ~NEARSIGHTED //doesn't even do anythig cos of the disabilities = 0 bit +// M.sdisabilities &= ~BLIND //doesn't even do anythig cos of the sdisabilities = 0 bit M.SetWeakened(0) M.SetStunned(0) M.SetParalysis(0) @@ -1368,7 +1375,7 @@ datum if(!M) M = holder.my_atom M.eye_blurry = max(M.eye_blurry-5 , 0) M.eye_blind = max(M.eye_blind-5 , 0) - M.disabilities &= ~1 + M.disabilities &= ~NEARSIGHTED M.eye_stat = max(M.eye_stat-5, 0) // M.sdisabilities &= ~1 Replaced by eye surgery ..() @@ -2126,7 +2133,7 @@ datum //nothing if(21 to INFINITY) if (prob(data-10)) - M.disabilities &= ~1 + M.disabilities &= ~NEARSIGHTED data++ ..() return diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 12b0cd3a99c..cd305eda444 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -95,9 +95,9 @@ if(M.glasses == src) M.eye_blind = 3 M.eye_blurry = 5 - M.disabilities |= 1 + M.disabilities |= NEARSIGHTED spawn(100) - M.disabilities &= ~1 + M.disabilities &= ~NEARSIGHTED ..() /obj/item/clothing/glasses/thermal/syndi //These are now a traitor item, concealed as mesons. -Pete diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index f6661247e0c..3e72436821f 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -71,23 +71,23 @@ /mob/living/carbon/alien/humanoid proc/handle_disabilities() - if (disabilities & 2) + if (disabilities & EPILEPSY) if ((prob(1) && paralysis < 10)) src << "\red You have a seizure!" Paralyse(10) - if (disabilities & 4) + if (disabilities & COUGHING) if ((prob(5) && paralysis <= 1)) drop_item() spawn( 0 ) emote("cough") return - if (disabilities & 8) + if (disabilities & TOURETTES) if ((prob(10) && paralysis <= 1)) Stun(10) spawn( 0 ) emote("twitch") return - if (disabilities & 16) + if (disabilities & NERVOUS) if (prob(10)) stuttering = max(10, stuttering) @@ -412,7 +412,7 @@ move_delay_add = max(0, move_delay_add - rand(1, 2)) //Eyes - if(sdisabilities & 1) //disabled-blind, doesn't get better on its own + if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own blinded = 1 else if(eye_blind) //blindness, heals slowly over time eye_blind = max(eye_blind-1,0) @@ -421,7 +421,7 @@ eye_blurry = max(eye_blurry-1, 0) //Ears - if(sdisabilities & 4) //disabled-deaf, doesn't get better on its own + if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own ear_deaf = max(ear_deaf, 1) else if(ear_deaf) //deafness, heals slowly over time ear_deaf = max(ear_deaf-1, 0) @@ -501,7 +501,7 @@ else blind.layer = 0 - if (disabilities & 1) + if (disabilities & NEARSIGHTED) client.screen += hud_used.vimpaired if (eye_blurry) diff --git a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm index c9eddfdd634..b2bb37f3c02 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm @@ -64,15 +64,9 @@ //TODO wear_suit.screen_loc = ui_alien_oclothing if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket)) - if (handcuffed) - handcuffed.loc = loc - handcuffed.layer = initial(handcuffed.layer) - handcuffed = null - if ((l_hand || r_hand)) - drop_item() - hand = !hand - drop_item() - hand = !hand + drop_from_inventory(handcuffed) + drop_r_hand() + drop_l_hand() overlays_lying[X_SUIT_LAYER] = lying overlays_standing[X_SUIT_LAYER] = standing diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 34258153cd9..c5e7af6efe0 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -336,7 +336,7 @@ move_delay_add = max(0, move_delay_add - rand(1, 2)) //Eyes - if(sdisabilities & 1) //disabled-blind, doesn't get better on its own + if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own blinded = 1 else if(eye_blind) //blindness, heals slowly over time eye_blind = max(eye_blind-1,0) @@ -345,7 +345,7 @@ eye_blurry = max(eye_blurry-1, 0) //Ears - if(sdisabilities & 4) //disabled-deaf, doesn't get better on its own + if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own ear_deaf = max(ear_deaf, 1) else if(ear_deaf) //deafness, heals slowly over time ear_deaf = max(ear_deaf-1, 0) @@ -426,7 +426,7 @@ else blind.layer = 0 - if (disabilities & 1) + if (disabilities & NEARSIGHTED) client.screen += hud_used.vimpaired if (eye_blurry) diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index 983690f1553..81c9e00e8ea 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -172,16 +172,16 @@ //Eyes - if(sdisabilities & 1) //disabled-blind, doesn't get better on its own + if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own blinded = 1 else if(eye_blind) //blindness, heals slowly over time eye_blind = max(eye_blind-1,0) blinded = 1 - else if(eye_blurry) //blurry eyes heal slowly + else if(eye_blurry) //blurry eyes heal slowly eye_blurry = max(eye_blurry-1, 0) //Ears - if(sdisabilities & 4) //disabled-deaf, doesn't get better on its own + if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own ear_deaf = max(ear_deaf, 1) else if(ear_deaf) //deafness, heals slowly over time ear_deaf = max(ear_deaf-1, 0) @@ -256,7 +256,7 @@ else blind.layer = 0 - if (disabilities & 1) + if (disabilities & NEARSIGHTED) client.screen += hud_used.vimpaired if (eye_blurry) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 13b53211186..07fb2c21b93 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -2,7 +2,7 @@ set src in view() if(!usr || !src) return - if(((usr.sdisabilities & 1) || usr.blinded || usr.stat) && !(istype(usr,/mob/dead/observer/))) + if( (usr.sdisabilities & BLIND || usr.blinded || usr.stat) && !istype(usr,/mob/dead/observer) ) usr << "Something is there but you can't see it." return diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 5f70a6d2071..ce96edbbc29 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -522,22 +522,22 @@ //repurposed proc. Now it combines get_id_name() and get_face_name() to determine a mob's name variable. Made into a seperate proc as it'll be useful elsewhere /mob/living/carbon/human/proc/get_visible_name() - if ((wear_mask && !(wear_mask.see_face))) //Making this work -Sieve + if( wear_mask && !wear_mask.see_face ) //Wearing a mask which covers our face, use id-name if possible return get_id_name("Unknown") - else - var/face_name = get_face_name() - var/id_name = get_id_name("") - if(id_name && (id_name != face_name)) - return "[face_name] as ([id_name])" - return face_name + + var/face_name = get_face_name() + var/id_name = get_id_name("") + if(id_name && (id_name != face_name)) + return "[face_name] as ([id_name])" + return face_name //Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable /mob/living/carbon/human/proc/get_face_name() - var/datum/organ/external/head/head = get_organ("head") - if(!head) //no face! + var/datum/organ/external/O = get_organ("head") + + if( (status_flags&DISFIGURED) || (O.brutestate+O.burnstate)>2 ) //disfigured. use id-name if possible return "Unknown" - else - return "[real_name]" + return real_name //gets name from ID or PDA itself, ID inside PDA doesn't matter //Useful when player is being seen by other mobs diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 06429c75d34..476a08d9375 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -75,8 +75,7 @@ //Update our name based on whether our face is obscured/disfigured name = get_visible_name() //TODO: this was broken by the dismemberment revert ~Carn - if(client) - handle_regular_hud_updates() + handle_regular_hud_updates() // Grabbing for(var/obj/item/weapon/grab/G in src) @@ -111,7 +110,7 @@ proc/handle_disabilities() - if (disabilities & 2) + if (disabilities & EPILEPSY) if ((prob(1) && paralysis < 1)) src << "\red You have a seizure!" for(var/mob/O in viewers(src, null)) @@ -120,13 +119,13 @@ O.show_message(text("\red [src] starts having a seizure!"), 1) Paralyse(10) make_jittery(1000) - if (disabilities & 4) + if (disabilities & COUGHING) if ((prob(5) && paralysis <= 1)) drop_item() spawn( 0 ) emote("cough") return - if (disabilities & 8) + if (disabilities & TOURETTES) if ((prob(10) && paralysis <= 1)) Stun(10) spawn( 0 ) @@ -143,7 +142,7 @@ pixel_x = old_x pixel_y = old_y return - if (disabilities & 16) + if (disabilities & NERVOUS) if (prob(10)) stuttering = max(10, stuttering) if (getBrainLoss() >= 60 && stat != 2) @@ -747,7 +746,7 @@ stat = CONSCIOUS //Eyes - if(sdisabilities & 1) //disabled-blind, doesn't get better on its own + if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own blinded = 1 else if(eye_blind) //blindness, heals slowly over time eye_blind = max(eye_blind-1,0) @@ -759,7 +758,7 @@ eye_blurry = max(eye_blurry-1, 0) //Ears - if(sdisabilities & 4) //disabled-deaf, doesn't get better on its own + if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own ear_deaf = max(ear_deaf, 1) else if(ear_deaf) //deafness, heals slowly over time ear_deaf = max(ear_deaf-1, 0) @@ -786,287 +785,188 @@ druggy = max(druggy-1, 0) return 1 - proc/handle_regular_hud_updates() - if(!client) return 0 for(var/image/hud in client.images) if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe del(hud) - if (stat == 2 || (XRAY in mutations)) - sight |= SEE_TURFS - sight |= SEE_MOBS - sight |= SEE_OBJS - see_in_dark = 8 - if(!druggy) - see_invisible = 2 + client.screen.Remove(hud_used.blurry, hud_used.druggy, hud_used.vimpaired, hud_used.darkMask) - else if (seer) - var/obj/effect/rune/R = locate() in loc - if (istype(R) && R.word1 == wordsee && R.word2 == wordhell && R.word3 == wordjoin) - see_invisible = 15 - else - seer = 0 - see_invisible = 0 - else if (istype(wear_mask, /obj/item/clothing/mask/gas/voice/space_ninja)) - switch(wear_mask:mode) - if(0) - if(client) + if( stat == DEAD ) + sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) + see_in_dark = 8 + if(!druggy) see_invisible = 2 + if(healths) healths.icon_state = "health7" //DEAD healthmeter + else + sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS) + switch(mutantrace) + if("lizard","metroid") + see_in_dark = 3 + see_invisible = 1 + else + see_in_dark = 2 + + if(XRAY in mutations) + sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS + see_in_dark = 8 + if(!druggy) see_invisible = 2 + + if(seer) + var/obj/effect/rune/R = locate() in loc + if(R && R.word1 == wordsee && R.word2 == wordhell && R.word3 == wordjoin) + see_invisible = 15 + else + see_invisible = 0 + seer = 0 + + if(istype(wear_mask, /obj/item/clothing/mask/gas/voice/space_ninja)) + var/obj/item/clothing/mask/gas/voice/space_ninja/O = wear_mask + switch(O.mode) + if(0) var/target_list[] = list() for(var/mob/living/target in oview(src)) if( target.mind&&(target.mind.special_role||issilicon(target)) )//They need to have a mind. target_list += target if(target_list.len)//Everything else is handled by the ninja mask proc. - wear_mask:assess_targets(target_list, src) - if (!druggy) - see_invisible = 0 - if(1) - see_in_dark = 5 - if(!druggy) - see_invisible = 0 - if(2) - sight |= SEE_MOBS - if(!druggy) - see_invisible = 2 - if(3) + O.assess_targets(target_list, src) + if(!druggy) see_invisible = 0 + if(1) + see_in_dark = 5 + if(!druggy) see_invisible = 0 + if(2) + sight |= SEE_MOBS + if(!druggy) see_invisible = 2 + if(3) + sight |= SEE_TURFS + if(!druggy) see_invisible = 0 + + if(glasses) + if(istype(glasses, /obj/item/clothing/glasses/meson)) sight |= SEE_TURFS - if(!druggy) - see_invisible = 0 - - else if(istype(glasses, /obj/item/clothing/glasses/meson)) - sight |= SEE_TURFS - if(!druggy) - see_invisible = 0 - else if(istype(glasses, /obj/item/clothing/glasses/night)) - see_in_dark = 5 - if(!druggy) - see_invisible = 0 - else if(istype(glasses, /obj/item/clothing/glasses/thermal)) - sight |= SEE_MOBS - if(!druggy) - see_invisible = 2 - else if(istype(glasses, /obj/item/clothing/glasses/material)) - sight |= SEE_OBJS - if (!druggy) - see_invisible = 0 - - else if(stat != 2) - sight &= ~SEE_TURFS - sight &= ~SEE_MOBS - sight &= ~SEE_OBJS - if (mutantrace == "lizard" || mutantrace == "metroid") - see_in_dark = 3 - see_invisible = 1 - else if (druggy) // If drugged~ - see_in_dark = 2 - //see_invisible regulated by drugs themselves. - else - see_in_dark = 2 - - var/seer = 0 - var/obj/effect/rune/R = locate() in loc - if (istype(R) && R.word1 == wordsee && R.word2 == wordhell && R.word3 == wordjoin) - seer = 1 - if(!seer) - see_invisible = 0 - - - - - - - - else if(istype(head, /obj/item/clothing/head/welding)) // wat. This is never fucking called. - if(!head:up && tinted_weldhelh) - see_in_dark = 1 - - - - - - - - + if(!druggy) see_invisible = 0 + else if(istype(glasses, /obj/item/clothing/glasses/night)) + see_in_dark = 5 + if(!druggy) see_invisible = 0 + else if(istype(glasses, /obj/item/clothing/glasses/thermal)) + sight |= SEE_MOBS + if(!druggy) see_invisible = 2 + else if(istype(glasses, /obj/item/clothing/glasses/material)) + sight |= SEE_OBJS + if(!druggy) see_invisible = 0 /* HUD shit goes here, as long as it doesn't modify sight flags */ // The purpose of this is to stop xray and w/e from preventing you from using huds -- Love, Doohl - if(istype(glasses, /obj/item/clothing/glasses/hud/health)) - if(client) - glasses:process_hud(src) - if (!druggy) - see_invisible = 0 - if(istype(glasses, /obj/item/clothing/glasses/hud/security)) - if(client) - glasses:process_hud(src) - if (!druggy) - see_invisible = 0 + else if(istype(glasses, /obj/item/clothing/glasses/sunglasses)) + see_in_dark = 1 + if(istype(glasses, /obj/item/clothing/glasses/sunglasses/sechud)) + var/obj/item/clothing/glasses/sunglasses/sechud/O = glasses + if(O.hud) O.hud.process_hud(src) + if(!druggy) see_invisible = 0 - if(istype(glasses, /obj/item/clothing/glasses/sunglasses)) - see_in_dark = 1 - if(istype(glasses, /obj/item/clothing/glasses/sunglasses/sechud)) - if(client) - if(glasses:hud) - glasses:hud:process_hud(src) - if (!druggy) - see_invisible = 0 + else if(istype(glasses, /obj/item/clothing/glasses/hud)) + var/obj/item/clothing/glasses/hud/health/O = glasses -/* - if (istype(glasses, /obj/item/clothing/glasses)) - sight = glasses.vision_flags - see_in_dark = 2 + glasses.darkness_view - see_invisible = invisa_view + if(istype(O, /obj/item/clothing/glasses/hud/health)) + O.process_hud(src) + if(!druggy) see_invisible = 0 - if(istype(glasses, /obj/item/clothing/glasses/hud)) - if(client) - glasses:process_hud(src) -*/ -//Should finish this up later + else if(istype(O, /obj/item/clothing/glasses/hud/security)) + O.process_hud(src) + if(!druggy) see_invisible = 0 + if(sleep && !hal_crit) sleep.icon_state = "sleep[sleeping]" //used? - - if (sleep && !hal_crit) sleep.icon_state = text("sleep[]", sleeping) - if (rest) rest.icon_state = text("rest[]", resting) - - if (healths) - if (stat != 2) - switch(health - halloss) - if(100 to INFINITY) - healths.icon_state = "health0" - if(80 to 100) - healths.icon_state = "health1" - if(60 to 80) - healths.icon_state = "health2" - if(40 to 60) - healths.icon_state = "health3" - if(20 to 40) - healths.icon_state = "health4" - if(0 to 20) - healths.icon_state = "health5" + if(healths) + switch(hal_screwyhud) + if(1) healths.icon_state = "health6" + if(2) healths.icon_state = "health7" else - healths.icon_state = "health6" - else - healths.icon_state = "health7" - if(hal_screwyhud == 1) - healths.icon_state = "health6" - if(hal_screwyhud == 2) - healths.icon_state = "health7" + switch(health - halloss) + if(100 to INFINITY) healths.icon_state = "health0" + if(80 to 100) healths.icon_state = "health1" + if(60 to 80) healths.icon_state = "health2" + if(40 to 60) healths.icon_state = "health3" + if(20 to 40) healths.icon_state = "health4" + if(0 to 20) healths.icon_state = "health5" + else healths.icon_state = "health6" - if (nutrition_icon) - switch(nutrition) - if(450 to INFINITY) - nutrition_icon.icon_state = "nutrition0" - if(350 to 450) - nutrition_icon.icon_state = "nutrition1" - if(250 to 350) - nutrition_icon.icon_state = "nutrition2" - if(150 to 250) - nutrition_icon.icon_state = "nutrition3" + if(nutrition_icon) + switch(nutrition) + if(450 to INFINITY) nutrition_icon.icon_state = "nutrition0" + if(350 to 450) nutrition_icon.icon_state = "nutrition1" + if(250 to 350) nutrition_icon.icon_state = "nutrition2" + if(150 to 250) nutrition_icon.icon_state = "nutrition3" + else nutrition_icon.icon_state = "nutrition4" + + if(pressure) + if(istype(wear_suit, /obj/item/clothing/suit/space)||istype(wear_suit, /obj/item/clothing/suit/armor/captain)) + pressure.icon_state = "pressure0" else - nutrition_icon.icon_state = "nutrition4" + var/datum/gas_mixture/environment = loc.return_air() + if(environment) + switch(environment.return_pressure()) + if(HAZARD_HIGH_PRESSURE to INFINITY) pressure.icon_state = "pressure2" + if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE) pressure.icon_state = "pressure1" + if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE) pressure.icon_state = "pressure0" + if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE) pressure.icon_state = "pressure-1" + else pressure.icon_state = "pressure-2" - if (pressure) + if(pullin) + if(pulling) pullin.icon_state = "pull1" + else pullin.icon_state = "pull0" +// if(rest) //Not used with new UI +// if(resting || lying || sleeping) rest.icon_state = "rest1" +// else rest.icon_state = "rest0" + if(toxin) + if(hal_screwyhud == 4 || toxins_alert) toxin.icon_state = "tox1" + else toxin.icon_state = "tox0" + if(oxygen) + if(hal_screwyhud == 3 || oxygen_alert) oxygen.icon_state = "oxy1" + else oxygen.icon_state = "oxy0" + if(fire) + if(fire_alert) fire.icon_state = "fire1" + else fire.icon_state = "fire0" - if(istype(wear_suit, /obj/item/clothing/suit/space)||istype(wear_suit, /obj/item/clothing/suit/armor/captain)) - pressure.icon_state = "pressure0" + if(bodytemp) + switch(bodytemperature) //310.055 optimal body temp + if(370 to INFINITY) bodytemp.icon_state = "temp4" + if(350 to 370) bodytemp.icon_state = "temp3" + if(335 to 350) bodytemp.icon_state = "temp2" + if(320 to 335) bodytemp.icon_state = "temp1" + if(300 to 320) bodytemp.icon_state = "temp0" + if(295 to 300) bodytemp.icon_state = "temp-1" + if(280 to 295) bodytemp.icon_state = "temp-2" + if(260 to 280) bodytemp.icon_state = "temp-3" + else bodytemp.icon_state = "temp-4" + if(blind) + if(blinded) blind.layer = 18 + else blind.layer = 0 + + if( disabilities & NEARSIGHTED && !istype(glasses, /obj/item/clothing/glasses/regular) ) + client.screen += hud_used.vimpaired + if(eye_blurry) client.screen += hud_used.blurry + if(druggy) client.screen += hud_used.druggy + + if( istype(head, /obj/item/clothing/head/welding) ) + var/obj/item/clothing/head/welding/O = head + if(!O.up && tinted_weldhelh) + client.screen += hud_used.darkMask + + if(eye_stat > 20) + if(eye_stat > 30) client.screen += hud_used.darkMask + else client.screen += hud_used.vimpaired + + if(machine) + if(!machine.check_eye(src)) reset_view(null) else - var/datum/gas_mixture/environment = loc.return_air() - if(environment) - switch(environment.return_pressure()) - if(HAZARD_HIGH_PRESSURE to INFINITY) - pressure.icon_state = "pressure2" - if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE) - pressure.icon_state = "pressure1" - if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE) - pressure.icon_state = "pressure0" - if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE) - pressure.icon_state = "pressure-1" - else - pressure.icon_state = "pressure-2" - - if(pullin) pullin.icon_state = "pull[pulling ? 1 : 0]" - - if(rest) rest.icon_state = "rest[(resting || lying || sleeping) ? 1 : 0]" - - - if (toxin || hal_screwyhud == 4) toxin.icon_state = "tox[toxins_alert ? 1 : 0]" - if (oxygen || hal_screwyhud == 3) oxygen.icon_state = "oxy[oxygen_alert ? 1 : 0]" - if (fire) fire.icon_state = "fire[fire_alert ? 1 : 0]" //NOTE: INVESTIGATE NUKE BURNINGS - //NOTE: the alerts dont reset when youre out of danger. dont blame me, - //blame the person who coded them. Temporary fix added. - - if(bodytemp) - switch(bodytemperature) //310.055 optimal body temp - if(370 to INFINITY) - bodytemp.icon_state = "temp4" - if(350 to 370) - bodytemp.icon_state = "temp3" - if(335 to 350) - bodytemp.icon_state = "temp2" - if(320 to 335) - bodytemp.icon_state = "temp1" - if(300 to 320) - bodytemp.icon_state = "temp0" - if(295 to 300) - bodytemp.icon_state = "temp-1" - if(280 to 295) - bodytemp.icon_state = "temp-2" - if(260 to 280) - bodytemp.icon_state = "temp-3" - else - bodytemp.icon_state = "temp-4" - - if(!client) return 0 //Wish we did not need these - client.screen.Remove(hud_used.blurry, hud_used.druggy, hud_used.vimpaired, hud_used.darkMask) - - if ((blind && stat != 2)) - if(blinded) - blind.layer = 18 - else - blind.layer = 0 - - if( disabilities & 1 && !istype(glasses, /obj/item/clothing/glasses/regular) ) - client.screen += hud_used.vimpaired - - if(eye_blurry) - client.screen += hud_used.blurry - - if(druggy) - client.screen += hud_used.druggy - - if( istype(head, /obj/item/clothing/head/welding) ) - if(!head:up && tinted_weldhelh) - client.screen += hud_used.darkMask - - if(eye_stat > 20) - if((eye_stat > 30)) - client.screen += hud_used.darkMask - else - client.screen += hud_used.vimpaired - - - - if (stat != 2) - if (machine) - if (!( machine.check_eye(src) )) - reset_view(null) - else - if(!client.adminobs) - reset_view(null) - + if(!client.adminobs) reset_view(null) return 1 proc/handle_random_events() - /* // probably stupid -- Doohl - if (prob(1) && prob(2)) - spawn(0) - emote("sneeze") - return - */ - // Puke if toxloss is too high if(!stat) if (getToxLoss() >= 45 && nutrition > 20) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 134ba694b16..876f130f6db 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -521,18 +521,10 @@ Please contact me on #coderbus IRC. ~Carn x standing = null else - if( istype(wear_suit, /obj/item/clothing/suit/straight_jacket) ) //TODO - if (handcuffed) // - handcuffed.loc = loc // - handcuffed.layer = initial(handcuffed.layer) // - handcuffed = null // - if (l_hand || r_hand) // - var/h = hand // - hand = 1 // - drop_item() // - hand = 0 // - drop_item() // - hand = h // + if( istype(wear_suit, /obj/item/clothing/suit/straight_jacket) ) + drop_from_inventory(handcuffed) + drop_l_hand() + drop_r_hand() if(wear_suit.blood_DNA) var/t_state diff --git a/code/modules/mob/living/carbon/human/whisper.dm b/code/modules/mob/living/carbon/human/whisper.dm index 0c79f8e1af3..35608a15a01 100644 --- a/code/modules/mob/living/carbon/human/whisper.dm +++ b/code/modules/mob/living/carbon/human/whisper.dm @@ -30,7 +30,7 @@ var/mob/living/carbon/human/H = src alt_name = " (as [H.get_id_name("Unknown")])" // Mute disability - if (src.sdisabilities & 2) + if (src.sdisabilities & MUTE) return if (istype(src.wear_mask, /obj/item/clothing/mask/muzzle)) diff --git a/code/modules/mob/living/carbon/metroid/examine.dm b/code/modules/mob/living/carbon/metroid/examine.dm index 5785a378c5e..ec25848ccc0 100644 --- a/code/modules/mob/living/carbon/metroid/examine.dm +++ b/code/modules/mob/living/carbon/metroid/examine.dm @@ -2,7 +2,7 @@ set src in oview() if(!usr || !src) return - if(((usr.sdisabilities & 1) || usr.blinded || usr.stat) && !(istype(usr,/mob/dead/observer/))) + if( (usr.sdisabilities & BLIND || usr.blinded || usr.stat) && !istype(usr,/mob/dead/observer) ) usr << "Something is there but you can't see it." return diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index 42d78f72ea6..1817a5a0297 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -461,9 +461,9 @@ src.density = !( src.lying ) - if (src.sdisabilities & 1) + if (src.sdisabilities & BLIND) src.blinded = 1 - if (src.sdisabilities & 4) + if (src.sdisabilities & DEAF) src.ear_deaf = 1 if (src.eye_blurry > 0) diff --git a/code/modules/mob/living/carbon/monkey/examine.dm b/code/modules/mob/living/carbon/monkey/examine.dm index b1583999645..869482b13f4 100644 --- a/code/modules/mob/living/carbon/monkey/examine.dm +++ b/code/modules/mob/living/carbon/monkey/examine.dm @@ -2,7 +2,7 @@ set src in oview() if(!usr || !src) return - if(((usr.sdisabilities & 1) || usr.blinded || usr.stat) && !(istype(usr,/mob/dead/observer/))) + if( (usr.sdisabilities & BLIND || usr.blinded || usr.stat) && !istype(usr,/mob/dead/observer) ) usr << "Something is there but you can't see it." return diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 9698b9c89c5..ac08a337a6d 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -81,23 +81,23 @@ proc/handle_disabilities() - if (disabilities & 2) + if (disabilities & EPILEPSY) if ((prob(1) && paralysis < 10)) src << "\red You have a seizure!" Paralyse(10) - if (disabilities & 4) + if (disabilities & COUGHING) if ((prob(5) && paralysis <= 1)) drop_item() spawn( 0 ) emote("cough") return - if (disabilities & 8) + if (disabilities & TOURETTES) if ((prob(10) && paralysis <= 1)) Stun(10) spawn( 0 ) emote("twitch") return - if (disabilities & 16) + if (disabilities & NERVOUS) if (prob(10)) stuttering = max(10, stuttering) @@ -426,16 +426,16 @@ stat = CONSCIOUS //Eyes - if(sdisabilities & 1) //disabled-blind, doesn't get better on its own + if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own blinded = 1 else if(eye_blind) //blindness, heals slowly over time eye_blind = max(eye_blind-1,0) blinded = 1 - else if(eye_blurry) //blurry eyes heal slowly + else if(eye_blurry) //blurry eyes heal slowly eye_blurry = max(eye_blurry-1, 0) //Ears - if(sdisabilities & 4) //disabled-deaf, doesn't get better on its own + if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own ear_deaf = max(ear_deaf, 1) else if(ear_deaf) //deafness, heals slowly over time ear_deaf = max(ear_deaf-1, 0) @@ -554,7 +554,7 @@ else blind.layer = 0 - if (disabilities & 1) + if (disabilities & NEARSIGHTED) client.screen += hud_used.vimpaired if (eye_blurry) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index a167f906588..cec328a1bfb 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -242,6 +242,7 @@ buckled = initial(src.buckled) handcuffed = initial(src.handcuffed) stat = CONSCIOUS + regenerate_icons() ..() return diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index f36506edcae..3afe593f33e 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -97,7 +97,7 @@ var/list/department_radio_keys = list( return // Mute disability - if (sdisabilities & 2) + if (sdisabilities & MUTE) return if (istype(wear_mask, /obj/item/clothing/mask/muzzle)) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 0399540c0b2..1ee631741d0 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -28,14 +28,9 @@ verbs += /mob/living/silicon/ai/proc/show_laws_verb if (istype(loc, /turf)) - verbs += /mob/living/silicon/ai/proc/ai_call_shuttle - verbs += /mob/living/silicon/ai/proc/ai_camera_track - verbs += /mob/living/silicon/ai/proc/ai_camera_list - //Added ai_network_change by Mord_Sith - verbs += /mob/living/silicon/ai/proc/ai_network_change - verbs += /mob/living/silicon/ai/proc/ai_statuschange - //Hologram verb./N - verbs += /mob/living/silicon/ai/proc/ai_hologram_change + verbs.Add(/mob/living/silicon/ai/proc/ai_call_shuttle,/mob/living/silicon/ai/proc/ai_camera_track, \ + /mob/living/silicon/ai/proc/ai_camera_list, /mob/living/silicon/ai/proc/ai_network_change, \ + /mob/living/silicon/ai/proc/ai_statuschange, /mob/living/silicon/ai/proc/ai_hologram_change) if(!safety)//Only used by AIize() to successfully spawn an AI. if (!B)//If there is no player/brain inside. @@ -61,12 +56,6 @@ spawn(0) ainame(src) - if(client) - for(var/obj/effect/rune/rune in world) - var/image/blood = image('blood.dmi', loc = rune, icon_state = "floor[rand(1,7)]") - blood.override = 1 - client.images += blood - return diff --git a/code/modules/mob/living/silicon/ai/examine.dm b/code/modules/mob/living/silicon/ai/examine.dm index c4e9d1ddbcc..1a36ce5a9b7 100644 --- a/code/modules/mob/living/silicon/ai/examine.dm +++ b/code/modules/mob/living/silicon/ai/examine.dm @@ -2,7 +2,7 @@ set src in oview() if(!usr || !src) return - if(((usr.sdisabilities & 1) || usr.blinded || usr.stat) && !(istype(usr,/mob/dead/observer/))) + if( (usr.sdisabilities & BLIND || usr.blinded || usr.stat) && !istype(usr,/mob/dead/observer) ) usr << "Something is there but you can't see it." return diff --git a/code/modules/mob/living/silicon/ai/login.dm b/code/modules/mob/living/silicon/ai/login.dm index 13464e3e15a..8e1c1c1f081 100644 --- a/code/modules/mob/living/silicon/ai/login.dm +++ b/code/modules/mob/living/silicon/ai/login.dm @@ -1,6 +1,6 @@ /mob/living/silicon/ai/Login() for(var/obj/effect/rune/rune in world) - var/image/blood = image('blood.dmi', loc = rune, icon_state = "floor[rand(1,7)]") + var/image/blood = image(loc = rune) blood.override = 1 client.images += blood ..() diff --git a/code/modules/mob/living/silicon/robot/examine.dm b/code/modules/mob/living/silicon/robot/examine.dm index c29674a6f27..90555bf0254 100644 --- a/code/modules/mob/living/silicon/robot/examine.dm +++ b/code/modules/mob/living/silicon/robot/examine.dm @@ -2,7 +2,7 @@ set src in oview() if(!usr || !src) return - if(((usr.sdisabilities & 1) || usr.blinded || usr.stat) && !(istype(usr,/mob/dead/observer/))) + if( (usr.sdisabilities & BLIND || usr.blinded || usr.stat) && !istype(usr,/mob/dead/observer) ) usr << "Something is there but you can't see it." return diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 14033fa6df9..cb75500620d 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -128,9 +128,9 @@ src.density = !( src.lying ) - if ((src.sdisabilities & 1)) + if ((src.sdisabilities & BLIND)) src.blinded = 1 - if ((src.sdisabilities & 4)) + if ((src.sdisabilities & DEAF)) src.ear_deaf = 1 if (src.eye_blurry > 0) @@ -259,7 +259,7 @@ else src.blind.layer = 0 - if (src.disabilities & 1) + if (src.disabilities & NEARSIGHTED) src.client.screen += src.hud_used.vimpaired if (src.eye_blurry) diff --git a/code/modules/mob/living/simple_animal/shade.dm b/code/modules/mob/living/simple_animal/shade.dm index 00b5e72f444..c16313b7e87 100644 --- a/code/modules/mob/living/simple_animal/shade.dm +++ b/code/modules/mob/living/simple_animal/shade.dm @@ -22,6 +22,7 @@ max_tox = 0 speed = -1 stop_automated_movement = 1 + status_flags = 0 Life() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 294e2519f46..f9f0ae8b026 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -43,22 +43,22 @@ /mob/proc/show_message(msg, type, alt, alt_type)//Message, type of message (1 or 2), alternative message, alt message type (1 or 2) if(!client) return if (type) - if ((type & 1 && (sdisabilities & 1 || (blinded || paralysis))))//Vision related + if(type & 1 && (sdisabilities & BLIND || blinded || paralysis) )//Vision related if (!( alt )) return else msg = alt type = alt_type - if ((type & 2 && (sdisabilities & 4 || ear_deaf)))//Hearing related + if (type & 2 && (sdisabilities & DEAF || ear_deaf))//Hearing related if (!( alt )) return else msg = alt type = alt_type - if ((type & 1 && sdisabilities & 1)) + if ((type & 1 && sdisabilities & BLIND)) return // Added voice muffling for Issue 41. - if (stat == 1 || sleeping > 0) + if(stat == UNCONSCIOUS || sleeping > 0) src << "... You can almost hear someone talking ..." else src << msg diff --git a/code/setup.dm b/code/setup.dm index a3428598ea9..e973a499e3e 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -261,6 +261,18 @@ var/MAX_EXPLOSION_RANGE = 14 #define NANOREGEN 28 // regenerative nanobots, -3 all damage types per second +//disabilities +#define NEARSIGHTED 1 +#define EPILEPSY 2 +#define COUGHING 4 +#define TOURETTES 8 +#define NERVOUS 16 + +//sdisabilities +#define BLIND 1 +#define MUTE 2 +#define DEAF 4 + //mob/var/stat things #define CONSCIOUS 0 #define UNCONSCIOUS 1 @@ -314,7 +326,7 @@ var/list/global_mutations = list() // list of hidden mutation things //Bluh shields -//Damage things //TODO: merge these down to reduce on defines >_> +//Damage things //TODO: merge these down to reduce on defines #define BRUTE "brute" #define BURN "fire" #define TOX "tox" @@ -334,6 +346,7 @@ var/list/global_mutations = list() // list of hidden mutation things #define CANSTUN 1 #define CANWEAKEN 2 #define CANPARALYSE 4 +#define DISFIGURED 65536 //I'll probably move this elsewhere if I ever get wround to writing a bitflag mob-damage system var/static/list/scarySounds = list('thudswoosh.ogg','Taser.ogg','armbomb.ogg','hiss1.ogg','hiss2.ogg','hiss3.ogg','hiss4.ogg','hiss5.ogg','hiss6.ogg','Glassbr1.ogg','Glassbr2.ogg','Glassbr3.ogg','Welder.ogg','Welder2.ogg','airlock.ogg','clownstep1.ogg','clownstep2.ogg')