Code Cleanup: (Bump(), Bumped()) -> (Collide(), CollidedWith()) (#4349)

This PR rips out the old Bump() and Bumped() procs and replaces them with Collide() and CollidedWith() respectively. Behavior should be the same, but Bump() should no longer be double-called, and no longer relies on spawns.

Other changes:

LAssailant is now a weakref.
Some direct loc setting are now forceMove().
This commit is contained in:
Lohikar
2018-03-08 09:39:53 +02:00
committed by Erki
parent 057e787948
commit a86398d0d2
66 changed files with 231 additions and 216 deletions
@@ -105,9 +105,8 @@
"<span class='notice'>[src] has been whittled away under your careful excavation, but there was nothing of interest inside.</span>")
qdel(src)
/obj/structure/boulder/Bumped(AM)
/obj/structure/boulder/CollidedWith(AM)
. = ..()
if(istype(AM,/mob/living/carbon/human))
var/mob/living/carbon/human/H = AM
if((istype(H.l_hand,/obj/item/weapon/pickaxe)) && (!H.hand))
@@ -20,7 +20,8 @@
icon_state = "gigadrill_mov"
user << "<span class='notice'>You press a button and [src] shudders to life.</span>"
/obj/machinery/giga_drill/Bump(atom/A)
/obj/machinery/giga_drill/Collide(atom/A)
. = ..()
if(active && !drilling_turf)
if(istype(A,/turf/simulated/mineral))
var/turf/simulated/mineral/M = A
@@ -84,7 +84,7 @@
secondary_effect.process()
if(pulledby)
Bumped(pulledby)
CollidedWith(pulledby)
//if either of our effects rely on environmental factors, work that out
var/trigger_cold = 0
@@ -254,7 +254,7 @@
if(secondary_effect && secondary_effect.trigger == TRIGGER_FORCE && prob(25))
secondary_effect.ToggleActivate(0)
/obj/machinery/artifact/Bumped(M as mob|obj)
/obj/machinery/artifact/CollidedWith(M as mob|obj)
..()
if(istype(M,/obj))
if(M:throwforce >= 10)
@@ -223,5 +223,6 @@
else
STOP_PROCESSING(SSprocessing, src)
/obj/effect/shadow_wight/Bump(var/atom/obstacle)
/obj/effect/shadow_wight/Collide(var/atom/obstacle)
. = ..()
obstacle << "<span class='warning'>You feel a chill run down your spine!</span>"