diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 6ae32a9d6a..2b8fe4b064 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -18,46 +18,76 @@ Gunshots/explosions/opening doors/less rare audio (done) var/image/halbody var/obj/halitem var/hal_screwyhud = SCREWYHUD_NONE - var/handling_hal = 0 + var/next_hallucination = 0 + +GLOBAL_LIST_INIT(hallucinations_minor, list( + /datum/hallucination/sounds, + /datum/hallucination/bolts, + /datum/hallucination/whispers, + /datum/hallucination/message, + /datum/hallucination/hudscrew)) + +GLOBAL_LIST_INIT(hallucinations_medium, list( + /datum/hallucination/fake_alert, + /datum/hallucination/items, + /datum/hallucination/items_other, + /datum/hallucination/dangerflash, + /datum/hallucination/bolts, + /datum/hallucination/fake_flood, + /datum/hallucination/husks, + /datum/hallucination/battle, + /datum/hallucination/fire, + /datum/hallucination/self_delusion)) + +GLOBAL_LIST_INIT(hallucinations_major, list( + /datum/hallucination/fakeattacker, + /datum/hallucination/death, + /datum/hallucination/xeno_attack, + /datum/hallucination/singularity_scare, + /datum/hallucination/delusion, + /datum/hallucination/oh_yeah)) /mob/living/carbon/proc/handle_hallucinations() - if(handling_hal) + if(world.time < next_hallucination) return - //Least obvious - var/list/minor = list("sounds"=25,"bolts_minor"=5,"whispers"=15,"message"=10,"hudscrew"=15) - //Something's wrong here - var/list/medium = list("fake_alert"=15,"items"=10,"items_other"=10,"dangerflash"=10,"bolts"=5,"flood"=5,"husks"=10,"battle"=15,"self_delusion"=10) - //AAAAH - var/list/major = list("fake"=20,"death"=10,"xeno"=10,"singulo"=10,"borer"=10,"delusion"=20,"koolaid"=10) + if(hallucination) + var/list/current = GLOB.hallucinations_minor + if(prob(25) && hallucination > 100) + current = GLOB.hallucinations_medium + else if(prob(10) && hallucination > 200) + current = GLOB.hallucinations_major + var/halpick = pick(current) + new halpick(src, FALSE) - handling_hal = 1 - while(hallucination > 20) - sleep(rand(200,500)/(hallucination/25)) - if(prob(20)) - continue - var/list/current = list() - switch(rand(100)) - if(1 to 50) - current = minor - if(51 to 85) - current = medium - if(86 to 100) - current = major +/mob/living/carbon/proc/set_screwyhud(hud_type) + hal_screwyhud = hud_type + update_health_hud() - var/halpick = pickweight(current) +/datum/hallucination + var/mob/living/carbon/target + var/cost = 5 //affects the amount of hallucination reduced, and cooldown until the next hallucination + var/feedback_details //extra info for investigate - hallucinate(halpick) - handling_hal = 0 +/datum/hallucination/New(mob/living/carbon/T, forced = TRUE) + set waitfor = 0 + target = T + if(!forced) + target.hallucination = max(0, target.hallucination - cost) + target.next_hallucination = world.time + (rand(cost * 0.5, cost * 3) * 10) + +/datum/hallucination/proc/wake_and_restore() + target.set_screwyhud(SCREWYHUD_NONE) + target.SetSleeping(0) + +/datum/hallucination/Destroy() + target.investigate_log("was afflicted with a hallucination of type [type]. [feedback_details]", INVESTIGATE_HALLUCINATIONS) + return ..() /obj/effect/hallucination invisibility = INVISIBILITY_OBSERVER var/mob/living/carbon/target = null -/obj/effect/hallucination/proc/wake_and_restore() - target.hal_screwyhud = SCREWYHUD_NONE - target.SetSleeping(0) - /obj/effect/hallucination/simple var/image_icon = 'icons/mob/alien.dmi' var/image_state = "alienh_pounce" @@ -226,39 +256,6 @@ Gunshots/explosions/opening doors/less rare audio (done) /obj/effect/hallucination/simple/clown/scary image_state = "scary_clown" -/obj/effect/hallucination/simple/borer - image_icon = 'icons/mob/borer.dmi' - image_state = "brainslug" - -/obj/effect/hallucination/borer - //A borer unconsciouss you and crawls in your ear - var/obj/machinery/atmospherics/components/unary/vent_pump/pump = null - var/obj/effect/hallucination/simple/borer/borer = null - -/obj/effect/hallucination/borer/Initialize(mapload, var/mob/living/carbon/T) - ..() - target = T - for(var/obj/machinery/atmospherics/components/unary/vent_pump/U in orange(7,target)) - if(!U.welded) - pump = U - break - if(pump) - borer = new(pump.loc,target) - for(var/i=0, i<11, i++) - walk_to(borer, get_step(borer, get_cardinal_dir(borer, T))) - if(borer.Adjacent(T)) - to_chat(T, "You feel a creeping, horrible sense of dread come over you, freezing your limbs and setting your heart racing.") - T.Stun(80) - sleep(50) - qdel(borer) - sleep(rand(60, 90)) - to_chat(T, "Primary [rand(1000,9999)] states: [pick("Hello","Hi","You're my slave now!","Don't try to get rid of me...")]") - break - sleep(4) - if(!QDELETED(borer)) - qdel(borer) - qdel(src) - /obj/effect/hallucination/simple/bubblegum name = "Bubblegum" image_icon = 'icons/mob/lavaland/96x96megafauna.dmi' @@ -728,22 +725,22 @@ Gunshots/explosions/opening doors/less rare audio (done) /datum/hallucination/whispers/New(mob/living/carbon/T, forced = TRUE) ..() - var/speak_messages = list("[pick("I'm watching you...","I know what you're doing","What are you hiding?","I saw that")]",\ - "[pick("","Hey, ","Hi ","Hello ","Wait, ","It's ")][target.first_name()]!",\ - "[pick("Get out","Go away","Fuck off","OUT!")]",\ - "[pick("Kchck-Chkck? Kchchck!","EEEeeeeEEEE","#@§*&£","H-hhhhh...")]",\ - "[pick("Did you hear that?","Did you see that?","What was that?")]",\ - "[pick("Hail Ratvar","Hail Nar'Sie","Viva!","[generate_code_phrase()]","Are you mr. [pick(GLOB.possible_changeling_IDs)]?")]",\ - "[pick("Why?","What?","Wait, what?","Wait","Hold on","Uh...")]",\ - "Give me that!",\ - "HELP[pick(""," ME"," HIM"," HER"," THEM")]!!",\ - "RUN!!",\ - "I'm infected, [pick("stay away","don't get close","be careful","help me","kill me")]") + var/speak_messages = list("[pick_list_replacements(HAL_LINES_FILE, "suspicion")]",\ + "[pick_list_replacements(HAL_LINES_FILE, "greetings")][target.first_name()]!",\ + "[pick_list_replacements(HAL_LINES_FILE, "getout")]",\ + "[pick_list_replacements(HAL_LINES_FILE, "weird")]",\ + "[pick_list_replacements(HAL_LINES_FILE, "didyouhearthat")]",\ + "[pick_list_replacements(HAL_LINES_FILE, "imatraitor")]",\ + "[pick_list_replacements(HAL_LINES_FILE, "doubt")]",\ + "[pick_list_replacements(HAL_LINES_FILE, "aggressive")]",\ + "[pick_list_replacements(HAL_LINES_FILE, "help")]!!",\ + "[pick_list_replacements(HAL_LINES_FILE, "escape")]",\ + "I'm infected, [pick_list_replacements(HAL_LINES_FILE, "infection_advice")]!") var/radio_messages = list("Set [target.first_name()] to arrest!",\ - "[pick("Captain","Hos","Cmo","Rd","Ce","Hop","Janitor","AI","Viro","Qm","[target.first_name()]")] is [pick("rogue","cult","clockcult","a revhead","a gang leader","a traitor","a ling","dead")]!",\ + "[pick_list_replacements(HAL_LINES_FILE, "people")] is [pick_list_replacements(HAL_LINES_FILE, "accusations")]!",\ "Help!",\ - "[pick("Cult", "Wizard", "Blob", "Ling", "Ops", "Swarmers", "Revenant", "Traitor", "Harm", "I hear flashing", "Help")] in [pick(GLOB.teleportlocs)][prob(50)?"!":"!!"]",\ + "[pick_list_replacements(HAL_LINES_FILE, "threat")] in [pick_list_replacements(HAL_LINES_FILE, "location")][prob(50)?"!":"!!"]",\ "Where's [target.first_name()]?"\ ,"[pick("C","Ai, c","Someone c","Rec")]all the shuttle!"\ ,"AI [pick("rogue", "is dead")]!!") @@ -774,312 +771,381 @@ Gunshots/explosions/opening doors/less rare audio (done) for(var/mob/living/carbon/human/H in GLOB.living_mob_list) humans += H person = pick(humans) - to_chat(target, target.compose_message(person,understood_language,pick(radio_messages),"1459",person.get_spans())) + var/message = target.compose_message(person,understood_language,pick(radio_messages),"1459",person.get_spans()) + feedback_details += "Type: Radio, Source: [person.real_name], Message: [message]" + to_chat(target, message) qdel(src) -/obj/effect/hallucination/message +/datum/hallucination/message + cost = 15 -/obj/effect/hallucination/message/Initialize(mapload, var/mob/living/carbon/T) +/datum/hallucination/message/New(mob/living/carbon/T, forced = TRUE) ..() - target = T var/chosen = pick("The light burns you!", \ "You don't feel like yourself.", \ - "Unknown has punched [target]!", \ "You hear something squeezing through the ducts...", \ "You hear a distant scream.", \ "You feel invincible, nothing can hurt you!", \ "You feel a tiny prick!", \ "[target] sneezes.", \ - "You feel faint.", \ - "You hear a strange, alien voice in your head...[pick("Hiss","Ssss")]", \ - "You can see...everything!") + //The truth, revealed + "You're hallucinating.", \ + //Direct advice + "[pick_list_replacements(HAL_LINES_FILE, "advice")]") + feedback_details += "Message: [chosen]" to_chat(target, chosen) qdel(src) -/mob/living/carbon/proc/hallucinate(hal_type, specific) // specific is used to specify a particular hallucination - set waitfor = 0 - switch(hal_type) - if("xeno") - new /obj/effect/hallucination/xeno_attack(src.loc,src) - if("borer") - new /obj/effect/hallucination/borer(src.loc,src) - if("singulo") - new /obj/effect/hallucination/singularity_scare(src.loc,src) - if("koolaid") - new /obj/effect/hallucination/oh_yeah(src.loc,src) - if("battle") - new /obj/effect/hallucination/battle(src.loc,src) - if("flood") - new /obj/effect/hallucination/fake_flood(src.loc,src) - if("delusion") - new /obj/effect/hallucination/delusion(src.loc,src) - if("self_delusion") - new /obj/effect/hallucination/self_delusion(src.loc,src) - if("fake") - new /obj/effect/hallucination/fakeattacker(src.loc,src) - if("bolts") - new /obj/effect/hallucination/bolts(src.loc,src) - if("bolts_minor") - new /obj/effect/hallucination/bolts(src.loc,src,rand(1,2)) - if("whispers") - new /obj/effect/hallucination/whispers(src.loc,src) - if("message") - new /obj/effect/hallucination/message(src.loc,src) - if("items_other") - new /obj/effect/hallucination/items_other(src.loc,src) - if("sounds") - //Strange audio - switch(rand(1,20)) - if(1) playsound_local(null,'sound/machines/airlock.ogg', 15, 1) - if(2) - if(prob(50)) playsound_local(null,'sound/effects/explosion1.ogg', 50, 1) - else playsound_local(null, 'sound/effects/explosion2.ogg', 50, 1) - if(3) playsound_local(null, 'sound/effects/explosionfar.ogg', 50, 1) - if(4) playsound_local(null, pick('sound/effects/glassbr1.ogg','sound/effects/glassbr2.ogg','sound/effects/glassbr3.ogg'), 50, 1) - if(5) - playsound_local(null, 'sound/weapons/ring.ogg', 35) - sleep(15) - playsound_local(null, 'sound/weapons/ring.ogg', 35) - sleep(15) - playsound_local(null, 'sound/weapons/ring.ogg', 35) - if(6) playsound_local(null, 'sound/magic/summon_guns.ogg', 50, 1) - if(7) playsound_local(null, 'sound/machines/alarm.ogg', 100, 0) - if(8) playsound_local(null, 'sound/voice/bfreeze.ogg', 35, 0) - if(9) - //To make it more realistic, I added two gunshots (enough to kill) - playsound_local(null, 'sound/weapons/gunshot.ogg', 25, 1) - spawn(rand(10,30)) - playsound_local(null, 'sound/weapons/gunshot.ogg', 25, 1) - sleep(rand(5,10)) - playsound_local(null, sound(get_sfx("bodyfall"), 25), 25, 1) - if(10) playsound_local(null, 'sound/effects/pray_chaplain.ogg', 50) - if(11) - //Same as above, but with tasers. - playsound_local(null, 'sound/weapons/taser.ogg', 25, 1) - spawn(rand(10,30)) - playsound_local(null, 'sound/weapons/taser.ogg', 25, 1) - sleep(rand(5,10)) - playsound_local(null, sound(get_sfx("bodyfall"), 25), 25, 1) - //Rare audio - if(12) - //These sounds are (mostly) taken from Hidden: Source - var/list/creepyasssounds = list('sound/effects/ghost.ogg', 'sound/effects/ghost2.ogg', 'sound/effects/heart_beat.ogg', 'sound/effects/screech.ogg',\ - 'sound/hallucinations/behind_you1.ogg', 'sound/hallucinations/behind_you2.ogg', 'sound/hallucinations/far_noise.ogg', 'sound/hallucinations/growl1.ogg', 'sound/hallucinations/growl2.ogg',\ - 'sound/hallucinations/growl3.ogg', 'sound/hallucinations/im_here1.ogg', 'sound/hallucinations/im_here2.ogg', 'sound/hallucinations/i_see_you1.ogg', 'sound/hallucinations/i_see_you2.ogg',\ - 'sound/hallucinations/look_up1.ogg', 'sound/hallucinations/look_up2.ogg', 'sound/hallucinations/over_here1.ogg', 'sound/hallucinations/over_here2.ogg', 'sound/hallucinations/over_here3.ogg',\ - 'sound/hallucinations/turn_around1.ogg', 'sound/hallucinations/turn_around2.ogg', 'sound/hallucinations/veryfar_noise.ogg', 'sound/hallucinations/wail.ogg') - playsound_local(null, pick(creepyasssounds), 50, 1) - if(13) - playsound_local(null, 'sound/effects/ratvar_rises.ogg', 100) - sleep(150) - playsound_local(null, 'sound/effects/ratvar_reveal.ogg', 100) - if(14) - to_chat(src, "

