mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 12:05:59 +01:00
Adds checks for the wires being intact to tape recorders, and readds the print transcript function.
This commit is contained in:
@@ -30,4 +30,11 @@ var/const/WIRE_RECORD = 2
|
||||
if(T.recording)
|
||||
T.stop()
|
||||
else
|
||||
T.record()
|
||||
T.record()
|
||||
|
||||
//helpers
|
||||
/datum/wires/taperecorder/proc/get_play()
|
||||
return !(wires_status & WIRE_PLAY)
|
||||
|
||||
/datum/wires/taperecorder/proc/get_record()
|
||||
return !(wires_status & WIRE_RECORD)
|
||||
@@ -15,6 +15,7 @@
|
||||
var/obj/item/device/tape/mytape
|
||||
var/open_panel = 0
|
||||
var/datum/wires/taperecorder/wires = null
|
||||
var/canprint = 1
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/New()
|
||||
@@ -119,6 +120,8 @@
|
||||
return
|
||||
if(playing)
|
||||
return
|
||||
if(!wires.get_record())
|
||||
return
|
||||
|
||||
if(mytape.used_capacity < mytape.max_capacity)
|
||||
usr << "<span class='notice'>Recording started.</span>"
|
||||
@@ -131,6 +134,8 @@
|
||||
for(used, used < max)
|
||||
if(recording == 0)
|
||||
break
|
||||
if(!wires.get_record())
|
||||
break
|
||||
mytape.used_capacity++
|
||||
used++
|
||||
sleep(10)
|
||||
@@ -172,6 +177,8 @@
|
||||
return
|
||||
if(playing)
|
||||
return
|
||||
if(!wires.get_play())
|
||||
return
|
||||
|
||||
playing = 1
|
||||
update_icon()
|
||||
@@ -181,6 +188,8 @@
|
||||
for(var/i = 1, used < max, sleep(10 * playsleepseconds))
|
||||
if(!mytape)
|
||||
break
|
||||
if(!wires.get_play())
|
||||
break
|
||||
if(playing == 0)
|
||||
break
|
||||
if(mytape.storedinfo.len < i)
|
||||
@@ -214,6 +223,33 @@
|
||||
record()
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/verb/print_transcript()
|
||||
set name = "Print Transcript"
|
||||
set category = "Object"
|
||||
|
||||
if(usr.stat)
|
||||
return
|
||||
if(!mytape)
|
||||
return
|
||||
if(!canprint)
|
||||
usr << "<span class='notice'>The recorder can't print that fast!</span>"
|
||||
return
|
||||
if(recording || playing)
|
||||
return
|
||||
|
||||
usr << "<span class='notice'>Transcript printed.</span>"
|
||||
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, mytape.storedinfo.len >= i, i++)
|
||||
t1 += "[mytape.storedinfo[i]]<BR>"
|
||||
P.info = t1
|
||||
P.name = "paper- 'Transcript'"
|
||||
usr.put_in_hands(P)
|
||||
canprint = 0
|
||||
sleep(300)
|
||||
canprint = 1
|
||||
|
||||
|
||||
//empty tape recorders
|
||||
/obj/item/device/taperecorder/empty/New()
|
||||
wires = new(src)
|
||||
@@ -264,16 +300,4 @@
|
||||
|
||||
//Random colour tapes
|
||||
/obj/item/device/tape/random/New()
|
||||
icon_state = "tape_[pick("white", "blue", "red", "yellow", "purple")]"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
/obj/item/device/taperecorder/proc/print_transcript()
|
||||
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,storedinfo.len >= i,i++)
|
||||
t1 += "[storedinfo[i]]<BR>"
|
||||
P.info = t1
|
||||
P.name = "paper- 'Transcript'"
|
||||
*/
|
||||
icon_state = "tape_[pick("white", "blue", "red", "yellow", "purple")]"
|
||||
Reference in New Issue
Block a user