Refactored CollidedWith (#19541)

Refactored CollidedWith()
This commit is contained in:
Fluffy
2024-06-29 12:01:18 +02:00
committed by GitHub
parent d63d63d78c
commit d8d67ebd3a
31 changed files with 317 additions and 183 deletions
@@ -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"
+12 -4
View File
@@ -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.
+9 -6
View File
@@ -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)
@@ -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
@@ -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("<span class=\"warning\">\The [AM] slams into \the [src] inducing a resonance... [AM.get_pronoun("his")] body starts to glow and catch flame before flashing into ash.</span>",\
if(istype(bumped_atom, /mob/living))
bumped_atom.visible_message("<span class=\"warning\">\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.</span>",\
"<span class=\"danger\">You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\"</span>",\
"<span class=\"warning\">You hear an unearthly noise as a wave of heat washes over you.</span>")
else
AM.visible_message("<span class=\"warning\">\The [AM] smacks into \the [src] and rapidly flashes to ash.</span>",\
bumped_atom.visible_message("<span class=\"warning\">\The [bumped_atom] smacks into \the [src] and rapidly flashes to ash.</span>",\
"<span class=\"warning\">You hear a loud crack as you are washed with a wave of heat.</span>")
playsound(src, 'sound/effects/supermatter.ogg', 50, 1)
Consume(AM)
Consume(bumped_atom)
/turf/unsimulated/wall/supermatter/proc/Consume(var/mob/living/user)
+1 -1
View File
@@ -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
+16 -16
View File
@@ -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()
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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
..()
+16 -9
View File
@@ -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)
. = ..()
+5 -3
View File
@@ -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)
+4 -2
View File
@@ -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)
+8 -6
View File
@@ -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))
+4 -2
View File
@@ -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
+3 -3
View File
@@ -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
+4 -4
View File
@@ -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
..()
+5 -3
View File
@@ -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)
+21 -13
View File
@@ -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()
+26 -12
View File
@@ -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)
+5 -3
View File
@@ -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()
+9 -9
View File
@@ -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
+13 -6
View File
@@ -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)
+12 -10
View File
@@ -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)
@@ -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)
@@ -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()
+12 -8
View File
@@ -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)
+15 -11
View File
@@ -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
@@ -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)
@@ -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, "<b>You accidentally touch [src].</b>")
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, "<b>You accidentally touch [src].</b>")
..()
/obj/machinery/artifact/bullet_act(var/obj/item/projectile/P)
+10 -8
View File
@@ -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("<span class=\"warning\">\The [AM] slams into \the [src] inducing a resonance... [AM.get_pronoun("his")] body starts to glow and catch flame before flashing into ash.</span>",\
if(istype(bumped_atom, /mob/living))
bumped_atom.visible_message("<span class=\"warning\">\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.</span>",\
"<span class=\"danger\">You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\"</span>",\
"<span class=\"warning\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>")
else if(!grav_pulling) //To prevent spam, detonating supermatter does not indicate non-mobs being destroyed
AM.visible_message("<span class=\"warning\">\The [AM] smacks into \the [src] and rapidly flashes to ash.</span>",\
bumped_atom.visible_message("<span class=\"warning\">\The [bumped_atom] smacks into \the [src] and rapidly flashes to ash.</span>",\
"<span class=\"warning\">You hear a loud crack as you are washed with a wave of heat.</span>")
Consume(AM)
Consume(bumped_atom)
/obj/machinery/power/supermatter/proc/Consume(var/mob/living/user)
if(istype(user))
@@ -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()."