diff --git a/code/game/objects/items/grenades/hypno.dm b/code/game/objects/items/grenades/hypno.dm new file mode 100644 index 00000000000..5d7652bb303 --- /dev/null +++ b/code/game/objects/items/grenades/hypno.dm @@ -0,0 +1,66 @@ +/obj/item/grenade/hypnotic + name = "flashbang" + desc = "A modified flashbang which uses hypnotic flashes and mind-altering soundwaves to induce an instant trance upon detonation." + icon_state = "flashbang" + item_state = "flashbang" + lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi' + var/flashbang_range = 7 + +/obj/item/grenade/hypnotic/prime() + update_mob() + var/flashbang_turf = get_turf(src) + if(!flashbang_turf) + return + do_sparks(rand(5, 9), FALSE, src) + playsound(flashbang_turf, 'sound/effects/screech.ogg', 100, TRUE, 8, 0.9) + new /obj/effect/dummy/lighting_obj (flashbang_turf, LIGHT_COLOR_PURPLE, (flashbang_range + 2), 4, 2) + for(var/mob/living/M in get_hearers_in_view(flashbang_range, flashbang_turf)) + bang(get_turf(M), M) + qdel(src) + +/obj/item/grenade/hypnotic/proc/bang(turf/T, mob/living/M) + if(M.stat == DEAD) //They're dead! + return + var/distance = max(0,get_dist(get_turf(src),T)) + + //Bang + var/hypno_sound = FALSE + + //Hearing protection check + if(iscarbon(M)) + var/mob/living/carbon/C = M + var/list/reflist = list(1) + SEND_SIGNAL(C, COMSIG_CARBON_SOUNDBANG, reflist) + var/intensity = reflist[1] + var/ear_safety = C.get_ear_protection() + var/effect_amount = intensity - ear_safety + if(effect_amount > 0) + hypno_sound = TRUE + + if(!distance || loc == M || loc == M.loc) + M.Paralyze(10) + M.Knockdown(100) + to_chat(M, "The sound echoes in your brain...") + M.hallucination += 50 + else + if(distance <= 1) + M.Paralyze(5) + M.Knockdown(30) + if(hypno_sound) + to_chat(M, "The sound echoes in your brain...") + M.hallucination += 50 + + //Flash + if(M.flash_act(affect_silicon = 1)) + M.Paralyze(max(10/max(1,distance), 5)) + M.Knockdown(max(100/max(1,distance), 40)) + if(iscarbon(M)) + var/mob/living/carbon/C = M + if(C.hypnosis_vulnerable()) //The sound causes the necessary conditions unless the target has mindshield or hearing protection + C.apply_status_effect(/datum/status_effect/trance, 100, TRUE) + else + to_chat(C, "The light is so pretty...") + C.confused += min(C.confused + 10, 20) + C.dizziness += min(C.dizziness + 10, 20) + C.drowsyness += min(C.drowsyness + 10, 20) diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index c388537aac2..4dcc90f9797 100644 --- a/code/modules/assembly/flash.dm +++ b/code/modules/assembly/flash.dm @@ -278,7 +278,7 @@ user.visible_message("[user] blinds [M] with the flash!", "You hypno-flash [M]!") if(!hypnosis) - to_chat(M, "The light makes you feel oddly relaxed...") + to_chat(M, "The light makes you feel oddly relaxed...") M.confused += min(M.confused + 10, 20) M.dizziness += min(M.dizziness + 10, 20) M.drowsyness += min(M.drowsyness + 10, 20) diff --git a/code/modules/uplink/uplink_items.dm b/code/modules/uplink/uplink_items.dm index b5dafecf530..791089924e1 100644 --- a/code/modules/uplink/uplink_items.dm +++ b/code/modules/uplink/uplink_items.dm @@ -1369,6 +1369,12 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) item = /obj/item/assembly/flash/hypnotic cost = 7 +/datum/uplink_item/device_tools/hypnotic_grenade + name = "Hypnotic Grenade" + desc = "A modified flashbang grenade able to hypnotize targets. The sound portion of the flashbang causes hallucinations, and will allow the flash to induce a hypnotic trance to viewers." + item = /obj/item/grenade/hypnotic + cost = 12 + /datum/uplink_item/device_tools/medgun name = "Medbeam Gun" desc = "A wonder of Syndicate engineering, the Medbeam gun, or Medi-Gun enables a medic to keep his fellow \ diff --git a/tgstation.dme b/tgstation.dme index 037fb907b3f..31af3c53d0c 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1016,6 +1016,7 @@ #include "code\game\objects\items\grenades\flashbang.dm" #include "code\game\objects\items\grenades\ghettobomb.dm" #include "code\game\objects\items\grenades\grenade.dm" +#include "code\game\objects\items\grenades\hypno.dm" #include "code\game\objects\items\grenades\plastic.dm" #include "code\game\objects\items\grenades\smokebomb.dm" #include "code\game\objects\items\grenades\spawnergrenade.dm"