Skip to content

Commit

Permalink
Assorted /vg/station ports (#426)
Browse files Browse the repository at this point in the history
* sounds

* table banging

* hahah oops

* add click drag to drop on table
  • Loading branch information
Kapu1178 authored Jul 24, 2023
1 parent da014f7 commit 2fdff26
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 30 deletions.
2 changes: 2 additions & 0 deletions code/datums/elements/climbable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@
SIGNAL_HANDLER
if(user == dropped_atom && isliving(dropped_atom))
var/mob/living/living_target = dropped_atom
if(living_target.combat_mode)
return
if(isanimal(living_target))
var/mob/living/simple_animal/animal = dropped_atom
if (!animal.dextrous)
Expand Down
5 changes: 4 additions & 1 deletion code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,10 @@
if("deny")
if(!machine_stat)
update_icon(ALL, AIRLOCK_DENY)
playsound(src,doorDeni,50,FALSE,3)
if(prob(1) && prob(10)) //1000.
playsound(src, 'sound/machines/access_denied_hl.ogg', 50, FALSE, 3)
else
playsound(src,doorDeni,50,FALSE,3)
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, update_icon), ALL, AIRLOCK_CLOSED), AIRLOCK_DENY_ANIMATION_TIME)

/obj/machinery/door/airlock/examine(mob/user)
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items/devices/scanners/health_analyzer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
to_chat(user, "<span class='info'>[M]'s biological structure is too complex for the health analyzer.")
return

playsound(user, 'sound/items/healthanalyzer.ogg', 50, 1)

user.visible_message(span_notice("[user] analyzes [M]'s vitals."), \
span_notice("You analyze [M]'s vitals."))

Expand Down
86 changes: 57 additions & 29 deletions code/game/objects/structures/tables_racks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,40 +84,35 @@
return attack_hand(user, modifiers)

/obj/structure/table/attack_hand(mob/living/user, list/modifiers)
if(Adjacent(user) && user.pulling)
if(isliving(user.pulling))
var/mob/living/pushed_mob = user.pulling
if(pushed_mob.buckled)
to_chat(user, span_warning("[pushed_mob] is buckled to [pushed_mob.buckled]!"))
return
if(user.combat_mode)
switch(user.grab_state)
if(GRAB_PASSIVE)
to_chat(user, span_warning("You need a better grip to do that!"))
return
if(GRAB_AGGRESSIVE)
tablepush(user, pushed_mob)
if(GRAB_NECK to GRAB_KILL)
tablelimbsmash(user, pushed_mob)
else
pushed_mob.visible_message(span_notice("[user] begins to place [pushed_mob] onto [src]..."), \
span_userdanger("[user] begins to place [pushed_mob] onto [src]..."))
if(do_after(user, pushed_mob, 3.5 SECONDS, DO_PUBLIC))
tableplace(user, pushed_mob)
else
return
user.stop_pulling()
else if(user.pulling.pass_flags & PASSTABLE)
user.Move_Pulled(src)
if (user.pulling.loc == loc)
user.visible_message(span_notice("[user] places [user.pulling] onto [src]."),
span_notice("You place [user.pulling] onto [src]."))
user.stop_pulling()
try_place_pulled_onto_table(user)
return ..()

/obj/structure/table/attack_tk(mob/user)
return

/obj/structure/table/MouseDrop_T(atom/dropping, mob/living/user)
. = ..()
if(ishuman(dropping))
if(dropping != user)
try_place_pulled_onto_table(user)
return
var/mob/living/carbon/human/H = user
if(H.incapacitated() || H.body_position == LYING_DOWN || !H.combat_mode)
return
if(!H.Adjacent(src))
return FALSE
if(!H.Enter(get_turf(src), TRUE))
return
H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5)
H.Paralyze(1 SECOND)
playsound(H, 'sound/items/trayhit1.ogg', 50, 1)
H.visible_message(
span_danger("[H] bangs [H.p_their()] head on [src]."),
span_danger("You bang your head on [src]."),
span_hear("You hear a metallic clang.")
)
return

/obj/structure/table/CanAllowThrough(atom/movable/mover, border_dir)
. = ..()
if(.)
Expand All @@ -132,6 +127,39 @@
if(caller)
. = . || (caller.pass_flags & PASSTABLE)

/obj/structure/table/proc/try_place_pulled_onto_table(mob/living/user)
if(!Adjacent(user) || !user.pulling)
return

if(isliving(user.pulling))
var/mob/living/pushed_mob = user.pulling
if(pushed_mob.buckled)
to_chat(user, span_warning("[pushed_mob] is buckled to [pushed_mob.buckled]!"))
return
if(user.combat_mode)
switch(user.grab_state)
if(GRAB_PASSIVE)
to_chat(user, span_warning("You need a better grip to do that!"))
return
if(GRAB_AGGRESSIVE)
tablepush(user, pushed_mob)
if(GRAB_NECK to GRAB_KILL)
tablelimbsmash(user, pushed_mob)
else
pushed_mob.visible_message(span_notice("[user] begins to place [pushed_mob] onto [src]..."), \
span_userdanger("[user] begins to place [pushed_mob] onto [src]..."))
if(do_after(user, pushed_mob, 3.5 SECONDS, DO_PUBLIC))
tableplace(user, pushed_mob)
else
return
user.stop_pulling()
else if(user.pulling.pass_flags & PASSTABLE)
user.Move_Pulled(src)
if (user.pulling.loc == loc)
user.visible_message(span_notice("[user] places [user.pulling] onto [src]."),
span_notice("You place [user.pulling] onto [src]."))
user.stop_pulling()

/obj/structure/table/proc/tableplace(mob/living/user, mob/living/pushed_mob)
pushed_mob.forceMove(loc)
pushed_mob.set_resting(TRUE, TRUE)
Expand Down
Binary file added sound/items/healthanalyzer.ogg
Binary file not shown.
Binary file added sound/machines/access_denied_hl.ogg
Binary file not shown.
Binary file modified sound/machines/deniedbeep.ogg
Binary file not shown.

0 comments on commit 2fdff26

Please sign in to comment.