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
This commit is contained in:
petethegoat@gmail.com
2013-01-27 13:20:59 +00:00
parent 03760c9dcf
commit 3c02e14efd
12 changed files with 92 additions and 76 deletions
+5 -6
View File
@@ -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)
+7 -1
View File
@@ -142,7 +142,11 @@
else
user << "<span class='notice'>The pages of [title] have been cut out!</span>"
return
if(src.dat)
if(is_blind(user))
return
if(dat)
user << browse("<TT><I>Penned by [author].</I></TT> <BR>" + "[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 << "<span class='notice'>There's already something in [title]!</span>"
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
+8 -1
View File
@@ -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"
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
+3
View File
@@ -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)
+1 -6
View File
@@ -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("<HTML><HEAD><TITLE>[P.name]</TITLE></HEAD><BODY>[stars(P.info)][P.stamps]</BODY></HTML>", "window=[P.name]")
onclose(usr, "[P.name]")
else
usr << browse("<HTML><HEAD><TITLE>[P.name]</TITLE></HEAD><BODY>[P.info][P.stamps]</BODY></HTML>", "window=[P.name]")
onclose(usr, "[P.name]")
P.examine()
if(href_list["top"])
var/obj/item/P = locate(href_list["top"])
+1 -6
View File
@@ -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("<HTML><HEAD><TITLE>[P.name]</TITLE></HEAD><BODY>[stars(P.info)][P.stamps]</BODY></HTML>", "window=[P.name]")
onclose(usr, "[P.name]")
else
usr << browse("<HTML><HEAD><TITLE>[P.name]</TITLE></HEAD><BODY>[P.info][P.stamps]</BODY></HTML>", "window=[P.name]")
onclose(usr, "[P.name]")
P.examine()
//Update everything
attack_self(usr)
+13 -9
View File
@@ -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("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[stars(info)][stamps]</BODY></HTML>", "window=[name]")
onclose(usr, "[name]")
else
@@ -62,7 +61,7 @@
onclose(usr, "[name]")
else
usr << "<span class='notice'>It is too far away.</span>"
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("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[stars(info)][stamps]</BODY></HTML>", "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
+2
View File
@@ -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
+1 -1
View File
@@ -67,7 +67,7 @@
loaded += AC
num_loaded++
if(num_loaded)
user << "\blue You load [num_loaded] shell\s into the gun!"
user << "<span class='notice'>You load [num_loaded] shell\s into the gun!</span>"
A.update_icon()
update_icon()
return
+2 -1
View File
@@ -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