Fixed hearing in lockers (and pipes, i-cards, etc).

Added verb Ghost Ears. Dead people and observers can now select if they do not want to hear every word said on the world.
Fixed electronic blink toy sprite.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1243 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
rastaf.zero@gmail.com
2011-03-23 09:56:01 +00:00
parent 2c5e101075
commit a05dad6397
5 changed files with 55 additions and 26 deletions

View File

@@ -7,7 +7,7 @@
obj/item/toy/blink
name = "electronic blink toy game"
desc = "Blink. Blink. Blink. Ages 8 and up."
icon = 'device.dmi'
icon = 'radio.dmi'
icon_state = "beacon"
item_state = "signaler"

View File

@@ -65,15 +65,6 @@
else
return
/obj/proc/hear_talk(mob/M as mob, text)
/*
var/mob/mo = locate(/mob) in src
if(mo)
var/rendered = "<span class='game say'><span class='name'>[M.name]: </span> <span class='message'>[text]</span></span>"
mo.show_message(rendered, 2)
*/
return
/proc/is_type_in_list(var/atom/A, var/list/L)
for(var/type in L)
if(isnull(type))

View File

@@ -23,3 +23,19 @@
if(istype(M) && M.client && M.machine == src)
src.attack_self(M)
/obj/proc/alter_health()
return 1
/obj/proc/hide(h)
return
/obj/proc/hear_talk(mob/M as mob, text)
/*
var/mob/mo = locate(/mob) in src
if(mo)
var/rendered = "<span class='game say'><span class='name'>[M.name]: </span> <span class='message'>[text]</span></span>"
mo.show_message(rendered, 2)
*/
return

View File

@@ -210,12 +210,8 @@
italics = 1
/////SPECIAL HEADSETS END
for (var/obj/O in view(message_range, src))
spawn (0)
if (O)
O.hear_talk(src, message)
var/list/listening
/*
if(istype(src.loc, /obj/item/device/aicard)) // -- TLE
var/obj/O = src.loc
if(istype(O.loc, /mob))
@@ -226,8 +222,33 @@
else
listening = hearers(message_range, src)
listening -= src
listening += src
for (var/obj/O in view(message_range, src))
for (var/mob/M in O)
listening += M // maybe need to check if M can hear src
spawn (0)
if (O)
O.hear_talk(src, message)
if (!(src in listening))
listening += src
*/
var/turf/T = get_turf(src)
listening = hearers(message_range, T)
var/list/V = view(message_range, T)
//find mobs in lockers, cryo and intellycards
for (var/mob/M in world)
if (isturf(M.loc))
continue //if M can hear us it is already was found by hearers()
if (!M.client)
continue //skip monkeys and leavers
if (get_turf(M) in V) //this slow, but I don't think we'd have a lot of wardrobewhores every round --rastaf0
listening+=M
for (var/obj/O in V)
spawn (0)
if (O)
O.hear_talk(src, message)
var/list/heard_a = list() // understood us
var/list/heard_b = list() // didn't understand us
@@ -252,14 +273,14 @@
for (var/mob/M in heard_a)
M.show_message(rendered, 2)
/*
for(var/obj/O in M) // This is terribly costly for such a unique circumstance, should probably do this a different way in the future -- TLE
if(istype(O, /obj/item/device/aicard))
for(var/mob/M2 in O)
M2.show_message(rendered, 2)
break
break
*/
if (length(heard_b))
var/message_b
@@ -289,7 +310,7 @@
for (var/mob/M in world)
if (istype(M, /mob/new_player))
continue
if (M.stat >= 2 && !(M in heard_a))
if (M.stat >= 2 && !(M in heard_a) && M.ghost_ears)
M.show_message(rendered, 2)
log_say("[src.name]/[src.key] : [message]")

View File

@@ -269,15 +269,9 @@
return 1
return 0
/obj/proc/alter_health()
return 1
/atom/proc/relaymove()
return
/obj/proc/hide(h)
return
/obj/item/weapon/grab/proc/throw()
if(src.affecting)
var/grabee = src.affecting
@@ -1365,6 +1359,13 @@
src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.bruteloss
src << "\blue You have given up life and succumbed to death."
/mob/var/ghost_ears = 1
/mob/verb/toggle_ghost_ears()
set name = "Ghost ears"
set category = "OOC"
set desc = "Hear talks from everywhere"
src.ghost_ears = !src.ghost_ears
/mob/verb/observe()
set name = "Observe"
set category = "OOC"