mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Committing this for ravingmaniac
New universal recorder: - Timestamps each line of dialogue - Skips pauses longer than 20 seconds during playback - Able to print out transcript Sample image: http://i.imgur.com/qIJmW.png git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2716 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -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,15 +86,21 @@
|
||||
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 Stopped."
|
||||
src.icon_state = "taperecorderidle"
|
||||
return
|
||||
else if (src.playing == 1)
|
||||
src.playing = 0
|
||||
usr << "\blue Stopped."
|
||||
src.icon_state = "taperecorderidle"
|
||||
@@ -133,20 +145,30 @@
|
||||
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("\green <B>Tape Recorder</B>: [src.storedinfo[i]]",2)
|
||||
if (src.storedinfo.len < i+1)
|
||||
src.playsleepseconds = 1
|
||||
else
|
||||
src.playsleepseconds = src.timestamp[i+1] - src.timestamp[i]
|
||||
if (src.playsleepseconds > 19)
|
||||
sleep(10)
|
||||
for(var/mob/O in hearers(world.view-1, T))
|
||||
O.show_message("\green <B>Tape Recorder</B>: Skipping [src.playsleepseconds] seconds of silence",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)
|
||||
O.show_message("\green <B>Tape Recorder</B>: End of recording.",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 +185,20 @@
|
||||
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'"
|
||||
Reference in New Issue
Block a user