diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm
index ef521753fe5..4bc873e76d6 100644
--- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm
+++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm
@@ -18,5 +18,7 @@
#define COMPONENT_ATOM_BLOCK_EXIT (1<<0)
///from base of atom/Exited(): (atom/movable/gone, direction)
#define COMSIG_ATOM_EXITED "atom_exited"
+///from base of atom/Bumped(): (/atom) **DIFFERS FROM TG THAT IS /atom/movable**
+#define COMSIG_ATOM_BUMPED "atom_bumped"
///from base of atom/has_gravity(): (turf/location, list/forced_gravities)
#define COMSIG_ATOM_HAS_GRAVITY "atom_has_gravity"
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index ea6d08c9a5d..414ec7c276f 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -68,10 +68,18 @@
/atom/proc/on_reagent_change()
return
-// This is called when AM collides with us.
-/atom/proc/CollidedWith(atom/movable/AM)
- set waitfor = FALSE
- return
+/**
+ * Called when an `/atom` collides with this atom
+ *
+ * It's roughly equivalent to `Bumped()` in TG, but it's not sleepable and you have to call parent
+ *
+ * * bumped_atom - The `/atom` that collided with this atom
+ */
+/atom/proc/CollidedWith(atom/bumped_atom)
+ SHOULD_NOT_SLEEP(TRUE)
+ SHOULD_CALL_PARENT(TRUE)
+
+ SEND_SIGNAL(src, COMSIG_ATOM_BUMPED, bumped_atom)
// Convenience proc to see if a container is open for chemistry handling.
// Returns true if open, false if closed.
diff --git a/code/game/gamemodes/cult/narsie.dm b/code/game/gamemodes/cult/narsie.dm
index 6a316065814..1411565a7f5 100644
--- a/code/game/gamemodes/cult/narsie.dm
+++ b/code/game/gamemodes/cult/narsie.dm
@@ -95,12 +95,15 @@ GLOBAL_LIST_EMPTY(narsie_list)
else if(istype(A, /obj/structure/cult))
qdel(A)
-/obj/singularity/narsie/large/CollidedWith(atom/A)
- if(!cause_hell) return
- if(isturf(A))
- narsiewall(A)
- else if(istype(A, /obj/structure/cult))
- qdel(A)
+/obj/singularity/narsie/large/CollidedWith(atom/bumped_atom)
+ . = ..()
+
+ if(!cause_hell)
+ return
+ if(isturf(bumped_atom))
+ narsiewall(bumped_atom)
+ else if(istype(bumped_atom, /obj/structure/cult))
+ qdel(bumped_atom)
/obj/singularity/narsie/move(var/force_move = 0)
if(!move_self)
diff --git a/code/game/gamemodes/cult/structures/gateway.dm b/code/game/gamemodes/cult/structures/gateway.dm
index 3a0800fffad..aa9ba058e51 100644
--- a/code/game/gamemodes/cult/structures/gateway.dm
+++ b/code/game/gamemodes/cult/structures/gateway.dm
@@ -8,9 +8,6 @@
anchored = 1.0
var/spawnable = null
-/obj/effect/gateway/CollidedWith(mob/M)
- return
-
/obj/effect/gateway/Crossed(AM as mob|obj)
return
diff --git a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm
index 4a8a1d9fff0..9c8f994ce38 100644
--- a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm
+++ b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm
@@ -100,21 +100,21 @@
return TRUE
-/turf/unsimulated/wall/supermatter/CollidedWith(atom/AM)
- if (!AM.simulated)
+/turf/unsimulated/wall/supermatter/CollidedWith(atom/bumped_atom)
+ if (!bumped_atom.simulated)
return ..()
- if(istype(AM, /mob/living))
- AM.visible_message("\The [AM] slams into \the [src] inducing a resonance... [AM.get_pronoun("his")] body starts to glow and catch flame before flashing into ash.",\
+ if(istype(bumped_atom, /mob/living))
+ bumped_atom.visible_message("\The [bumped_atom] slams into \the [src] inducing a resonance... [bumped_atom.get_pronoun("his")] body starts to glow and catch flame before flashing into ash.",\
"You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\"",\
"You hear an unearthly noise as a wave of heat washes over you.")
else
- AM.visible_message("\The [AM] smacks into \the [src] and rapidly flashes to ash.",\
+ bumped_atom.visible_message("\The [bumped_atom] smacks into \the [src] and rapidly flashes to ash.",\
"You hear a loud crack as you are washed with a wave of heat.")
playsound(src, 'sound/effects/supermatter.ogg', 50, 1)
- Consume(AM)
+ Consume(bumped_atom)
/turf/unsimulated/wall/supermatter/proc/Consume(var/mob/living/user)
diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm
index cdf0bd50c40..be49e54b95f 100644
--- a/code/game/machinery/doors/blast_door.dm
+++ b/code/game/machinery/doors/blast_door.dm
@@ -55,7 +55,7 @@
// Proc: Bumped()
// Parameters: 1 (AM - Atom that tried to walk through this object)
// Description: If we are open returns zero, otherwise returns result of parent function.
-/obj/machinery/door/blast/CollidedWith(atom/AM)
+/obj/machinery/door/blast/CollidedWith(atom/bumped_atom)
if(!density)
return ..()
else
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index ad4ab87ce34..5037d6926c6 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -144,49 +144,49 @@
return 0
return 1
-/obj/machinery/door/CollidedWith(atom/AM)
+/obj/machinery/door/CollidedWith(atom/bumped_atom)
. = ..()
if(p_open || operating) return
- if (!AM.simulated) return
- if(ismob(AM))
- var/mob/M = AM
+ if (!bumped_atom.simulated) return
+ if(ismob(bumped_atom))
+ var/mob/M = bumped_atom
if(world.time - M.last_bumped <= 10) return //Can bump-open one airlock per second. This is to prevent shock spam.
M.last_bumped = world.time
if(!M.restrained() && (!issmall(M) || ishuman(M) || istype(M, /mob/living/silicon/robot/drone/mining)))
bumpopen(M)
return
- if(istype(AM, /obj/machinery/bot))
- var/obj/machinery/bot/bot = AM
+ if(istype(bumped_atom, /obj/machinery/bot))
+ var/obj/machinery/bot/bot = bumped_atom
if(src.check_access(bot.botcard))
if(density)
open()
return
- if(istype(AM, /mob/living/bot))
- var/mob/living/bot/bot = AM
+ if(istype(bumped_atom, /mob/living/bot))
+ var/mob/living/bot/bot = bumped_atom
if(src.check_access(bot.botcard))
if(density)
open()
return
- if(istype(AM, /mob/living/simple_animal/spiderbot))
- var/mob/living/simple_animal/spiderbot/bot = AM
+ if(istype(bumped_atom, /mob/living/simple_animal/spiderbot))
+ var/mob/living/simple_animal/spiderbot/bot = bumped_atom
if(src.check_access(bot.internal_id))
if(density)
open()
return
- if(istype(AM, /obj/structure/bed/stool/chair/office/wheelchair))
- var/obj/structure/bed/stool/chair/office/wheelchair/wheel = AM
+ if(istype(bumped_atom, /obj/structure/bed/stool/chair/office/wheelchair))
+ var/obj/structure/bed/stool/chair/office/wheelchair/wheel = bumped_atom
if(density)
if(wheel.pulling && (src.allowed(wheel.pulling)))
open()
else
do_animate("deny")
return
- if(istype(AM, /obj/structure/janitorialcart))
- var/obj/structure/janitorialcart/cart = AM
+ if(istype(bumped_atom, /obj/structure/janitorialcart))
+ var/obj/structure/janitorialcart/cart = bumped_atom
if(density)
if(cart.pulling && (src.allowed(cart.pulling)))
open()
@@ -194,8 +194,8 @@
do_animate("deny")
return
- if(istype(AM, /obj/vehicle))
- var/obj/vehicle/V = AM
+ if(istype(bumped_atom, /obj/vehicle))
+ var/obj/vehicle/V = bumped_atom
if(density)
if(V.buckled && (src.allowed(V.buckled)))
open()
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index c9824dc0ecd..6b79afa13fb 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -186,7 +186,7 @@
users_to_open_string += ", [users_to_open[i]]"
. += "These people have opened \the [src] during an alert: [users_to_open_string]."
-/obj/machinery/door/firedoor/CollidedWith(atom/AM)
+/obj/machinery/door/firedoor/CollidedWith(atom/bumped_atom)
if(p_open || operating)
return
if(!density)
diff --git a/code/game/machinery/doors/unpowered.dm b/code/game/machinery/doors/unpowered.dm
index a2e46014af9..3fb7bf1e351 100644
--- a/code/game/machinery/doors/unpowered.dm
+++ b/code/game/machinery/doors/unpowered.dm
@@ -3,7 +3,7 @@
autoclose = 0
var/locked = 0
-/obj/machinery/door/unpowered/CollidedWith(atom/AM)
+/obj/machinery/door/unpowered/CollidedWith(atom/bumped_atom)
if(src.locked)
return
..()
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index 44e86fa129b..5a76977ed68 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -52,20 +52,27 @@
update_nearby_tiles()
return ..()
-/obj/machinery/door/window/CollidedWith(atom/movable/AM as mob|obj)
- var/mob/M = AM
+/obj/machinery/door/window/CollidedWith(atom/bumped_atom)
+ //Fucking snowflake code
+ SHOULD_CALL_PARENT(FALSE)
+ SEND_SIGNAL(src, COMSIG_ATOM_BUMPED, bumped_atom)
+
+ var/mob/M = bumped_atom
if (!( ROUND_IS_STARTED ) || operating || !density || !istype(M) || !allowed(M))
return
if(ishuman(M) || isrobot(M) || isbot(M) || istype(M, /mob/living/simple_animal/spiderbot) || ismech(M))
- if(!operable())
- if(do_after(M, 1 SECOND, src))
- // The VM here is before open and the wording is backwards because density gets set after a background sleep in open
- visible_message("\The [M] [density ? "pushes" : "pulls"] \the [src] [density ? "open" : "closed"].")
- open()
- else
+ INVOKE_ASYNC(src, PROC_REF(handle_collision_opening), M)
+
+/obj/machinery/door/window/proc/handle_collision_opening(var/mob/M)
+ if(!operable())
+ if(do_after(M, 1 SECOND, src))
+ // The VM here is before open and the wording is backwards because density gets set after a background sleep in open
+ visible_message("\The [M] [density ? "pushes" : "pulls"] \the [src] [density ? "open" : "closed"].")
open()
- addtimer(CALLBACK(src, PROC_REF(close)), check_access(null) ? 5 SECONDS : 2 SECONDS)
+ else
+ open()
+ addtimer(CALLBACK(src, PROC_REF(close)), check_access(null) ? 5 SECONDS : 2 SECONDS)
/obj/machinery/door/window/allowed(mob/M)
. = ..()
diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm
index 46fb3651b9f..83a4968a0ae 100644
--- a/code/game/machinery/rechargestation.dm
+++ b/code/game/machinery/rechargestation.dm
@@ -241,9 +241,11 @@
if(icon_update_tick == 0)
build_overlays()
-/obj/machinery/recharge_station/CollidedWith(atom/movable/AM)
- if(isliving(AM))
- go_in(AM)
+/obj/machinery/recharge_station/CollidedWith(atom/bumped_atom)
+ . = ..()
+
+ if(isliving(bumped_atom))
+ go_in(bumped_atom)
/obj/machinery/recharge_station/proc/go_in(mob/living/M)
if(occupant)
diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm
index 623056cde32..b1e97a725da 100644
--- a/code/game/machinery/teleporter.dm
+++ b/code/game/machinery/teleporter.dm
@@ -35,9 +35,11 @@
if(old_engaged != engaged)
update_icon()
-/obj/machinery/teleport/pad/CollidedWith(M as mob|obj)
+/obj/machinery/teleport/pad/CollidedWith(atom/bumped_atom)
+ . = ..()
+
if(engaged)
- teleport(M)
+ teleport(bumped_atom)
use_power_oneoff(5000)
/obj/machinery/teleport/pad/proc/teleport(atom/movable/M as mob|obj)
diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm
index f55196acbf8..4448958787d 100644
--- a/code/game/machinery/transformer.dm
+++ b/code/game/machinery/transformer.dm
@@ -34,15 +34,17 @@
if(istype(west, /turf/simulated/floor))
new /obj/machinery/conveyor(west, WEST, 1)
-/obj/machinery/transformer/CollidedWith(var/atom/movable/AM)
+/obj/machinery/transformer/CollidedWith(atom/bumped_atom)
+ . = ..()
+
// HasEntered didn't like people lying down.
- if(ishuman(AM))
+ if(ishuman(bumped_atom))
// Only humans can enter from the west side, while lying down.
- var/move_dir = get_dir(loc, AM.loc)
- var/mob/living/carbon/human/H = AM
+ var/move_dir = get_dir(loc, bumped_atom.loc)
+ var/mob/living/carbon/human/H = bumped_atom
if((transform_standing || H.lying) && move_dir == EAST)
- AM.forceMove(src.loc)
- make_robot(AM)
+ H.forceMove(src.loc)
+ make_robot(H)
/obj/machinery/transformer/proc/make_robot(var/mob/living/carbon/human/H)
if(stat & (BROKEN|NOPOWER))
diff --git a/code/game/objects/effects/bump_teleporter.dm b/code/game/objects/effects/bump_teleporter.dm
index 0eb58c40a18..054f7fcd27f 100644
--- a/code/game/objects/effects/bump_teleporter.dm
+++ b/code/game/objects/effects/bump_teleporter.dm
@@ -19,8 +19,10 @@ var/list/obj/effect/bump_teleporter/BUMP_TELEPORTERS = list()
BUMP_TELEPORTERS -= src
return ..()
-/obj/effect/bump_teleporter/CollidedWith(atom/user)
- if(!ismob(user))
+/obj/effect/bump_teleporter/CollidedWith(atom/bumped_atom)
+ . = ..()
+
+ if(!ismob(bumped_atom))
//user.forceMove(src.loc) //Stop at teleporter location
return
diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm
index dab249133d0..4728d4d680b 100644
--- a/code/game/objects/effects/portals.dm
+++ b/code/game/objects/effects/portals.dm
@@ -30,11 +30,11 @@
precision = precise
-/obj/effect/portal/CollidedWith(mob/M)
- set waitfor = FALSE
+/obj/effect/portal/CollidedWith(atom/bumped_atom)
+ . = ..()
if(does_teleport)
- teleport(M)
+ teleport(bumped_atom)
/obj/effect/portal/Crossed(AM)
set waitfor = FALSE
diff --git a/code/game/objects/items/weapons/traps.dm b/code/game/objects/items/weapons/traps.dm
index 0d09d2e301f..ea4d28411f2 100644
--- a/code/game/objects/items/weapons/traps.dm
+++ b/code/game/objects/items/weapons/traps.dm
@@ -233,7 +233,7 @@
if(AM.loc != loc)
AM.forceMove(loc)
captured = WEAKREF(L)
- buckle(L)
+ INVOKE_ASYNC(src, PROC_REF(buckle), L)
layer = L.layer + 0.1
playsound(src, 'sound/weapons/beartrap_shut.ogg', 100, 1)
deployed = FALSE
@@ -282,9 +282,9 @@
release()
-/obj/item/trap/animal/CollidedWith(atom/AM)
- if(deployed && is_type_in_list(AM, allowed_mobs))
- Crossed(AM)
+/obj/item/trap/animal/CollidedWith(atom/bumped_atom)
+ if(deployed && is_type_in_list(bumped_atom, allowed_mobs))
+ Crossed(bumped_atom)
else
..()
diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm
index b77a7826b3e..6c4a6048144 100644
--- a/code/game/objects/structures/grille.dm
+++ b/code/game/objects/structures/grille.dm
@@ -72,9 +72,11 @@
else
icon_state = initial(icon_state)
-/obj/structure/grille/CollidedWith(atom/user)
- if(ismob(user))
- shock(user, 70)
+/obj/structure/grille/CollidedWith(atom/bumped_atom)
+ . = ..()
+
+ if(ismob(bumped_atom))
+ shock(bumped_atom, 70)
/obj/structure/grille/attack_hand(mob/user as mob)
diff --git a/code/game/objects/structures/simple_doors.dm b/code/game/objects/structures/simple_doors.dm
index e78e3808fe3..07e7e972ddc 100644
--- a/code/game/objects/structures/simple_doors.dm
+++ b/code/game/objects/structures/simple_doors.dm
@@ -65,10 +65,10 @@
if(lock)
. += SPAN_NOTICE("It appears to have a lock.")
-/obj/structure/simple_door/CollidedWith(atom/user)
+/obj/structure/simple_door/CollidedWith(atom/bumped_atom)
..()
if(!state)
- return TryToSwitchState(user)
+ return TryToSwitchState(bumped_atom)
return
/obj/structure/simple_door/attack_ai(mob/user as mob) //those aren't machinery, they're just big fucking slabs of a mineral
@@ -123,22 +123,30 @@
isSwitchingStates = 1
playsound(loc, material.dooropen_noise, 100, 1)
flick("[material.door_icon_base]opening",src)
- sleep(10)
- density = 0
- opacity = 0
- state = 1
- update_icon()
- isSwitchingStates = 0
- update_nearby_tiles()
+ addtimer(CALLBACK(src, PROC_REF(change_state_after_openclode), TRUE), 1 SECONDS)
+
/obj/structure/simple_door/proc/Close()
isSwitchingStates = 1
playsound(loc, material.dooropen_noise, 100, 1)
flick("[material.door_icon_base]closing",src)
- sleep(10)
- density = 1
- opacity = 1
- state = 0
+ addtimer(CALLBACK(src, PROC_REF(change_state_after_openclode), FALSE), 1 SECONDS)
+
+/**
+ * Complete the open/close of the door
+ *
+ * * to_open - Whether the door is to be set as open, if FALSE, it is to be set as closed instead
+ */
+/obj/structure/simple_door/proc/change_state_after_openclode(to_open = FALSE)
+ if(to_open)
+ density = 0
+ opacity = 0
+ state = 1
+ else
+ density = 1
+ opacity = 1
+ state = 0
+
update_icon()
isSwitchingStates = 0
update_nearby_tiles()
diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm
index dbad85f2835..034b4f7a0f9 100644
--- a/code/modules/awaymissions/gateway.dm
+++ b/code/modules/awaymissions/gateway.dm
@@ -115,19 +115,26 @@
//okay, here's the good teleporting stuff
-/obj/machinery/gateway/centerstation/CollidedWith(atom/movable/M as mob|obj)
+/obj/machinery/gateway/centerstation/CollidedWith(atom/bumped_atom)
+ . = ..()
+
if(!ready || !active || !awaygate)
return
+ if(!ismovable(bumped_atom))
+ return
+
+ var/atom/movable/AM = bumped_atom
+
if(awaygate.calibrated)
- M.forceMove(get_step(awaygate.loc, SOUTH))
- M.set_dir(SOUTH)
+ AM.forceMove(get_step(awaygate.loc, SOUTH))
+ AM.set_dir(SOUTH)
return
else
var/obj/effect/landmark/dest = pick(GLOB.awaydestinations)
if(dest)
- M.forceMove(dest.loc)
- M.set_dir(SOUTH)
+ AM.forceMove(dest.loc)
+ AM.set_dir(SOUTH)
use_power_oneoff(5000)
return
@@ -215,17 +222,24 @@
toggleoff()
-/obj/machinery/gateway/centeraway/CollidedWith(atom/movable/M as mob|obj)
+/obj/machinery/gateway/centeraway/CollidedWith(atom/bumped_atom)
+ . = ..()
+
if(!ready || !active)
return
- if(istype(M, /mob/living/carbon))
- for(var/obj/item/implant/exile/E in M)//Checking that there is an exile implant in the contents
- if(E.imp_in == M)//Checking that it's actually implanted vs just in their pocket
- to_chat(M, "\black The station gate has detected your exile implant and is blocking your entry.")
+ if(!ismovable(bumped_atom))
+ return
+
+ var/atom/movable/AM = bumped_atom
+
+ if(iscarbon(AM))
+ for(var/obj/item/implant/exile/E in AM)//Checking that there is an exile implant in the contents
+ if(E.imp_in == AM)//Checking that it's actually implanted vs just in their pocket
+ to_chat(AM, "\black The station gate has detected your exile implant and is blocking your entry.")
return
- M.forceMove(get_step(stationgate.loc, SOUTH))
- M.set_dir(SOUTH)
+ AM.forceMove(get_step(stationgate.loc, SOUTH))
+ AM.set_dir(SOUTH)
/obj/machinery/gateway/centeraway/attackby(obj/item/attacking_item, mob/user)
diff --git a/code/modules/cooking/machinery/gibber.dm b/code/modules/cooking/machinery/gibber.dm
index 2ae7553c1a5..74d07711c9e 100644
--- a/code/modules/cooking/machinery/gibber.dm
+++ b/code/modules/cooking/machinery/gibber.dm
@@ -37,12 +37,14 @@
log_misc("a [src] didn't find an input plate.")
return
-/obj/machinery/gibber/autogibber/CollidedWith(var/atom/A)
+/obj/machinery/gibber/autogibber/CollidedWith(atom/bumped_atom)
+ . = ..()
+
if(!input_plate)
return
- if(!ismob(A))
+ if(!ismob(bumped_atom))
return
- var/mob/M = A
+ var/mob/M = bumped_atom
if(M.loc == input_plate)
M.forceMove(src)
M.gib()
diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm
index 36cc30893c8..8dbb0521978 100644
--- a/code/modules/mining/mine_turfs.dm
+++ b/code/modules/mining/mine_turfs.dm
@@ -144,24 +144,24 @@ var/list/mineral_can_smooth_with = list(
if(emitter_blasts_taken >= 3)
GetDrilled()
-/turf/simulated/mineral/CollidedWith(AM)
+/turf/simulated/mineral/CollidedWith(atom/bumped_atom)
. = ..()
- if(istype(AM,/mob/living/carbon/human))
- var/mob/living/carbon/human/H = AM
+ if(istype(bumped_atom, /mob/living/carbon/human))
+ var/mob/living/carbon/human/H = bumped_atom
if((istype(H.l_hand,/obj/item/pickaxe)) && (!H.hand))
var/obj/item/pickaxe/P = H.l_hand
if(P.autodrill)
- attackby(H.l_hand,H)
+ INVOKE_ASYNC(src, TYPE_PROC_REF(/atom, attackby), H.l_hand, H)
- else if((istype(H.r_hand,/obj/item/pickaxe)) && H.hand)
+ else if((istype(H.r_hand, /obj/item/pickaxe)) && H.hand)
var/obj/item/pickaxe/P = H.r_hand
if(P.autodrill)
- attackby(H.r_hand,H)
+ INVOKE_ASYNC(src, TYPE_PROC_REF(/atom, attackby), H.r_hand, H)
- else if(istype(AM,/mob/living/silicon/robot))
- var/mob/living/silicon/robot/R = AM
+ else if(istype(bumped_atom, /mob/living/silicon/robot))
+ var/mob/living/silicon/robot/R = bumped_atom
if(istype(R.module_active,/obj/item/pickaxe))
- attackby(R.module_active,R)
+ INVOKE_ASYNC(src, TYPE_PROC_REF(/atom, attackby), R.module_active, R)
//For use in non-station z-levels as decoration.
/turf/unsimulated/mineral/asteroid
diff --git a/code/modules/multiz/structures.dm b/code/modules/multiz/structures.dm
index 38beefe4648..2267aace098 100644
--- a/code/modules/multiz/structures.dm
+++ b/code/modules/multiz/structures.dm
@@ -255,17 +255,24 @@
return ..()
-/obj/structure/stairs/CollidedWith(atom/movable/moving_atom)
+/obj/structure/stairs/CollidedWith(atom/bumped_atom)
+ . = ..()
+
+ if(!ismovable(bumped_atom))
+ return
+
+ var/atom/movable/AM = bumped_atom
+
// This is hackish but whatever.
- var/turf/target = get_step(GetAbove(moving_atom), dir)
+ var/turf/target = get_step(GetAbove(AM), dir)
if(!target)
return
if(target.z > (z + 1)) //Prevents wheelchair fuckery. Basically, you teleport twice because both the wheelchair + your mob collide with the stairs.
return
- if(target.Enter(moving_atom, src) && moving_atom.dir == dir)
- moving_atom.forceMove(target)
- if(isliving(moving_atom))
- var/mob/living/living_mob = moving_atom
+ if(target.Enter(AM, src) && AM.dir == dir)
+ AM.forceMove(target)
+ if(isliving(AM))
+ var/mob/living/living_mob = AM
if(living_mob.pulling)
living_mob.pulling.forceMove(target)
for(var/obj/item/grab/grab in living_mob)
diff --git a/code/modules/overmap/exoplanets/decor/_turfs.dm b/code/modules/overmap/exoplanets/decor/_turfs.dm
index 355930ea287..469cf544017 100644
--- a/code/modules/overmap/exoplanets/decor/_turfs.dm
+++ b/code/modules/overmap/exoplanets/decor/_turfs.dm
@@ -159,15 +159,15 @@
O.name = "distant terrain"
O.desc = "You need to come over there to take a better look."
-/turf/unsimulated/planet_edge/CollidedWith(atom/movable/A)
+/turf/unsimulated/planet_edge/CollidedWith(atom/bumped_atom)
. = ..()
var/obj/effect/overmap/visitable/sector/exoplanet/E = GLOB.map_sectors["[z]"]
if(!istype(E))
return
if(E.planetary_area && istype(loc, world.area))
ChangeArea(src, E.planetary_area)
- var/new_x = A.x
- var/new_y = A.y
+ var/new_x = bumped_atom.x
+ var/new_y = bumped_atom.y
if(x <= TRANSITIONEDGE)
new_x = E.maxx - TRANSITIONEDGE - 1
else if (x >= (E.maxx - TRANSITIONEDGE))
@@ -177,11 +177,13 @@
else if (y >= (E.maxy - TRANSITIONEDGE))
new_y = TRANSITIONEDGE + 1
- var/turf/T = locate(new_x, new_y, A.z)
+ var/turf/T = locate(new_x, new_y, bumped_atom.z)
if(T && !T.density)
- A.forceMove(T)
- if(isliving(A))
- var/mob/living/L = A
- if(L.pulling)
- var/atom/movable/AM = L.pulling
- AM.forceMove(T)
+ if(ismovable(bumped_atom))
+ var/atom/movable/AM = bumped_atom
+ AM.forceMove(T)
+ if(isliving(AM))
+ var/mob/living/L = bumped_atom
+ if(L.pulling)
+ var/atom/movable/pulling = L.pulling
+ pulling.forceMove(T)
diff --git a/code/modules/power/singularity/particle_accelerator/particle.dm b/code/modules/power/singularity/particle_accelerator/particle.dm
index fbf97089ae5..c7a29ad485b 100644
--- a/code/modules/power/singularity/particle_accelerator/particle.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle.dm
@@ -63,12 +63,12 @@
PC.parent.energy += energy
qdel(src)
-/obj/effect/accelerated_particle/CollidedWith(atom/A)
+/obj/effect/accelerated_particle/CollidedWith(atom/bumped_atom)
. = ..()
if (!active)
return
- if(ismob(A))
- toxmob(A)
+ if(ismob(bumped_atom))
+ toxmob(bumped_atom)
/obj/effect/accelerated_particle/ex_act(severity)
if (!active)
diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm
index 8f2bb73ef51..d27874b981d 100644
--- a/code/modules/power/singularity/singularity.dm
+++ b/code/modules/power/singularity/singularity.dm
@@ -79,10 +79,10 @@
if (A)
consume(A)
-/obj/singularity/CollidedWith(atom/movable/AM)
+/obj/singularity/CollidedWith(atom/bumped_atom)
. = ..()
- if (AM)
- consume(AM)
+ if (bumped_atom)
+ consume(bumped_atom)
/obj/singularity/process()
eat()
diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm
index 3dd92b239b6..044d91db76d 100644
--- a/code/modules/power/tesla/energy_ball.dm
+++ b/code/modules/power/tesla/energy_ball.dm
@@ -211,16 +211,20 @@
var/obj/O = A
O.tesla_act(0, TRUE)
-/obj/singularity/energy_ball/CollidedWith(atom/A)
- if(check_for_immune(A))
+/obj/singularity/energy_ball/CollidedWith(atom/bumped_atom)
+ //Fucking snowflake code
+ SHOULD_CALL_PARENT(FALSE)
+ SEND_SIGNAL(src, COMSIG_ATOM_BUMPED, bumped_atom)
+
+ if(check_for_immune(bumped_atom))
return
- if(isliving(A))
- dust_mobs(A)
- else if(isobj(A))
- if(istype(A, /obj/effect/accelerated_particle))
- consume(A)
+ if(isliving(bumped_atom))
+ dust_mobs(bumped_atom)
+ else if(isobj(bumped_atom))
+ if(istype(bumped_atom, /obj/effect/accelerated_particle))
+ consume(bumped_atom)
return
- var/obj/O = A
+ var/obj/O = bumped_atom
O.tesla_act(0, TRUE)
/obj/singularity/energy_ball/proc/check_for_immune(var/O)
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index ed97e071790..9720e2cc749 100755
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -312,25 +312,29 @@
/obj/machinery/disposal/deliveryChute/update()
return
-/obj/machinery/disposal/deliveryChute/CollidedWith(var/atom/movable/AM) //Go straight into the chute
- if(istype(AM, /obj/item/projectile) || istype(AM, /obj/effect)) return
+/obj/machinery/disposal/deliveryChute/CollidedWith(atom/bumped_atom) //Go straight into the chute
+ . = ..()
+
+ if(istype(bumped_atom, /obj/item/projectile) || istype(bumped_atom, /obj/effect))
+ return
+
switch(dir)
if(NORTH)
- if(AM.loc.y != src.loc.y+1) return
+ if(bumped_atom.loc.y != src.loc.y+1) return
if(EAST)
- if(AM.loc.x != src.loc.x+1) return
+ if(bumped_atom.loc.x != src.loc.x+1) return
if(SOUTH)
- if(AM.loc.y != src.loc.y-1) return
+ if(bumped_atom.loc.y != src.loc.y-1) return
if(WEST)
- if(AM.loc.x != src.loc.x-1) return
+ if(bumped_atom.loc.x != src.loc.x-1) return
- if(istype(AM, /obj))
- var/obj/O = AM
+ if(istype(bumped_atom, /obj))
+ var/obj/O = bumped_atom
O.forceMove(src)
- else if(istype(AM, /mob))
- var/mob/M = AM
+ else if(istype(bumped_atom, /mob))
+ var/mob/M = bumped_atom
M.forceMove(src)
- src.flush()
+ INVOKE_ASYNC(src, PROC_REF(flush))
/obj/machinery/disposal/deliveryChute/flush()
flushing = 1
diff --git a/code/modules/research/xenoarchaeology/artifact/artifact.dm b/code/modules/research/xenoarchaeology/artifact/artifact.dm
index 39f7332fa0c..7a5d11ccc14 100644
--- a/code/modules/research/xenoarchaeology/artifact/artifact.dm
+++ b/code/modules/research/xenoarchaeology/artifact/artifact.dm
@@ -111,20 +111,20 @@
SPAN_NOTICE("[src] has been whittled away under your careful excavation, but there was nothing of interest inside."))
qdel(src)
-/obj/structure/boulder/CollidedWith(AM)
+/obj/structure/boulder/CollidedWith(atom/bumped_atom)
. = ..()
- if(istype(AM,/mob/living/carbon/human))
- var/mob/living/carbon/human/H = AM
+ if(istype(bumped_atom,/mob/living/carbon/human))
+ var/mob/living/carbon/human/H = bumped_atom
if((istype(H.l_hand,/obj/item/pickaxe)) && (!H.hand))
var/obj/item/pickaxe/P = H.l_hand
if(P.autodrill)
- attackby(H.l_hand,H)
+ INVOKE_ASYNC(src, TYPE_PROC_REF(/atom, attackby), H.l_hand, H)
else if((istype(H.r_hand,/obj/item/pickaxe)) && H.hand)
var/obj/item/pickaxe/P = H.r_hand
if(P.autodrill)
- attackby(H.r_hand,H)
+ INVOKE_ASYNC(src, TYPE_PROC_REF(/atom, attackby), H.r_hand, H)
- else if(istype(AM,/mob/living/silicon/robot))
- var/mob/living/silicon/robot/R = AM
+ else if(istype(bumped_atom,/mob/living/silicon/robot))
+ var/mob/living/silicon/robot/R = bumped_atom
if(istype(R.module_active,/obj/item/pickaxe))
- attackby(R.module_active,R)
+ INVOKE_ASYNC(src, TYPE_PROC_REF(/atom, attackby), R.module_active, R)
diff --git a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
index 6f6f8b10c36..ed2e7d7cfcb 100644
--- a/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
+++ b/code/modules/research/xenoarchaeology/artifact/artifact_unknown.dm
@@ -244,33 +244,39 @@
if(secondary_effect?.trigger == TRIGGER_FORCE)
secondary_effect.ToggleActivate()
-/obj/machinery/artifact/CollidedWith(M as mob|obj)
+/obj/machinery/artifact/CollidedWith(atom/bumped_atom)
..()
- if(istype(M,/obj))
- if(M:throwforce >= 10)
+ if(istype(bumped_atom, /obj))
+ var/obj/O = bumped_atom
+ if(O.throwforce >= 10)
if(my_effect.trigger == TRIGGER_FORCE)
my_effect.ToggleActivate()
if(secondary_effect?.trigger == TRIGGER_FORCE)
secondary_effect.ToggleActivate()
- else if(ishuman(M) && !istype(M:gloves,/obj/item/clothing/gloves))
- var/warn = 0
- if (my_effect.trigger == TRIGGER_TOUCH && prob(50))
- my_effect.ToggleActivate()
- warn = 1
- if(secondary_effect?.trigger == TRIGGER_TOUCH && prob(50))
- secondary_effect.ToggleActivate()
- warn = 1
+ else if(ishuman(bumped_atom))
- if (my_effect.effect == EFFECT_TOUCH && prob(50))
- my_effect.DoEffectTouch(M)
- warn = 1
- if(secondary_effect?.effect == EFFECT_TOUCH && prob(50))
- secondary_effect.DoEffectTouch(M)
- warn = 1
+ var/mob/living/carbon/human/H = bumped_atom
- if(warn)
- to_chat(M, "You accidentally touch [src].")
+ if(!istype(H.gloves, /obj/item/clothing/gloves))
+ var/warn = 0
+
+ if (my_effect.trigger == TRIGGER_TOUCH && prob(50))
+ my_effect.ToggleActivate()
+ warn = 1
+ if(secondary_effect?.trigger == TRIGGER_TOUCH && prob(50))
+ secondary_effect.ToggleActivate()
+ warn = 1
+
+ if (my_effect.effect == EFFECT_TOUCH && prob(50))
+ my_effect.DoEffectTouch(H)
+ warn = 1
+ if(secondary_effect?.effect == EFFECT_TOUCH && prob(50))
+ secondary_effect.DoEffectTouch(H)
+ warn = 1
+
+ if(warn)
+ to_chat(H, "You accidentally touch [src].")
..()
/obj/machinery/artifact/bullet_act(var/obj/item/projectile/P)
diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm
index 812903f565e..1dae12466b8 100644
--- a/code/modules/supermatter/supermatter.dm
+++ b/code/modules/supermatter/supermatter.dm
@@ -405,22 +405,24 @@
living_user.apply_damage(150, DAMAGE_RADIATION, damage_flags = DAMAGE_FLAG_DISPERSED)
-/obj/machinery/power/supermatter/CollidedWith(atom/AM as mob|obj)
- if(!AM.simulated)
+/obj/machinery/power/supermatter/CollidedWith(atom/bumped_atom)
+ . = ..()
+
+ if(!bumped_atom.simulated)
return
- if(istype(AM, /obj/effect))
+ if(istype(bumped_atom, /obj/effect))
return
- if(isprojectile(AM))
+ if(isprojectile(bumped_atom))
return
- if(istype(AM, /mob/living))
- AM.visible_message("\The [AM] slams into \the [src] inducing a resonance... [AM.get_pronoun("his")] body starts to glow and catch flame before flashing into ash.",\
+ if(istype(bumped_atom, /mob/living))
+ bumped_atom.visible_message("\The [bumped_atom] slams into \the [src] inducing a resonance... [bumped_atom.get_pronoun("his")] body starts to glow and catch flame before flashing into ash.",\
"You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\"",\
"You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.")
else if(!grav_pulling) //To prevent spam, detonating supermatter does not indicate non-mobs being destroyed
- AM.visible_message("\The [AM] smacks into \the [src] and rapidly flashes to ash.",\
+ bumped_atom.visible_message("\The [bumped_atom] smacks into \the [src] and rapidly flashes to ash.",\
"You hear a loud crack as you are washed with a wave of heat.")
- Consume(AM)
+ Consume(bumped_atom)
/obj/machinery/power/supermatter/proc/Consume(var/mob/living/user)
if(istype(user))
diff --git a/html/changelogs/fluffyghost-restructurecollidedwith.yml b/html/changelogs/fluffyghost-restructurecollidedwith.yml
new file mode 100644
index 00000000000..253f0c4824f
--- /dev/null
+++ b/html/changelogs/fluffyghost-restructurecollidedwith.yml
@@ -0,0 +1,58 @@
+################################
+# Example Changelog File
+#
+# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
+#
+# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
+# When it is, any changes listed below will disappear.
+#
+# Valid Prefixes:
+# bugfix
+# - (fixes bugs)
+# wip
+# - (work in progress)
+# qol
+# - (quality of life)
+# soundadd
+# - (adds a sound)
+# sounddel
+# - (removes a sound)
+# rscadd
+# - (adds a feature)
+# rscdel
+# - (removes a feature)
+# imageadd
+# - (adds an image or sprite)
+# imagedel
+# - (removes an image or sprite)
+# spellcheck
+# - (fixes spelling or grammar)
+# experiment
+# - (experimental change)
+# balance
+# - (balance changes)
+# code_imp
+# - (misc internal code change)
+# refactor
+# - (refactors code)
+# config
+# - (makes a change to the config files)
+# admin
+# - (makes changes to administrator tools)
+# server
+# - (miscellaneous changes to server)
+#################################
+
+# Your name.
+author: FluffyGhost
+
+# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
+delete-after: True
+
+# Any changes you've made. See valid prefix list above.
+# INDENT WITH TWO SPACES. NOT TABS. SPACES.
+# SCREW THIS UP AND IT WON'T WORK.
+# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
+# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - refactor: "Refactored CollidedWith()."