Priority Announcement

") - to_chat(src, "

The Emergency Shuttle has docked with the station. You have 3 minutes to board the Emergency Shuttle.

") - playsound_local(null, 'sound/ai/shuttledock.ogg', 100) - //Deconstructing a wall - if(15) - playsound_local(null, 'sound/items/welder.ogg', 15, 1) - sleep(105) - playsound_local(null, 'sound/items/welder2.ogg', 15, 1) - sleep(15) - playsound_local(null, 'sound/items/ratchet.ogg', 15, 1) - //Hacking a door - if(16) - playsound_local(null, 'sound/items/screwdriver.ogg', 15, 1) - sleep(rand(10,30)) - for(var/i = rand(1,3), i>0, i--) - playsound_local(null, 'sound/weapons/empty.ogg', 15, 1) - sleep(rand(10,30)) - playsound_local(null, 'sound/machines/airlockforced.ogg', 15, 1) - if(17) - playsound_local(null, 'sound/weapons/saberon.ogg',35,1) - if(18) - to_chat(src, "

Biohazard Alert

") - to_chat(src, "

Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.

") - playsound_local(null, 'sound/ai/outbreak5.ogg') - if(19) //Tesla loose! - playsound_local(null, 'sound/magic/lightningbolt.ogg', 35, 1) - sleep(20) - playsound_local(null, 'sound/magic/lightningbolt.ogg', 65, 1) - sleep(20) - playsound_local(null, 'sound/magic/lightningbolt.ogg', 100, 1) - if(20) //AI is doomsdaying! - to_chat(src, "

