Numerous fixes.

This commit is contained in:
SkyMarshal
2011-12-25 10:57:23 -07:00
parent 9becacf956
commit dd8deae835
13 changed files with 339 additions and 37 deletions
+2 -1
View File
@@ -83,6 +83,7 @@
icon_on = "plight1"
icon_off = "plight0"
brightness_on = 3
w_class = 1
@@ -90,7 +91,7 @@
if(!ismob(M))
return
user << "\red You stab [M] with the pen."
M << "\red You feel a tiny prick!"
// M << "\red You feel a tiny prick!"
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been stabbed with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to stab [M.name] ([M.ckey])</font>")
..()
+110 -20
View File
@@ -1,5 +1,5 @@
/obj/item/device/taperecorder
desc = "A device that can record up to a minute of dialogue and play it back. It automatically translates the content in playback."
desc = "A device that can record up to an hour of dialogue and play it back. It automatically translates the content in playback."
name = "universal recorder"
icon_state = "taperecorderidle"
item_state = "analyzer"
@@ -10,7 +10,9 @@
var/recording = 0.0
var/playing = 0.0
var/timerecorded = 0.0
var/playsleepseconds = 0.0
var/list/storedinfo = new/list()
var/list/timestamp = new/list()
flags = FPRINT | TABLEPASS| CONDUCT
throwforce = 2
throw_speed = 4
@@ -19,19 +21,20 @@
/obj/item/device/taperecorder/hear_talk(mob/M as mob, msg)
if (recording)
var/ending = copytext(msg, length(msg))
src.timestamp+= src.timerecorded
if (M.stuttering)
src.storedinfo += "[M.name] stammers, \"[msg]\""
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] stammers, \"[msg]\""
return
if (M.getBrainLoss() >= 60)
src.storedinfo += "[M.name] gibbers, \"[msg]\""
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] gibbers, \"[msg]\""
return
if (ending == "?")
src.storedinfo += "[M.name] asks, \"[msg]\""
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] asks, \"[msg]\""
return
else if (ending == "!")
src.storedinfo += "[M.name] exclaims, \"[msg]\""
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] exclaims, \"[msg]\""
return
src.storedinfo += "[M.name] says, \"[msg]\""
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] says, \"[msg]\""
return
/obj/item/device/taperecorder/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -60,15 +63,18 @@
set name = "Start Recording"
set category = "Object"
if(usr.stat)
usr << "Not when you're incapicated."
usr << "Not when you're incapacitated."
return
if(src.emagged == 1)
usr << "\red The tape recorder makes a scratchy noise."
return
src.icon_state = "taperecorderrecording"
if(src.timerecorded < 60 && src.playing == 0)
if(src.timerecorded < 3600 && src.playing == 0)
usr << "\blue Recording started."
src.recording = 1
for(src.timerecorded, src.timerecorded<60)
src.timestamp+= src.timerecorded
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] Recording started."
for(src.timerecorded, src.timerecorded<3600)
if(src.recording == 0)
break
src.timerecorded++
@@ -80,17 +86,25 @@
usr << "\red Either your tape recorder's memory is full, or it is currently playing back its memory."
/obj/item/device/taperecorder/verb/stop_recording()
set name = "Stop Recording"
/obj/item/device/taperecorder/verb/stop()
set name = "Stop"
set category = "Object"
if(usr.stat)
usr << "Not when you're incapicated."
usr << "Not when you're incapacitated."
return
if (src.recording == 1 || src.playing == 1)
if (src.recording == 1)
src.recording = 0
src.timestamp+= src.timerecorded
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] Recording stopped."
usr << "\blue Recording stopped."
src.icon_state = "taperecorderidle"
return
else if (src.playing == 1)
src.playing = 0
usr << "\blue Stopped."
var/turf/T = get_turf(src)
for(var/mob/O in hearers(world.view-1, T))
O.show_message("<font color=Maroon><B>Tape Recorder</B>: Playback stopped.</font>",2)
src.icon_state = "taperecorderidle"
return
else
@@ -113,6 +127,7 @@
return
else
src.storedinfo -= src.storedinfo
src.timestamp -= src.timestamp
src.timerecorded = 0
usr << "\blue Memory cleared."
return
@@ -133,20 +148,32 @@
return
src.playing = 1
src.icon_state = "taperecorderplaying"
for(var/i=1,src.timerecorded<60,sleep(10 * (src.timerecorded/src.storedinfo.len)))
usr << "\blue Playing started."
for(var/i=1,src.timerecorded<3600,sleep(10 * (src.playsleepseconds) ))
if (src.playing == 0)
break
if (src.storedinfo.len < i)
break
var/turf/T = get_turf(src)
for(var/mob/O in hearers(world.view-1, T))
O.show_message("\green <B>Tape Recorder</B>: \"[src.storedinfo[i]]\"",2)
O.show_message("<font color=Maroon><B>Tape Recorder</B>: [src.storedinfo[i]]</font>",2)
if (src.storedinfo.len < i+1)
src.playsleepseconds = 1
sleep(10)
T = get_turf(src)
for(var/mob/O in hearers(world.view-1, T))
O.show_message("<font color=Maroon><B>Tape Recorder</B>: End of recording.</font>",2)
else
src.playsleepseconds = src.timestamp[i+1] - src.timestamp[i]
if (src.playsleepseconds > 19)
sleep(10)
T = get_turf(src)
for(var/mob/O in hearers(world.view-1, T))
O.show_message("<font color=Maroon><B>Tape Recorder</B>: Skipping [src.playsleepseconds] seconds of silence</font>",2)
src.playsleepseconds = 1
i++
src.icon_state = "taperecorderidle"
src.playing = 0
var/turf/T = get_turf(src)
for(var/mob/O in hearers(world.view-1, T))
O.show_message("Tape Recorder: End playback.",2)
if (src.emagged == 1.0)
for(var/mob/O in hearers(world.view-1, get_turf(src)))
O.show_message("Tape Recorder: This tape recorder will self destruct in <B>5</B>",2)
@@ -163,4 +190,67 @@
for(var/mob/O in hearers(world.view-1, get_turf(src)))
O.show_message("<B>1</B>",2)
sleep(10)
src.explode()
src.explode()
/obj/item/device/taperecorder/verb/print_transcript()
set name = "Print Transcript"
set category = "Object"
if (src.recording == 1 || src.playing == 1)
usr << "\red You can't print the transcript while playing or recording!"
return
usr << "\blue Transcript printed."
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(get_turf(src))
var/t1 = "<B>Transcript:</B><BR><BR>"
for(var/i=1,src.storedinfo.len >= i,i++)
t1 += "[src.storedinfo[i]]<BR>"
P.info = t1
P.name = "paper- 'Transcript'"
/obj/item/device/taperecorder/attack_self(mob/user)
if(src.recording == 0 && src.playing == 0)
if(usr.stat)
usr << "Not when you're incapacitated."
return
if(src.emagged == 1)
usr << "\red The tape recorder makes a scratchy noise."
return
src.icon_state = "taperecorderrecording"
if(src.timerecorded < 3600 && src.playing == 0)
usr << "\blue Recording started."
src.recording = 1
src.timestamp+= src.timerecorded
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] Recording started."
for(src.timerecorded, src.timerecorded<3600)
if(src.recording == 0)
break
src.timerecorded++
sleep(10)
src.recording = 0
src.icon_state = "taperecorderidle"
return
else
usr << "\red Either your tape recorder's memory is full, or it is currently playing back its memory."
else
if(usr.stat)
usr << "Not when you're incapacitated."
return
if (src.recording == 1)
src.recording = 0
src.timestamp+= src.timerecorded
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] Recording stopped."
usr << "\blue Recording stopped."
src.icon_state = "taperecorderidle"
return
else if (src.playing == 1)
src.playing = 0
var/turf/T = get_turf(src)
for(var/mob/O in hearers(world.view-1, T))
O.show_message("<font color=Maroon><B>Tape Recorder</B>: Playback stopped.</font>",2)
src.icon_state = "taperecorderidle"
return
else
usr << "\red Stop what?"
return