diff --git a/code/modules/integrated_electronics/core/integrated_circuit.dm b/code/modules/integrated_electronics/core/integrated_circuit.dm index 4df26d733387..ab0df67f8899 100644 --- a/code/modules/integrated_electronics/core/integrated_circuit.dm +++ b/code/modules/integrated_electronics/core/integrated_circuit.dm @@ -339,10 +339,10 @@ a creative player the means to solve many problems. Circuits are held inside an if(!check_power()) power_fail() return FALSE + do_work(ord) //Moved it behind next use incase the cooldown is modified in do_work next_use = world.time + cooldown_per_use if(assembly) assembly.ext_next_use = world.time + ext_cooldown - do_work(ord) return TRUE /obj/item/integrated_circuit/proc/do_work(ord) diff --git a/code/modules/integrated_electronics/subtypes/input.dm b/code/modules/integrated_electronics/subtypes/input.dm index 5679c18b6a82..2dd9e32b12b2 100644 --- a/code/modules/integrated_electronics/subtypes/input.dm +++ b/code/modules/integrated_electronics/subtypes/input.dm @@ -213,32 +213,93 @@ name = "integrated advanced medical analyzer" desc = "A very small version of the medibot's medical analyzer. This allows the machine to know how healthy someone is. \ - - This type is much more precise, allowing the machine to know much more about the target than a normal analyzer." + This type is much more precise, allowing the machine to know much more about the target than a normal analyzer. \ + A better health scanner can be installed to expand functionality. T1 for brain damage, bleeding and infection. \ + T2 For fractions and internal bleeding. T3 for non medical reagents." icon_state = "medscan_adv" complexity = 12 inputs = list("target" = IC_PINTYPE_REF) outputs = list( - "brain activity" = IC_PINTYPE_BOOLEAN, - "is conscious" = IC_PINTYPE_BOOLEAN, - "total health %" = IC_PINTYPE_NUMBER, - "total missing health" = IC_PINTYPE_NUMBER, - "brute damage" = IC_PINTYPE_NUMBER, - "burn damage" = IC_PINTYPE_NUMBER, - "tox damage" = IC_PINTYPE_NUMBER, - "oxy damage" = IC_PINTYPE_NUMBER, - "clone damage" = IC_PINTYPE_NUMBER, - "blood loss" = IC_PINTYPE_NUMBER, - "pain level" = IC_PINTYPE_NUMBER, - "radiation" = IC_PINTYPE_NUMBER, - "nutrition" = IC_PINTYPE_NUMBER, - "list of reagents" = IC_PINTYPE_LIST, - "quantity of reagents" = IC_PINTYPE_LIST + "brain activity" = IC_PINTYPE_BOOLEAN, //1 + "is conscious" = IC_PINTYPE_BOOLEAN, //2 + "total health %" = IC_PINTYPE_NUMBER, //3 + "total missing health" = IC_PINTYPE_NUMBER, //4 + "brute damage" = IC_PINTYPE_NUMBER, //5 + "burn damage" = IC_PINTYPE_NUMBER, //6 + "tox damage" = IC_PINTYPE_NUMBER, //7 + "oxy damage" = IC_PINTYPE_NUMBER, //8 + "clone damage" = IC_PINTYPE_NUMBER, //9 + "blood loss" = IC_PINTYPE_NUMBER, //10 + "pain level" = IC_PINTYPE_NUMBER, //11 + "radiation" = IC_PINTYPE_NUMBER, //12 + "nutrition" = IC_PINTYPE_NUMBER, //13 + "list of reagents" = IC_PINTYPE_LIST, //14 + "quantity of reagents" = IC_PINTYPE_LIST, //15 + "health scan tier" = IC_PINTYPE_NUMBER, //16 + "brain damage" = IC_PINTYPE_NUMBER, //17 + "bleeding limbs" = IC_PINTYPE_LIST, //18 + "infected limbs" = IC_PINTYPE_LIST, //19 + "internal bleeding" = IC_PINTYPE_LIST, //20 + "fractured limbs" = IC_PINTYPE_LIST //21 ) activators = list("scan" = IC_PINTYPE_PULSE_IN, "on scanned" = IC_PINTYPE_PULSE_OUT) spawn_flags = IC_SPAWN_RESEARCH origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_BIO = 4) power_draw_per_use = 80 + can_be_asked_input = TRUE + var/obj/item/healthanalyzer/current_healthanalyzer + var/advscan = 0 + //T1: brain damage, bleeding, infection. T2: show location of IB and fracture. T3: show non medical reagents + +/obj/item/integrated_circuit/input/adv_med_scanner/ask_for_input(mob/living/user, obj/item/I, a_intent) + if(!current_healthanalyzer) + if(!isobj(I)) + return FALSE + attackby_react(I, user, a_intent) + else + attack_self(user) + +/obj/item/integrated_circuit/input/adv_med_scanner/attackby_react(var/obj/item/healthanalyzer/I, var/mob/living/user) + //Check if it truly is a health scanner + if(!(istype(I,/obj/item/healthanalyzer))) + to_chat(user,"The [I.name] doesn't seem to fit in here.") + return + + //Check if there is no other health scanner already inside + if(current_healthanalyzer) + to_chat(user,"There is already a health scanner inside.") + return + + if(!user.attempt_insert_item_for_installation(I, src)) + return + + //The health scanner is the one we just attached, its location is inside the circuit + current_healthanalyzer = I + + to_chat(user,"You slot in the [I.name] inside the assembly.") + + //Set the pin to a weak reference of the current beaker + set_pin_data(IC_OUTPUT, 16, I.advscan) + advscan = I.advscan + push_data() + +/obj/item/integrated_circuit/input/adv_med_scanner/attack_self(mob/user) + . = ..() + if(.) + return + //Check if no health scanner is attached + if(!current_healthanalyzer) + to_chat(user, "There is currently no health scanner attached.") + return + + //Remove beaker and put in user's hands/location + to_chat(user, "You yank the [current_healthanalyzer] out of the slot.") + user.put_in_hands(current_healthanalyzer) + current_healthanalyzer = null + //Reset to 0 + set_pin_data(IC_OUTPUT, 16, 0) + advscan = 0 + push_data() /obj/item/integrated_circuit/input/adv_med_scanner/do_work(ord) if(ord == 1) @@ -267,11 +328,38 @@ var/cont[0] var/amt[0] for(var/datum/reagent/RE in H.reagents.reagent_list) - if(RE.scannable) + if(RE.scannable || advscan >= 3) cont += RE.id amt += round(H.reagents.get_reagent_amount(RE.id), 1) set_pin_data(IC_OUTPUT, 14, cont) set_pin_data(IC_OUTPUT, 15, amt) + var/frac[0] + var/ib[0] + var/bleed[0] + var/infec[0] + if(advscan >= 1) + set_pin_data(IC_OUTPUT, 17, H.getBrainLoss()) + for(var/obj/item/organ/external/e in H.organs) + if(!e) + continue + // Bleeding + if(e.status & ORGAN_BLEEDING) + bleed += e.name + // Infections + if(e.has_infected_wound()) + infec += e.name + if(advscan >= 2) + // Broken limbs + if(e.status & ORGAN_BROKEN) + frac += e.name + // IB + for(var/datum/wound/W as anything in e.wounds) + if(W.internal) + ib += e.name + set_pin_data(IC_OUTPUT, 18, bleed) + set_pin_data(IC_OUTPUT, 19, infec) + set_pin_data(IC_OUTPUT, 20, ib) + set_pin_data(IC_OUTPUT, 21, frac) push_data() activate_pin(2) diff --git a/code/modules/integrated_electronics/subtypes/output.dm b/code/modules/integrated_electronics/subtypes/output.dm index 489e89379262..d3116a6ab077 100644 --- a/code/modules/integrated_electronics/subtypes/output.dm +++ b/code/modules/integrated_electronics/subtypes/output.dm @@ -177,16 +177,18 @@ desc = "A miniature speaker is attached to this component." icon_state = "speaker" complexity = 8 - cooldown_per_use = 4 SECONDS + cooldown_per_use = 1 SECONDS //The cooldown is adjusted by sound length + var/cooldown_after_use = 1 SECONDS //Extra cooldown added to the sound length inputs = list( "sound ID" = IC_PINTYPE_STRING, "volume" = IC_PINTYPE_NUMBER, "frequency" = IC_PINTYPE_BOOLEAN ) - outputs = list() - activators = list("play sound" = IC_PINTYPE_PULSE_IN) + outputs = list("cooldown duration" = IC_PINTYPE_NUMBER) + activators = list("play sound" = IC_PINTYPE_PULSE_IN, "on played" = IC_PINTYPE_PULSE_OUT) power_draw_per_use = 20 var/list/sounds = list() + var/list/durations = list() //Audacity works decently well to finding out deciseconds /obj/item/integrated_circuit/output/sound/Initialize(mapload) . = ..() @@ -205,8 +207,13 @@ var/selected_sound = sounds[ID] if(!selected_sound) return + var/selected_cooldown = durations[ID] vol = clamp( vol, 0, 100) playsound(get_turf(src), selected_sound, vol, freq, -1) + cooldown_per_use = selected_cooldown + cooldown_after_use + set_pin_data(IC_OUTPUT, 1, cooldown_per_use) + push_data() + activate_pin(2) /obj/item/integrated_circuit/output/sound/beeper name = "beeper circuit" @@ -223,6 +230,16 @@ "synth no" = 'sound/machines/synth_no.ogg', "warning buzz" = 'sound/machines/warning-buzzer.ogg' ) + durations = list( + "beep" = 3, + "chime" = 4, + "buzz sigh" = 3, + "buzz twice" = 6, + "ping" = 5, + "synth yes" = 4, + "synth no" = 4, + "warning buzz" = 35 + ) spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH /obj/item/integrated_circuit/output/sound/beepsky @@ -238,6 +255,16 @@ "radio" = 'sound/voice/bradio.ogg', "secure day" = 'sound/voice/bsecureday.ogg', ) + durations = list( + "creep" = 16, + "criminal" = 11, + "freeze" = 10, + "god" = 30, + "i am the law" = 22, + "insult" = 141, //Yeah it is that long + "radio" = 18, + "secure day" = 12, + ) spawn_flags = IC_SPAWN_RESEARCH origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_ILLEGAL = 1) @@ -261,9 +288,86 @@ "apple" = 'sound/voice/medibot/mapple.ogg', "no" = 'sound/voice/medibot/mno.ogg', ) + durations = list( + "surgeon" = 39, + "radar" = 16, + "feel better" = 14, + "patched up" = 11, + "injured" = 21, + "insult" = 155, + "coming" = 20, + "help" = 13, + "live" = 15, + "lost" = 45, + "flies" = 50, + "catch" = 38, + "delicious" = 7, + "apple" = 23, + "no" = 16, + ) spawn_flags = IC_SPAWN_RESEARCH origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_BIO = 1) +/obj/item/integrated_circuit/output/sound/hev + name = "HEV sound circuit" + desc = "Takes a sound name as an input, and will play said sound when pulsed. This circuit is similar to those used in some old RIG suit" + cooldown_after_use = 5 + sounds = list( + "bio_warn" = 'sound/voice/Hevsounds/biohazard_detected.wav', + "chem_warn" = 'sound/voice/Hevsounds/chemical_detected.wav', + "rad_warn" = 'sound/voice/Hevsounds/radiation_detected.wav', + "near_death" = 'sound/voice/Hevsounds/near_death.wav', + "seek_medic" = 'sound/voice/Hevsounds/seek_medic.wav', + "shock_damage" = 'sound/voice/Hevsounds/shock_damage.wav', + "blood_loss" = 'sound/voice/Hevsounds/blood_loss.wav', + "blood_plasma" = 'sound/voice/Hevsounds/blood_plasma.wav', + "blood_toxins" = 'sound/voice/Hevsounds/blood_toxins.wav', + "health_critical" = 'sound/voice/Hevsounds/health_critical.wav', + "health_dropping" = 'sound/voice/Hevsounds/health_dropping.wav', + "health_dropping2" = 'sound/voice/Hevsounds/health_dropping2.wav', + "minor_fracture" = 'sound/voice/Hevsounds/minor_fracture.wav', + "minor_lacerations" = 'sound/voice/Hevsounds/minor_lacerations.wav', + "major_fracture" = 'sound/voice/Hevsounds/major_fracture.wav', + "major_lacerations" = 'sound/voice/Hevsounds/major_lacerations.wav', + "wound_sterilized" = 'sound/voice/Hevsounds/wound_sterilized.wav', + "administering_medical" = 'sound/voice/Hevsounds/administering_medical.wav', + "adrenaline_shot" = 'sound/voice/Hevsounds/adrenaline_shot.wav', + "automedic_on" = 'sound/voice/Hevsounds/automedic_on.wav', + "antitoxin_shot" = 'sound/voice/Hevsounds/antitoxin_shot.wav', + "heat_damage" = 'sound/voice/Hevsounds/heat_damage.wav', + "morphine_shot" = 'sound/voice/Hevsounds/morphine_shot.wav', + "innsuficient_medical" = 'sound/voice/Hevsounds/innsuficient_medical.wav', + "internal_bleeding" = 'sound/voice/Hevsounds/internal_bleeding.wav' + ) + durations = list( + "bio_warn" = 31, + "chem_warn" = 38, + "rad_warn" = 45, + "near_death" = 36, + "seek_medic" = 25, + "shock_damage" = 23, + "blood_loss" = 22, + "blood_plasma" = 26, + "blood_toxins" = 38, + "health_critical" = 32, + "health_dropping" = 35, + "health_dropping2" = 29, + "minor_fracture" = 24, + "minor_lacerations" = 29, + "major_fracture" = 24, + "major_lacerations" = 30, + "wound_sterilized" = 20, + "administering_medical" = 31, + "adrenaline_shot" = 20, + "automedic_on" = 35, + "antitoxin_shot" = 22, + "heat_damage" = 30, + "morphine_shot" = 20, + "innsuficient_medical" = 45, + "internal_bleeding" = 24 + ) + spawn_flags = IC_SPAWN_RESEARCH + /obj/item/integrated_circuit/output/video_camera name = "video camera circuit" desc = "This small camera allows a remote viewer to see what it sees." diff --git a/sound/voice/Hevsounds/administering_medical.wav b/sound/voice/Hevsounds/administering_medical.wav new file mode 100644 index 000000000000..b5034a39651d Binary files /dev/null and b/sound/voice/Hevsounds/administering_medical.wav differ diff --git a/sound/voice/Hevsounds/adrenaline_shot.wav b/sound/voice/Hevsounds/adrenaline_shot.wav new file mode 100644 index 000000000000..ea09a88902a5 Binary files /dev/null and b/sound/voice/Hevsounds/adrenaline_shot.wav differ diff --git a/sound/voice/Hevsounds/antitoxin_shot.wav b/sound/voice/Hevsounds/antitoxin_shot.wav new file mode 100644 index 000000000000..b33d9a6f3bec Binary files /dev/null and b/sound/voice/Hevsounds/antitoxin_shot.wav differ diff --git a/sound/voice/Hevsounds/automedic_on.wav b/sound/voice/Hevsounds/automedic_on.wav new file mode 100644 index 000000000000..b4dbdc67b84e Binary files /dev/null and b/sound/voice/Hevsounds/automedic_on.wav differ diff --git a/sound/voice/Hevsounds/biohazard_detected.wav b/sound/voice/Hevsounds/biohazard_detected.wav new file mode 100644 index 000000000000..4dbfe2f7d741 Binary files /dev/null and b/sound/voice/Hevsounds/biohazard_detected.wav differ diff --git a/sound/voice/Hevsounds/blood_loss.wav b/sound/voice/Hevsounds/blood_loss.wav new file mode 100644 index 000000000000..50c276744402 Binary files /dev/null and b/sound/voice/Hevsounds/blood_loss.wav differ diff --git a/sound/voice/Hevsounds/blood_plasma.wav b/sound/voice/Hevsounds/blood_plasma.wav new file mode 100644 index 000000000000..5b2c73115c79 Binary files /dev/null and b/sound/voice/Hevsounds/blood_plasma.wav differ diff --git a/sound/voice/Hevsounds/blood_toxins.wav b/sound/voice/Hevsounds/blood_toxins.wav new file mode 100644 index 000000000000..52a03e1d3665 Binary files /dev/null and b/sound/voice/Hevsounds/blood_toxins.wav differ diff --git a/sound/voice/Hevsounds/chemical_detected.wav b/sound/voice/Hevsounds/chemical_detected.wav new file mode 100644 index 000000000000..5417cae08a61 Binary files /dev/null and b/sound/voice/Hevsounds/chemical_detected.wav differ diff --git a/sound/voice/Hevsounds/health_critical.wav b/sound/voice/Hevsounds/health_critical.wav new file mode 100644 index 000000000000..d2dcc4cdf1d9 Binary files /dev/null and b/sound/voice/Hevsounds/health_critical.wav differ diff --git a/sound/voice/Hevsounds/health_dropping.wav b/sound/voice/Hevsounds/health_dropping.wav new file mode 100644 index 000000000000..76f7ae9852ac Binary files /dev/null and b/sound/voice/Hevsounds/health_dropping.wav differ diff --git a/sound/voice/Hevsounds/health_dropping2.wav b/sound/voice/Hevsounds/health_dropping2.wav new file mode 100644 index 000000000000..254a764d50a9 Binary files /dev/null and b/sound/voice/Hevsounds/health_dropping2.wav differ diff --git a/sound/voice/Hevsounds/heat_damage.wav b/sound/voice/Hevsounds/heat_damage.wav new file mode 100644 index 000000000000..6f8b844d374d Binary files /dev/null and b/sound/voice/Hevsounds/heat_damage.wav differ diff --git a/sound/voice/Hevsounds/innsuficient_medical.wav b/sound/voice/Hevsounds/innsuficient_medical.wav new file mode 100644 index 000000000000..dfad3c4dbeae Binary files /dev/null and b/sound/voice/Hevsounds/innsuficient_medical.wav differ diff --git a/sound/voice/Hevsounds/internal_bleeding.wav b/sound/voice/Hevsounds/internal_bleeding.wav new file mode 100644 index 000000000000..e82a295cf069 Binary files /dev/null and b/sound/voice/Hevsounds/internal_bleeding.wav differ diff --git a/sound/voice/Hevsounds/major_fracture.wav b/sound/voice/Hevsounds/major_fracture.wav new file mode 100644 index 000000000000..e2759bdb3dcb Binary files /dev/null and b/sound/voice/Hevsounds/major_fracture.wav differ diff --git a/sound/voice/Hevsounds/major_lacerations.wav b/sound/voice/Hevsounds/major_lacerations.wav new file mode 100644 index 000000000000..90ea4a9513b0 Binary files /dev/null and b/sound/voice/Hevsounds/major_lacerations.wav differ diff --git a/sound/voice/Hevsounds/minor_fracture.wav b/sound/voice/Hevsounds/minor_fracture.wav new file mode 100644 index 000000000000..fe432d382e14 Binary files /dev/null and b/sound/voice/Hevsounds/minor_fracture.wav differ diff --git a/sound/voice/Hevsounds/minor_lacerations.wav b/sound/voice/Hevsounds/minor_lacerations.wav new file mode 100644 index 000000000000..9fd434ee7140 Binary files /dev/null and b/sound/voice/Hevsounds/minor_lacerations.wav differ diff --git a/sound/voice/Hevsounds/morphine_shot.wav b/sound/voice/Hevsounds/morphine_shot.wav new file mode 100644 index 000000000000..aba4f15c321e Binary files /dev/null and b/sound/voice/Hevsounds/morphine_shot.wav differ diff --git a/sound/voice/Hevsounds/near_death.wav b/sound/voice/Hevsounds/near_death.wav new file mode 100644 index 000000000000..f1b4e30cc58f Binary files /dev/null and b/sound/voice/Hevsounds/near_death.wav differ diff --git a/sound/voice/Hevsounds/radiation_detected.wav b/sound/voice/Hevsounds/radiation_detected.wav new file mode 100644 index 000000000000..c22971dd2669 Binary files /dev/null and b/sound/voice/Hevsounds/radiation_detected.wav differ diff --git a/sound/voice/Hevsounds/seek_medic.wav b/sound/voice/Hevsounds/seek_medic.wav new file mode 100644 index 000000000000..79dd1422c0fa Binary files /dev/null and b/sound/voice/Hevsounds/seek_medic.wav differ diff --git a/sound/voice/Hevsounds/shock_damage.wav b/sound/voice/Hevsounds/shock_damage.wav new file mode 100644 index 000000000000..7125358cd1e6 Binary files /dev/null and b/sound/voice/Hevsounds/shock_damage.wav differ diff --git a/sound/voice/Hevsounds/wound_sterilized.wav b/sound/voice/Hevsounds/wound_sterilized.wav new file mode 100644 index 000000000000..d2da281e12e2 Binary files /dev/null and b/sound/voice/Hevsounds/wound_sterilized.wav differ