Anomaly Alert

") - to_chat(src, "

Hostile runtimes detected in all station systems, please deactivate your AI to prevent possible damage to its morality core.

") - playsound_local(null, 'sound/ai/aimalf.ogg', 100) - if("hudscrew") - //Screwy HUD - //to_chat(src, "Screwy HUD") - hal_screwyhud = pick(SCREWYHUD_NONE,SCREWYHUD_CRIT,SCREWYHUD_DEAD,SCREWYHUD_HEALTHY) - sleep(rand(100,250)) - hal_screwyhud = 0 +/datum/hallucination/sounds + cost = 15 - if("fake_alert") - var/alert_type = pick("oxy","not_enough_tox","not_enough_co2","too_much_oxy","too_much_co2","tox_in_air","newlaw","nutrition","charge","weightless","fire","locked","hacked","temp","pressure") - if(specific) - alert_type = specific - switch(alert_type) - if("oxy") - throw_alert("oxy", /obj/screen/alert/oxy, override = TRUE) - if("not_enough_tox") - throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox, override = TRUE) - if("not_enough_co2") - throw_alert("not_enough_co2", /obj/screen/alert/not_enough_co2, override = TRUE) - if("too_much_oxy") - throw_alert("too_much_oxy", /obj/screen/alert/too_much_oxy, override = TRUE) - if("too_much_co2") - throw_alert("too_much_co2", /obj/screen/alert/too_much_co2, override = TRUE) - if("tox_in_air") - throw_alert("tox_in_air", /obj/screen/alert/tox_in_air, override = TRUE) - if("nutrition") - if(prob(50)) - throw_alert("nutrition", /obj/screen/alert/fat, override = TRUE) - else - throw_alert("nutrition", /obj/screen/alert/starving, override = TRUE) - if("weightless") - throw_alert("weightless", /obj/screen/alert/weightless, override = TRUE) - if("fire") - throw_alert("fire", /obj/screen/alert/fire, override = TRUE) - if("temp") - if(prob(50)) - throw_alert("temp", /obj/screen/alert/hot, 3, override = TRUE) - else - throw_alert("temp", /obj/screen/alert/cold, 3, override = TRUE) - if("pressure") - if(prob(50)) - throw_alert("pressure", /obj/screen/alert/highpressure, 2, override = TRUE) - else - throw_alert("pressure", /obj/screen/alert/lowpressure, 2, override = TRUE) - //BEEP BOOP I AM A ROBOT - if("newlaw") - throw_alert("newlaw", /obj/screen/alert/newlaw, override = TRUE) - if("locked") - throw_alert("locked", /obj/screen/alert/locked, override = TRUE) - if("hacked") - throw_alert("hacked", /obj/screen/alert/hacked, override = TRUE) - if("charge") - throw_alert("charge",/obj/screen/alert/emptycell, override = TRUE) - sleep(rand(100,200)) - clear_alert(alert_type, clear_override = TRUE) - - if("items") - //Strange items - //to_chat(src, "Traitor Items") - if(!halitem) - halitem = new - var/obj/item/l_hand = get_item_for_held_index(1) - var/obj/item/r_hand = get_item_for_held_index(2) - var/l = ui_hand_position(get_held_index_of_item(l_hand)) - var/r = ui_hand_position(get_held_index_of_item(r_hand)) - var/list/slots_free = list(l,r) - if(l_hand) slots_free -= l - if(r_hand) slots_free -= r - if(ishuman(src)) - var/mob/living/carbon/human/H = src - if(!H.belt) slots_free += ui_belt - if(!H.l_store) slots_free += ui_storage1 - if(!H.r_store) slots_free += ui_storage2 - if(slots_free.len) - halitem.screen_loc = pick(slots_free) - halitem.layer = ABOVE_HUD_LAYER - halitem.plane = ABOVE_HUD_PLANE - switch(rand(1,6)) - if(1) //revolver - halitem.icon = 'icons/obj/guns/projectile.dmi' - halitem.icon_state = "revolver" - halitem.name = "Revolver" - if(2) //c4 - halitem.icon = 'icons/obj/grenade.dmi' - halitem.icon_state = "plastic-explosive0" - halitem.name = "Mysterious Package" - if(prob(25)) - halitem.icon_state = "c4small_1" - if(3) //sword - halitem.icon = 'icons/obj/weapons.dmi' - halitem.icon_state = "sword1" - halitem.name = "Sword" - if(4) //stun baton - halitem.icon = 'icons/obj/weapons.dmi' - halitem.icon_state = "stunbaton" - halitem.name = "Stun Baton" - if(5) //emag - halitem.icon = 'icons/obj/card.dmi' - halitem.icon_state = "emag" - halitem.name = "Cryptographic Sequencer" - if(6) //flashbang - halitem.icon = 'icons/obj/grenade.dmi' - halitem.icon_state = "flashbang1" - halitem.name = "Flashbang" - if(client) client.screen += halitem - QDEL_IN(halitem, rand(100, 250)) - if("dangerflash") - //Flashes of danger - //to_chat(src, "Danger Flash") - if(!halimage) - var/list/possible_points = list() - for(var/turf/open/floor/F in view(src,world.view)) - possible_points += F - if(possible_points.len) - var/turf/open/floor/target = pick(possible_points) - - switch(rand(1,4)) - if(1) - //to_chat(src, "Space") - halimage = image('icons/turf/space.dmi',target,"[rand(1,25)]",TURF_LAYER) - if(2) - //to_chat(src, "Lava") - halimage = image('icons/turf/floors/lava.dmi',target,"smooth",TURF_LAYER) - if(3) - //to_chat(src, "Chasm") - halimage = image('icons/turf/floors/Chasms.dmi',target,"smooth",TURF_LAYER) - if(4) - //to_chat(src, "C4") - halimage = image('icons/obj/grenade.dmi',target,"plastic-explosive2",OBJ_LAYER+0.01) - - - if(client) client.images += halimage - sleep(rand(40,60)) //Only seen for a brief moment. - if(client) client.images -= halimage - halimage = null - if("death") - //Fake death - hal_screwyhud = SCREWYHUD_DEAD - SetUnconscious(400) - var/area/area = get_area(src) - to_chat(src, "[mind.name] has died at [area.name].") +/datum/hallucination/sounds/New(mob/living/carbon/T, forced = TRUE, sound_type) + ..() + if(!sound_type) + sound_type = pick("airlock","explosion","far_explosion","glass","phone","summon_guns","alarm","beepsky","hallelujah","creepy","ratvar","shuttle_dock", + "wall_decon","door_hack","esword","blob_alert","tesla","malf_ai") + feedback_details += "Type: [sound_type]" + //Strange audio + switch(sound_type) + if("airlock") + target.playsound_local(null,'sound/machines/airlock.ogg', 15, 1) + if("explosion") if(prob(50)) - var/list/dead_people = list() - for(var/mob/dead/observer/G in GLOB.player_list) - dead_people += G - var/mob/dead/observer/fakemob = pick(dead_people) - if(fakemob) - sleep(rand(30, 60)) - to_chat(src, "DEAD: [fakemob.name] says, \"[pick("rip","welcome [first_name()]","you too?","is the AI malf?",\ - "i[prob(50)?" fucking":""] hate [pick("blood cult", "clock cult", "revenants", "abductors","double agents","viruses","badmins","you")]")]\"") - sleep(rand(50,70)) - hal_screwyhud = SCREWYHUD_NONE - SetSleeping(0) - if("husks") - if(!halbody) - var/list/possible_points = list() - for(var/turf/open/floor/F in view(src,world.view)) - possible_points += F - if(possible_points.len) - var/turf/open/floor/target = pick(possible_points) - switch(rand(1,4)) - if(1) - var/image/body = image('icons/mob/human.dmi',target,"husk",TURF_LAYER) - var/matrix/M = matrix() - M.Turn(90) - body.transform = M - halbody = body - if(2,3) - halbody = image('icons/mob/human.dmi',target,"husk",TURF_LAYER) - if(4) - halbody = image('icons/mob/alien.dmi',target,"alienother",TURF_LAYER) + target.playsound_local(null,'sound/effects/explosion1.ogg', 50, 1) + else + target.playsound_local(null, 'sound/effects/explosion2.ogg', 50, 1) + if("far_explosion") + target.playsound_local(null, 'sound/effects/explosionfar.ogg', 50, 1) + if("glass") + target.playsound_local(null, pick('sound/effects/glassbr1.ogg','sound/effects/glassbr2.ogg','sound/effects/glassbr3.ogg'), 50, 1) + if("phone") + target.playsound_local(null, 'sound/weapons/ring.ogg', 35) + sleep(15) + target.playsound_local(null, 'sound/weapons/ring.ogg', 35) + sleep(15) + target.playsound_local(null, 'sound/weapons/ring.ogg', 35) + if("summon_guns") + target.playsound_local(null, 'sound/magic/summon_guns.ogg', 50, 1) + if("alarm") + target.playsound_local(null, 'sound/machines/alarm.ogg', 100, 0) + if("beepsky") + target.playsound_local(null, 'sound/voice/bfreeze.ogg', 35, 0) + if("hallelujah") + target.playsound_local(null, 'sound/effects/pray_chaplain.ogg', 50) + //Rare audio + if("creepy") + //These sounds are (mostly) taken from Hidden: Source + var/static/list/hallucinations_creepyasssounds = list('sound/effects/ghost.ogg', 'sound/effects/ghost2.ogg', 'sound/effects/heart_beat.ogg', 'sound/effects/screech.ogg',\ + 'sound/hallucinations/behind_you1.ogg', 'sound/hallucinations/behind_you2.ogg', 'sound/hallucinations/far_noise.ogg', 'sound/hallucinations/growl1.ogg', 'sound/hallucinations/growl2.ogg',\ + 'sound/hallucinations/growl3.ogg', 'sound/hallucinations/im_here1.ogg', 'sound/hallucinations/im_here2.ogg', 'sound/hallucinations/i_see_you1.ogg', 'sound/hallucinations/i_see_you2.ogg',\ + 'sound/hallucinations/look_up1.ogg', 'sound/hallucinations/look_up2.ogg', 'sound/hallucinations/over_here1.ogg', 'sound/hallucinations/over_here2.ogg', 'sound/hallucinations/over_here3.ogg',\ + 'sound/hallucinations/turn_around1.ogg', 'sound/hallucinations/turn_around2.ogg', 'sound/hallucinations/veryfar_noise.ogg', 'sound/hallucinations/wail.ogg') + target.playsound_local(null, pick(hallucinations_creepyasssounds), 50, 1) + if("ratvar") + target.playsound_local(null, 'sound/effects/ratvar_rises.ogg', 100) + sleep(150) + target.playsound_local(null, 'sound/effects/ratvar_reveal.ogg', 100) + if("shuttle_dock") + to_chat(target, "

