From 875ab818245d2ff20fce6a131ccae60938fce8e6 Mon Sep 17 00:00:00 2001 From: Cyantime Date: Wed, 19 Jul 2017 15:54:41 -0400 Subject: [PATCH] Adds object-specific effects for running into them while confused (#1879) * Adds object-specific effects for running into them while confused. * How do comments work, we just don't know * WHAT EVEN ARE COMMENTS --- code/game/objects/stumble_into_vr.dm | 126 +++++++++++++++++++++++++++ code/modules/mob/living/living.dm | 7 +- vorestation.dme | 1 + 3 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 code/game/objects/stumble_into_vr.dm diff --git a/code/game/objects/stumble_into_vr.dm b/code/game/objects/stumble_into_vr.dm new file mode 100644 index 00000000000..cddcd80610c --- /dev/null +++ b/code/game/objects/stumble_into_vr.dm @@ -0,0 +1,126 @@ +/atom/proc/stumble_into(mob/living/M) + playsound(get_turf(M), "punch", 25, 1, -1) + visible_message("[M] [pick("ran", "slammed")] into \the [src]!") + to_chat(M, "You just [pick("ran", "slammed")] into \the [src]!") + M.apply_damage(5, BRUTE) + M.Weaken(2) + +/obj/structure/table/stumble_into(mob/living/M) + var/obj/occupied = turf_is_crowded() + if(occupied) + return ..() + if(material) + playsound(get_turf(src), material.tableslam_noise, 25, 1, -1) + else + playsound(get_turf(src), 'sound/weapons/tablehit1.ogg', 25, 1, -1) + visible_message("[M] flopped onto \the [src]!") + M.apply_damage(5, BRUTE) + M.Weaken(2) + M.forceMove(get_turf(src)) + +/obj/machinery/disposal/stumble_into(mob/living/M) + playsound(get_turf(src), 'sound/effects/clang.ogg', 25, 1, -1) + visible_message("[M] [pick("tripped", "stumbled")] into \the [src]!") + if(M.client) + M.client.perspective = EYE_PERSPECTIVE + M.client.eye = src + M.apply_damage(5, BRUTE) + M.Weaken(2) + M.forceMove(src) + update() + +/obj/structure/inflatable/stumble_into(mob/living/M) + playsound(get_turf(M), "sound/effects/Glasshit.ogg", 25, 1, -1) + visible_message("[M] [pick("ran", "slammed")] into \the [src]!") + M.Weaken(1) + +/obj/structure/kitchenspike/stumble_into(mob/living/M) + playsound(get_turf(M), "sound/weapons/pierce.ogg", 25, 1, -1) + visible_message("[M] [pick("ran", "slammed")] into the spikes on \the [src]!") + M.apply_damage(15, BRUTE, sharp=1) + M.Weaken(5) + +/obj/structure/m_tray/stumble_into(mob/living/M) + playsound(get_turf(src), 'sound/weapons/tablehit1.ogg', 25, 1, -1) + visible_message("[M] flopped onto \the [src]!") + M.apply_damage(5, BRUTE) + M.Weaken(2) + M.forceMove(get_turf(src)) + +/obj/structure/c_tray/stumble_into(mob/living/M) + playsound(get_turf(src), 'sound/weapons/tablehit1.ogg', 25, 1, -1) + visible_message("[M] flopped onto \the [src]!") + M.apply_damage(5, BRUTE) + M.Weaken(2) + M.forceMove(get_turf(src)) + +/obj/structure/window/stumble_into(mob/living/M) + visible_message("[M] [pick("ran", "slammed")] into \the [src]!") + M.apply_damage(5, BRUTE) + M.Weaken(2) + hitby(M) + +/obj/structure/railing/stumble_into(mob/living/M) + var/obj/occupied = turf_is_crowded() + if(occupied) + return ..() + playsound(get_turf(src), 'sound/misc/slip.ogg', 25, 1, -1) + visible_message("[M] [pick("tripped", "stumbled")] over \the [src]!") + M.Weaken(2) + if(get_turf(M) == get_turf(src)) + M.forceMove(get_step(src, src.dir)) + else + M.forceMove(get_turf(src)) + +/obj/machinery/door/stumble_into(mob/living/M) + ..() + bumpopen(M) + +/obj/machinery/cooker/fryer/stumble_into(mob/living/M) + visible_message("[M] [pick("ran", "slammed")] into \the [src]!") + M.apply_damage(15, BURN) + M.Weaken(5) + M.emote("scream") + +/obj/machinery/atmospherics/unary/cryo_cell/stumble_into(mob/living/M) + if((stat & (NOPOWER|BROKEN)) || !istype(M, /mob/living/carbon) || occupant || M.abiotic() || !node) + return ..() + playsound(get_turf(src), 'sound/effects/Glasshit.ogg', 25, 1, -1) + visible_message("[M] [pick("tripped", "stumbled")] into \the [src]!") + M.apply_damage(5, BRUTE) + M.Weaken(2) + put_mob(M) + +/obj/machinery/porta_turret/stumble_into(mob/living/M) + ..() + if(!attacked && !emagged) + attacked = 1 + spawn() + sleep(60) + attacked = 0 + +/obj/machinery/space_heater/stumble_into(mob/living/M) + ..() + if(on) + M.apply_damage(10, BURN) + M.emote("scream") + +/obj/machinery/suit_storage_unit/stumble_into(mob/living/M) + if(!ishuman(M) || !isopen || !ispowered || isbroken || OCCUPANT || HELMET || SUIT) + return ..() + playsound(get_turf(src), 'sound/effects/clang.ogg', 25, 1, -1) + visible_message("[M] [pick("tripped", "stumbled")] into \the [src]!") + if(M.client) + M.client.perspective = EYE_PERSPECTIVE + M.client.eye = src + M.forceMove(src) + OCCUPANT = M + isopen = 0 + update_icon() + add_fingerprint(M) + updateUsrDialog() + +/obj/machinery/vending/stumble_into(mob/living/M) + ..() + if(prob(2)) + throw_item() \ No newline at end of file diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 554de787d79..49a14896d8d 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -137,12 +137,17 @@ default behaviour is: spawn(0) ..() if (!istype(AM, /atom/movable) || AM.anchored) - if(confused && prob(50) && m_intent=="run") + //VOREStation Edit - object-specific proc for running into things + if((confused || is_blind()) && prob(50) && m_intent=="run") + AM.stumble_into(src) + //VOREStation Edit End + /* VOREStation Removal - See above Weaken(2) playsound(loc, "punch", 25, 1, -1) visible_message("[src] [pick("ran", "slammed")] into \the [AM]!") src.apply_damage(5, BRUTE) src << ("You just [pick("ran", "slammed")] into \the [AM]!") + */ // VOREStation Removal End return if (!now_pushing) now_pushing = 1 diff --git a/vorestation.dme b/vorestation.dme index 43456d223d4..41cb5cfc711 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -784,6 +784,7 @@ #include "code\game\objects\items.dm" #include "code\game\objects\objs.dm" #include "code\game\objects\structures.dm" +#include "code\game\objects\stumble_into_vr.dm" #include "code\game\objects\weapons.dm" #include "code\game\objects\effects\bump_teleporter.dm" #include "code\game\objects\effects\effect_system.dm"