From 5fafc73094c9c093d51bf7b2fe0f0807cb1daa3b Mon Sep 17 00:00:00 2001 From: XDTM Date: Sat, 15 Jul 2017 21:03:34 +0200 Subject: [PATCH 01/11] Hallucinations 3.0 --- .../diseases/advance/symptoms/hallucigen.dm | 2 +- code/game/machinery/doors/airlock.dm | 2 +- code/game/objects/effects/mines.dm | 2 +- code/modules/flufftext/Hallucination.dm | 778 +++++++++--------- code/modules/mob/living/carbon/life.dm | 3 +- .../simple_animal/guardian/types/fire.dm | 2 +- code/modules/surgery/organs/vocal_cords.dm | 5 +- 7 files changed, 412 insertions(+), 382 deletions(-) diff --git a/code/datums/diseases/advance/symptoms/hallucigen.dm b/code/datums/diseases/advance/symptoms/hallucigen.dm index ac38fd9164f..a8a6ce8aefd 100644 --- a/code/datums/diseases/advance/symptoms/hallucigen.dm +++ b/code/datums/diseases/advance/symptoms/hallucigen.dm @@ -59,4 +59,4 @@ Bonus else if(prob(base_message_chance)) to_chat(M, "[pick("Oh, your head...", "Your head pounds.", "They're everywhere! Run!", "Something in the shadows...")]") - M.hallucination += (15 * power) + M.hallucination += (45 * power) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 624d853808a..e65900fa73f 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -233,7 +233,7 @@ return else /*if(src.justzap)*/ return - else if(user.hallucination > 50 && ishuman(user) && prob(10) && src.operating == FALSE) + else if(user.hallucination > 50 && ishuman(user) && prob(4) && src.operating == FALSE) hallucinate_shock(user) return if (cyclelinkedairlock) diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm index c9b524836f6..005d9c7595b 100644 --- a/code/game/objects/effects/mines.dm +++ b/code/game/objects/effects/mines.dm @@ -127,7 +127,7 @@ var/pure_red = list(0,0,0,0,0,0,0,0,0,1,0,0) spawn(0) - new /obj/effect/hallucination/delusion(victim.loc,victim,"demon",duration,0) + new /datum/hallucination/delusion(victim, TRUE, "demon",duration,0) var/obj/item/weapon/twohanded/required/chainsaw/doomslayer/chainsaw = new(victim.loc) chainsaw.flags |= NODROP diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 30e7c843b07..84155f291aa 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -16,46 +16,65 @@ 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 /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) + var/list/minor = list(\ + /datum/hallucination/sound,\ + /datum/hallucination/bolts,\ + /datum/hallucination/whispers,\ + /datum/hallucination/message,\ + /datum/hallucination/hudscrew) //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) + var/list/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/self_delusion) //AAAAH - var/list/major = list("fake"=20,"death"=10,"xeno"=10,"singulo"=10,"delusion"=20,"koolaid"=10) + var/list/major = list(\ + /datum/hallucination/fakeattacker,\ + /datum/hallucination/death,\ + /datum/hallucination/xeno_attack,\ + /datum/hallucination/singularity_scare,\ + /datum/hallucination/delusion,\ + /datum/hallucination/oh_yeah) - 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 + if(hallucination) + var/list/current = minor + if(prob(25) && hallucination > 100) + current = medium + else if(prob(10) && hallucination > 200) + current = major + var/halpick = pick(current) + new halpick(src, FALSE) - var/halpick = pickweight(current) +/datum/hallucination + var/mob/living/carbon/target = null + var/cost = 5 //affects the amount of hallucination reduced, and cooldown until the next hallucination - hallucinate(halpick) - handling_hal = 0 +/datum/hallucination/New(mob/living/carbon/T, forced = TRUE) + 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.hal_screwyhud = SCREWYHUD_NONE + target.SetSleeping(0) /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" @@ -64,7 +83,7 @@ Gunshots/explosions/opening doors/less rare audio (done) var/col_mod = null var/image/current_image = null var/image_layer = MOB_LAYER - var/active = 1 //qdelery + var/active = TRUE //qdelery /obj/effect/hallucination/simple/Initialize(mapload, var/mob/living/carbon/T) ..() @@ -108,29 +127,30 @@ Gunshots/explosions/opening doors/less rare audio (done) #define FAKE_FLOOD_EXPAND_TIME 20 #define FAKE_FLOOD_MAX_RADIUS 10 -/obj/effect/hallucination/fake_flood +/datum/hallucination/fake_flood //Plasma starts flooding from the nearby vent + var/turf/center var/list/flood_images = list() var/list/turf/flood_turfs = list() var/image_icon = 'icons/effects/tile_effects.dmi' var/image_state = "plasma" var/radius = 0 var/next_expand = 0 + cost = 25 -/obj/effect/hallucination/fake_flood/Initialize(mapload, var/mob/living/carbon/T) +/datum/hallucination/fake_flood/New(mob/living/carbon/T, forced = TRUE) ..() - target = T for(var/obj/machinery/atmospherics/components/unary/vent_pump/U in orange(7,target)) if(!U.welded) - src.loc = U.loc + center = get_turf(U) break flood_images += image(image_icon,src,image_state,MOB_LAYER) - flood_turfs += get_turf(src.loc) + flood_turfs += center if(target.client) target.client.images |= flood_images next_expand = world.time + FAKE_FLOOD_EXPAND_TIME START_PROCESSING(SSobj, src) -/obj/effect/hallucination/fake_flood/process() +/datum/hallucination/fake_flood/process() if(next_expand <= world.time) radius++ if(radius > FAKE_FLOOD_MAX_RADIUS) @@ -138,10 +158,10 @@ Gunshots/explosions/opening doors/less rare audio (done) return Expand() if((get_turf(target) in flood_turfs) && !target.internal) - target.hallucinate("fake_alert", "tox_in_air") + new /datum/hallucination/fake_alert(target, TRUE, "tox_in_air") next_expand = world.time + FAKE_FLOOD_EXPAND_TIME -/obj/effect/hallucination/fake_flood/proc/Expand() +/datum/hallucination/fake_flood/proc/Expand() for(var/turf/FT in flood_turfs) for(var/dir in GLOB.cardinals) var/turf/T = get_step(FT, dir) @@ -152,7 +172,7 @@ Gunshots/explosions/opening doors/less rare audio (done) if(target.client) target.client.images |= flood_images -/obj/effect/hallucination/fake_flood/Destroy() +/datum/hallucination/fake_flood/Destroy() STOP_PROCESSING(SSobj, src) qdel(flood_turfs) flood_turfs = list() @@ -167,7 +187,7 @@ Gunshots/explosions/opening doors/less rare audio (done) image_icon = 'icons/mob/alien.dmi' image_state = "alienh_pounce" -/obj/effect/hallucination/simple/xeno/Initialize(mapload, var/mob/living/carbon/T) +/obj/effect/hallucination/simple/xeno/Initialize(mapload, mob/living/carbon/T) ..() name = "alien hunter ([rand(1, 1000)])" @@ -177,14 +197,14 @@ Gunshots/explosions/opening doors/less rare audio (done) target.Knockdown(100) target.visible_message("[target] flails around wildly.","[name] pounces on you!") -/obj/effect/hallucination/xeno_attack +/datum/hallucination/xeno_attack //Xeno crawls from nearby vent,jumps at you, and goes back in var/obj/machinery/atmospherics/components/unary/vent_pump/pump = null var/obj/effect/hallucination/simple/xeno/xeno = null + cost = 25 -/obj/effect/hallucination/xeno_attack/Initialize(mapload, var/mob/living/carbon/T) +/datum/hallucination/xeno_attack/New(mob/living/carbon/T, forced = TRUE) ..() - target = T for(var/obj/machinery/atmospherics/components/unary/vent_pump/U in orange(7,target)) if(!U.welded) pump = U @@ -209,7 +229,7 @@ Gunshots/explosions/opening doors/less rare audio (done) image_icon = 'icons/mob/animal.dmi' image_state = "clown" -/obj/effect/hallucination/simple/clown/Initialize(mapload, var/mob/living/carbon/T,duration) +/obj/effect/hallucination/simple/clown/Initialize(mapload, mob/living/carbon/T, duration) ..(loc, T) name = pick(GLOB.clown_names) QDEL_IN(src,duration) @@ -223,14 +243,14 @@ Gunshots/explosions/opening doors/less rare audio (done) image_state = "bubblegum" px = -32 -/obj/effect/hallucination/oh_yeah +/datum/hallucination/oh_yeah var/obj/effect/hallucination/simple/bubblegum/bubblegum var/image/fakebroken var/image/fakerune + cost = 75 -/obj/effect/hallucination/oh_yeah/Initialize(mapload, var/mob/living/carbon/T) +/datum/hallucination/oh_yeah/New(mob/living/carbon/T, forced = TRUE) . = ..() - target = T var/turf/closed/wall/wall for(var/turf/closed/wall/W in range(7,target)) wall = W @@ -250,7 +270,7 @@ Gunshots/explosions/opening doors/less rare audio (done) bubblegum = new(wall, target) addtimer(CALLBACK(src, .proc/bubble_attack, landing), 10) -/obj/effect/hallucination/oh_yeah/proc/bubble_attack(turf/landing) +/datum/hallucination/oh_yeah/proc/bubble_attack(turf/landing) var/charged = FALSE //only get hit once while(get_turf(bubblegum) != landing && target && target.stat != DEAD) bubblegum.forceMove(get_step_towards(bubblegum, landing)) @@ -268,7 +288,7 @@ Gunshots/explosions/opening doors/less rare audio (done) sleep(30) qdel(src) -/obj/effect/hallucination/oh_yeah/Destroy() +/datum/hallucination/oh_yeah/Destroy() if(target.client) target.client.images.Remove(fakebroken) target.client.images.Remove(fakerune) @@ -277,23 +297,23 @@ Gunshots/explosions/opening doors/less rare audio (done) QDEL_NULL(bubblegum) return ..() -/obj/effect/hallucination/singularity_scare +/datum/hallucination/singularity_scare //Singularity moving towards you. //todo Hide where it moved with fake space images var/obj/effect/hallucination/simple/singularity/s = null + cost = 75 -/obj/effect/hallucination/singularity_scare/Initialize(mapload, var/mob/living/carbon/T) +/datum/hallucination/singularity_scare/New(mob/living/carbon/T, forced = TRUE) ..() - target = T var/turf/start = get_turf(T) var/screen_border = pick(SOUTH,EAST,WEST,NORTH) - for(var/i = 0,i<11,i++) + for(var/i = 0,i<13,i++) start = get_step(start,screen_border) s = new(start,target) s.parent = src - for(var/i = 0,i<11,i++) - sleep(5) - s.loc = get_step(get_turf(s),get_dir(s,target)) + for(var/i = 0,i<13,i++) + sleep(10) + s.forceMove(get_step(get_turf(s),get_dir(s,target))) s.Show() s.Eat() qdel(s) @@ -304,26 +324,26 @@ Gunshots/explosions/opening doors/less rare audio (done) image_layer = MASSIVE_OBJ_LAYER px = -96 py = -96 - var/obj/effect/hallucination/singularity_scare/parent + var/datum/hallucination/singularity_scare/parent /obj/effect/hallucination/simple/singularity/proc/Eat(atom/OldLoc, Dir) var/target_dist = get_dist(src,target) if(target_dist<=3) //"Eaten" - target.hal_screwyhud = SCREWYHUD_CRIT + target.hal_screwyhud = SCREWYHUD_DEAD target.SetUnconscious(160) - addtimer(CALLBACK(parent, .proc/wake_and_restore), rand(30, 50)) + addtimer(CALLBACK(parent, /datum/hallucination/.proc/wake_and_restore), rand(30, 50)) -/obj/effect/hallucination/battle +/datum/hallucination/battle + cost = 15 -/obj/effect/hallucination/battle/Initialize(mapload, var/mob/living/carbon/T) +/datum/hallucination/battle/New(mob/living/carbon/T, forced = TRUE) ..() - target = T var/hits = rand(3,6) switch(rand(1,5)) if(1) //Laser fight for(var/i=0,i[my_target] stumbles around.") -/obj/effect/fake_attacker/Initialize(mapload, var/mob/living/carbon/T) +/obj/effect/fake_attacker/Initialize(mapload, mob/living/carbon/T) ..() my_target = T QDEL_IN(src, 300) @@ -641,12 +660,12 @@ Gunshots/explosions/opening doors/less rare audio (done) QDEL_IN(O, 300) -/obj/effect/hallucination/bolts +/datum/hallucination/bolts var/list/doors = list() + cost = 25 -/obj/effect/hallucination/bolts/Initialize(mapload, var/mob/living/carbon/T,var/door_number=-1) //-1 for severe, 1-2 for subtle +/datum/hallucination/bolts/New(mob/living/carbon/T, forced, door_number=-1) //-1 for severe, 1-2 for subtle ..() - target = T var/image/I = null var/count = 0 for(var/obj/machinery/door/airlock/A in range(7, target)) @@ -667,13 +686,30 @@ Gunshots/explosions/opening doors/less rare audio (done) sleep(rand(6,12)) qdel(src) -/obj/effect/hallucination/whispers +/datum/hallucination/whispers + cost = 15 -/obj/effect/hallucination/whispers/Initialize(mapload, var/mob/living/carbon/T) +/datum/hallucination/whispers/New(mob/living/carbon/T, forced = TRUE) ..() - target = T - var/speak_messages = list("I'm watching you...","[target.first_name()]!","Get out!","Kchck-Chkck? Kchchck!","Did you hear that?","What did you do ?","Why?","Give me that!","HELP!!","EI NATH!!", "RUN!!", "Kill me!","O bidai nabora se'sma!", "[text2ratvar("Divinity, grant...")]") - var/radio_messages = list("Xenos!","Singularity loose!","Comms down!","They are arming the nuke!","They butchered Ian!","H-help!","[pick("Cult", "Wizard", "Ling", "Ops", "Revenant", "Murderer", "Harm", "I hear flashing", "Help")] in [pick(GLOB.teleportlocs)][prob(50)?"!":"!!"]","Where's [target.first_name()]?","Call the shuttle!","AI rogue!!") + var/speak_messages = list("[pick("I'm watching you...","I know what you're doing","What are you hiding?","I saw that")]",\ //they KNOW + "[pick("","Hey, ","Hi ","Hello ","Wait, ","It's ")][target.first_name()]!",\ //yes, you + "[pick("Get out","Go away","Fuck off","OUT!")]",\ //Shoo + "[pick("Kchck-Chkck? Kchchck!","EEEeeeeEEEE","#@§*&£","H-hhhhh...)]",\ //wat + "[pick("Did you hear that?","Did you see that?","What was that?")]",\ //that + "[pick("Hail Ratvar","Hail Nar'Sie","Viva!","[generate_code_phrase()]","Are you mr. [pick(GLOB.possible_changeling_IDs)]?")]",\ //Hi i'm mr. antag + "[pick("Why?","What?","Wait, what?","Wait","Hold on","Uh...")]",\ //Odd during a conversation + "Give me that!",\ + "HELP[pick(""," ME"," HIM"," HER"," THEM")]!!",\ //chelp + "RUN!!",\ + "I'm infected, [pick("stay away","don't get close","be careful","help me","kill me")]") + + 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")]!",\ + "Help!",\ + "[pick("Cult", "Wizard", "Blob", "Ling", "Ops", "Swarmers", "Revenant", "Traitor", "Harm", "I hear flashing", "Help")] in [pick(GLOB.teleportlocs)][prob(50)?"!":"!!"]",\ + "Where's [target.first_name()]?"\ + ,"[pick("C","Ai, c","Someone c","Rec")]all the shuttle!"\ + ,"AI [pick("rogue", "is dead")]!!") var/list/mob/living/carbon/people = list() var/list/mob/living/carbon/person = null @@ -702,307 +738,303 @@ Gunshots/explosions/opening doors/less rare audio (done) to_chat(target, target.compose_message(person,understood_language,pick(radio_messages),"1459",person.get_spans())) 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 speech + "[pick("Hmm...","Yes.","No.","Ignore that last message.","You should stop doing that.","Good luck.")]") 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("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/sound + 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/sound/New(mob/living/carbon/T, forced = TRUE) + ..() + //Strange audio + switch(rand(1,20)) + if(1) target.playsound_local(null,'sound/machines/airlock.ogg', 15, 1) + if(2) 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(3) target.playsound_local(null, 'sound/effects/explosionfar.ogg', 50, 1) + if(4) target.playsound_local(null, pick('sound/effects/glassbr1.ogg','sound/effects/glassbr2.ogg','sound/effects/glassbr3.ogg'), 50, 1) + if(5) + 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(6) target.playsound_local(null, 'sound/magic/summon_guns.ogg', 50, 1) + if(7) target.playsound_local(null, 'sound/machines/alarm.ogg', 100, 0) + if(8) target.playsound_local(null, 'sound/voice/bfreeze.ogg', 35, 0) + if(9) target.playsound_local(null, 'sound/effects/pray_chaplain.ogg', 50) + //Rare audio + if(10) + //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') + target.playsound_local(null, pick(creepyasssounds), 50, 1) + if(11) + target.playsound_local(null, 'sound/effects/ratvar_rises.ogg', 100) + sleep(150) + target.playsound_local(null, 'sound/effects/ratvar_reveal.ogg', 100) + if(12) + 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(13) + 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(14) + 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(15) + target.playsound_local(null, 'sound/weapons/saberon.ogg',35,1) + if(16) + 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(17) //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(18) //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) - if(client) client.images += halbody - spawn(rand(30,50)) //Only seen for a brief moment. - if(client) client.images -= halbody - halbody = null +/datum/hallucination/hudscrew + cost = 10 + +/datum/hallucination/hudscrew/New(mob/living/carbon/T, forced = TRUE) + ..() + //Screwy HUD + target.hal_screwyhud = pick(SCREWYHUD_CRIT,SCREWYHUD_DEAD,SCREWYHUD_HEALTHY) + sleep(rand(100,250)) + target.hal_screwyhud = SCREWYHUD_NONE + qdel(src) + +/datum/hallucination/fake_alert + cost = 15 + +/datum/hallucination/fake_alert/New(mob/living/carbon/T, forced = TRUE, specific) + ..() + 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") + target.throw_alert("oxy", /obj/screen/alert/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("tox_in_air", /obj/screen/alert/tox_in_air, 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("temp") + if(prob(50)) + target.throw_alert("temp", /obj/screen/alert/hot, 3, override = TRUE) + else + 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(rand(100,200)) + 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" + 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) + ..() + target.hal_screwyhud = SCREWYHUD_DEAD + target.SetUnconscious(400) + var/area/area = get_area(src) + to_chat(target, "[target.mind.name] has died at [area.name].") + 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(target, "DEAD: [fakemob.name] says, \"[pick("rip","welcome [target.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)) + target.hal_screwyhud = SCREWYHUD_NONE + target.SetSleeping(0) + 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(src,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) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 9b04a5467de..8bacfe53df7 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -369,8 +369,7 @@ adjust_drugginess(-1) if(hallucination) - spawn handle_hallucinations() - hallucination = max(hallucination-2,0) + handle_hallucinations() //used in human and monkey handle_environment() /mob/living/carbon/proc/natural_bodytemperature_stabilization() diff --git a/code/modules/mob/living/simple_animal/guardian/types/fire.dm b/code/modules/mob/living/simple_animal/guardian/types/fire.dm index c42dbb0783a..78554e29bad 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/fire.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/fire.dm @@ -21,7 +21,7 @@ /mob/living/simple_animal/hostile/guardian/fire/AttackingTarget() . = ..() if(. && ishuman(target) && target != summoner) - new /obj/effect/hallucination/delusion(target.loc,target,"custom",200,0, icon_state,icon) + new /datum/hallucination/delusion(target,TRUE,"custom",200,0, icon_state,icon) /mob/living/simple_animal/hostile/guardian/fire/Crossed(AM as mob|obj) ..() diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index ff44804e759..0f5f1de91d6 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -290,9 +290,8 @@ //HALLUCINATE else if((findtext(message, hallucinate_words))) cooldown = COOLDOWN_MEME - for(var/V in listeners) - var/mob/living/L = V - new /obj/effect/hallucination/delusion(get_turf(L),L,null,150 * power_multiplier,0) + for(var/mob/living/carbon/C in listeners) + new /datum/hallucination/delusion(C, TRUE, null,150 * power_multiplier,0) //WAKE UP else if((findtext(message, wakeup_words))) From 444dd6a600595f3a6d5142c9614a55ed6a40ae03 Mon Sep 17 00:00:00 2001 From: XDTM Date: Sat, 15 Jul 2017 22:02:47 +0200 Subject: [PATCH 02/11] don't you love it when comments affect the code --- code/modules/flufftext/Hallucination.dm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 84155f291aa..5816864e0b4 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -691,15 +691,15 @@ 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")]",\ //they KNOW - "[pick("","Hey, ","Hi ","Hello ","Wait, ","It's ")][target.first_name()]!",\ //yes, you - "[pick("Get out","Go away","Fuck off","OUT!")]",\ //Shoo - "[pick("Kchck-Chkck? Kchchck!","EEEeeeeEEEE","#@§*&£","H-hhhhh...)]",\ //wat - "[pick("Did you hear that?","Did you see that?","What was that?")]",\ //that - "[pick("Hail Ratvar","Hail Nar'Sie","Viva!","[generate_code_phrase()]","Are you mr. [pick(GLOB.possible_changeling_IDs)]?")]",\ //Hi i'm mr. antag - "[pick("Why?","What?","Wait, what?","Wait","Hold on","Uh...")]",\ //Odd during a conversation + 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")]!!",\ //chelp + "HELP[pick(""," ME"," HIM"," HER"," THEM")]!!",\ "RUN!!",\ "I'm infected, [pick("stay away","don't get close","be careful","help me","kill me")]") From 9a2a083e5140c3750cf4a2d21962cfbaa2e5f573 Mon Sep 17 00:00:00 2001 From: XDTM Date: Sun, 16 Jul 2017 16:29:44 +0200 Subject: [PATCH 03/11] Fire hallucination and misc fixes --- code/datums/datumvars.dm | 18 +++++ code/modules/flufftext/Hallucination.dm | 94 +++++++++++++++--------- code/modules/mob/living/carbon/carbon.dm | 1 + 3 files changed, 80 insertions(+), 33 deletions(-) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index b9c90ce4f50..9a79c477c89 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -929,6 +929,24 @@ manipulate_organs(C) href_list["datumrefresh"] = href_list["editorgans"] + else if(href_list["hallucinate"]) + if(!check_rights(0)) + return + + var/mob/living/carbon/C = locate(href_list["hallucinate"]) + if(!istype(C)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon") + return + + var/list/hallucinations = subtypesof(/datum/hallucination) + var/result = input(usr, "Choose the hallucination to apply","Send Hallucination") as null|anything in hallucinations + if(!C) + to_chat(usr, "Mob doesn't exist anymore") + return + + if(result) + new result(C, TRUE) + else if(href_list["makehuman"]) if(!check_rights(R_SPAWN)) return diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 5816864e0b4..e6f19586225 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -22,30 +22,31 @@ Gunshots/explosions/opening doors/less rare audio (done) if(world.time < next_hallucination) return //Least obvious - var/list/minor = list(\ - /datum/hallucination/sound,\ - /datum/hallucination/bolts,\ - /datum/hallucination/whispers,\ - /datum/hallucination/message,\ + var/list/minor = list( + /datum/hallucination/sound, + /datum/hallucination/bolts, + /datum/hallucination/whispers, + /datum/hallucination/message, /datum/hallucination/hudscrew) //Something's wrong here - var/list/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,\ + var/list/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) //AAAAH - var/list/major = list(\ - /datum/hallucination/fakeattacker,\ - /datum/hallucination/death,\ - /datum/hallucination/xeno_attack,\ - /datum/hallucination/singularity_scare,\ - /datum/hallucination/delusion,\ + var/list/major = list( + /datum/hallucination/fakeattacker, + /datum/hallucination/death, + /datum/hallucination/xeno_attack, + /datum/hallucination/singularity_scare, + /datum/hallucination/delusion, /datum/hallucination/oh_yeah) if(hallucination) @@ -144,7 +145,7 @@ Gunshots/explosions/opening doors/less rare audio (done) if(!U.welded) center = get_turf(U) break - flood_images += image(image_icon,src,image_state,MOB_LAYER) + flood_images += image(image_icon,center,image_state,MOB_LAYER) flood_turfs += center if(target.client) target.client.images |= flood_images next_expand = world.time + FAKE_FLOOD_EXPAND_TIME @@ -220,7 +221,7 @@ Gunshots/explosions/opening doors/less rare audio (done) sleep(10) var/xeno_name = xeno.name to_chat(target, "[xeno_name] begins climbing into the ventilation system...") - sleep(10) + sleep(30) qdel(xeno) to_chat(target, "[xeno_name] scrambles into the ventilation ducts!") qdel(src) @@ -637,7 +638,7 @@ Gunshots/explosions/opening doors/less rare audio (done) if(!locate(/obj/effect/overlay) in my_target.loc) fake_blood(my_target) else - my_target.playsound_local(my_target, pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg'), 25, 1, -1) + my_target.playsound_local(my_target, pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg'), 25, 1) my_target.show_message("[src.name] has punched [my_target]!", 1) my_target.staminaloss += 30 if(prob(33)) @@ -846,9 +847,9 @@ Gunshots/explosions/opening doors/less rare audio (done) /datum/hallucination/fake_alert cost = 15 -/datum/hallucination/fake_alert/New(mob/living/carbon/T, forced = TRUE, specific) +/datum/hallucination/fake_alert/New(mob/living/carbon/T, forced = TRUE, specific, duration = 150) ..() - 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") + 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","temphot","tempcold","pressure") if(specific) alert_type = specific switch(alert_type) @@ -873,11 +874,10 @@ Gunshots/explosions/opening doors/less rare audio (done) target.throw_alert("weightless", /obj/screen/alert/weightless, override = TRUE) if("fire") target.throw_alert("fire", /obj/screen/alert/fire, override = TRUE) - if("temp") - if(prob(50)) - target.throw_alert("temp", /obj/screen/alert/hot, 3, override = TRUE) - else - target.throw_alert("temp", /obj/screen/alert/cold, 3, 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) @@ -892,7 +892,7 @@ Gunshots/explosions/opening doors/less rare audio (done) target.throw_alert("hacked", /obj/screen/alert/hacked, override = TRUE) if("charge") target.throw_alert("charge",/obj/screen/alert/emptycell, override = TRUE) - sleep(rand(100,200)) + sleep(duration) target.clear_alert(alert_type, clear_override = TRUE) qdel(src) @@ -992,7 +992,7 @@ Gunshots/explosions/opening doors/less rare audio (done) ..() target.hal_screwyhud = SCREWYHUD_DEAD target.SetUnconscious(400) - var/area/area = get_area(src) + var/area/area = get_area(target) to_chat(target, "[target.mind.name] has died at [area.name].") if(prob(50)) var/list/dead_people = list() @@ -1008,6 +1008,34 @@ Gunshots/explosions/opening doors/less rare audio (done) target.SetSleeping(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 @@ -1015,7 +1043,7 @@ Gunshots/explosions/opening doors/less rare audio (done) ..() if(!target.halbody) var/list/possible_points = list() - for(var/turf/open/floor/F in view(src,world.view)) + 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) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index f70c4cfa2cc..f0d8f1d4ca8 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -805,3 +805,4 @@ .["Make AI"] = "?_src_=vars;makeai=\ref[src]" .["Modify bodypart"] = "?_src_=vars;editbodypart=\ref[src]" .["Modify organs"] = "?_src_=vars;editorgans=\ref[src]" + .["Hallucinate"] = "?_src_=vars;hallucinate=\ref[src]" From 57d4753ad6f3a84fe3cf696c27fbc8554b1f81d1 Mon Sep 17 00:00:00 2001 From: XDTM Date: Sun, 16 Jul 2017 17:26:23 +0200 Subject: [PATCH 04/11] code improvement --- code/modules/flufftext/Hallucination.dm | 31 +++++++++++++++---------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index e6f19586225..6020d2980b2 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -308,11 +308,11 @@ Gunshots/explosions/opening doors/less rare audio (done) ..() var/turf/start = get_turf(T) var/screen_border = pick(SOUTH,EAST,WEST,NORTH) - for(var/i = 0,i<13,i++) + for(var/i in 1 to 13) start = get_step(start,screen_border) s = new(start,target) s.parent = src - for(var/i = 0,i<13,i++) + for(var/i in 1 to 13) sleep(10) s.forceMove(get_step(get_turf(s),get_dir(s,target))) s.Show() @@ -342,7 +342,7 @@ Gunshots/explosions/opening doors/less rare audio (done) var/hits = rand(3,6) switch(rand(1,5)) if(1) //Laser fight - for(var/i=0,i Date: Sun, 16 Jul 2017 20:26:42 +0200 Subject: [PATCH 05/11] stray bullets --- code/modules/flufftext/Hallucination.dm | 46 +++++-- .../modules/projectiles/projectile/special.dm | 126 ++++++++++++++++++ 2 files changed, 159 insertions(+), 13 deletions(-) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 6020d2980b2..68e8a9289c9 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -18,18 +18,14 @@ Gunshots/explosions/opening doors/less rare audio (done) var/hal_screwyhud = SCREWYHUD_NONE var/next_hallucination = 0 -/mob/living/carbon/proc/handle_hallucinations() - if(world.time < next_hallucination) - return - //Least obvious - var/list/minor = list( +var/static/list/hallucinations_minor = list( /datum/hallucination/sound, /datum/hallucination/bolts, /datum/hallucination/whispers, /datum/hallucination/message, /datum/hallucination/hudscrew) - //Something's wrong here - var/list/medium = list( + +var/static/list/hallucinations_medium = list( /datum/hallucination/fake_alert, /datum/hallucination/items, /datum/hallucination/items_other, @@ -40,8 +36,8 @@ Gunshots/explosions/opening doors/less rare audio (done) /datum/hallucination/battle, /datum/hallucination/fire, /datum/hallucination/self_delusion) - //AAAAH - var/list/major = list( + +var/static/list/hallucinations_major = list( /datum/hallucination/fakeattacker, /datum/hallucination/death, /datum/hallucination/xeno_attack, @@ -49,12 +45,16 @@ Gunshots/explosions/opening doors/less rare audio (done) /datum/hallucination/delusion, /datum/hallucination/oh_yeah) +/mob/living/carbon/proc/handle_hallucinations() + if(world.time < next_hallucination) + return + if(hallucination) - var/list/current = minor + var/list/current = hallucinations_minor if(prob(25) && hallucination > 100) - current = medium + current = hallucinations_medium else if(prob(10) && hallucination > 200) - current = major + current = hallucinations_major var/halpick = pick(current) new halpick(src, FALSE) @@ -1072,4 +1072,24 @@ Gunshots/explosions/opening doors/less rare audio (done) if(target.client) target.client.images -= target.halbody QDEL_NULL(target.halbody) - qdel(src) \ No newline at end of file + 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/T, forced = TRUE) + ..() + var/list/turf/startlocs = (view(world.view+1,target)-view(world.view,target)) + var/turf/start = pick(startlocs) + var/obj/item/projectile/hallucination/bullet/H = new(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) + diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index 6d7b1d4ef02..a3dbcd49be1 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -386,3 +386,129 @@ var/obj/effect/ebeam/B = b animate(B, alpha = 0, time = 32) return ..() + +/obj/item/projectile/hallucination + name = "bullet" + icon = 'icons/obj/projectiles.dmi' + icon_state = "bullet" + hitsound = "" + suppressed = TRUE + ricochets_max = 0 + ricochet_chance = 0 + damage = 0 + nodamage = TRUE + projectile_type = /obj/item/projectile/hallucination + log_override = TRUE + var/hal_icon_state + var/image/fake_icon + var/mob/living/carbon/hal_target + var/hal_fire_sound + var/hal_hitsound + var/hal_impact_effect + var/hal_hitsound_wall + +/obj/item/projectile/hallucination/fire() + ..() + fake_icon = image('icons/obj/projectiles.dmi', src, hal_icon_state, ABOVE_MOB_LAYER) + if(hal_target.client) + hal_target.client.images += fake_icon + +/obj/item/projectile/hallucination/Destroy() + if(hal_target.client) + hal_target.client.images -= fake_icon + QDEL_NULL(fake_icon) + return ..() + +/obj/item/projectile/hallucination/Collide(atom/A) + if(!ismob(A)) + hal_target.playsound_local(loc, hal_hitsound_wall, 40, 1) + spawn_hit(A) + else if(A == hal_target) + hal_target.playsound_local(A, hal_hitsound, 100, 1) + target_on_hit(A) + qdel(src) + return TRUE + +/obj/item/projectile/hallucination/proc/target_on_hit(mob/M) + var/organ_hit_text = "" + if(isliving(M)) + var/mob/living/L = M + var/limb_hit = L.check_limb_hit(def_zone)//to get the correct message info. + if(limb_hit) + organ_hit_text = " in \the [parse_zone(limb_hit)]" + if(M == hal_target) + to_chat(hal_target, "[M] is hit by \a [src][organ_hit_text]!") + hal_apply_effect() + else if(M in view(hal_target)) + to_chat(hal_target, "[M] is hit by \a [src][organ_hit_text]!") + if(damage_type == BRUTE) + var/splatter_dir = dir + if(starting) + splatter_dir = get_dir(starting, get_turf(M)) + spawn_blood(M, splatter_dir) + else if(hal_impact_effect) + spawn_hit(M) + +/obj/item/projectile/hallucination/proc/spawn_blood(mob/M, set_dir) + if(!hal_target.client) + return + var/splatter_icon_state + if(set_dir in GLOB.diagonals) + splatter_icon_state = "splatter[pick(1, 2, 6)]" + else + splatter_icon_state = "splatter[pick(3, 4, 5)]" + + var/image/blood = image('icons/effects/blood.dmi', M, splatter_icon_state, ABOVE_MOB_LAYER) + var/target_pixel_x = 0 + var/target_pixel_y = 0 + switch(set_dir) + if(NORTH) + target_pixel_y = 16 + if(SOUTH) + target_pixel_y = -16 + layer = ABOVE_MOB_LAYER + if(EAST) + target_pixel_x = 16 + if(WEST) + target_pixel_x = -16 + if(NORTHEAST) + target_pixel_x = 16 + target_pixel_y = 16 + if(NORTHWEST) + target_pixel_x = -16 + target_pixel_y = 16 + if(SOUTHEAST) + target_pixel_x = 16 + target_pixel_y = -16 + layer = ABOVE_MOB_LAYER + if(SOUTHWEST) + target_pixel_x = -16 + target_pixel_y = -16 + layer = ABOVE_MOB_LAYER + hal_target.client.images += blood + animate(blood, pixel_x = target_pixel_x, pixel_y = target_pixel_y, alpha = 0, time = 5) + QDEL_IN(blood, 5) + +/obj/item/projectile/hallucination/proc/spawn_hit(atom/A) + if(!hal_target.client) + return + + var/image/hit_effect = image('icons/effects/blood.dmi', A, hal_impact_effect, ABOVE_MOB_LAYER) + hit_effect.pixel_x = A.pixel_x + rand(-4,4) + hit_effect.pixel_y = A.pixel_y + rand(-4,4) + hal_target.client.images += hit_effect + QDEL_IN(hit_effect, 5) + +/obj/item/projectile/hallucination/proc/hal_apply_effect() + return + +/obj/item/projectile/hallucination/bullet + name = "bullet" + hal_icon_state = "bullet" + hal_fire_sound = "gunshot" + hal_hitsound = 'sound/weapons/pierce.ogg' + hal_impact_effect = "impact_bullet" + hal_hitsound_wall = "ricochet" + +/obj/item/projectile/hallucination/bullet/hal_apply_effect() + hal_target.adjustStaminaLoss(60) \ No newline at end of file From 4283a07aa61f530733bf19a7d3bf61fb1af675ab Mon Sep 17 00:00:00 2001 From: XDTM Date: Tue, 18 Jul 2017 22:00:42 +0200 Subject: [PATCH 06/11] stray bullets --- code/modules/flufftext/Hallucination.dm | 9 +- .../modules/projectiles/projectile/special.dm | 115 +++++++++++++++--- 2 files changed, 102 insertions(+), 22 deletions(-) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 68e8a9289c9..6cc08868f09 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -1078,11 +1078,14 @@ var/static/list/hallucinations_major = list( /datum/hallucination/stray_bullet cost = 15 -/datum/hallucination/stray_bullet/New(mob/living/carbon/T, forced = TRUE) +/datum/hallucination/stray_bullet/New(mob/living/carbon/C, forced = TRUE) ..() - var/list/turf/startlocs = (view(world.view+1,target)-view(world.view,target)) + var/list/turf/startlocs = list() + for(var/turf/T in view(world.view+1,target)-view(world.view,target)) + startlocs += T var/turf/start = pick(startlocs) - var/obj/item/projectile/hallucination/bullet/H = new(start) + var/proj_type = pick(subtypesof(/obj/item/projectile/hallucination)) + 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 diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index a3dbcd49be1..8917556a854 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -404,8 +404,11 @@ var/mob/living/carbon/hal_target var/hal_fire_sound var/hal_hitsound - var/hal_impact_effect var/hal_hitsound_wall + var/hal_impact_effect + var/hal_impact_effect_wall + var/hit_duration + var/hit_duration_wall /obj/item/projectile/hallucination/fire() ..() @@ -421,37 +424,36 @@ /obj/item/projectile/hallucination/Collide(atom/A) if(!ismob(A)) - hal_target.playsound_local(loc, hal_hitsound_wall, 40, 1) - spawn_hit(A) + if(hal_hitsound_wall) + hal_target.playsound_local(loc, hal_hitsound_wall, 40, 1) + if(hal_impact_effect_wall) + spawn_hit(A, TRUE) else if(A == hal_target) - hal_target.playsound_local(A, hal_hitsound, 100, 1) + if(hal_hitsound) + hal_target.playsound_local(A, hal_hitsound, 100, 1) target_on_hit(A) qdel(src) return TRUE /obj/item/projectile/hallucination/proc/target_on_hit(mob/M) - var/organ_hit_text = "" - if(isliving(M)) - var/mob/living/L = M - var/limb_hit = L.check_limb_hit(def_zone)//to get the correct message info. - if(limb_hit) - organ_hit_text = " in \the [parse_zone(limb_hit)]" if(M == hal_target) - to_chat(hal_target, "[M] is hit by \a [src][organ_hit_text]!") + to_chat(hal_target, "[M] is hit by \a [src] in the chest!") hal_apply_effect() else if(M in view(hal_target)) - to_chat(hal_target, "[M] is hit by \a [src][organ_hit_text]!") + to_chat(hal_target, "[M] is hit by \a [src] in the chest!!") if(damage_type == BRUTE) var/splatter_dir = dir if(starting) splatter_dir = get_dir(starting, get_turf(M)) spawn_blood(M, splatter_dir) else if(hal_impact_effect) - spawn_hit(M) + spawn_hit(M, FALSE) /obj/item/projectile/hallucination/proc/spawn_blood(mob/M, set_dir) + set waitfor = 0 if(!hal_target.client) return + var/splatter_icon_state if(set_dir in GLOB.diagonals) splatter_icon_state = "splatter[pick(1, 2, 6)]" @@ -487,17 +489,23 @@ layer = ABOVE_MOB_LAYER hal_target.client.images += blood animate(blood, pixel_x = target_pixel_x, pixel_y = target_pixel_y, alpha = 0, time = 5) - QDEL_IN(blood, 5) + sleep(5) + hal_target.client.images -= blood + qdel(blood) -/obj/item/projectile/hallucination/proc/spawn_hit(atom/A) +/obj/item/projectile/hallucination/proc/spawn_hit(atom/A, is_wall) + set waitfor = 0 if(!hal_target.client) return - var/image/hit_effect = image('icons/effects/blood.dmi', A, hal_impact_effect, ABOVE_MOB_LAYER) + var/image/hit_effect = image('icons/effects/blood.dmi', A, is_wall ? hal_impact_effect_wall : hal_impact_effect, ABOVE_MOB_LAYER) hit_effect.pixel_x = A.pixel_x + rand(-4,4) hit_effect.pixel_y = A.pixel_y + rand(-4,4) hal_target.client.images += hit_effect - QDEL_IN(hit_effect, 5) + sleep(is_wall ? hit_duration_wall : hit_duration) + hal_target.client.images -= hit_effect + qdel(hit_effect) + /obj/item/projectile/hallucination/proc/hal_apply_effect() return @@ -507,8 +515,77 @@ hal_icon_state = "bullet" hal_fire_sound = "gunshot" hal_hitsound = 'sound/weapons/pierce.ogg' - hal_impact_effect = "impact_bullet" hal_hitsound_wall = "ricochet" + hal_impact_effect = "impact_bullet" + hal_impact_effect_wall = "impact_bullet" + hit_duration = 5 + hit_duration_wall = 5 /obj/item/projectile/hallucination/bullet/hal_apply_effect() - hal_target.adjustStaminaLoss(60) \ No newline at end of file + hal_target.adjustStaminaLoss(60) + +/obj/item/projectile/hallucination/laser + name = "laser" + damage_type = BURN + hal_icon_state = "laser" + hal_fire_sound = 'sound/weapons/laser.ogg' + hal_hitsound = 'sound/weapons/sear.ogg' + hal_hitsound_wall = 'sound/weapons/effects/searwall.ogg' + hal_impact_effect = "impact_laser" + hal_impact_effect_wall = "impact_laser_wall" + hit_duration = 4 + hit_duration_wall = 10 + pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE + +/obj/item/projectile/hallucination/laser/hal_apply_effect() + hal_target.adjustStaminaLoss(20) + hal_target.blur_eyes(2) + +/obj/item/projectile/hallucination/taser + name = "electrode" + hal_icon_state = "spark" + color = "#FFFF00" + hal_fire_sound = 'sound/weapons/taser.ogg' + hal_hitsound = 'sound/weapons/taserhit.ogg' + hal_hitsound_wall = null + hal_impact_effect = null + hal_impact_effect_wall = null + range = 7 + +/obj/item/projectile/hallucination/taser/hal_apply_effect() + hal_target.Knockdown(100) + hal_target.stuttering += 20 + if(hal_target.dna && hal_target.dna.check_mutation(HULK)) + hal_target.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) + else if(hal_target.status_flags & CANKNOCKDOWN) + addtimer(CALLBACK(hal_target, /mob/living/carbon.proc/do_jitter_animation, 20), 5) + +/obj/item/projectile/hallucination/disabler + name = "disabler beam" + damage_type = STAMINA + hal_icon_state = "omnilaser" + hal_fire_sound = 'sound/weapons/taser2.ogg' + hal_hitsound = 'sound/weapons/tap.ogg' + hal_hitsound_wall = 'sound/weapons/effects/searwall.ogg' + hal_impact_effect = "impact_laser_blue" + hal_impact_effect_wall = null + hit_duration = 4 + pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE + +/obj/item/projectile/hallucination/disabler/hal_apply_effect() + hal_target.adjustStaminaLoss(25) + +/obj/item/projectile/hallucination/ebow + name = "bolt" + damage_type = TOX + hal_icon_state = "cbbolt" + hal_fire_sound = 'sound/weapons/genhit.ogg' + hal_hitsound = null + hal_hitsound_wall = null + hal_impact_effect = null + hal_impact_effect_wall = null + +/obj/item/projectile/hallucination/ebow/hal_apply_effect() + hal_target.Knockdown(100) + hal_target.stuttering += 5 + hal_target.adjustStaminaLoss(8) From ae045dab62ba11c2f2789073d4cbb173fee4340b Mon Sep 17 00:00:00 2001 From: XDTM Date: Tue, 18 Jul 2017 23:21:15 +0200 Subject: [PATCH 07/11] Further code improvement --- code/datums/datumvars.dm | 4 +- code/game/machinery/doors/airlock.dm | 2 +- code/modules/flufftext/Hallucination.dm | 67 ++++---- strings/hallucination.json | 201 ++++++++++++++++++++++++ 4 files changed, 242 insertions(+), 32 deletions(-) create mode 100644 strings/hallucination.json diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 700c76e56ad..7b399879c57 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -933,13 +933,15 @@ if(!check_rights(0)) return - var/mob/living/carbon/C = locate(href_list["hallucinate"]) + var/mob/living/carbon/C = locate(href_list["hallucinate"]) in GLOB.mob_list if(!istype(C)) to_chat(usr, "This can only be done to instances of type /mob/living/carbon") return var/list/hallucinations = subtypesof(/datum/hallucination) var/result = input(usr, "Choose the hallucination to apply","Send Hallucination") as null|anything in hallucinations + if(!usr) + return if(!C) to_chat(usr, "Mob doesn't exist anymore") return diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index e65900fa73f..007f8e42bdc 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -233,7 +233,7 @@ return else /*if(src.justzap)*/ return - else if(user.hallucination > 50 && ishuman(user) && prob(4) && src.operating == FALSE) + else if(user.hallucination > 50 && ishuman(user) && prob(4) && !operating) hallucinate_shock(user) return if (cyclelinkedairlock) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 1fd83090283..01693d0bc77 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -11,6 +11,8 @@ Gunshots/explosions/opening doors/less rare audio (done) */ +#define HAL_LINES_FILE "hallucination.json" + /mob/living/carbon var/image/halimage var/image/halbody @@ -19,7 +21,7 @@ Gunshots/explosions/opening doors/less rare audio (done) var/next_hallucination = 0 var/static/list/hallucinations_minor = list( - /datum/hallucination/sound, + /datum/hallucination/sounds, /datum/hallucination/bolts, /datum/hallucination/whispers, /datum/hallucination/message, @@ -59,7 +61,7 @@ var/static/list/hallucinations_major = list( new halpick(src, FALSE) /datum/hallucination - var/mob/living/carbon/target = null + var/mob/living/carbon/target var/cost = 5 //affects the amount of hallucination reduced, and cooldown until the next hallucination /datum/hallucination/New(mob/living/carbon/T, forced = TRUE) @@ -90,7 +92,8 @@ var/static/list/hallucinations_major = list( ..() target = T current_image = GetImage() - if(target.client) target.client.images |= current_image + if(target.client) + target.client.images |= current_image /obj/effect/hallucination/simple/proc/GetImage() var/image/I = image(image_icon,src,image_state,image_layer,dir=src.dir) @@ -102,10 +105,12 @@ var/static/list/hallucinations_major = list( /obj/effect/hallucination/simple/proc/Show(update=1) if(active) - if(target.client) target.client.images.Remove(current_image) + if(target.client) + target.client.images.Remove(current_image) if(update) current_image = GetImage() - if(target.client) target.client.images |= current_image + if(target.client) + target.client.images |= current_image /obj/effect/hallucination/simple/update_icon(new_state,new_icon,new_px=0,new_py=0) image_state = new_state @@ -121,8 +126,9 @@ var/static/list/hallucinations_major = list( Show() /obj/effect/hallucination/simple/Destroy() - if(target.client) target.client.images.Remove(current_image) - active = 0 + if(target.client) + target.client.images.Remove(current_image) + active = FALSE return ..() #define FAKE_FLOOD_EXPAND_TIME 20 @@ -692,22 +698,22 @@ var/static/list/hallucinations_major = list( /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")]!!") @@ -753,15 +759,15 @@ var/static/list/hallucinations_major = list( "[target] sneezes.", \ //The truth, revealed "You're hallucinating.", \ - //Direct speech - "[pick("Hmm...","Yes.","No.","Ignore that last message.","You should stop doing that.","Good luck.")]") + //Direct advice + "[pick_list_replacements(HAL_LINES_FILE, "advice")]") to_chat(target, chosen) qdel(src) -/datum/hallucination/sound +/datum/hallucination/sounds cost = 15 -/datum/hallucination/sound/New(mob/living/carbon/T, forced = TRUE) +/datum/hallucination/sounds/New(mob/living/carbon/T, forced = TRUE) ..() //Strange audio switch(rand(1,20)) @@ -793,12 +799,12 @@ var/static/list/hallucinations_major = list( //Rare audio if(10) //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',\ + 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(creepyasssounds), 50, 1) + target.playsound_local(null, pick(hallucinations_creepyasssounds), 50, 1) if(11) target.playsound_local(null, 'sound/effects/ratvar_rises.ogg', 100) sleep(150) @@ -856,12 +862,12 @@ var/static/list/hallucinations_major = list( /datum/hallucination/fake_alert/New(mob/living/carbon/T, forced = TRUE, specific, duration = 150) ..() - 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","temphot","tempcold","pressure") + 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 switch(alert_type) if("oxy") - target.throw_alert("oxy", /obj/screen/alert/oxy, override = TRUE) + 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") @@ -871,7 +877,7 @@ var/static/list/hallucinations_major = list( 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("tox_in_air", /obj/screen/alert/tox_in_air, override = TRUE) + 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) @@ -1094,4 +1100,5 @@ var/static/list/hallucinations_major = list( H.xo = target.x - start.x H.original = target H.fire() - qdel(src) \ No newline at end of file + qdel(src) + diff --git a/strings/hallucination.json b/strings/hallucination.json new file mode 100644 index 00000000000..03c2a21b854 --- /dev/null +++ b/strings/hallucination.json @@ -0,0 +1,201 @@ +{ + "suspicion": [ + "I'm watching you...", + "I know what you're doing", + "What are you hiding?", + "I saw that" + ], + + "greetings": [ + "", + "Hey, ", + "Hi ", + "Hello ", + "Wait, ", + "It's " + ], + + "getout": [ + "Get out", + "Get out!", + "Go away", + "Fuck off", + "OUT!", + "Out!" + ], + + "weird": [ + "Kchck-Chkck? Kchchck!", + "Kchckchk...", + "EEEeeeeEEEE", + "khhhhh", + "#@§*&£", + "H**p m*", + "H-hhhhh..." + ], + + "didyouhearthat": [ + "Did you hear that?", + "Did you see that?", + "What was that?" + ], + + "imatraitor": [ + "Hail Ratvar", + "Hail Nar'Sie", + "Hey, i've got some TC left, want something?", + "Viva!", + "I'll spare you if you don't tell anybody about me", + "Hey, are you a traitor too?", + "You're my target, but @pick(excuses)", + "Are you mr. @pick(ling_names)?" + ], + + "excuses": [ + "i like you, so i'll spare you", + "i don't really feel like following objectives today", + "i'm not robust enough to fight you", + "who cares", + "i'll kill you later" + ] + + "ling_names": [ + "Alpha", + "Beta", + "Gamma", + "Delta", + "Epsilon", + "Eta", + "Theta", + "Lambda", + "Mu", + "Xi", + "Rho", + "Sigma", + "Tau", + "Upsilon", + "Phi", + "Psi", + "Omega" + ] + + "doubt": [ + "Why?", + "What?", + "Wait, what?", + "Wait", + "Hold on", + "Uh..." + ], + + "aggressive": [ + "Give me that!", + "I'm going to kill you!", + "Fuck you!" + ], + + "help": [ + "HELP", + "HELP ME", + "HELP HIM", + "HELP HER", + "HELP THEM", + "HELP US", + "HELP YOURSELF" + ], + + "escape": [ + "RUN!!", + "They're behind me!", + "It's here!", + "Follow me!", + "Follow me" + ] + + "infection_advice": [ + "stay away", + "don't get close", + "be careful", + "help me", + "kill me" + ] + + "people": [ + "Captain", + "Hos", + "Cmo", + "Rd", + "Ce", + "Hop", + "Janitor", + "AI", + "Viro", + "Qm", + "[target.first_name()]" + ] + + "accusations": [ + "rogue", + "cult", + "a cultist", + "clockcult", + "a clock cultist", + "a revhead", + "a rev", + "a gang leader", + "a gangster", + "a traitor", + "a tator", + "a ling", + "a changeling" + ] + + "threat": [ + "Cult", + "Wizard", + "Blob", + "Ling", + "Ops", + "Swarmers", + "Revenant", + "Traitor", + "Harm", + "I hear flashing", + "Help" + ] + + "location": [ + "bridge", + "armory", + "sec", + "security", + "science", + "engineering", + "cargo", + "medbay", + "atmos", + "maint", + "hops office", + "captains office", + "chapel", + "library", + "tool storage", + "botany", + "kitchen", + "the ai sat" + ] + + "advice": [ + "Hmm...not sure about that.", + "Yes. You're doing the right thing.", + "No. Stop what you're doing.", + "You should be wary of that person.", + "Trust that person.", + "That person wants to kill you.", + "Kill that person. You know who.", + "You should go somewhere else. Quickly.", + "Good luck. You'll need it.", + "You have my permission. Do it." + ] + +} From 264bd8c780adff3561016870fe57ab2a836af82d Mon Sep 17 00:00:00 2001 From: XDTM Date: Wed, 19 Jul 2017 00:04:13 +0200 Subject: [PATCH 08/11] GLOB --- code/modules/flufftext/Hallucination.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 01693d0bc77..874d23b9015 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -20,14 +20,14 @@ Gunshots/explosions/opening doors/less rare audio (done) var/hal_screwyhud = SCREWYHUD_NONE var/next_hallucination = 0 -var/static/list/hallucinations_minor = list( +GLOBAL_LIST_INIT(hallucinations_minor, list( /datum/hallucination/sounds, /datum/hallucination/bolts, /datum/hallucination/whispers, /datum/hallucination/message, /datum/hallucination/hudscrew) -var/static/list/hallucinations_medium = list( +GLOBAL_LIST_INIT(hallucinations_medium, list( /datum/hallucination/fake_alert, /datum/hallucination/items, /datum/hallucination/items_other, @@ -39,7 +39,7 @@ var/static/list/hallucinations_medium = list( /datum/hallucination/fire, /datum/hallucination/self_delusion) -var/static/list/hallucinations_major = list( +GLOBAL_LIST_INIT(hallucinations_major, list( /datum/hallucination/fakeattacker, /datum/hallucination/death, /datum/hallucination/xeno_attack, @@ -52,11 +52,11 @@ var/static/list/hallucinations_major = list( return if(hallucination) - var/list/current = hallucinations_minor + var/list/current = GLOB.hallucinations_minor if(prob(25) && hallucination > 100) - current = hallucinations_medium + current = GLOB.hallucinations_medium else if(prob(10) && hallucination > 200) - current = hallucinations_major + current = GLOB.hallucinations_major var/halpick = pick(current) new halpick(src, FALSE) From 6424304a4c897b3ea547c1e9bd1ce59a5e10b918 Mon Sep 17 00:00:00 2001 From: XDTM Date: Wed, 19 Jul 2017 01:04:51 +0200 Subject: [PATCH 09/11] phone coding --- code/modules/flufftext/Hallucination.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 874d23b9015..706af3a1572 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -25,7 +25,7 @@ GLOBAL_LIST_INIT(hallucinations_minor, list( /datum/hallucination/bolts, /datum/hallucination/whispers, /datum/hallucination/message, - /datum/hallucination/hudscrew) + /datum/hallucination/hudscrew)) GLOBAL_LIST_INIT(hallucinations_medium, list( /datum/hallucination/fake_alert, @@ -37,7 +37,7 @@ GLOBAL_LIST_INIT(hallucinations_medium, list( /datum/hallucination/husks, /datum/hallucination/battle, /datum/hallucination/fire, - /datum/hallucination/self_delusion) + /datum/hallucination/self_delusion)) GLOBAL_LIST_INIT(hallucinations_major, list( /datum/hallucination/fakeattacker, @@ -45,7 +45,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( /datum/hallucination/xeno_attack, /datum/hallucination/singularity_scare, /datum/hallucination/delusion, - /datum/hallucination/oh_yeah) + /datum/hallucination/oh_yeah)) /mob/living/carbon/proc/handle_hallucinations() if(world.time < next_hallucination) From 6425fbbec031945a13f59d4ab14ccf98dfbf856e Mon Sep 17 00:00:00 2001 From: XDTM Date: Wed, 19 Jul 2017 21:34:18 +0200 Subject: [PATCH 10/11] couple more projectiles, fixes bugs --- code/modules/flufftext/Hallucination.dm | 35 ++++++++++++------- .../modules/projectiles/projectile/special.dm | 32 +++++++++++++++-- 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 874d23b9015..8633b89f006 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -25,7 +25,7 @@ GLOBAL_LIST_INIT(hallucinations_minor, list( /datum/hallucination/bolts, /datum/hallucination/whispers, /datum/hallucination/message, - /datum/hallucination/hudscrew) + /datum/hallucination/hudscrew)) GLOBAL_LIST_INIT(hallucinations_medium, list( /datum/hallucination/fake_alert, @@ -37,7 +37,7 @@ GLOBAL_LIST_INIT(hallucinations_medium, list( /datum/hallucination/husks, /datum/hallucination/battle, /datum/hallucination/fire, - /datum/hallucination/self_delusion) + /datum/hallucination/self_delusion)) GLOBAL_LIST_INIT(hallucinations_major, list( /datum/hallucination/fakeattacker, @@ -45,7 +45,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( /datum/hallucination/xeno_attack, /datum/hallucination/singularity_scare, /datum/hallucination/delusion, - /datum/hallucination/oh_yeah) + /datum/hallucination/oh_yeah)) /mob/living/carbon/proc/handle_hallucinations() if(world.time < next_hallucination) @@ -65,6 +65,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( var/cost = 5 //affects the amount of hallucination reduced, and cooldown until the next hallucination /datum/hallucination/New(mob/living/carbon/T, forced = TRUE) + set waitfor = 0 target = T if(!forced) target.hallucination = max(0, target.hallucination - cost) @@ -472,7 +473,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( var/image/delusion cost = 40 -/datum/hallucination/self_delusion/New(mob/living/carbon/T, forced, force_kind = null , duration = 300, custom_icon = null, custom_icon_file = null) +/datum/hallucination/self_delusion/New(mob/living/carbon/T, forced, force_kind = null , duration = 300, custom_icon = null, custom_icon_file = null, wabbajack = TRUE) //set wabbajack to false if you want to use another fake source ..() var/image/A = null var/kind = force_kind ? force_kind : pick("clown","corgi","carp","skeleton","demon","zombie","robot") @@ -496,8 +497,9 @@ GLOBAL_LIST_INIT(hallucinations_major, list( A = image(custom_icon_file, target, custom_icon) A.override = 1 if(target.client) - to_chat(target, "...wabbajack...wabbajack...") - target.playsound_local(target,'sound/magic/staff_change.ogg', 50, 1, -1) + if(wabbajack) + to_chat(target, "...wabbajack...wabbajack...") + target.playsound_local(target,'sound/magic/staff_change.ogg', 50, 1) delusion = A target.client.images |= A QDEL_IN(src, duration) @@ -1002,23 +1004,30 @@ GLOBAL_LIST_INIT(hallucinations_major, list( cost = 40 /datum/hallucination/death/New(mob/living/carbon/T, forced = TRUE) + set waitfor = 0 ..() target.hal_screwyhud = SCREWYHUD_DEAD - target.SetUnconscious(400) + 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 - var/mob/dead/observer/fakemob = pick(dead_people) + if(LAZYLEN(dead_people)) + fakemob = pick(dead_people) + else + fakemob = target //ever been so lonely you had to haunt yourself? if(fakemob) - sleep(rand(30, 60)) - to_chat(target, "DEAD: [fakemob.name] says, \"[pick("rip","welcome [target.first_name()]","you too?","is the AI malf?",\ + 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(50,70)) + sleep(rand(70,90)) target.hal_screwyhud = SCREWYHUD_NONE - target.SetSleeping(0) + target.SetKnockdown(0) + target.silent = 0 qdel(src) /datum/hallucination/fire @@ -1087,7 +1096,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( /datum/hallucination/stray_bullet/New(mob/living/carbon/C, forced = TRUE) ..() var/list/turf/startlocs = list() - for(var/turf/T in view(world.view+1,target)-view(world.view,target)) + 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)) diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index 089f73b1c83..5a8f49f45a5 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -390,8 +390,8 @@ /obj/item/projectile/hallucination name = "bullet" - icon = 'icons/obj/projectiles.dmi' - icon_state = "bullet" + icon = null + icon_state = null hitsound = "" suppressed = TRUE ricochets_max = 0 @@ -544,6 +544,7 @@ /obj/item/projectile/hallucination/taser name = "electrode" + damage_type = BURN hal_icon_state = "spark" color = "#FFFF00" hal_fire_sound = 'sound/weapons/taser.ogg' @@ -551,7 +552,6 @@ hal_hitsound_wall = null hal_impact_effect = null hal_impact_effect_wall = null - range = 7 /obj/item/projectile/hallucination/taser/hal_apply_effect() hal_target.Knockdown(100) @@ -590,3 +590,29 @@ hal_target.Knockdown(100) hal_target.stuttering += 5 hal_target.adjustStaminaLoss(8) + +/obj/item/projectile/hallucination/change + name = "bolt of change" + damage_type = BURN + hal_icon_state = "ice_1" + hal_fire_sound = 'sound/magic/staff_change.ogg' + hal_hitsound = null + hal_hitsound_wall = null + hal_impact_effect = null + hal_impact_effect_wall = null + +/obj/item/projectile/hallucination/change/hal_apply_effect() + new /datum/hallucination/self_delusion(hal_target, TRUE, wabbajack = FALSE) + +/obj/item/projectile/hallucination/death + name = "bolt of death" + damage_type = BURN + hal_icon_state = "pulse1_bl" + hal_fire_sound = 'sound/magic/wandodeath.ogg' + hal_hitsound = null + hal_hitsound_wall = null + hal_impact_effect = null + hal_impact_effect_wall = null + +/obj/item/projectile/hallucination/death/hal_apply_effect() + new /datum/hallucination/death(hal_target, TRUE) From 59fdce8e66cfa0e238832e09ddf9ab4927e7ac01 Mon Sep 17 00:00:00 2001 From: XDTM Date: Sat, 29 Jul 2017 12:36:48 +0200 Subject: [PATCH 11/11] Lotsa stuff --- code/__DEFINES/logging.dm | 1 + code/datums/datumvars.dm | 2 +- code/game/machinery/doors/airlock.dm | 10 +- code/modules/admin/admin_investigate.dm | 2 +- code/modules/flufftext/Hallucination.dm | 124 ++++++++++++------ code/modules/mob/living/carbon/carbon.dm | 6 + code/modules/mob/mob_helpers.dm | 3 + .../chemistry/machinery/chem_dispenser.dm | 12 +- strings/hallucination.json | 28 ++++ 9 files changed, 138 insertions(+), 50 deletions(-) diff --git a/code/__DEFINES/logging.dm b/code/__DEFINES/logging.dm index 859f3e37756..21406c0e43a 100644 --- a/code/__DEFINES/logging.dm +++ b/code/__DEFINES/logging.dm @@ -9,6 +9,7 @@ #define INVESTIGATE_SUPERMATTER "supermatter" #define INVESTIGATE_TELESCI "telesci" #define INVESTIGATE_WIRES "wires" +#define INVESTIGATE_HALLUCINATIONS "hallucinations" //Individual logging defines #define INDIVIDUAL_ATTACK_LOG "Attack log" diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 7b399879c57..4fe57be4429 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -942,7 +942,7 @@ var/result = input(usr, "Choose the hallucination to apply","Send Hallucination") as null|anything in hallucinations if(!usr) return - if(!C) + if(QDELETED(C)) to_chat(usr, "Mob doesn't exist anymore") return diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 007f8e42bdc..94047727bc0 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -233,9 +233,13 @@ return else /*if(src.justzap)*/ return - else if(user.hallucination > 50 && ishuman(user) && prob(4) && !operating) - hallucinate_shock(user) - return + else if(user.hallucinating() && ishuman(user) && prob(4) && !operating) + var/mob/living/carbon/human/H = user + if(H.gloves) + var/obj/item/clothing/gloves/G = H.gloves + if(G.siemens_coefficient)//not insulated + hallucinate_shock(H) + return if (cyclelinkedairlock) if (!shuttledocked && !emergency && !cyclelinkedairlock.shuttledocked && !cyclelinkedairlock.emergency && allowed(user)) if(cyclelinkedairlock.operating) diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm index 0e91b3c0f12..d0ee90e4d39 100644 --- a/code/modules/admin/admin_investigate.dm +++ b/code/modules/admin/admin_investigate.dm @@ -5,7 +5,7 @@ F << "[time_stamp()] \ref[src] ([x],[y],[z]) || [src] [message]
" -/client/proc/investigate_show(subject in list("hrefs","notes, memos, watchlist", INVESTIGATE_SINGULO, INVESTIGATE_WIRES, INVESTIGATE_TELESCI, INVESTIGATE_GRAVITY, INVESTIGATE_RECORDS, INVESTIGATE_CARGO, INVESTIGATE_SUPERMATTER, INVESTIGATE_ATMOS, INVESTIGATE_EXPERIMENTOR, INVESTIGATE_BOTANY) ) +/client/proc/investigate_show(subject in list("hrefs","notes, memos, watchlist", INVESTIGATE_SINGULO, INVESTIGATE_WIRES, INVESTIGATE_TELESCI, INVESTIGATE_GRAVITY, INVESTIGATE_RECORDS, INVESTIGATE_CARGO, INVESTIGATE_SUPERMATTER, INVESTIGATE_ATMOS, INVESTIGATE_EXPERIMENTOR, INVESTIGATE_BOTANY, INVESTIGATE_HALLUCINATIONS) ) set name = "Investigate" set category = "Admin" if(!holder) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 8633b89f006..2b8fe4b0642 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -60,9 +60,14 @@ GLOBAL_LIST_INIT(hallucinations_major, list( var/halpick = pick(current) new halpick(src, FALSE) +/mob/living/carbon/proc/set_screwyhud(hud_type) + hal_screwyhud = hud_type + update_health_hud() + /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 /datum/hallucination/New(mob/living/carbon/T, forced = TRUE) set waitfor = 0 @@ -72,9 +77,13 @@ GLOBAL_LIST_INIT(hallucinations_major, list( target.next_hallucination = world.time + (rand(cost * 0.5, cost * 3) * 10) /datum/hallucination/proc/wake_and_restore() - target.hal_screwyhud = SCREWYHUD_NONE + 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 @@ -152,6 +161,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( if(!U.welded) center = get_turf(U) break + feedback_details += "Vent Coords: [center.x],[center.y],[center.z]" flood_images += image(image_icon,center,image_state,MOB_LAYER) flood_turfs += center if(target.client) target.client.images |= flood_images @@ -217,6 +227,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( if(!U.welded) pump = U break + feedback_details += "Vent Coords: [pump.x],[pump.y],[pump.z]" if(pump) xeno = new(pump.loc,target) sleep(10) @@ -265,6 +276,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( break if(!wall) return INITIALIZE_HINT_QDEL + feedback_details += "Source: [wall.x],[wall.y],[wall.z]" fakebroken = image('icons/turf/floors.dmi', wall, "plating", layer = TURF_LAYER) var/turf/landing = get_turf(target) @@ -317,6 +329,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( var/screen_border = pick(SOUTH,EAST,WEST,NORTH) for(var/i in 1 to 13) start = get_step(start,screen_border) + feedback_details += "Source: [start.x],[start.y],[start.z]" s = new(start,target) s.parent = src for(var/i in 1 to 13) @@ -337,18 +350,21 @@ GLOBAL_LIST_INIT(hallucinations_major, list( /obj/effect/hallucination/simple/singularity/proc/Eat(atom/OldLoc, Dir) var/target_dist = get_dist(src,target) if(target_dist<=3) //"Eaten" - target.hal_screwyhud = SCREWYHUD_DEAD + target.set_screwyhud(SCREWYHUD_DEAD) target.SetUnconscious(160) addtimer(CALLBACK(parent, /datum/hallucination/.proc/wake_and_restore), rand(30, 50)) /datum/hallucination/battle cost = 15 -/datum/hallucination/battle/New(mob/living/carbon/T, forced = TRUE) +/datum/hallucination/battle/New(mob/living/carbon/T, forced = TRUE, battle_type) ..() var/hits = rand(3,6) - switch(rand(1,5)) - if(1) //Laser fight + if(!battle_type) + battle_type = pick("laser","esword","gun","stunprod","bomb") + feedback_details += "Type: [battle_type]" + switch(battle_type) + if("laser") //Laser fight for(var/i in 1 to hits) target.playsound_local(null, 'sound/weapons/laser.ogg', 25, 1) if(prob(50)) @@ -357,14 +373,14 @@ GLOBAL_LIST_INIT(hallucinations_major, list( addtimer(CALLBACK(target, /mob/.proc/playsound_local, null, 'sound/weapons/effects/searwall.ogg', 25, 1), rand(10,20)) sleep(rand(CLICK_CD_RANGE, CLICK_CD_RANGE + 8)) target.playsound_local(null, get_sfx("bodyfall"), 25, 1) - if(2) //Esword fight + if("esword") //Esword fight target.playsound_local(null, 'sound/weapons/saberon.ogg',15, 1) for(var/i=0,idoor_number && door_number>0) break @@ -734,7 +759,9 @@ GLOBAL_LIST_INIT(hallucinations_major, list( people += H if(person) //Basic talk var/image/speech_overlay = image('icons/mob/talk.dmi', person, "default0", layer = ABOVE_MOB_LAYER) - to_chat(target, target.compose_message(person,understood_language,pick(speak_messages),null,person.get_spans())) + var/message = target.compose_message(person,understood_language,pick(speak_messages),null,person.get_spans()) + feedback_details += "Type: Talk, Source: [person.real_name], Message: [message]" + to_chat(target, message) if(target.client) target.client.images |= speech_overlay sleep(30) @@ -744,7 +771,9 @@ GLOBAL_LIST_INIT(hallucinations_major, list( 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) /datum/hallucination/message @@ -763,43 +792,48 @@ GLOBAL_LIST_INIT(hallucinations_major, list( "You're hallucinating.", \ //Direct advice "[pick_list_replacements(HAL_LINES_FILE, "advice")]") + feedback_details += "Message: [chosen]" to_chat(target, chosen) qdel(src) /datum/hallucination/sounds cost = 15 -/datum/hallucination/sounds/New(mob/living/carbon/T, forced = TRUE) +/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(rand(1,20)) - if(1) + switch(sound_type) + if("airlock") target.playsound_local(null,'sound/machines/airlock.ogg', 15, 1) - if(2) + if("explosion") if(prob(50)) target.playsound_local(null,'sound/effects/explosion1.ogg', 50, 1) else target.playsound_local(null, 'sound/effects/explosion2.ogg', 50, 1) - if(3) + if("far_explosion") target.playsound_local(null, 'sound/effects/explosionfar.ogg', 50, 1) - if(4) + if("glass") target.playsound_local(null, pick('sound/effects/glassbr1.ogg','sound/effects/glassbr2.ogg','sound/effects/glassbr3.ogg'), 50, 1) - if(5) + 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(6) + if("summon_guns") target.playsound_local(null, 'sound/magic/summon_guns.ogg', 50, 1) - if(7) + if("alarm") target.playsound_local(null, 'sound/machines/alarm.ogg', 100, 0) - if(8) + if("beepsky") target.playsound_local(null, 'sound/voice/bfreeze.ogg', 35, 0) - if(9) + if("hallelujah") target.playsound_local(null, 'sound/effects/pray_chaplain.ogg', 50) //Rare audio - if(10) + 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',\ @@ -807,42 +841,42 @@ GLOBAL_LIST_INIT(hallucinations_major, list( '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(11) + 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(12) + 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(13) + 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(14) + 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(15) + if("esword") target.playsound_local(null, 'sound/weapons/saberon.ogg',35,1) - if(16) + 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(17) //Tesla loose! + 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(18) //AI is doomsdaying! + 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) @@ -854,9 +888,10 @@ GLOBAL_LIST_INIT(hallucinations_major, list( /datum/hallucination/hudscrew/New(mob/living/carbon/T, forced = TRUE) ..() //Screwy HUD - target.hal_screwyhud = pick(SCREWYHUD_CRIT,SCREWYHUD_DEAD,SCREWYHUD_HEALTHY) + target.set_screwyhud(pick(SCREWYHUD_CRIT,SCREWYHUD_DEAD,SCREWYHUD_HEALTHY)) + feedback_details += "Type: [target.hal_screwyhud]" sleep(rand(100,250)) - target.hal_screwyhud = SCREWYHUD_NONE + target.set_screwyhud(SCREWYHUD_NONE) qdel(src) /datum/hallucination/fake_alert @@ -867,6 +902,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( 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) @@ -962,6 +998,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( 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) @@ -1006,7 +1043,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( /datum/hallucination/death/New(mob/living/carbon/T, forced = TRUE) set waitfor = 0 ..() - target.hal_screwyhud = SCREWYHUD_DEAD + target.set_screwyhud(SCREWYHUD_DEAD) target.Knockdown(300) target.silent += 10 var/area/area = get_area(target) @@ -1025,7 +1062,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( 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.hal_screwyhud = SCREWYHUD_NONE + target.set_screwyhud(SCREWYHUD_NONE) target.SetKnockdown(0) target.silent = 0 qdel(src) @@ -1100,6 +1137,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( 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 diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 1c07c408d38..3ae1b198f80 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -234,6 +234,12 @@ /mob/living/carbon/is_muzzled() return(istype(src.wear_mask, /obj/item/clothing/mask/muzzle)) +/mob/living/carbon/hallucinating() + if(hallucination) + return TRUE + else + return FALSE + /mob/living/carbon/resist_buckle() if(restrained()) changeNext_move(CLICK_CD_BREAKOUT) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index a704c2e43f0..46f5db920bc 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -325,6 +325,9 @@ It's fairly easy to fix if dealing with single letters but not so much with comp return B.eye_blind return 0 +/mob/proc/hallucinating() + return FALSE + /proc/is_special_character(mob/M) // returns 1 for special characters and 2 for heroes of gamemode //moved out of admins.dm because things other than admin procs were calling this. if(!SSticker.HasRoundStarted()) return 0 diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 27cad406fab..3811512a021 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -101,9 +101,11 @@ ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "chem_dispenser", name, 550, 550, master_ui, state) + if(user.hallucinating()) + ui.set_autoupdate(FALSE) //to not ruin the immersion by constantly changing the fake chemicals ui.open() -/obj/machinery/chem_dispenser/ui_data() +/obj/machinery/chem_dispenser/ui_data(mob/user) var/data = list() data["amount"] = amount data["energy"] = cell.charge ? cell.charge * powerefficiency : "0" //To prevent NaN in the UI. @@ -128,10 +130,16 @@ data["beakerTransferAmounts"] = null var chemicals[0] + var/is_hallucinating = FALSE + if(user.hallucinating()) + is_hallucinating = TRUE for(var/re in dispensable_reagents) var/datum/reagent/temp = GLOB.chemical_reagents_list[re] if(temp) - chemicals.Add(list(list("title" = temp.name, "id" = temp.id))) + var/chemname = temp.name + if(is_hallucinating && prob(5)) + chemname = "[pick_list_replacements("hallucination.json", "chemicals")]" + chemicals.Add(list(list("title" = chemname, "id" = temp.id))) data["chemicals"] = chemicals return data diff --git a/strings/hallucination.json b/strings/hallucination.json index 03c2a21b854..b28c70db4a6 100644 --- a/strings/hallucination.json +++ b/strings/hallucination.json @@ -198,4 +198,32 @@ "You have my permission. Do it." ] + "chemicals": [ + "Ooze", + "Fire", + "Earth", + "Lightning", + "Air", + "Magic", + "Spiders", + "Button", + "Surprise", + "Happiness", + "Despair", + "Blood", + "Awesome", + "Infinity", + "Electronics", + "Time", + "Space", + "Pain", + "Guts", + "Life", + "Death", + "Phlebotinium", + "Mana", + "Energy", + "?????" + ] + }