Priority Announcement

") + to_chat(target, "

The Emergency Shuttle has docked with the station. You have 3 minutes to board the Emergency Shuttle.

") + target.playsound_local(null, 'sound/ai/shuttledock.ogg', 100) + //Deconstructing a wall + if("wall_decon") + target.playsound_local(null, 'sound/items/welder.ogg', 15, 1) + sleep(105) + target.playsound_local(null, 'sound/items/welder2.ogg', 15, 1) + sleep(15) + target.playsound_local(null, 'sound/items/ratchet.ogg', 15, 1) + //Hacking a door + if("door_hack") + target.playsound_local(null, 'sound/items/screwdriver.ogg', 15, 1) + sleep(rand(10,30)) + for(var/i = rand(1,3), i>0, i--) + target.playsound_local(null, 'sound/weapons/empty.ogg', 15, 1) + sleep(rand(10,30)) + target.playsound_local(null, 'sound/machines/airlockforced.ogg', 15, 1) + if("esword") + target.playsound_local(null, 'sound/weapons/saberon.ogg',35,1) + if("blob_alert") + to_chat(target, "

Biohazard Alert

") + to_chat(target, "

Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.

") + target.playsound_local(null, 'sound/ai/outbreak5.ogg', 100, 0) + if("tesla") //Tesla loose! + target.playsound_local(null, 'sound/magic/lightningbolt.ogg', 35, 1) + sleep(20) + target.playsound_local(null, 'sound/magic/lightningbolt.ogg', 65, 1) + sleep(20) + target.playsound_local(null, 'sound/magic/lightningbolt.ogg', 100, 1) + if("malf_ai") //AI is doomsdaying! + to_chat(target, "

