mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Converted all old events to lazy_events, removed old events, renamed lazy_event to event (#30503)
* wip refactor old events * refactored events * We're not lazy anymore! I mean we're still are. We just don't call ourselves that. Lazy is the new default option. It's also the only option. God, this took so long.
This commit is contained in:
@@ -69,7 +69,7 @@
|
||||
RestrainedClickOn(A)
|
||||
else
|
||||
*/
|
||||
if(lazy_invoke_event(/lazy_event/on_uattack, list("atom" = A))) //This returns 1 when doing an action intercept
|
||||
if(invoke_event(/event/uattack, list("atom" = A))) //This returns 1 when doing an action intercept
|
||||
return
|
||||
A.add_hiddenprint(src)
|
||||
A.attack_ai(src)
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
return
|
||||
|
||||
var/list/modifiers = params2list(params)
|
||||
lazy_invoke_event(/lazy_event/on_clickon, list(
|
||||
invoke_event(/event/clickon, list(
|
||||
"user" = src,
|
||||
"modifiers" = modifiers,
|
||||
"target" = A
|
||||
@@ -152,7 +152,7 @@
|
||||
else
|
||||
if(ismob(A) || istype(held_item, /obj/item/weapon/grab))
|
||||
delayNextAttack(10)
|
||||
if(lazy_invoke_event(/lazy_event/on_uattack, list("atom" = A))) //This returns 1 when doing an action intercept
|
||||
if(invoke_event(/event/uattack, list("atom" = A))) //This returns 1 when doing an action intercept
|
||||
return
|
||||
UnarmedAttack(A, 1, params)
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
else
|
||||
if(ismob(A))
|
||||
delayNextAttack(10)
|
||||
if(lazy_invoke_event(/lazy_event/on_uattack, list("atom" = A))) //This returns 1 when doing an action intercept
|
||||
if(invoke_event(/event/uattack, list("atom" = A))) //This returns 1 when doing an action intercept
|
||||
return
|
||||
RangedAttack(A, params)
|
||||
|
||||
@@ -245,7 +245,7 @@
|
||||
Not currently used by anything but could easily be.
|
||||
*/
|
||||
/mob/proc/RestrainedClickOn(var/atom/A)
|
||||
lazy_invoke_event(/lazy_event/on_ruattack, list("atom" = A))
|
||||
invoke_event(/event/ruattack, list("atom" = A))
|
||||
|
||||
/*
|
||||
Middle click
|
||||
@@ -388,9 +388,9 @@
|
||||
else if(A.pixel_x < -16)
|
||||
change_dir(WEST)
|
||||
|
||||
lazy_invoke_event(/lazy_event/on_before_move)
|
||||
lazy_invoke_event(/lazy_event/on_face)
|
||||
lazy_invoke_event(/lazy_event/on_after_move)
|
||||
invoke_event(/event/before_move)
|
||||
invoke_event(/event/face)
|
||||
invoke_event(/event/after_move)
|
||||
return
|
||||
|
||||
if(abs(dx) < abs(dy))
|
||||
@@ -404,9 +404,9 @@
|
||||
else
|
||||
change_dir(WEST)
|
||||
|
||||
lazy_invoke_event(/lazy_event/on_before_move)
|
||||
lazy_invoke_event(/lazy_event/on_face)
|
||||
lazy_invoke_event(/lazy_event/on_after_move)
|
||||
invoke_event(/event/before_move)
|
||||
invoke_event(/event/face)
|
||||
invoke_event(/event/after_move)
|
||||
|
||||
|
||||
// File renamed to mouse.dm?
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
aicamera.captureimage(A, src)
|
||||
return
|
||||
|
||||
if(lazy_invoke_event(/lazy_event/on_uattack, list("atom" = A)))
|
||||
if(invoke_event(/event/uattack, list("atom" = A)))
|
||||
return
|
||||
|
||||
var/obj/item/W = get_active_hand()
|
||||
|
||||
@@ -50,14 +50,14 @@
|
||||
second.equip_to_slot(cuffs, slot_handcuffed)
|
||||
first.equip_to_slot(cuffs, slot_handcuffed)
|
||||
|
||||
first.lazy_register_event(/lazy_event/on_z_transition, first, /mob/living/carbon/proc/z_transition_bringalong)
|
||||
second.lazy_register_event(/lazy_event/on_z_transition, second, /mob/living/carbon/proc/z_transition_bringalong)
|
||||
first.register_event(/event/z_transition, first, /mob/living/carbon/proc/z_transition_bringalong)
|
||||
second.register_event(/event/z_transition, second, /mob/living/carbon/proc/z_transition_bringalong)
|
||||
|
||||
first.lazy_register_event(/lazy_event/on_post_z_transition, first, /mob/living/carbon/proc/post_z_transition_bringalong)
|
||||
second.lazy_register_event(/lazy_event/on_post_z_transition, second, /mob/living/carbon/proc/post_z_transition_bringalong)
|
||||
first.register_event(/event/post_z_transition, first, /mob/living/carbon/proc/post_z_transition_bringalong)
|
||||
second.register_event(/event/post_z_transition, second, /mob/living/carbon/proc/post_z_transition_bringalong)
|
||||
|
||||
second.lazy_register_event(/lazy_event/on_moved, first, /mob/living/carbon/proc/on_mutual_cuffed_move)
|
||||
first.lazy_register_event(/lazy_event/on_moved, second, /mob/living/carbon/proc/on_mutual_cuffed_move)
|
||||
second.register_event(/event/moved, first, /mob/living/carbon/proc/on_mutual_cuffed_move)
|
||||
first.register_event(/event/moved, second, /mob/living/carbon/proc/on_mutual_cuffed_move)
|
||||
|
||||
cuffs.on_restraint_apply(first)
|
||||
cuffs.on_restraint_apply(second)
|
||||
@@ -75,14 +75,14 @@
|
||||
mutual_handcuffed_mobs.Remove(handcuffed_to)
|
||||
|
||||
//remove from the event
|
||||
C.lazy_unregister_event(/lazy_event/on_moved, C, /mob/living/carbon/proc/on_mutual_cuffed_move)
|
||||
handcuffed_to.lazy_unregister_event(/lazy_event/on_moved, handcuffed_to, /mob/living/carbon/proc/on_mutual_cuffed_move)
|
||||
C.unregister_event(/event/moved, C, /mob/living/carbon/proc/on_mutual_cuffed_move)
|
||||
handcuffed_to.unregister_event(/event/moved, handcuffed_to, /mob/living/carbon/proc/on_mutual_cuffed_move)
|
||||
|
||||
C.lazy_unregister_event(/lazy_event/on_z_transition, C, /mob/living/carbon/proc/z_transition_bringalong)
|
||||
handcuffed_to.lazy_unregister_event(/lazy_event/on_z_transition, handcuffed_to, /mob/living/carbon/proc/z_transition_bringalong)
|
||||
C.unregister_event(/event/z_transition, C, /mob/living/carbon/proc/z_transition_bringalong)
|
||||
handcuffed_to.unregister_event(/event/z_transition, handcuffed_to, /mob/living/carbon/proc/z_transition_bringalong)
|
||||
|
||||
C.lazy_unregister_event(/lazy_event/on_post_z_transition, C, /mob/living/carbon/proc/post_z_transition_bringalong)
|
||||
handcuffed_to.lazy_unregister_event(/lazy_event/on_post_z_transition, handcuffed_to, /mob/living/carbon/proc/post_z_transition_bringalong)
|
||||
C.unregister_event(/event/post_z_transition, C, /mob/living/carbon/proc/post_z_transition_bringalong)
|
||||
handcuffed_to.unregister_event(/event/post_z_transition, handcuffed_to, /mob/living/carbon/proc/post_z_transition_bringalong)
|
||||
|
||||
//reset the mob's vars
|
||||
handcuffed_to.mutual_handcuffed_to = null
|
||||
@@ -114,14 +114,14 @@
|
||||
/mob/living/carbon/proc/z_transition_bringalong(var/mob/user, var/from_z, var/to_z)
|
||||
if (mutual_handcuffed_to)
|
||||
// Remove the ability to bring his buddy, since his buddy already brought him here
|
||||
mutual_handcuffed_to.lazy_unregister_event(/lazy_event/on_z_transition, mutual_handcuffed_to, /mob/living/carbon/proc/z_transition_bringalong)
|
||||
mutual_handcuffed_to.lazy_unregister_event(/lazy_event/on_post_z_transition, mutual_handcuffed_to, /mob/living/carbon/proc/post_z_transition_bringalong)
|
||||
mutual_handcuffed_to.lazy_unregister_event(/lazy_event/on_moved, mutual_handcuffed_to, /mob/living/carbon/proc/on_mutual_cuffed_move)
|
||||
mutual_handcuffed_to.unregister_event(/event/z_transition, mutual_handcuffed_to, /mob/living/carbon/proc/z_transition_bringalong)
|
||||
mutual_handcuffed_to.unregister_event(/event/post_z_transition, mutual_handcuffed_to, /mob/living/carbon/proc/post_z_transition_bringalong)
|
||||
mutual_handcuffed_to.unregister_event(/event/moved, mutual_handcuffed_to, /mob/living/carbon/proc/on_mutual_cuffed_move)
|
||||
|
||||
/mob/living/carbon/proc/post_z_transition_bringalong(var/mob/user, var/from_z, var/to_z)
|
||||
if (mutual_handcuffed_to)
|
||||
// Re-adds the events on the fly once the transition is done.
|
||||
mutual_handcuffed_to.forceMove(get_turf(src))
|
||||
mutual_handcuffed_to.lazy_register_event(/lazy_event/on_z_transition, mutual_handcuffed_to, /mob/living/carbon/proc/z_transition_bringalong)
|
||||
mutual_handcuffed_to.lazy_register_event(/lazy_event/on_post_z_transition, mutual_handcuffed_to, /mob/living/carbon/proc/post_z_transition_bringalong)
|
||||
mutual_handcuffed_to.lazy_register_event(/lazy_event/on_moved, mutual_handcuffed_to, /mob/living/carbon/proc/on_mutual_cuffed_move)
|
||||
mutual_handcuffed_to.register_event(/event/z_transition, mutual_handcuffed_to, /mob/living/carbon/proc/z_transition_bringalong)
|
||||
mutual_handcuffed_to.register_event(/event/post_z_transition, mutual_handcuffed_to, /mob/living/carbon/proc/post_z_transition_bringalong)
|
||||
mutual_handcuffed_to.register_event(/event/moved, mutual_handcuffed_to, /mob/living/carbon/proc/on_mutual_cuffed_move)
|
||||
|
||||
Reference in New Issue
Block a user