From 6425fbbec031945a13f59d4ab14ccf98dfbf856e Mon Sep 17 00:00:00 2001 From: XDTM Date: Wed, 19 Jul 2017 21:34:18 +0200 Subject: [PATCH] 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)