Anomaly Alert

") + to_chat(target, "

Hostile runtimes detected in all station systems, please deactivate your AI to prevent possible damage to its morality core.

") + target.playsound_local(null, 'sound/ai/aimalf.ogg', 100, 0) + qdel(src) + +/datum/hallucination/hudscrew + cost = 10 + +/datum/hallucination/hudscrew/New(mob/living/carbon/T, forced = TRUE) + ..() + //Screwy HUD + target.set_screwyhud(pick(SCREWYHUD_CRIT,SCREWYHUD_DEAD,SCREWYHUD_HEALTHY)) + feedback_details += "Type: [target.hal_screwyhud]" + sleep(rand(100,250)) + target.set_screwyhud(SCREWYHUD_NONE) + qdel(src) + +/datum/hallucination/fake_alert + cost = 15 + +/datum/hallucination/fake_alert/New(mob/living/carbon/T, forced = TRUE, specific, duration = 150) + ..() + var/alert_type = pick("not_enough_oxy","not_enough_tox","not_enough_co2","too_much_oxy","too_much_co2","too_much_tox","newlaw","nutrition","charge","weightless","fire","locked","hacked","temphot","tempcold","pressure") + if(specific) + alert_type = specific + feedback_details += "Type: [alert_type]" + switch(alert_type) + if("oxy") + target.throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy, override = TRUE) + if("not_enough_tox") + target.throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox, override = TRUE) + if("not_enough_co2") + target.throw_alert("not_enough_co2", /obj/screen/alert/not_enough_co2, override = TRUE) + if("too_much_oxy") + target.throw_alert("too_much_oxy", /obj/screen/alert/too_much_oxy, override = TRUE) + if("too_much_co2") + target.throw_alert("too_much_co2", /obj/screen/alert/too_much_co2, override = TRUE) + if("tox_in_air") + target.throw_alert("too_much_tox", /obj/screen/alert/too_much_tox, override = TRUE) + if("nutrition") + if(prob(50)) + target.throw_alert("nutrition", /obj/screen/alert/fat, override = TRUE) + else + target.throw_alert("nutrition", /obj/screen/alert/starving, override = TRUE) + if("weightless") + target.throw_alert("weightless", /obj/screen/alert/weightless, override = TRUE) + if("fire") + target.throw_alert("fire", /obj/screen/alert/fire, override = TRUE) + if("temphot") + target.throw_alert("temp", /obj/screen/alert/hot, 3, override = TRUE) + if("tempcold") + target.throw_alert("temp", /obj/screen/alert/cold, 3, override = TRUE) + if("pressure") + if(prob(50)) + target.throw_alert("pressure", /obj/screen/alert/highpressure, 2, override = TRUE) + else + target.throw_alert("pressure", /obj/screen/alert/lowpressure, 2, override = TRUE) + //BEEP BOOP I AM A ROBOT + if("newlaw") + target.throw_alert("newlaw", /obj/screen/alert/newlaw, override = TRUE) + if("locked") + target.throw_alert("locked", /obj/screen/alert/locked, override = TRUE) + if("hacked") + target.throw_alert("hacked", /obj/screen/alert/hacked, override = TRUE) + if("charge") + target.throw_alert("charge",/obj/screen/alert/emptycell, override = TRUE) + sleep(duration) + target.clear_alert(alert_type, clear_override = TRUE) + qdel(src) + +/datum/hallucination/items + cost = 15 + +/datum/hallucination/items/New(mob/living/carbon/T, forced = TRUE) + ..() + //Strange items + if(!target.halitem) + target.halitem = new + var/obj/item/l_hand = target.get_item_for_held_index(1) + var/obj/item/r_hand = target.get_item_for_held_index(2) + var/l = ui_hand_position(target.get_held_index_of_item(l_hand)) + var/r = ui_hand_position(target.get_held_index_of_item(r_hand)) + var/list/slots_free = list(l,r) + if(l_hand) slots_free -= l + if(r_hand) slots_free -= r + if(ishuman(target)) + var/mob/living/carbon/human/H = target + if(!H.belt) slots_free += ui_belt + if(!H.l_store) slots_free += ui_storage1 + if(!H.r_store) slots_free += ui_storage2 + if(slots_free.len) + target.halitem.screen_loc = pick(slots_free) + target.halitem.layer = ABOVE_HUD_LAYER + target.halitem.plane = ABOVE_HUD_PLANE + switch(rand(1,6)) + if(1) //revolver + target.halitem.icon = 'icons/obj/guns/projectile.dmi' + target.halitem.icon_state = "revolver" + target.halitem.name = "Revolver" + if(2) //c4 + target.halitem.icon = 'icons/obj/grenade.dmi' + target.halitem.icon_state = "plastic-explosive0" + target.halitem.name = "C4" + if(prob(25)) + target.halitem.icon_state = "plasticx40" + if(3) //sword + target.halitem.icon = 'icons/obj/weapons.dmi' + target.halitem.icon_state = "sword0" + target.halitem.name = "Energy Sword" + if(4) //stun baton + target.halitem.icon = 'icons/obj/weapons.dmi' + target.halitem.icon_state = "stunbaton" + target.halitem.name = "Stun Baton" + if(5) //emag + target.halitem.icon = 'icons/obj/card.dmi' + target.halitem.icon_state = "emag" + target.halitem.name = "Cryptographic Sequencer" + if(6) //flashbang + target.halitem.icon = 'icons/obj/grenade.dmi' + target.halitem.icon_state = "flashbang1" + target.halitem.name = "Flashbang" + feedback_details += "Type: [target.halitem.name]" + if(target.client) target.client.screen += target.halitem + QDEL_IN(target.halitem, rand(150, 350)) + qdel(src) + +/datum/hallucination/dangerflash + cost = 15 + +/datum/hallucination/dangerflash/New(mob/living/carbon/T, forced = TRUE) + ..() + //Flashes of danger + if(!target.halimage) + var/list/possible_points = list() + for(var/turf/open/floor/F in view(target,world.view)) + possible_points += F + if(possible_points.len) + var/turf/open/floor/danger_point = pick(possible_points) + + switch(rand(1,5)) + if(1) + target.halimage = image('icons/turf/space.dmi',danger_point,"[rand(1,25)]",TURF_LAYER) + if(2) + target.halimage = image('icons/turf/floors/lava.dmi',danger_point,"smooth",TURF_LAYER) + if(3) + target.halimage = image('icons/turf/floors/Chasms.dmi',danger_point,"smooth",TURF_LAYER) + if(4) + target.halimage = image('icons/effects/effects.dmi',danger_point,"anom",OBJ_LAYER+0.01) + if(5) + target.halimage = image('icons/effects/effects.dmi',danger_point,"electricity2",OBJ_LAYER+0.01) + + + if(target.client) + target.client.images += target.halimage + sleep(rand(200,450)) + if(target.client) + target.client.images -= target.halimage + QDEL_NULL(target.halimage) + qdel(src) + +/datum/hallucination/death + cost = 40 + +/datum/hallucination/death/New(mob/living/carbon/T, forced = TRUE) + set waitfor = 0 + ..() + target.set_screwyhud(SCREWYHUD_DEAD) + target.Knockdown(300) + target.silent += 10 + var/area/area = get_area(target) + to_chat(target, "[target.mind.name] has died at [area.name].") + if(prob(50)) + var/mob/fakemob + var/list/dead_people = list() + for(var/mob/dead/observer/G in GLOB.player_list) + dead_people += G + if(LAZYLEN(dead_people)) + fakemob = pick(dead_people) + else + fakemob = target //ever been so lonely you had to haunt yourself? + if(fakemob) + sleep(rand(20, 50)) + to_chat(target, "DEAD: [fakemob.name] says, \"[pick("rip","hey [target.first_name()]","you too?","is the AI rogue?",\ + "i[prob(50)?" fucking":""] hate [pick("blood cult", "clock cult", "revenants", "abductors","double agents","viruses","badmins","you")]")]\"") + sleep(rand(70,90)) + target.set_screwyhud(SCREWYHUD_NONE) + target.SetKnockdown(0) + target.silent = 0 + qdel(src) + +/datum/hallucination/fire + cost = 25 + +/datum/hallucination/fire/New(mob/living/carbon/T, forced = TRUE) + ..() + var/image/fire_overlay = image('icons/mob/OnFire.dmi', target, "Standing", ABOVE_MOB_LAYER) + if(target.client) + target.client.images += fire_overlay + to_chat(target, "You're set on fire!") + target.throw_alert("fire", /obj/screen/alert/fire, override = TRUE) + sleep(20) + target.throw_alert("temp", /obj/screen/alert/hot, 1, override = TRUE) + sleep(30) + target.clear_alert("temp", clear_override = TRUE) + target.throw_alert("temp", /obj/screen/alert/hot, 2, override = TRUE) + sleep(30) + target.clear_alert("temp", clear_override = TRUE) + target.throw_alert("temp", /obj/screen/alert/hot, 3, override = TRUE) + for(var/i in 1 to rand(5, 10)) + target.adjustStaminaLoss(15) + sleep(25) + target.clear_alert("fire", clear_override = TRUE) + target.clear_alert("temp", clear_override = TRUE) + if(target.client) + target.client.images -= fire_overlay + QDEL_NULL(fire_overlay) + qdel(src) + +/datum/hallucination/husks + cost = 20 + +/datum/hallucination/husks/New(mob/living/carbon/T, forced = TRUE) + ..() + if(!target.halbody) + var/list/possible_points = list() + for(var/turf/open/floor/F in view(target,world.view)) + possible_points += F + if(possible_points.len) + var/turf/open/floor/husk_point = pick(possible_points) + switch(rand(1,4)) + if(1) + var/image/body = image('icons/mob/human.dmi',husk_point,"husk",TURF_LAYER) + var/matrix/M = matrix() + M.Turn(90) + body.transform = M + target.halbody = body + if(2,3) + target.halbody = image('icons/mob/human.dmi',husk_point,"husk",TURF_LAYER) + if(4) + target.halbody = image('icons/mob/alien.dmi',husk_point,"alienother",TURF_LAYER) + + if(target.client) + target.client.images += target.halbody + sleep(rand(30,50)) //Only seen for a brief moment. + if(target.client) + target.client.images -= target.halbody + QDEL_NULL(target.halbody) + qdel(src) + +//hallucination projectile code in code/modules/projectiles/projectile/special.dm +/datum/hallucination/stray_bullet + cost = 15 + +/datum/hallucination/stray_bullet/New(mob/living/carbon/C, forced = TRUE) + ..() + var/list/turf/startlocs = list() + for(var/turf/open/T in view(world.view+1,target)-view(world.view,target)) + startlocs += T + var/turf/start = pick(startlocs) + var/proj_type = pick(subtypesof(/obj/item/projectile/hallucination)) + feedback_details += "Type: [proj_type]" + var/obj/item/projectile/hallucination/H = new proj_type(start) + target.playsound_local(start, H.hal_fire_sound, 60, 1) + H.hal_target = target + H.current = start + H.starting = start + H.yo = target.y - start.y + H.xo = target.x - start.x + H.original = target + H.fire() + qdel(src) - if(client) client.images += halbody - spawn(rand(30,50)) //Only seen for a brief moment. - if(client) client.images -= halbody - halbody = null