mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-08-24 20:46:29 +01:00
Polaris December Sync
This commit is contained in:
@@ -0,0 +1,157 @@
|
||||
//The case the paddles are kept in.
|
||||
/obj/item/device/defib_kit
|
||||
name = "defibrillator kit"
|
||||
desc = "This KHI-branded defib kit is a semi-automated model. Remove pads, slap on chest, wait."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "defib_kit"
|
||||
w_class = ITEMSIZE_LARGE
|
||||
|
||||
var/state //0 off, 1 open, 2 working, 3 dead
|
||||
var/uses = 2 //Calculates initial uses based on starting cell size
|
||||
var/chance = 75 //Percent chance of working
|
||||
var/charge_cost //Set in New() based on uses
|
||||
var/obj/item/weapon/cell/cell //The size is mostly irrelevant, see 'uses'
|
||||
var/mob/living/carbon/human/patient //The person the paddles are on
|
||||
|
||||
/obj/item/device/defib_kit/New()
|
||||
..()
|
||||
//Create cell and determine uses (futureproofing against cell size changes)
|
||||
cell = new(src)
|
||||
charge_cost = cell.maxcharge / uses
|
||||
statechange(0)
|
||||
|
||||
/obj/item/device/defib_kit/attack_self(mob/user as mob)
|
||||
..()
|
||||
if(patient)
|
||||
patient = null
|
||||
user.visible_message("<span class='notice'>[user] returns the pads to \the [src] and closes it.</span>",
|
||||
"<span class='notice'>You return the pads to \the [src] and close it.</span>")
|
||||
statechange(0)
|
||||
|
||||
/obj/item/device/defib_kit/MouseDrop(var/mob/living/carbon/human/onto)
|
||||
if(istype(onto) && Adjacent(usr) && !usr.restrained() && !usr.stat)
|
||||
var/mob/living/carbon/human/user = usr
|
||||
//<--Feel free to code clothing checks right here
|
||||
user.visible_message("<span class='warning'>[user] begins applying defib pads to [onto].</span>",
|
||||
"<span class='warning'>You begin applying defib pads to [onto].</span>")
|
||||
if(do_after(user, 100, onto))
|
||||
patient = onto
|
||||
statechange(1,patient)
|
||||
user.visible_message("<span class='warning'>[user] applies defib pads to [onto].</span>",
|
||||
"<span class='warning'>You finish applying defib pads to [onto].</span>")
|
||||
|
||||
/obj/item/device/defib_kit/attackby(var/obj/item/A as obj, mob/living/user as mob)
|
||||
..()
|
||||
|
||||
if(!cell && istype(A,/obj/item/weapon/cell))
|
||||
if(!user.unEquip(A)) return
|
||||
to_chat(user,"You jack \the [A] into \the [src]'s battery mount.")
|
||||
A.forceMove(src)
|
||||
src.cell = A
|
||||
|
||||
else if(istype(A,/obj/item/weapon/screwdriver))
|
||||
if(cell)
|
||||
to_chat(user,"<span class='notice'>You remove \the [cell] from \the [src].</span>")
|
||||
if(user.r_hand && user.l_hand)
|
||||
cell.forceMove(get_turf(user))
|
||||
else
|
||||
cell.forceMove(user.put_in_hands(cell))
|
||||
cell = null
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
else
|
||||
to_chat(user,"<span class='warning'>The power source has already been removed!</span>")
|
||||
|
||||
/obj/item/device/defib_kit/proc/statechange(var/new_state, var/pat)
|
||||
if(state == new_state) return //Let's just save ourselves some time
|
||||
state = new_state
|
||||
icon_state = "[initial(icon_state)][state]"
|
||||
var/turf/T = get_turf(src)
|
||||
var/state_words = ""
|
||||
switch(state)
|
||||
if(0)
|
||||
state_words = "It is currently closed."
|
||||
processing_objects -= src
|
||||
if(1)
|
||||
state_words = "A green light is lit; it has charge."
|
||||
processing_objects |= src
|
||||
if(2)
|
||||
state_words = "A yellow light is flashing: it's in the process of reviving a patient."
|
||||
T.visible_message("<span class='notice'>A yellow light starts flashing on \the [src].</span>")
|
||||
playsound(T, 'sound/machines/chime.ogg', 50, 0)
|
||||
if(3)
|
||||
state_words = "A red light is flashing: the battery needs to be recharged."
|
||||
T.visible_message("<span class='warning'>A red light starts flashing on \the [src].</span>")
|
||||
playsound(T, 'sound/machines/buzz-sigh.ogg', 50, 0)
|
||||
|
||||
desc = "[initial(desc)] [state_words][pat ? " The pads are attached to [pat]." : ""]"
|
||||
update_icon()
|
||||
|
||||
/obj/item/device/defib_kit/process()
|
||||
if(!state) //0 or null
|
||||
statechange(0)
|
||||
processing_objects -= src
|
||||
return
|
||||
|
||||
//Patient moved too far
|
||||
if(patient && !(get_dist(src,patient) <= 1)) //You separated the kit and pads too far
|
||||
audible_message("<span class='warning'>There's a clatter as the defib pads are yanked off of [patient].</span>")
|
||||
statechange(0)
|
||||
patient = null
|
||||
return
|
||||
|
||||
//Battery died
|
||||
if(!cell || cell.charge < charge_cost)
|
||||
statechange(3,patient)
|
||||
return
|
||||
|
||||
//A patient isn't being worked on, but we have one, so start
|
||||
if(patient && patient.stat == DEAD && state != 2)
|
||||
statechange(2)
|
||||
if(attempt_shock()) //Try to shock them, has timer and such
|
||||
patient.visible_message("<span class='warning'>[patient] convulses!</span>")
|
||||
playsound(src.loc, 'sound/effects/sparks2.ogg', 75, 1)
|
||||
//Actual rezzing code
|
||||
if(prob(chance) && ((world.time - patient.timeofdeath) < (10 MINUTES))) //Can only revive within a few minutes
|
||||
if(!patient.client && patient.mind) //Don't force the dead person to come back if they don't want to.
|
||||
for(var/mob/observer/dead/ghost in player_list)
|
||||
if(ghost.mind == patient.mind)
|
||||
to_chat(ghost, "<b><font color = #330033><font size = 3>Someone is trying to \
|
||||
revive you. Return to your body if you want to be revived!</b> \
|
||||
(Verbs -> Ghost -> Re-enter corpse). You have 15 seconds to do this!</font></font>")
|
||||
sleep(15 SECONDS)
|
||||
break
|
||||
|
||||
if(patient.client)
|
||||
patient.adjustOxyLoss(-20) //Look, blood stays oxygenated for quite some time, but I'm not recoding the entire oxy system
|
||||
patient.stat = CONSCIOUS //Note that if whatever killed them in the first place wasn't fixed, they're likely to die again.
|
||||
dead_mob_list -= patient
|
||||
living_mob_list += patient
|
||||
patient.timeofdeath = null
|
||||
patient.visible_message("<span class='notice'>[patient]'s eyes open!</span>")
|
||||
log_and_message_admins("[patient] was revived.")
|
||||
cell.charge -= charge_cost //Always charge the cost after any attempt, failed or not
|
||||
sleep(20) //Wait 2 seconds before next attempt
|
||||
statechange(1,patient) //Back to ready
|
||||
|
||||
/obj/item/device/defib_kit/proc/attempt_shock()
|
||||
if(!patient || cell.charge < charge_cost)
|
||||
return
|
||||
|
||||
var/zap_time = world.time + (7 SECONDS)
|
||||
var/o_patient_loc = patient.loc
|
||||
. = 1
|
||||
|
||||
while(world.time < zap_time) //This is basically a custom do_after() call
|
||||
sleep(1)
|
||||
|
||||
//Failed: We lost something important
|
||||
if(!patient || !cell || cell.charge < charge_cost)
|
||||
. = 0
|
||||
break
|
||||
|
||||
//Failed: The locations aren't right
|
||||
if((o_patient_loc != patient.loc) || !(get_dist(src,patient) <= 1))
|
||||
. = 0
|
||||
break
|
||||
|
||||
return
|
||||
@@ -274,6 +274,8 @@ var/global/list/default_medbay_channels = list(
|
||||
// Fix for permacell radios, but kinda eh about actually fixing them.
|
||||
if(!M || !message) return 0
|
||||
|
||||
if(speaking && (speaking.flags & (SIGNLANG|NONVERBAL))) return 0
|
||||
|
||||
if(istype(M)) M.trigger_aiming(TARGET_CAN_RADIO)
|
||||
|
||||
// Uncommenting this. To the above comment:
|
||||
|
||||
@@ -69,7 +69,7 @@ REAGENT SCANNER
|
||||
user.show_message("<span class='notice'>Analyzing Results for [M]:</span>")
|
||||
user.show_message("<span class='notice'>Overall Status: dead</span>")
|
||||
else
|
||||
user.show_message("<span class='notice'>Analyzing Results for [M]:\n\t Overall Status: [M.stat > 1 ? "dead" : "[round(M.health/M.maxHealth)*100]% healthy"]</span>")
|
||||
user.show_message("<span class='notice'>Analyzing Results for [M]:\n\t Overall Status: [M.stat > 1 ? "dead" : "[round((M.health/M.maxHealth)*100) ]% healthy"]</span>")
|
||||
user.show_message("<span class='notice'> Key: <font color='blue'>Suffocation</font>/<font color='green'>Toxin</font>/<font color='#FFA500'>Burns</font>/<font color='red'>Brute</font></span>", 1)
|
||||
user.show_message("<span class='notice'> Damage Specifics: <font color='blue'>[OX]</font> - <font color='green'>[TX]</font> - <font color='#FFA500'>[BU]</font> - <font color='red'>[BR]</font></span>")
|
||||
user.show_message("<span class='notice'>Body Temperature: [M.bodytemperature-T0C]°C ([M.bodytemperature*1.8-459.67]°F)</span>", 1)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/obj/item/device/taperecorder
|
||||
name = "universal recorder"
|
||||
desc = "A device that can record up to an hour of dialogue and play it back. It automatically translates the content in playback."
|
||||
icon_state = "taperecorderidle"
|
||||
desc = "A device that can record to cassette tapes, and play them. It automatically translates the content in playback."
|
||||
icon_state = "taperecorder_empty"
|
||||
item_state = "analyzer"
|
||||
w_class = ITEMSIZE_SMALL
|
||||
|
||||
@@ -10,33 +10,100 @@
|
||||
var/emagged = 0.0
|
||||
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()
|
||||
var/obj/item/device/tape/mytape = /obj/item/device/tape/random
|
||||
var/canprint = 1
|
||||
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
throwforce = 2
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
show_messages = 1
|
||||
|
||||
/obj/item/device/taperecorder/New()
|
||||
..()
|
||||
if(ispath(mytape))
|
||||
mytape = new mytape(src)
|
||||
update_icon()
|
||||
listening_objects += src
|
||||
|
||||
/obj/item/device/taperecorder/empty
|
||||
mytape = null
|
||||
|
||||
/obj/item/device/taperecorder/Destroy()
|
||||
listening_objects -= src
|
||||
if(mytape)
|
||||
qdel(mytape)
|
||||
mytape = null
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/device/tape))
|
||||
if(mytape)
|
||||
to_chat(user, "<span class='notice'>There's already a tape inside.</span>")
|
||||
return
|
||||
if(!user.unEquip(I))
|
||||
return
|
||||
I.forceMove(src)
|
||||
mytape = I
|
||||
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
|
||||
update_icon()
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/fire_act()
|
||||
if(mytape)
|
||||
mytape.ruin() //Fires destroy the tape
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/attack_hand(mob/user)
|
||||
if(user.get_inactive_hand() == src)
|
||||
if(mytape)
|
||||
eject()
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/verb/eject()
|
||||
set name = "Eject Tape"
|
||||
set category = "Object"
|
||||
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
if(!mytape)
|
||||
to_chat(usr, "<span class='notice'>There's no tape in \the [src].</span>")
|
||||
return
|
||||
if(emagged)
|
||||
to_chat(usr, "<span class='notice'>The tape seems to be stuck inside.</span>")
|
||||
return
|
||||
|
||||
if(playing || recording)
|
||||
stop()
|
||||
to_chat(usr, "<span class='notice'>You remove [mytape] from [src].</span>")
|
||||
usr.put_in_hands(mytape)
|
||||
mytape = null
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/hear_talk(mob/living/M as mob, msg, var/verb="says", datum/language/speaking=null)
|
||||
if(recording)
|
||||
timestamp += timerecorded
|
||||
if(mytape && recording)
|
||||
|
||||
if(speaking)
|
||||
storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] [speaking.format_message_plain(msg, verb)]"
|
||||
if(!speaking.machine_understands)
|
||||
msg = speaking.scramble(msg)
|
||||
mytape.record_speech("[M.name] [speaking.format_message_plain(msg, verb)]")
|
||||
else
|
||||
storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] [verb], \"[msg]\""
|
||||
mytape.record_speech("[M.name] [verb], \"[msg]\"")
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/see_emote(mob/M as mob, text, var/emote_type)
|
||||
if(emote_type != 2) //only hearable emotes
|
||||
return
|
||||
if(recording)
|
||||
timestamp += timerecorded
|
||||
storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [strip_html_properly(text)]"
|
||||
if(mytape && recording)
|
||||
mytape.record_speech("[strip_html_properly(text)]")
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/show_message(msg, type, alt, alt_type)
|
||||
var/recordedtext
|
||||
@@ -46,25 +113,24 @@
|
||||
recordedtext = alt
|
||||
else
|
||||
return
|
||||
if(recording)
|
||||
timestamp += timerecorded
|
||||
storedinfo += "*\[[time2text(timerecorded*10,"mm:ss")]\] *[strip_html_properly(recordedtext)]*" //"*" at front as a marker
|
||||
if(mytape && recording)
|
||||
mytape.record_noise("[strip_html_properly(recordedtext)]")
|
||||
|
||||
/obj/item/device/taperecorder/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(emagged == 0)
|
||||
emagged = 1
|
||||
recording = 0
|
||||
user << "<span class='warning'>PZZTTPFFFT</span>"
|
||||
icon_state = "taperecorderidle"
|
||||
to_chat(user, "<span class='warning'>PZZTTPFFFT</span>")
|
||||
update_icon()
|
||||
return 1
|
||||
else
|
||||
user << "<span class='warning'>It is already emagged!</span>"
|
||||
to_chat(user, "<span class='warning'>It is already emagged!</span>")
|
||||
|
||||
/obj/item/device/taperecorder/proc/explode()
|
||||
var/turf/T = get_turf(loc)
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
M << "<span class='danger'>\The [src] explodes!</span>"
|
||||
to_chat(M, "<span class='danger'>\The [src] explodes!</span>")
|
||||
if(T)
|
||||
T.hotspot_expose(700,125)
|
||||
explosion(T, -1, -1, 0, 4)
|
||||
@@ -75,117 +141,152 @@
|
||||
set name = "Start Recording"
|
||||
set category = "Object"
|
||||
|
||||
if(usr.stat)
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
if(emagged == 1)
|
||||
usr << "<span class='warning'>The tape recorder makes a scratchy noise.</span>"
|
||||
if(!mytape)
|
||||
to_chat(usr, "<span class='notice'>There's no tape!</span>")
|
||||
return
|
||||
icon_state = "taperecorderrecording"
|
||||
if(timerecorded < 3600 && playing == 0)
|
||||
usr << "<span class='notice'>Recording started.</span>"
|
||||
if(mytape.ruined)
|
||||
to_chat(usr, "<span class='warning'>The tape recorder makes a scratchy noise.</span>")
|
||||
return
|
||||
if(recording)
|
||||
to_chat(usr, "<span class='notice'>You're already recording!</span>")
|
||||
return
|
||||
if(playing)
|
||||
to_chat(usr, "<span class='notice'>You can't record when playing!</span>")
|
||||
return
|
||||
if(emagged)
|
||||
to_chat(usr, "<span class='warning'>The tape recorder makes a scratchy noise.</span>")
|
||||
return
|
||||
if(mytape.used_capacity < mytape.max_capacity)
|
||||
to_chat(usr, "<span class='notice'>Recording started.</span>")
|
||||
recording = 1
|
||||
timestamp+= timerecorded
|
||||
storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] Recording started."
|
||||
for(timerecorded, timerecorded<3600)
|
||||
if(recording == 0)
|
||||
break
|
||||
timerecorded++
|
||||
update_icon()
|
||||
|
||||
mytape.record_speech("Recording started.")
|
||||
|
||||
//count seconds until full, or recording is stopped
|
||||
while(mytape && recording && mytape.used_capacity < mytape.max_capacity)
|
||||
sleep(10)
|
||||
recording = 0
|
||||
icon_state = "taperecorderidle"
|
||||
mytape.used_capacity++
|
||||
if(mytape.used_capacity >= mytape.max_capacity)
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
to_chat(M, "<span class='notice'>The tape is full.</span>")
|
||||
stop_recording()
|
||||
|
||||
|
||||
update_icon()
|
||||
return
|
||||
else
|
||||
usr << "<span class='notice'>Either your tape recorder's memory is full, or it is currently playing back its memory.</span>"
|
||||
to_chat(usr, "<span class='notice'>The tape is full.</span>")
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/proc/stop_recording()
|
||||
//Sanity checks skipped, should not be called unless actually recording
|
||||
recording = 0
|
||||
update_icon()
|
||||
mytape.record_speech("Recording stopped.")
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
to_chat(M, "<span class='notice'>Recording stopped.</span>")
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/verb/stop()
|
||||
set name = "Stop"
|
||||
set category = "Object"
|
||||
|
||||
if(usr.stat)
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
if(emagged == 1)
|
||||
usr << "<span class='warning'>The tape recorder makes a scratchy noise.</span>"
|
||||
if(recording)
|
||||
stop_recording()
|
||||
return
|
||||
if(recording == 1)
|
||||
recording = 0
|
||||
timestamp+= timerecorded
|
||||
storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] Recording stopped."
|
||||
usr << "<span class='notice'>Recording stopped.</span>"
|
||||
icon_state = "taperecorderidle"
|
||||
return
|
||||
else if(playing == 1)
|
||||
else if(playing)
|
||||
playing = 0
|
||||
var/turf/T = get_turf(src)
|
||||
T.audible_message("<font color=Maroon><B>Tape Recorder</B>: Playback stopped.</font>")
|
||||
icon_state = "taperecorderidle"
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/verb/clear_memory()
|
||||
set name = "Clear Memory"
|
||||
set category = "Object"
|
||||
|
||||
if(usr.stat)
|
||||
return
|
||||
if(emagged == 1)
|
||||
usr << "<span class='warning'>The tape recorder makes a scratchy noise.</span>"
|
||||
return
|
||||
if(recording == 1 || playing == 1)
|
||||
usr << "<span class='notice'>You can't clear the memory while playing or recording!</span>"
|
||||
update_icon()
|
||||
to_chat(usr, "<span class='notice'>Playback stopped.</span>")
|
||||
return
|
||||
else
|
||||
if(storedinfo) storedinfo.Cut()
|
||||
if(timestamp) timestamp.Cut()
|
||||
timerecorded = 0
|
||||
usr << "<span class='notice'>Memory cleared.</span>"
|
||||
to_chat(usr, "<span class='notice'>Stop what?</span>")
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/verb/wipe_tape()
|
||||
set name = "Wipe Tape"
|
||||
set category = "Object"
|
||||
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
if(emagged)
|
||||
to_chat(usr, "<span class='warning'>The tape recorder makes a scratchy noise.</span>")
|
||||
return
|
||||
if(mytape.ruined)
|
||||
to_chat(usr, "<span class='warning'>The tape recorder makes a scratchy noise.</span>")
|
||||
return
|
||||
if(recording || playing)
|
||||
to_chat(usr, "<span class='notice'>You can't wipe the tape while playing or recording!</span>")
|
||||
return
|
||||
else
|
||||
if(mytape.storedinfo) mytape.storedinfo.Cut()
|
||||
if(mytape.timestamp) mytape.timestamp.Cut()
|
||||
mytape.used_capacity = 0
|
||||
to_chat(usr, "<span class='notice'>You wipe the tape.</span>")
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/verb/playback_memory()
|
||||
set name = "Playback Memory"
|
||||
set name = "Playback Tape"
|
||||
set category = "Object"
|
||||
|
||||
if(usr.stat)
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
if(emagged == 1)
|
||||
usr << "<span class='warning'>The tape recorder makes a scratchy noise.</span>"
|
||||
if(!mytape)
|
||||
to_chat(usr, "<span class='notice'>There's no tape!</span>")
|
||||
return
|
||||
if(recording == 1)
|
||||
usr << "<span class='notice'>You can't playback when recording!</span>"
|
||||
if(mytape.ruined)
|
||||
to_chat(usr, "<span class='warning'>The tape recorder makes a scratchy noise.</span>")
|
||||
return
|
||||
if(playing == 1)
|
||||
usr << "<span class='notice'>You're already playing!</span>"
|
||||
if(recording)
|
||||
to_chat(usr, "<span class='notice'>You can't playback when recording!</span>")
|
||||
return
|
||||
if(playing)
|
||||
to_chat(usr, "<span class='notice'>You're already playing!</span>")
|
||||
return
|
||||
playing = 1
|
||||
icon_state = "taperecorderplaying"
|
||||
usr << "<span class='notice'>Playing started.</span>"
|
||||
for(var/i=1,timerecorded<3600,sleep(10 * (playsleepseconds) ))
|
||||
if(playing == 0)
|
||||
update_icon()
|
||||
to_chat(usr, "<span class='notice'>Playing started.</span>")
|
||||
for(var/i=1 , i < mytape.max_capacity , i++)
|
||||
if(!mytape || !playing)
|
||||
break
|
||||
if(storedinfo.len < i)
|
||||
if(mytape.storedinfo.len < i)
|
||||
break
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
var/playedmessage = storedinfo[i]
|
||||
var/playedmessage = mytape.storedinfo[i]
|
||||
if (findtextEx(playedmessage,"*",1,2)) //remove marker for action sounds
|
||||
playedmessage = copytext(playedmessage,2)
|
||||
T.audible_message("<font color=Maroon><B>Tape Recorder</B>: [playedmessage]</font>")
|
||||
if(storedinfo.len < i+1)
|
||||
|
||||
if(mytape.storedinfo.len < i+1)
|
||||
playsleepseconds = 1
|
||||
sleep(10)
|
||||
T = get_turf(src)
|
||||
T.audible_message("<font color=Maroon><B>Tape Recorder</B>: End of recording.</font>")
|
||||
break
|
||||
else
|
||||
playsleepseconds = timestamp[i+1] - timestamp[i]
|
||||
playsleepseconds = mytape.timestamp[i+1] - mytape.timestamp[i]
|
||||
|
||||
if(playsleepseconds > 14)
|
||||
sleep(10)
|
||||
T = get_turf(src)
|
||||
T.audible_message("<font color=Maroon><B>Tape Recorder</B>: Skipping [playsleepseconds] seconds of silence</font>")
|
||||
playsleepseconds = 1
|
||||
i++
|
||||
icon_state = "taperecorderidle"
|
||||
sleep(10 * playsleepseconds)
|
||||
|
||||
|
||||
playing = 0
|
||||
if(emagged == 1.0)
|
||||
update_icon()
|
||||
|
||||
if(emagged)
|
||||
var/turf/T = get_turf(src)
|
||||
T.audible_message("<font color=Maroon><B>Tape Recorder</B>: This tape recorder will self-destruct in... Five.</font>")
|
||||
sleep(10)
|
||||
@@ -208,24 +309,31 @@
|
||||
set name = "Print Transcript"
|
||||
set category = "Object"
|
||||
|
||||
if(usr.stat)
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
if(emagged == 1)
|
||||
usr << "<span class='warning'>The tape recorder makes a scratchy noise.</span>"
|
||||
if(!mytape)
|
||||
to_chat(usr, "<span class='notice'>There's no tape!</span>")
|
||||
return
|
||||
if(mytape.ruined)
|
||||
to_chat(usr, "<span class='warning'>The tape recorder makes a scratchy noise.</span>")
|
||||
return
|
||||
if(emagged)
|
||||
to_chat(usr, "<span class='warning'>The tape recorder makes a scratchy noise.</span>")
|
||||
return
|
||||
if(!canprint)
|
||||
usr << "<span class='notice'>The recorder can't print that fast!</span>"
|
||||
to_chat(usr, "<span class='notice'>The recorder can't print that fast!</span>")
|
||||
return
|
||||
if(recording == 1 || playing == 1)
|
||||
usr << "<span class='notice'>You can't print the transcript while playing or recording!</span>"
|
||||
if(recording || playing)
|
||||
to_chat(usr, "<span class='notice'>You can't print the transcript while playing or recording!</span>")
|
||||
return
|
||||
usr << "<span class='notice'>Transcript printed.</span>"
|
||||
|
||||
to_chat(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,storedinfo.len >= i,i++)
|
||||
var/printedmessage = storedinfo[i]
|
||||
for(var/i=1,mytape.storedinfo.len >= i,i++)
|
||||
var/printedmessage = mytape.storedinfo[i]
|
||||
if (findtextEx(printedmessage,"*",1,2)) //replace action sounds
|
||||
printedmessage = "\[[time2text(timestamp[i]*10,"mm:ss")]\] (Unrecognized sound)"
|
||||
printedmessage = "\[[time2text(mytape.timestamp[i]*10,"mm:ss")]\] (Unrecognized sound)"
|
||||
t1 += "[printedmessage]<BR>"
|
||||
P.info = t1
|
||||
P.name = "Transcript"
|
||||
@@ -235,46 +343,98 @@
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/attack_self(mob/user)
|
||||
if(recording == 0 && playing == 0)
|
||||
if(usr.stat)
|
||||
return
|
||||
if(emagged == 1)
|
||||
usr << "<span class='warning'>The tape recorder makes a scratchy noise.</span>"
|
||||
return
|
||||
icon_state = "taperecorderrecording"
|
||||
if(timerecorded < 3600 && playing == 0)
|
||||
usr << "<span class='notice'>Recording started.</span>"
|
||||
recording = 1
|
||||
timestamp+= timerecorded
|
||||
storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] Recording started."
|
||||
for(timerecorded, timerecorded<3600)
|
||||
if(recording == 0)
|
||||
break
|
||||
timerecorded++
|
||||
sleep(10)
|
||||
recording = 0
|
||||
icon_state = "taperecorderidle"
|
||||
return
|
||||
else
|
||||
usr << "<span class='warning'>Either your tape recorder's memory is full, or it is currently playing back its memory.</span>"
|
||||
if(recording || playing)
|
||||
stop()
|
||||
else
|
||||
if(usr.stat)
|
||||
usr << "Not when you're incapacitated."
|
||||
return
|
||||
if(recording == 1)
|
||||
recording = 0
|
||||
timestamp+= timerecorded
|
||||
storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] Recording stopped."
|
||||
usr << "<span class='notice'>Recording stopped.</span>"
|
||||
icon_state = "taperecorderidle"
|
||||
return
|
||||
else if(playing == 1)
|
||||
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)
|
||||
icon_state = "taperecorderidle"
|
||||
return
|
||||
else
|
||||
usr << "<span class='warning'>Stop what?</span>"
|
||||
return
|
||||
record()
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/update_icon()
|
||||
if(!mytape)
|
||||
icon_state = "taperecorder_empty"
|
||||
else if(recording)
|
||||
icon_state = "taperecorder_recording"
|
||||
else if(playing)
|
||||
icon_state = "taperecorder_playing"
|
||||
else
|
||||
icon_state = "taperecorder_idle"
|
||||
|
||||
|
||||
|
||||
/obj/item/device/tape
|
||||
name = "tape"
|
||||
desc = "A magnetic tape that can hold up to ten minutes of content."
|
||||
icon_state = "tape_white"
|
||||
item_state = "analyzer"
|
||||
w_class = ITEMSIZE_TINY
|
||||
matter = list(DEFAULT_WALL_MATERIAL=20, "glass"=5)
|
||||
force = 1
|
||||
throwforce = 0
|
||||
var/max_capacity = 600
|
||||
var/used_capacity = 0
|
||||
var/list/storedinfo = new/list()
|
||||
var/list/timestamp = new/list()
|
||||
var/ruined = 0
|
||||
|
||||
|
||||
/obj/item/device/tape/update_icon()
|
||||
overlays.Cut()
|
||||
if(ruined)
|
||||
overlays += "ribbonoverlay"
|
||||
|
||||
|
||||
/obj/item/device/tape/fire_act()
|
||||
ruin()
|
||||
|
||||
/obj/item/device/tape/attack_self(mob/user)
|
||||
if(!ruined)
|
||||
to_chat(user, "<span class='notice'>You pull out all the tape!</span>")
|
||||
ruin()
|
||||
|
||||
|
||||
/obj/item/device/tape/proc/ruin()
|
||||
ruined = 1
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/device/tape/proc/fix()
|
||||
ruined = 0
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/device/tape/proc/record_speech(text)
|
||||
timestamp += used_capacity
|
||||
storedinfo += "\[[time2text(used_capacity*10,"mm:ss")]\] [text]"
|
||||
|
||||
|
||||
//shows up on the printed transcript as (Unrecognized sound)
|
||||
/obj/item/device/tape/proc/record_noise(text)
|
||||
timestamp += used_capacity
|
||||
storedinfo += "*\[[time2text(used_capacity*10,"mm:ss")]\] [text]"
|
||||
|
||||
|
||||
/obj/item/device/tape/attackby(obj/item/I, mob/user, params)
|
||||
if(ruined && istype(I, /obj/item/weapon/screwdriver))
|
||||
to_chat(user, "<span class='notice'>You start winding the tape back in...</span>")
|
||||
if(do_after(user, 120, target = src))
|
||||
to_chat(user, "<span class='notice'>You wound the tape back in.</span>")
|
||||
fix()
|
||||
return
|
||||
else if(istype(I, /obj/item/weapon/pen))
|
||||
if(loc == user && !user.incapacitated())
|
||||
var/new_name = input(user, "What would you like to label the tape?", "Tape labeling") as null|text
|
||||
if(isnull(new_name)) return
|
||||
new_name = sanitizeSafe(new_name)
|
||||
if(new_name)
|
||||
name = "tape - '[new_name]'"
|
||||
to_chat(user, "<span class='notice'>You label the tape '[new_name]'.</span>")
|
||||
else
|
||||
name = "tape"
|
||||
to_chat(user, "<span class='notice'>You scratch off the label.</span>")
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
//Random colour tapes
|
||||
/obj/item/device/tape/random/New()
|
||||
icon_state = "tape_[pick("white", "blue", "red", "yellow", "purple")]"
|
||||
@@ -217,8 +217,9 @@
|
||||
// Includes normal radio uplink, multitool uplink,
|
||||
// implant uplink (not the implant tool) and a preset headset uplink.
|
||||
|
||||
/obj/item/device/radio/uplink/New()
|
||||
hidden_uplink = new(src, usr.mind, DEFAULT_TELECRYSTAL_AMOUNT)
|
||||
/obj/item/device/radio/uplink/New(atom/loc, datum/mind/target_mind, telecrystals)
|
||||
..(loc)
|
||||
hidden_uplink = new(src, target_mind, telecrystals)
|
||||
icon_state = "radio"
|
||||
|
||||
/obj/item/device/radio/uplink/attack_self(mob/user as mob)
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
P.icon_state = "paper_words"
|
||||
|
||||
if(istype(usr,/mob/living/carbon))
|
||||
usr.put_in_hands(src)
|
||||
usr.put_in_hands(P)
|
||||
|
||||
/obj/item/weapon/autopsy_scanner/do_surgery(mob/living/carbon/human/M, mob/living/user)
|
||||
if(!istype(M))
|
||||
|
||||
@@ -278,3 +278,26 @@
|
||||
beakers += B1
|
||||
beakers += B2
|
||||
icon_state = initial(icon_state) +"_locked"
|
||||
|
||||
/obj/item/weapon/grenade/chem_grenade/teargas
|
||||
name = "tear gas grenade"
|
||||
desc = "Concentrated Capsaicin. Contents under pressure. Use with caution."
|
||||
stage = 2
|
||||
path = 1
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/large/B1 = new(src)
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/large/B2 = new(src)
|
||||
|
||||
B1.reagents.add_reagent("phosphorus", 40)
|
||||
B1.reagents.add_reagent("potassium", 40)
|
||||
B1.reagents.add_reagent("condensedcapsaicin", 40)
|
||||
B2.reagents.add_reagent("sugar", 40)
|
||||
B2.reagents.add_reagent("condensedcapsaicin", 80)
|
||||
|
||||
detonator = new/obj/item/device/assembly_holder/timer_igniter(src)
|
||||
|
||||
beakers += B1
|
||||
beakers += B2
|
||||
icon_state = initial(icon_state) +"_locked"
|
||||
@@ -159,3 +159,23 @@
|
||||
src.imp = new /obj/item/weapon/implant/health( src )
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/implantcase/language
|
||||
name = "glass case - 'GalCom'"
|
||||
desc = "A case containing a GalCom language implant."
|
||||
icon_state = "implantcase-b"
|
||||
|
||||
/obj/item/weapon/implantcase/language/New()
|
||||
src.imp = new /obj/item/weapon/implant/language( src )
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/implantcase/language/eal
|
||||
name = "glass case - 'EAL'"
|
||||
desc = "A case containing an Encoded Audio Language implant."
|
||||
icon_state = "implantcase-b"
|
||||
|
||||
/obj/item/weapon/implantcase/language/eal/New()
|
||||
src.imp = new /obj/item/weapon/implant/language/eal( src )
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
//These allow someone to speak a language they are otherwise physically incapable of speaking or hearing
|
||||
//They don't, at the moment, grant knowledge of the language
|
||||
//The can_speak_special checks should check for the presence of the implants.
|
||||
|
||||
/obj/item/weapon/implant/language
|
||||
name = "GalCom language implant"
|
||||
desc = "An implant allowing someone to speak and hear the range of frequencies used in Galactic Common, as well as produce any phonemes that they usually cannot. Only helps with hearing and producing sounds, not understanding them."
|
||||
|
||||
/obj/item/weapon/implant/language/get_data()
|
||||
var/dat = {"
|
||||
<b>Implant Specifications:</b><BR>
|
||||
<b>Name:</b> Vey-Med L-1 Galactic Common Implant<BR>
|
||||
<b>Life:</b> 5 years<BR>
|
||||
<b>Important Notes:</b> Affects hearing and speech.<BR>
|
||||
<HR>
|
||||
<b>Implant Details:</b><BR>
|
||||
<b>Function:</b> Allows a being otherwise incapable to both hear the frequencies Galactic Common is generally spoken at, as well as to produce the phonemes of the language.<BR>
|
||||
<b>Special Features:</b> None.<BR>
|
||||
<b>Integrity:</b> Implant will function for expected life, barring physical damage."}
|
||||
return dat
|
||||
|
||||
/obj/item/weapon/implant/language/eal
|
||||
name = "EAL language implant"
|
||||
desc = "An implant allowing an organic to both hear and speak Encoded Audio Language accurately. Only helps with hearing and producing sounds, not understanding them."
|
||||
|
||||
/obj/item/weapon/implant/language/get_data()
|
||||
var/dat = {"
|
||||
<b>Implant Specifications:</b><BR>
|
||||
<b>Name:</b> Vey-Med L-2 Encoded Audio Language Implant<BR>
|
||||
<b>Life:</b> 5 years<BR>
|
||||
<b>Important Notes:</b> Affects hearing and speech.<BR>
|
||||
<HR>
|
||||
<b>Implant Details:</b><BR>
|
||||
<b>Function:</b> Allows an organic to accurately process and speak Encoded Audio Language.<BR>
|
||||
<b>Special Features:</b> None.<BR>
|
||||
<b>Integrity:</b> Implant will function for expected life, barring physical damage."}
|
||||
return dat
|
||||
@@ -237,10 +237,13 @@ var/list/tape_roll_applications = list()
|
||||
|
||||
if (istype(A, /obj/machinery/door/airlock))
|
||||
var/turf/T = get_turf(A)
|
||||
var/obj/item/tape/P = new tape_type(T)
|
||||
P.update_icon()
|
||||
P.layer = 3.2
|
||||
user << "<span class='notice'>You finish placing \the [src].</span>"
|
||||
if(locate(/obj/item/tape, A.loc))
|
||||
user << "There's already tape over that door!"
|
||||
else
|
||||
var/obj/item/tape/P = new tape_type(T)
|
||||
P.update_icon()
|
||||
P.layer = 3.2
|
||||
user << "<span class='notice'>You finish placing \the [src].</span>"
|
||||
|
||||
if (istype(A, /turf/simulated/floor) ||istype(A, /turf/unsimulated/floor))
|
||||
var/turf/F = A
|
||||
@@ -277,7 +280,7 @@ var/list/tape_roll_applications = list()
|
||||
return ..(mover)
|
||||
|
||||
/obj/item/tape/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
breaktape(W, user)
|
||||
breaktape(user)
|
||||
|
||||
/obj/item/tape/attack_hand(mob/user as mob)
|
||||
if (user.a_intent == I_HELP && src.allowed(user))
|
||||
@@ -285,7 +288,7 @@ var/list/tape_roll_applications = list()
|
||||
for(var/obj/item/tape/T in gettapeline())
|
||||
T.lift(100) //~10 seconds
|
||||
else
|
||||
breaktape(null, user)
|
||||
breaktape(user)
|
||||
|
||||
/obj/item/tape/proc/lift(time)
|
||||
lifted = 1
|
||||
@@ -320,14 +323,11 @@ var/list/tape_roll_applications = list()
|
||||
cur = get_step(cur, dir)
|
||||
return tapeline
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/tape/proc/breaktape(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(user.a_intent == I_HELP && ((!can_puncture(W) && src.allowed(user))))
|
||||
user << "You can't break \the [src] with that!"
|
||||
/obj/item/tape/proc/breaktape(mob/user)
|
||||
if(user.a_intent == I_HELP)
|
||||
to_chat(user, "<span class='warning'>You refrain from breaking \the [src].</span>")
|
||||
return
|
||||
user.show_viewers("<span class='notice'>\The [user] breaks \the [src]!</span>")
|
||||
user.visible_message("<span class='notice'>\The [user] breaks \the [src]!</span>","<span class='notice'>You break \the [src].</span>")
|
||||
|
||||
for (var/obj/item/tape/T in gettapeline())
|
||||
if(T == src)
|
||||
|
||||
@@ -339,6 +339,16 @@
|
||||
for(var/i = 1 to 7)
|
||||
new /obj/item/weapon/grenade/chem_grenade/metalfoam(src)
|
||||
|
||||
/obj/item/weapon/storage/box/teargas
|
||||
name = "box of teargas grenades"
|
||||
desc = "A box containing 7 teargas grenades."
|
||||
icon_state = "flashbang"
|
||||
|
||||
/obj/item/weapon/storage/box/teargas/New()
|
||||
..()
|
||||
for(var/i = 1 to 7)
|
||||
new /obj/item/weapon/grenade/chem_grenade/teargas(src)
|
||||
|
||||
/obj/item/weapon/storage/box/trackimp
|
||||
name = "boxed tracking implant kit"
|
||||
desc = "Box full of scum-bag tracking utensils."
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
new /obj/item/clothing/gloves/yellow(src)
|
||||
new /obj/item/weapon/screwdriver(src)
|
||||
new /obj/item/weapon/wrench(src)
|
||||
new /obj/item/weapon/weldingtool(src)
|
||||
new /obj/item/weapon/weldingtool/experimental(src)
|
||||
new /obj/item/weapon/crowbar(src)
|
||||
new /obj/item/weapon/wirecutters(src)
|
||||
new /obj/item/device/multitool(src)
|
||||
|
||||
@@ -390,16 +390,21 @@
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
origin_tech = list(TECH_ENGINEERING = 4, TECH_PHORON = 3)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 120)
|
||||
var/last_gen = 0
|
||||
var/nextrefueltick = 0
|
||||
|
||||
/obj/item/weapon/weldingtool/experimental/New()
|
||||
processing_objects |= src
|
||||
..()
|
||||
|
||||
/obj/item/weapon/weldingtool/experimental/Destroy()
|
||||
processing_objects -= src
|
||||
..()
|
||||
|
||||
/obj/item/weapon/weldingtool/experimental/proc/fuel_gen()//Proc to make the experimental welder generate fuel, optimized as fuck -Sieve
|
||||
var/gen_amount = ((world.time-last_gen)/25)
|
||||
reagents += (gen_amount)
|
||||
if(reagents > max_fuel)
|
||||
reagents = max_fuel
|
||||
|
||||
/obj/item/weapon/weldingtool/experimental/process()
|
||||
..()
|
||||
if(get_fuel() < max_fuel && nextrefueltick < world.time)
|
||||
nextrefueltick = world.time + 10
|
||||
reagents.add_reagent("fuel", 1)
|
||||
/*
|
||||
* Crowbar
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user