From 3c02e14efd236ce735b5f4fc551104a5b614f766 Mon Sep 17 00:00:00 2001 From: "petethegoat@gmail.com" Date: Sun, 27 Jan 2013 13:20:59 +0000 Subject: [PATCH] Fixes issue 1179. If gravity is off, can't escape trash chutes Fixes issue 1219. Cloning Scanner Popping Out Prematurely Fixes issue 1182. Using wrapping paper on a bodybag Fixes issue 1238. Reading while blind (fixes paper, photographs, and books) Fixes issue 1253. Braindead message when converting non braindead people (rev) Fixes issue 1188. Head revs converting unconscious people Added is_blind(A) as a helper proc for blindness. It returns 1 if A is a fully blinded carbon mob. Updated the loot spawner to use a list instead of a text string. Updated gun reloading to use text styles. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5619 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/dna.dm | 33 +++++------ code/game/objects/items/devices/flash.dm | 61 +++++++++++---------- code/modules/awaymissions/loot.dm | 11 ++-- code/modules/library/lib_items.dm | 8 ++- code/modules/mob/mob_helpers.dm | 9 ++- code/modules/mob/mob_movement.dm | 3 + code/modules/paperwork/clipboard.dm | 7 +-- code/modules/paperwork/folders.dm | 7 +-- code/modules/paperwork/paper.dm | 22 +++++--- code/modules/paperwork/photography.dm | 2 + code/modules/projectiles/guns/projectile.dm | 2 +- code/modules/recycling/sortingmachinery.dm | 3 +- 12 files changed, 92 insertions(+), 76 deletions(-) diff --git a/code/game/dna.dm b/code/game/dna.dm index 9579aa87d25..eafe23a6369 100644 --- a/code/game/dna.dm +++ b/code/game/dna.dm @@ -675,16 +675,16 @@ set category = "Object" set name = "Enter DNA Scanner" - if (usr.stat != 0) + if(usr.stat != 0) return - if (!ishuman(usr) && !ismonkey(usr)) //Make sure they're a mob that has dna - usr << "\blue Try as you might, you can not climb up into the scanner." + if(!ishuman(usr) && !ismonkey(usr)) //Make sure they're a mob that has dna + usr << "Try as you might, you can not climb up into the scanner." return - if (src.occupant) - usr << "\blue The scanner is already occupied!" + if(occupant) + usr << "The scanner is already occupied!" return - if (usr.abiotic()) - usr << "\blue Subject cannot have abiotic items on." + if(usr.abiotic()) + usr << "Subject cannot have abiotic items on." return usr.stop_pulling() usr.client.perspective = EYE_PERSPECTIVE @@ -701,24 +701,25 @@ src.add_fingerprint(usr) return -/obj/machinery/dna_scannernew/attackby(obj/item/weapon/grab/G as obj, user as mob) - if ((!( istype(G, /obj/item/weapon/grab) ) || !( ismob(G.affecting) ))) +/obj/machinery/dna_scannernew/attackby(obj/item/weapon/grab/G, mob/user) + if(!istype(G, /obj/item/weapon/grab) || !ismob(G.affecting)) return - if (src.occupant) - user << "\blue The scanner is already occupied!" + if(occupant) + user << "The scanner is already occupied!" return - if (G.affecting.abiotic()) - user << "\blue Subject cannot have abiotic items on." + if(G.affecting.abiotic()) + user << "Subject cannot have abiotic items on." return var/mob/M = G.affecting if(M.client) M.client.perspective = EYE_PERSPECTIVE M.client.eye = src M.loc = src - src.occupant = M - src.icon_state = "scanner_1" + occupant = M + user.stop_pulling() + icon_state = "scanner_1" - src.add_fingerprint(user) + add_fingerprint(user) // search for ghosts, if the corpse is empty and the scanner is connected to a cloner if(locate(/obj/machinery/computer/cloning, get_step(src, NORTH)) \ diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index c0945a79f4c..50f34a66b6f 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -14,9 +14,9 @@ var/broken = 0 //Is the flash burnt out? var/last_used = 0 //last world.time it was used. -/obj/item/device/flash/proc/clown_check(var/mob/user) +/obj/item/device/flash/proc/clown_check(mob/user) if(user && (CLUMSY in user.mutations) && prob(50)) - user << "\red \The [src] slips out of your hand." + user << "\red [src] slips out of your hand." user.drop_item() return 0 return 1 @@ -32,7 +32,7 @@ times_used = max(0,round(times_used)) //sanity -/obj/item/device/flash/attack(mob/living/M as mob, mob/user as mob) +/obj/item/device/flash/attack(mob/living/M, mob/user) if(!user || !M) return //sanity M.attack_log += text("\[[time_stamp()]\] Has been flashed (attempt) with [src.name] by [user.name] ([user.ckey])") user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to flash [M.name] ([M.ckey])") @@ -42,7 +42,7 @@ if(!clown_check(user)) return if(broken) - user << "\The [src] is broken." + user << "[src] is broken." return flash_recharge() @@ -70,24 +70,29 @@ M.Weaken(10) flick("e_flash", M.flash) - if(ishuman(M) && ishuman(user) && M.stat!=DEAD) + if(ishuman(M) && ishuman(user) && M.stat != DEAD) if(user.mind && user.mind in ticker.mode.head_revolutionaries) - var/revsafe = 0 - for(var/obj/item/weapon/implant/loyalty/L in M) - if(L && L.implanted) - revsafe = 1 - break - M.mind_initialize() //give them a mind datum if they don't have one. - if(M.mind.has_been_rev) - revsafe = 2 - if(!revsafe) - M.mind.has_been_rev = 1 - ticker.mode.add_revolutionary(M.mind) - else if(revsafe == 1) - user << "Something seems to be blocking the flash!" + if(M.client) + if(M.stat == CONSCIOUS) + var/revsafe = 0 + for(var/obj/item/weapon/implant/loyalty/L in M) + if(L && L.implanted) + revsafe = 1 + break + M.mind_initialize() //give them a mind datum if they don't have one. + if(M.mind.has_been_rev) + revsafe = 2 + if(!revsafe) + M.mind.has_been_rev = 1 + ticker.mode.add_revolutionary(M.mind) + else if(revsafe == 1) + user << "Something seems to be blocking the flash!" + else + user << "This mind seems resistant to the flash!" + else + user << "They must be conscious before you can convert them!" else - user << "This mind seems resistant to the flash!" - user << "This mind is so vacant that it is not susceptible to influence!" + user << "This mind is so vacant that it is not susceptible to influence!" else flashfail = 1 @@ -119,15 +124,13 @@ user.visible_message("[user] fails to blind [M] with the flash!") - return - -/obj/item/device/flash/attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0) +/obj/item/device/flash/attack_self(mob/living/carbon/user, flag = 0, emp = 0) if(!user || !clown_check(user)) return if(broken) - user.show_message("The [src.name] is broken", 2) + user.show_message("[src] is broken!", 2) return flash_recharge() @@ -196,19 +199,19 @@ desc = "When a problem arises, SCIENCE is the solution." icon_state = "sflash" origin_tech = "magnets=2;combat=1" - var/construction_cost = list("metal"=750,"glass"=750) + var/construction_cost = list("metal"=750, "glass"=750) var/construction_time=100 -/obj/item/device/flash/synthetic/attack(mob/living/M as mob, mob/user as mob) +/obj/item/device/flash/synthetic/attack(mob/living/M, mob/user) ..() if(!broken) broken = 1 - user << "\red The bulb has burnt out!" + user << "The bulb has burnt out!" icon_state = "flashburnt" -/obj/item/device/flash/synthetic/attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0) +/obj/item/device/flash/synthetic/attack_self(mob/living/carbon/user, flag = 0, emp = 0) ..() if(!broken) broken = 1 - user << "\red The bulb has burnt out!" + user << "The bulb has burnt out!" icon_state = "flashburnt" diff --git a/code/modules/awaymissions/loot.dm b/code/modules/awaymissions/loot.dm index 70ec7ddc36c..43c4084384b 100644 --- a/code/modules/awaymissions/loot.dm +++ b/code/modules/awaymissions/loot.dm @@ -3,16 +3,15 @@ icon_state = "x2" var/lootcount = 1 //how many items will be spawned var/lootdoubles = 0 //if the same item can be spawned twice - var/loot = "" //a list of possible items to spawn- a string of paths + var/list/loot //a list of possible items to spawn e.g. list(/obj/item, /obj/structure, /obj/effect) /obj/effect/spawner/lootdrop/initialize() - var/list/things = params2list(loot) - if(things && things.len) + if(loot && loot.len) for(var/i = lootcount, i > 0, i--) - if(!things.len) return - var/lootspawn = text2path(pick(things)) + if(!loot.len) return + var/lootspawn = pick(loot) if(!lootdoubles) - things.Remove(lootspawn) + loot.Remove(lootspawn) new lootspawn(get_turf(src)) del(src) \ No newline at end of file diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index 34319c0d91f..4579c6c51ce 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -142,7 +142,11 @@ else user << "The pages of [title] have been cut out!" return - if(src.dat) + + if(is_blind(user)) + return + + if(dat) user << browse("Penned by [author].
" + "[dat]", "window=book") user.visible_message("[user] opens a book titled \"[src.title]\" and begins reading intently.") onclose(user, "book") @@ -165,6 +169,8 @@ user << "There's already something in [title]!" return if(istype(W, /obj/item/weapon/pen)) + if(is_blind(user)) + return if(unique) user << "These pages don't seem to take the ink well. Looks like you can't modify it." return diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 5c0825b20dd..cd2163355ee 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -379,4 +379,11 @@ var/list/intents = list("help","disarm","grab","hurt") if(a_intent == "hurt") hud_used.action_intent.icon_state = "harm" else - hud_used.action_intent.icon_state = "help" \ No newline at end of file + hud_used.action_intent.icon_state = "help" + +proc/is_blind(A) + if(istype(A, /mob/living/carbon)) + var/mob/living/carbon/C = A + if(C.blinded != null) + return 1 + return 0 \ No newline at end of file diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index c88c52c4957..77f97bf356f 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -436,6 +436,9 @@ if(restrained()) return 0 + if(!isturf(loc)) //if they're in a disposal unit, for example + return 1 + /* if(istype(src,/mob/living/carbon)) if(src.l_hand && src.r_hand) diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index ff0e2fc7483..a594d2cecaf 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -120,12 +120,7 @@ if(href_list["read"]) var/obj/item/weapon/paper/P = locate(href_list["read"]) if(P) - if(!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/dead/observer) || istype(usr, /mob/living/silicon))) - usr << browse("[P.name][stars(P.info)][P.stamps]", "window=[P.name]") - onclose(usr, "[P.name]") - else - usr << browse("[P.name][P.info][P.stamps]", "window=[P.name]") - onclose(usr, "[P.name]") + P.examine() if(href_list["top"]) var/obj/item/P = locate(href_list["top"]) diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index cb70206cbfc..4b25aa10694 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -68,12 +68,7 @@ if(href_list["read"]) var/obj/item/weapon/paper/P = locate(href_list["read"]) if(P) - if(!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/dead/observer) || istype(usr, /mob/living/silicon))) - usr << browse("[P.name][stars(P.info)][P.stamps]", "window=[P.name]") - onclose(usr, "[P.name]") - else - usr << browse("[P.name][P.info][P.stamps]", "window=[P.name]") - onclose(usr, "[P.name]") + P.examine() //Update everything attack_self(usr) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 37d8a65ba14..1e4cda20560 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -39,7 +39,7 @@ spawn(2) update_icon() updateinfolinks() - return + /obj/item/weapon/paper/update_icon() if(info) @@ -50,11 +50,10 @@ /obj/item/weapon/paper/examine() set src in oview(1) -// ..() //We don't want them to see the dumb "this is a paper" thing every time. -// I didn't like the idea that people can read tiny pieces of paper from across the room. -// Now you need to be next to the paper in order to read it. + if(is_blind(usr)) + return if(in_range(usr, src)) - if(!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/dead/observer) || istype(usr, /mob/living/silicon))) + if( !(ishuman(usr) || isobserver(usr) || issilicon(usr)) ) usr << browse("[name][stars(info)][stamps]", "window=[name]") onclose(usr, "[name]") else @@ -62,7 +61,7 @@ onclose(usr, "[name]") else usr << "It is too far away." - return + /obj/item/weapon/paper/verb/rename() set name = "Rename paper" @@ -76,7 +75,7 @@ if((loc == usr && usr.stat == 0)) name = "paper[(n_name ? text("- '[n_name]'") : null)]" add_fingerprint(usr) - return + /obj/item/weapon/paper/attack_self(mob/living/user as mob) examine() @@ -86,7 +85,7 @@ playsound(loc, 'sound/items/bikehorn.ogg', 50, 1) spawn(20) spam_flag = 0 - return + /obj/item/weapon/paper/attack_ai(var/mob/living/silicon/ai/user as mob) var/dist @@ -100,7 +99,7 @@ else usr << browse("[name][stars(info)][stamps]", "window=[name]") onclose(usr, "[name]") - return + /obj/item/weapon/paper/proc/addtofield(var/id, var/text, var/links = 0) var/locid = 0 @@ -139,6 +138,7 @@ info = before + text + after updateinfolinks() + /obj/item/weapon/paper/proc/updateinfolinks() info_links = info var/i = 0 @@ -263,6 +263,10 @@ /obj/item/weapon/paper/attackby(obj/item/weapon/P as obj, mob/user as mob) ..() + + if(is_blind(user)) + return + var/clown = 0 if(user.mind && (user.mind.assigned_role == "Clown")) clown = 1 diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index a8d5bea0c89..ad88fa3940b 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -43,6 +43,8 @@ /obj/item/weapon/photo/examine() set src in oview(1) + if(is_blind(usr)) + return if(in_range(usr, src)) show(usr) usr << desc diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index c7141e741d8..fe44c984d4a 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -67,7 +67,7 @@ loaded += AC num_loaded++ if(num_loaded) - user << "\blue You load [num_loaded] shell\s into the gun!" + user << "You load [num_loaded] shell\s into the gun!" A.update_icon() update_icon() return diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index b2c815f8e03..ef040cd8bdf 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -102,7 +102,8 @@ return if(istype(target, /obj/structure/table) || istype(target, /obj/structure/rack) \ || istype(target, /obj/item/smallDelivery) || istype(target,/obj/structure/bigDelivery) \ - || istype(target, /obj/item/weapon/gift) || istype(target, /obj/item/weapon/evidencebag)) + || istype(target, /obj/item/weapon/gift) || istype(target, /obj/item/weapon/evidencebag) \ + || istype(target, /obj/structure/closet/body_bag)) return if(target.anchored) return