mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Optimized invoke_event (#31046)
This commit is contained in:
@@ -275,15 +275,11 @@
|
||||
* * event/event_type Required. The typepath of the event to invoke.
|
||||
* * list/arguments Optional. List of parameters to be passed to the event handlers.
|
||||
*/
|
||||
#define INVOKE_EVENT(target, event_type, arguments...) (target.registered_events?[event_type] && target.invoke_event(event_type, list(##arguments)))
|
||||
|
||||
/datum/proc/invoke_event(event/event_type, list/arguments)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
if(!length(registered_events))
|
||||
// No event at all is registered for this datum.
|
||||
return
|
||||
var/list/event_handlers = registered_events[event_type]
|
||||
if(!length(event_handlers))
|
||||
// This datum does not have any handler registered for this event_type.
|
||||
return
|
||||
for(var/key in event_handlers)
|
||||
var/list/handler = event_handlers[key]
|
||||
var/objRef = handler[EVENT_HANDLER_OBJREF_INDEX]
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
RestrainedClickOn(A)
|
||||
else
|
||||
*/
|
||||
if(invoke_event(/event/uattack, list("atom" = A))) //This returns 1 when doing an action intercept
|
||||
if(INVOKE_EVENT(src, /event/uattack, "atom" = A)) //This returns 1 when doing an action intercept
|
||||
return
|
||||
A.add_hiddenprint(src)
|
||||
A.attack_ai(src)
|
||||
|
||||
@@ -75,11 +75,7 @@
|
||||
return
|
||||
|
||||
var/list/modifiers = params2list(params)
|
||||
invoke_event(/event/clickon, list(
|
||||
"user" = src,
|
||||
"modifiers" = modifiers,
|
||||
"target" = A
|
||||
))
|
||||
INVOKE_EVENT(src, /event/clickon, "user" = src, "modifiers" = modifiers, "target" = A)
|
||||
if(modifiers["middle"])
|
||||
if(modifiers["shift"])
|
||||
MiddleShiftClickOn(A)
|
||||
@@ -155,7 +151,7 @@
|
||||
else
|
||||
if(ismob(A) || istype(held_item, /obj/item/weapon/grab))
|
||||
delayNextAttack(10)
|
||||
if(invoke_event(/event/uattack, list("atom" = A))) //This returns 1 when doing an action intercept
|
||||
if(INVOKE_EVENT(src, /event/uattack, "atom" = A)) //This returns 1 when doing an action intercept
|
||||
return
|
||||
UnarmedAttack(A, 1, params)
|
||||
|
||||
@@ -186,7 +182,7 @@
|
||||
else
|
||||
if(ismob(A))
|
||||
delayNextAttack(10)
|
||||
if(invoke_event(/event/uattack, list("atom" = A))) //This returns 1 when doing an action intercept
|
||||
if(INVOKE_EVENT(src, /event/uattack, "atom" = A)) //This returns 1 when doing an action intercept
|
||||
return
|
||||
RangedAttack(A, params)
|
||||
|
||||
@@ -248,7 +244,7 @@
|
||||
Not currently used by anything but could easily be.
|
||||
*/
|
||||
/mob/proc/RestrainedClickOn(var/atom/A)
|
||||
invoke_event(/event/ruattack, list("atom" = A))
|
||||
INVOKE_EVENT(src, /event/ruattack, "atom" = A)
|
||||
|
||||
/*
|
||||
Middle click
|
||||
@@ -391,9 +387,9 @@
|
||||
else if(A.pixel_x < -16)
|
||||
change_dir(WEST)
|
||||
|
||||
invoke_event(/event/before_move)
|
||||
invoke_event(/event/face)
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/before_move)
|
||||
INVOKE_EVENT(src, /event/face)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
return
|
||||
|
||||
if(abs(dx) < abs(dy))
|
||||
@@ -407,9 +403,9 @@
|
||||
else
|
||||
change_dir(WEST)
|
||||
|
||||
invoke_event(/event/before_move)
|
||||
invoke_event(/event/face)
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/before_move)
|
||||
INVOKE_EVENT(src, /event/face)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
|
||||
|
||||
// File renamed to mouse.dm?
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
aicamera.captureimage(A, src)
|
||||
return
|
||||
|
||||
if(invoke_event(/event/uattack, list("atom" = A)))
|
||||
if(INVOKE_EVENT(src, /event/uattack, "atom" = A))
|
||||
return
|
||||
|
||||
var/obj/item/W = get_active_hand()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
// Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown.
|
||||
/obj/item/proc/attack_self(mob/user)
|
||||
. = invoke_event(/event/item_attack_self, list("user" = user))
|
||||
. = INVOKE_EVENT(src, /event/item_attack_self, "user" = user)
|
||||
if(flags & TWOHANDABLE)
|
||||
if(!(flags & MUSTTWOHAND))
|
||||
if(wielded)
|
||||
@@ -32,7 +32,7 @@
|
||||
I.attack(src, user, def_zone, originator)
|
||||
else
|
||||
I.attack(src, user, def_zone)
|
||||
invoke_event(/event/attackby, list("attacker" = user, "item" = I))
|
||||
INVOKE_EVENT(src, /event/attackby, "attacker" = user, "item" = I)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
msg = replace_pronoun(user, msg)
|
||||
|
||||
if(isliving(user))
|
||||
user.invoke_event(/event/emote, list("emote" = key, "source" = user))
|
||||
INVOKE_EVENT(user, /event/emote, "emote" = key, "source" = user)
|
||||
|
||||
if(!msg)
|
||||
return
|
||||
|
||||
@@ -1669,7 +1669,7 @@ var/list/bloodstone_list = list()
|
||||
switch(dance_move)
|
||||
if ("clock")
|
||||
for (var/mob/M in contributors)
|
||||
M.invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(M, /event/before_move)
|
||||
switch (get_dir(src,M))
|
||||
if (NORTHWEST,NORTH)
|
||||
M.forceMove(get_step(M,EAST))
|
||||
@@ -1683,11 +1683,11 @@ var/list/bloodstone_list = list()
|
||||
if (SOUTHWEST,WEST)
|
||||
M.forceMove(get_step(M,NORTH))
|
||||
M.dir = NORTH
|
||||
M.invoke_event(/event/after_move)
|
||||
M.invoke_event(/event/moved, list("mover" = M))
|
||||
INVOKE_EVENT(M, /event/after_move)
|
||||
INVOKE_EVENT(M, /event/moved, "mover" = M)
|
||||
if ("counter")
|
||||
for (var/mob/M in contributors)
|
||||
M.invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(M, /event/before_move)
|
||||
switch (get_dir(src,M))
|
||||
if (NORTHEAST,NORTH)
|
||||
M.forceMove(get_step(M,WEST))
|
||||
@@ -1701,22 +1701,22 @@ var/list/bloodstone_list = list()
|
||||
if (NORTHWEST,WEST)
|
||||
M.forceMove(get_step(M,SOUTH))
|
||||
M.dir = SOUTH
|
||||
M.invoke_event(/event/after_move)
|
||||
M.invoke_event(/event/moved, list("mover" = M))
|
||||
INVOKE_EVENT(M, /event/after_move)
|
||||
INVOKE_EVENT(M, /event/moved, "mover" = M)
|
||||
if ("spin")
|
||||
for (var/mob/M in contributors)
|
||||
spawn()
|
||||
M.dir = SOUTH
|
||||
M.invoke_event(/event/face)
|
||||
INVOKE_EVENT(M, /event/face)
|
||||
sleep(0.75)
|
||||
M.dir = EAST
|
||||
M.invoke_event(/event/face)
|
||||
INVOKE_EVENT(M, /event/face)
|
||||
sleep(0.75)
|
||||
M.dir = NORTH
|
||||
M.invoke_event(/event/face)
|
||||
INVOKE_EVENT(M, /event/face)
|
||||
sleep(0.75)
|
||||
M.dir = WEST
|
||||
M.invoke_event(/event/face)
|
||||
INVOKE_EVENT(M, /event/face)
|
||||
sleep(0.75)
|
||||
M.dir = SOUTH
|
||||
M.invoke_event(/event/face)
|
||||
INVOKE_EVENT(M, /event/face)
|
||||
|
||||
@@ -679,7 +679,7 @@ var/bloodstone_backup = 0
|
||||
switch(dance_move)
|
||||
if ("clock")
|
||||
for (var/mob/M in dancers)
|
||||
M.invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(M, /event/before_move)
|
||||
switch (get_dir(src,M))
|
||||
if (NORTHWEST,NORTH)
|
||||
step_to(M, get_step(M,EAST))
|
||||
@@ -689,11 +689,11 @@ var/bloodstone_backup = 0
|
||||
step_to(M, get_step(M,WEST))
|
||||
if (SOUTHWEST,WEST)
|
||||
step_to(M, get_step(M,NORTH))
|
||||
M.invoke_event(/event/after_move)
|
||||
M.invoke_event(/event/moved, list("mover" = M))
|
||||
INVOKE_EVENT(M, /event/after_move)
|
||||
INVOKE_EVENT(M, /event/moved, "mover" = M)
|
||||
if ("counter")
|
||||
for (var/mob/M in dancers)
|
||||
M.invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(M, /event/before_move)
|
||||
switch (get_dir(src,M))
|
||||
if (NORTHEAST,NORTH)
|
||||
step_to(M, get_step(M,WEST))
|
||||
@@ -703,22 +703,22 @@ var/bloodstone_backup = 0
|
||||
step_to(M, get_step(M,EAST))
|
||||
if (NORTHWEST,WEST)
|
||||
step_to(M, get_step(M,SOUTH))
|
||||
M.invoke_event(/event/after_move)
|
||||
M.invoke_event(/event/moved, list("mover" = M))
|
||||
INVOKE_EVENT(M, /event/after_move)
|
||||
INVOKE_EVENT(M, /event/moved, "mover" = M)
|
||||
if ("spin")
|
||||
for (var/mob/M in dancers)
|
||||
spawn()
|
||||
M.dir = SOUTH
|
||||
M.invoke_event(/event/face)
|
||||
INVOKE_EVENT(M, /event/face)
|
||||
sleep(0.75)
|
||||
M.dir = EAST
|
||||
M.invoke_event(/event/face)
|
||||
INVOKE_EVENT(M, /event/face)
|
||||
sleep(0.75)
|
||||
M.dir = NORTH
|
||||
M.invoke_event(/event/face)
|
||||
INVOKE_EVENT(M, /event/face)
|
||||
sleep(0.75)
|
||||
M.dir = WEST
|
||||
M.invoke_event(/event/face)
|
||||
INVOKE_EVENT(M, /event/face)
|
||||
sleep(0.75)
|
||||
M.dir = SOUTH
|
||||
M.invoke_event(/event/face)
|
||||
INVOKE_EVENT(M, /event/face)
|
||||
|
||||
@@ -143,9 +143,9 @@
|
||||
P.reflected = TRUE//you can now get hit by the projectile you just fired. Careful with portals!
|
||||
|
||||
if(curturf.z != destturf.z)
|
||||
teleatom.invoke_event(/event/z_transition, list("user" = teleatom, "from_z" = curturf.z, "to_z" = destturf.z))
|
||||
INVOKE_EVENT(teleatom, /event/z_transition, "user" = teleatom, "from_z" = curturf.z, "to_z" = destturf.z)
|
||||
for(var/atom/movable/AA in recursive_type_check(teleatom))
|
||||
AA.invoke_event(/event/z_transition, list("user" = AA, "from_z" = curturf.z, "to_z" = destturf.z))
|
||||
INVOKE_EVENT(AA, /event/z_transition, "user" = AA, "from_z" = curturf.z, "to_z" = destturf.z)
|
||||
|
||||
if(force_teleport)
|
||||
teleatom.forceMove(destturf, no_tp = 1)
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
|
||||
if (hasFactionsWithHUDIcons())
|
||||
update_faction_icons()
|
||||
invoke_event(/event/after_mind_transfer, list("mind" = src))
|
||||
INVOKE_EVENT(src, /event/after_mind_transfer, "mind" = src)
|
||||
|
||||
/datum/mind/proc/transfer_to_without_current(var/mob/new_character)
|
||||
new_character.attack_log += "\[[time_stamp()]\]: mind transfer from a body-less observer to [new_character]"
|
||||
|
||||
@@ -333,7 +333,7 @@
|
||||
destination_port = null
|
||||
return
|
||||
for(var/atom/movable/AA in linked_area)
|
||||
AA.invoke_event(/event/z_transition, list("user" = AA, "to_z" = D.z, "from_z" = linked_port.z))
|
||||
INVOKE_EVENT(AA, /event/z_transition, "user" = AA, "to_z" = D.z, "from_z" = linked_port.z)
|
||||
|
||||
if(transit_port && get_transit_delay())
|
||||
if(broadcast)
|
||||
|
||||
@@ -198,7 +198,7 @@ var/global/list/ghdel_profiling = list()
|
||||
densityChanged()
|
||||
|
||||
/atom/proc/densityChanged()
|
||||
invoke_event(/event/density_change, list("atom" = src))
|
||||
INVOKE_EVENT(src, /event/density_change, "atom" = src)
|
||||
if(beams && beams.len) // If beams is not a list something bad happened and we want to have a runtime to lynch whomever is responsible.
|
||||
beams.len = 0
|
||||
if(!isturf(src))
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
qdel(materials)
|
||||
materials = null
|
||||
|
||||
invoke_event(/event/destroyed, list("thing" = src))
|
||||
INVOKE_EVENT(src, /event/destroyed, "thing" = src)
|
||||
|
||||
for (var/atom/movable/AM in locked_atoms)
|
||||
unlock_atom(AM)
|
||||
@@ -127,7 +127,7 @@
|
||||
/atom/movable/Move(NewLoc, Dir = 0, step_x = 0, step_y = 0, var/glide_size_override = 0)
|
||||
if(!loc || !NewLoc)
|
||||
return 0
|
||||
invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(src, /event/before_move)
|
||||
|
||||
if(current_tethers && current_tethers.len)
|
||||
for(var/datum/tether/master_slave/T in current_tethers)
|
||||
@@ -137,7 +137,7 @@
|
||||
break
|
||||
if(get_exact_dist(T.effective_master, NewLoc) > T.tether_distance)
|
||||
change_dir(Dir)
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
return 0
|
||||
for(var/datum/tether/equal/restrictive/R in current_tethers)
|
||||
var/atom/movable/AM
|
||||
@@ -150,11 +150,11 @@
|
||||
break
|
||||
if(get_exact_dist(AM, NewLoc) > R.tether_distance)
|
||||
change_dir(Dir)
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
return 0
|
||||
if(timestopped)
|
||||
if(!pulledby || pulledby.timestopped) //being moved by our wizard maybe?
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
return 0
|
||||
|
||||
var/can_pull_tether = 0
|
||||
@@ -162,7 +162,7 @@
|
||||
if(tether.attempt_to_follow(src,NewLoc))
|
||||
can_pull_tether = 1
|
||||
else
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
return 0
|
||||
|
||||
if(glide_size_override > 0)
|
||||
@@ -173,7 +173,7 @@
|
||||
. = ..()
|
||||
|
||||
update_dir()
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
return
|
||||
|
||||
//We always split up movements into cardinals for issues with diagonal movements.
|
||||
@@ -215,7 +215,7 @@
|
||||
|
||||
if(!loc || (loc == oldloc && oldloc != NewLoc))
|
||||
last_move = 0
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
return
|
||||
|
||||
update_client_hook(loc)
|
||||
@@ -233,8 +233,8 @@
|
||||
last_moved = world.time
|
||||
src.move_speed = world.timeofday - src.l_move_time
|
||||
src.l_move_time = world.timeofday
|
||||
invoke_event(/event/moved, list("mover" = src))
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/moved, "mover" = src)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
|
||||
/atom/movable/search_contents_for(path,list/filter_path=null) // For vehicles
|
||||
var/list/found = ..()
|
||||
@@ -409,7 +409,7 @@
|
||||
|
||||
// harderforce is for things like lighting overlays which should only be moved in EXTREMELY specific sitations.
|
||||
/atom/movable/proc/forceMove(atom/destination,var/no_tp=0, var/harderforce = FALSE, glide_size_override = 0)
|
||||
invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(src, /event/before_move)
|
||||
if(glide_size_override)
|
||||
glide_size = glide_size_override
|
||||
var/atom/old_loc = loc
|
||||
@@ -439,11 +439,11 @@
|
||||
|
||||
update_client_hook(loc)
|
||||
|
||||
invoke_event(/event/moved, list("mover" = src))
|
||||
INVOKE_EVENT(src, /event/moved, "mover" = src)
|
||||
var/turf/T = get_turf(destination)
|
||||
if(old_loc && T && old_loc.z != T.z)
|
||||
invoke_event(/event/z_transition, list("user" = src, "from_z" = old_loc.z, "to_z" = T.z))
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/z_transition, "user" = src, "from_z" = old_loc.z, "to_z" = T.z)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
return 1
|
||||
|
||||
/atom/movable/proc/update_client_hook(atom/destination)
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
if(newrange > maxjumprange) //to avoid going in an infinite loop
|
||||
break
|
||||
|
||||
invoke_event(/event/moved, list("mover" = src))
|
||||
INVOKE_EVENT(src, /event/moved, "mover" = src)
|
||||
return 0
|
||||
|
||||
invoke_event(/event/moved, list("mover" = src))
|
||||
INVOKE_EVENT(src, /event/moved, "mover" = src)
|
||||
|
||||
@@ -2112,7 +2112,7 @@ var/global/msg_id = 0
|
||||
var/t = input(U, "Please enter new ringtone", name, ttone) as text
|
||||
if (in_range(U, src) && loc == U)
|
||||
if (t)
|
||||
if(invoke_event(/event/pda_change_ringtone, list("user" = U, "new_ringtone" = t)))
|
||||
if(INVOKE_EVENT(src, /event/pda_change_ringtone, "user" = U, "new_ringtone" = t))
|
||||
to_chat(U, "The PDA softly beeps.")
|
||||
U << browse(null, "window=pda")
|
||||
src.mode = 0
|
||||
|
||||
@@ -243,7 +243,7 @@
|
||||
|
||||
/obj/item/device/radio/headset/attackby(obj/item/weapon/W, mob/user)
|
||||
// ..()
|
||||
if(invoke_event(/event/attackby, list("attacker" = user, "item" = W)))
|
||||
if(INVOKE_EVENT(src, /event/attackby, "attacker" = user, "item" = W))
|
||||
return
|
||||
user.set_machine(src)
|
||||
if (!( W.is_screwdriver(user) || (istype(W, /obj/item/device/encryptionkey/ ))))
|
||||
|
||||
@@ -137,14 +137,14 @@
|
||||
var/new_frequency
|
||||
new_frequency = input(usr, "Set a new frequency (1200-1600 kHz).", src, frequency) as null|num
|
||||
new_frequency = sanitize_frequency(new_frequency, maxf)
|
||||
if(!invoke_event(/event/radio_new_frequency, list("user" = usr, "new_frequency" = new_frequency)))
|
||||
if(!INVOKE_EVENT(src, /event/radio_new_frequency, "user" = usr, "new_frequency" = new_frequency))
|
||||
set_frequency(new_frequency)
|
||||
|
||||
else if (href_list["freq"])
|
||||
var/new_frequency
|
||||
new_frequency = (frequency + text2num(href_list["freq"]))
|
||||
new_frequency = sanitize_frequency(new_frequency, maxf)
|
||||
if(!invoke_event(/event/radio_new_frequency, list("user" = usr, "new_frequency" = new_frequency)))
|
||||
if(!INVOKE_EVENT(src, /event/radio_new_frequency, "user" = usr, "new_frequency" = new_frequency))
|
||||
set_frequency(new_frequency)
|
||||
|
||||
else if (href_list["talk"])
|
||||
|
||||
@@ -90,12 +90,12 @@
|
||||
if(!success)
|
||||
tempL.Remove(attempt)
|
||||
else
|
||||
user.invoke_event(/event/z_transition, list("user" = user, "to_z" = user.z, "from_z" = prev_z))
|
||||
INVOKE_EVENT(user, /event/z_transition, "user" = user, "to_z" = user.z, "from_z" = prev_z)
|
||||
break
|
||||
|
||||
if(!success)
|
||||
user.forceMove(pick(L))
|
||||
user.invoke_event(/event/z_transition, list("user" = user, "to_z" = user.z, "from_z" = prev_z))
|
||||
INVOKE_EVENT(user, /event/z_transition, "user" = user, "to_z" = user.z, "from_z" = prev_z)
|
||||
|
||||
smoke.start()
|
||||
src.uses -= 1
|
||||
|
||||
@@ -85,7 +85,7 @@ var/global/list/reagents_to_log = list(FUEL, PLASMA, PACID, SACID, AMUTATIONTOXI
|
||||
verbs += /obj/proc/remove_pai
|
||||
|
||||
/obj/attackby(obj/item/weapon/W, mob/user)
|
||||
invoke_event(/event/attackby, list("attacker" = user, "item" = W))
|
||||
INVOKE_EVENT(src, /event/attackby, "attacker" = user, "item" = W)
|
||||
if(can_take_pai && istype(W, /obj/item/device/paicard))
|
||||
if(integratedpai)
|
||||
to_chat(user, "<span class = 'notice'>There's already a Personal AI inserted.</span>")
|
||||
@@ -349,14 +349,14 @@ var/global/list/reagents_to_log = list(FUEL, PLASMA, PACID, SACID, AMUTATIONTOXI
|
||||
return FALSE
|
||||
|
||||
/obj/singularity_pull(S, current_size)
|
||||
invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(src, /event/before_move)
|
||||
if(anchored)
|
||||
if(current_size >= STAGE_FIVE)
|
||||
anchored = 0
|
||||
step_towards(src, S)
|
||||
else
|
||||
step_towards(src, S)
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
|
||||
/obj/proc/multitool_menu(var/mob/user,var/obj/item/device/multitool/P)
|
||||
return "<b>NO MULTITOOL_MENU!</b>"
|
||||
|
||||
@@ -945,9 +945,9 @@
|
||||
|
||||
|
||||
/obj/structure/mannequin/proc/spin()
|
||||
invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(src, /event/before_move)
|
||||
change_dir(turn(dir, 90))
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
|
||||
/obj/structure/mannequin/verb/rotate_mannequin()
|
||||
set name = "Rotate Mannequin"
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
/turf/Exited(atom/movable/mover, atom/newloc)
|
||||
..()
|
||||
invoke_event(/event/exited, list("mover" = mover, "location" = src, "newloc" = newloc))
|
||||
INVOKE_EVENT(src, /event/exited, "mover" = mover, "location" = src, "newloc" = newloc)
|
||||
|
||||
/turf/Enter(atom/movable/mover as mob|obj, atom/forget as mob|obj|turf|area)
|
||||
if (!mover)
|
||||
@@ -177,7 +177,7 @@
|
||||
A.inertia_dir = 0
|
||||
|
||||
..()
|
||||
invoke_event(/event/entered, list("mover" = A, "location" = src, "oldloc" = OldLoc))
|
||||
INVOKE_EVENT(src, /event/entered, "mover" = A, "location" = src, "oldloc" = OldLoc)
|
||||
var/objects = 0
|
||||
if(A && A.flags & PROXMOVE)
|
||||
for(var/atom/Obj in range(1, src))
|
||||
@@ -251,9 +251,9 @@
|
||||
if(!move_to_z)
|
||||
return
|
||||
|
||||
A.invoke_event(/event/z_transition, list("user" = A, "from_z" = A.z, "to_z" = move_to_z))
|
||||
INVOKE_EVENT(A, /event/z_transition, "user" = A, "from_z" = A.z, "to_z" = move_to_z)
|
||||
for(var/atom/movable/AA in contents_brought)
|
||||
AA.invoke_event(/event/z_transition, list("user" = AA, "from_z" = AA.z, "to_z" = move_to_z))
|
||||
INVOKE_EVENT(AA, /event/z_transition, "user" = AA, "from_z" = AA.z, "to_z" = move_to_z)
|
||||
A.z = move_to_z
|
||||
|
||||
if(src.x <= TRANSITIONEDGE)
|
||||
@@ -283,9 +283,9 @@
|
||||
var/obj/item/projectile/P = A
|
||||
P.reset()//fixing linear projectile movement
|
||||
|
||||
A.invoke_event(/event/post_z_transition, list("user" = A, "from_z" = A.z, "to_z" = move_to_z))
|
||||
INVOKE_EVENT(A, /event/post_z_transition, "user" = A, "from_z" = A.z, "to_z" = move_to_z)
|
||||
for(var/atom/movable/AA in contents_brought)
|
||||
AA.invoke_event(/event/post_z_transition, list("user" = AA, "from_z" = AA.z, "to_z" = move_to_z))
|
||||
INVOKE_EVENT(AA, /event/post_z_transition, "user" = AA, "from_z" = AA.z, "to_z" = move_to_z)
|
||||
|
||||
if(A && A.opacity)
|
||||
has_opaque_atom = TRUE // Make sure to do this before reconsider_lights(), incase we're on instant updates. Guaranteed to be on in this case.
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
if(CanOpenDoor(D))
|
||||
if(get_dist(src, target) > 1)
|
||||
return // keep movin'.
|
||||
parent.invoke_event(/event/comp_ai_cmd_set_busy, list("yes" = TRUE))
|
||||
parent.invoke_event(/event/comp_ai_cmd_move, list("target" = 0))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_set_busy, "yes" = TRUE)
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_move, "target" = 0)
|
||||
D.visible_message("<span class='warning'>\The [D]'s motors whine as four arachnid claws begin trying to force it open!</span>")
|
||||
spawn(50)
|
||||
if(CanOpenDoor(D) && prob(25))
|
||||
@@ -30,10 +30,10 @@
|
||||
FD.open(1)
|
||||
|
||||
// Reset targetting
|
||||
parent.invoke_event(/event/comp_ai_cmd_set_busy, list("yes" = FALSE))
|
||||
parent.invoke_event(/event/comp_ai_cmd_set_target, list("target" = null))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_set_busy, "yes" = FALSE)
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_set_target, "target" = null)
|
||||
return
|
||||
parent.invoke_event(/event/comp_ai_cmd_set_busy, list("yes" = FALSE))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_set_busy, "yes" = FALSE)
|
||||
|
||||
/datum/component/ai/door_opener/proc/performPressureCheck(var/turf/loc)
|
||||
var/turf/simulated/lT=loc
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
|
||||
/datum/component/ai/escape_confinement/process()
|
||||
life_tick++
|
||||
if(parent.invoke_event(/event/comp_ai_cmd_get_busy))
|
||||
if(INVOKE_EVENT(parent, /event/comp_ai_cmd_get_busy))
|
||||
return
|
||||
var/atom/parent_atom = parent
|
||||
switch(parent.invoke_event(/event/comp_ai_cmd_get_state))
|
||||
var/result = INVOKE_EVENT(parent, /event/comp_ai_cmd_get_state)
|
||||
switch(result)
|
||||
if(HOSTILE_STANCE_IDLE)
|
||||
EscapeConfinement()
|
||||
if(HOSTILE_STANCE_ATTACK)
|
||||
@@ -37,8 +38,8 @@
|
||||
/datum/component/ai/escape_confinement/proc/DestroySurroundings()
|
||||
EscapeConfinement()
|
||||
var/list/smash_dirs = list(0)
|
||||
var/atom/target = parent.invoke_event(/event/comp_ai_cmd_get_target)
|
||||
if(!target || !parent.invoke_event(/event/comp_ai_cmd_can_attack, list("target" = target)))
|
||||
var/atom/target = INVOKE_EVENT(parent, /event/comp_ai_cmd_get_target)
|
||||
if(!target || INVOKE_EVENT(!parent, /event/comp_ai_cmd_can_attack, "target" = target))
|
||||
smash_dirs |= alldirs //if no target, attack everywhere
|
||||
else
|
||||
var/targdir = get_dir(src, target)
|
||||
|
||||
@@ -18,23 +18,24 @@
|
||||
|
||||
/datum/component/ai/hunt/process()
|
||||
life_tick++
|
||||
if(parent.invoke_event(/event/comp_ai_cmd_get_busy))
|
||||
if(INVOKE_EVENT(parent, /event/comp_ai_cmd_get_busy))
|
||||
return
|
||||
switch(parent.invoke_event(/event/comp_ai_cmd_get_state))
|
||||
var/result = INVOKE_EVENT(parent, /event/comp_ai_cmd_get_state)
|
||||
switch(result)
|
||||
if(HOSTILE_STANCE_IDLE)
|
||||
var/atom/target = parent.invoke_event(/event/comp_ai_cmd_get_best_target)
|
||||
var/atom/target = INVOKE_EVENT(parent, /event/comp_ai_cmd_get_best_target)
|
||||
if(!isnull(target))
|
||||
parent.invoke_event(/event/comp_ai_cmd_set_target, list("target" = target))
|
||||
parent.invoke_event(/event/comp_ai_cmd_set_state, list("new_state" = HOSTILE_STANCE_ATTACK))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_set_target, "target" = target)
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_set_state, "new_state" = HOSTILE_STANCE_ATTACK)
|
||||
else
|
||||
parent.invoke_event(/event/comp_ai_cmd_move, list("target" = pick(orange(movement_range, src))))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_move, "target" = pick(orange(movement_range, src)))
|
||||
if(HOSTILE_STANCE_ATTACK)
|
||||
var/atom/target = parent.invoke_event(/event/comp_ai_cmd_get_best_target)
|
||||
var/atom/target = INVOKE_EVENT(parent, /event/comp_ai_cmd_get_best_target)
|
||||
if(!isnull(target))
|
||||
// We're telling the attack modules that we have attack intention. They then individually decide whether to fire.
|
||||
parent.invoke_event(/event/comp_ai_cmd_attack, list("target" = target))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_attack, "target" = target)
|
||||
var/turf/T = get_turf(target)
|
||||
if(T)
|
||||
parent.invoke_event(/event/comp_ai_cmd_move, list("target" = T))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_move, "target" = T)
|
||||
return
|
||||
parent.invoke_event(/event/comp_ai_cmd_set_state, list("new_state" = HOSTILE_STANCE_IDLE))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_set_state, "new_state" = HOSTILE_STANCE_IDLE)
|
||||
|
||||
@@ -26,20 +26,20 @@
|
||||
|
||||
/datum/component/ai/human_brain/process()
|
||||
life_tick++
|
||||
if(parent.invoke_event(/event/comp_ai_cmd_get_busy))
|
||||
if(INVOKE_EVENT(parent, /event/comp_ai_cmd_get_busy))
|
||||
return
|
||||
if(!ishuman(parent))
|
||||
return
|
||||
var/mob/living/carbon/human/H = parent
|
||||
|
||||
if(H.stat != CONSCIOUS || !H.canmove || !isturf(H.loc))
|
||||
parent.invoke_event(/event/comp_ai_cmd_move, list("target" = 0))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_move, "target" = 0)
|
||||
return
|
||||
|
||||
current_target = parent.invoke_event(/event/comp_ai_cmd_get_best_target)
|
||||
current_target = INVOKE_EVENT(parent, /event/comp_ai_cmd_get_best_target)
|
||||
if(!isnull(current_target))
|
||||
personal_desires.Add(DESIRE_CONFLICT)
|
||||
parent.invoke_event(/event/comp_ai_cmd_set_target, list("target" = current_target))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_set_target, "target" = current_target)
|
||||
if(IsBetterWeapon(H))
|
||||
personal_desires.Add(DESIRE_HAVE_WEAPON)
|
||||
if(IsBetterWeapon(H, H.contents))
|
||||
@@ -51,18 +51,18 @@
|
||||
if(I)
|
||||
if(H.Adjacent(I))
|
||||
AcquireItem(H, I)
|
||||
parent.invoke_event(/event/comp_ai_cmd_move, list("target" = 0))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_move, "target" = 0)
|
||||
else
|
||||
if(H.stat == CONSCIOUS && H.canmove && isturf(H.loc))
|
||||
parent.invoke_event(/event/comp_ai_cmd_move, list("target" = get_turf(I)))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_move, "target" = get_turf(I))
|
||||
return
|
||||
|
||||
if(!isnull(current_target))
|
||||
parent.invoke_event(/event/comp_ai_cmd_attack, list("target" = current_target))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_attack, "target" = current_target)
|
||||
var/turf/T = get_turf(current_target)
|
||||
if(T)
|
||||
if(H.stat == CONSCIOUS && H.canmove && isturf(H.loc))
|
||||
parent.invoke_event(/event/comp_ai_cmd_move, list("target" = T))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_move, "target" = T)
|
||||
return
|
||||
else
|
||||
personal_desires.Remove(DESIRE_CONFLICT)
|
||||
@@ -78,7 +78,7 @@
|
||||
else
|
||||
dir = turn(lastdir, 180)
|
||||
if(H.stat == CONSCIOUS && H.canmove && isturf(H.loc))
|
||||
parent.invoke_event(/event/comp_ai_cmd_move, list("target" = dir))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_move, "target" = dir)
|
||||
lastdir = dir
|
||||
|
||||
/datum/component/ai/human_brain/proc/AssessNeeds(mob/living/carbon/human/H)
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
return FALSE
|
||||
var/mob/living/carbon/human/H = parent
|
||||
H.a_intent = I_HURT
|
||||
var/damage_type = H.invoke_event(/event/comp_ai_cmd_get_damage_type)
|
||||
var/damage_type = INVOKE_EVENT(H, /event/comp_ai_cmd_get_damage_type)
|
||||
// TODO make it target the correct def_zone
|
||||
H.invoke_event(/event/comp_ai_cmd_evaluate_target, list("target" = target, "damage_type" = damage_type))
|
||||
INVOKE_EVENT(H, /event/comp_ai_cmd_evaluate_target, "target" = target, "damage_type" = damage_type)
|
||||
H.ClickOn(target)
|
||||
return TRUE
|
||||
|
||||
@@ -15,4 +15,4 @@
|
||||
for(var/mob/living/M in oview(7, parent))
|
||||
if(!(M in brain.friends)) //THEY'RE ATTACKING OUR BOY, GET HIM!
|
||||
continue
|
||||
M.invoke_event(/event/comp_ai_friend_attacked, list("attacker"=attacker))
|
||||
INVOKE_EVENT(M, /event/comp_ai_friend_attacked, "attacker"=attacker)
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
|
||||
/datum/component/ai/target_holder/prioritizing/cmd_get_best_target()
|
||||
targets.Cut() // Clear first
|
||||
for(var/atom/target in parent.invoke_event(/event/comp_ai_cmd_find_targets))
|
||||
parent.invoke_event(/event/comp_ai_cmd_add_target, list("target" = target))
|
||||
for(var/atom/target in INVOKE_EVENT(parent, /event/comp_ai_cmd_find_targets))
|
||||
INVOKE_EVENT(parent, /event/comp_ai_cmd_add_target, "target" = target)
|
||||
for(var/priority in 1 to max_priority)
|
||||
var/list/priority_targets = targets["[priority]"]
|
||||
if(priority_targets == null)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
/mob/proc/death(gibbed)
|
||||
timeofdeath = world.time
|
||||
invoke_event(/event/death, list("user" = src, "body_destroyed" = gibbed))
|
||||
INVOKE_EVENT(src, /event/death, "user" = src, "body_destroyed" = gibbed)
|
||||
living_mob_list -= src
|
||||
dead_mob_list += src
|
||||
stat_collection.add_death_stat(src)
|
||||
|
||||
@@ -383,7 +383,7 @@
|
||||
update_inv_wear_mask()
|
||||
else
|
||||
return 0
|
||||
invoke_event(/event/unequipped, list(W))
|
||||
INVOKE_EVENT(src, /event/unequipped, W)
|
||||
if(success)
|
||||
if(client)
|
||||
client.screen -= W
|
||||
|
||||
@@ -52,13 +52,13 @@
|
||||
success = 1
|
||||
slot = slot_r_store
|
||||
update_inv_pockets()
|
||||
invoke_event(/event/unequipped, list(W))
|
||||
INVOKE_EVENT(src, /event/unequipped, W)
|
||||
else if (W == l_store)
|
||||
l_store = null
|
||||
success = 1
|
||||
slot = slot_l_store
|
||||
update_inv_pockets()
|
||||
invoke_event(/event/unequipped, list(W))
|
||||
INVOKE_EVENT(src, /event/unequipped, W)
|
||||
else
|
||||
success = ..()
|
||||
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
if(istype(AM, /mob/living/carbon))
|
||||
var/mob/living/carbon/C = AM
|
||||
C.handle_symptom_on_touch(src, AM, BUMP)
|
||||
invoke_event(/event/to_bump, list("bumper" = src, "bumped" = AM))
|
||||
INVOKE_EVENT(src, /event/to_bump, "bumper" = src, "bumped" = AM)
|
||||
|
||||
/mob/living/carbon/Bumped(var/atom/movable/AM)
|
||||
..()
|
||||
if(!istype(AM, /mob/living/carbon))
|
||||
handle_symptom_on_touch(AM, src, BUMP)
|
||||
invoke_event(/event/bumped, list("bumper" = AM, "bumped" = src))
|
||||
INVOKE_EVENT(src, /event/bumped, "bumper" = AM, "bumped" = src)
|
||||
|
||||
/mob/living/carbon/Move(NewLoc, Dir = 0, step_x = 0, step_y = 0, glide_size_override = 0)
|
||||
. = ..()
|
||||
@@ -104,7 +104,7 @@
|
||||
to_chat(M, "<span class='warning'>You can't use your [temp.display_name]</span>")
|
||||
return
|
||||
handle_symptom_on_touch(M, src, HAND)
|
||||
invoke_event(/event/touched, list("toucher" = M, "touched" = src))
|
||||
INVOKE_EVENT(src, /event/touched, "toucher" = M, "touched" = src)
|
||||
|
||||
/mob/living/carbon/electrocute_act(const/shock_damage, const/obj/source, const/siemens_coeff = 1.0, var/def_zone = null, var/incapacitation_duration = 20 SECONDS)
|
||||
if(incapacitation_duration <= 0)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
return TRUE
|
||||
else
|
||||
to_chat(src, "<span class='warning'>You fail to catch \the [I]!")
|
||||
invoke_event(/event/hitby, list("victim" = src, "item" = I))
|
||||
INVOKE_EVENT(src, /event/hitby, "victim" = src, "item" = I)
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/proc/can_catch(var/obj/item/I, var/speed)
|
||||
@@ -74,7 +74,7 @@
|
||||
add_logs(user, src, "damaged", admin=1, object=I, addition="DMG: [max(damage - armor, 0)]")
|
||||
|
||||
apply_damage(damage, I.damtype, affecting, armor , I.is_sharp(), used_weapon = I)
|
||||
invoke_event(/event/attacked_by, list("attacked" = src, "attacker" = user, "item" = I))
|
||||
INVOKE_EVENT(src, /event/attacked_by, "attacked" = src, "attacker" = user, "item" = I)
|
||||
return TRUE
|
||||
|
||||
/mob/living/carbon/proc/check_shields(var/damage = 0, var/atom/A)
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
head = null
|
||||
success = 1
|
||||
update_inv_head()
|
||||
invoke_event(/event/unequipped, list(W))
|
||||
INVOKE_EVENT(src, /event/unequipped, W)
|
||||
else
|
||||
success = ..()
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
amount = amount * brute_damage_modifier
|
||||
|
||||
if(invoke_event(/event/damaged, list("kind" = BRUTE, "amount" = amount)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = BRUTE, "amount" = amount))
|
||||
return 0
|
||||
|
||||
if(amount > 0)
|
||||
@@ -68,7 +68,7 @@
|
||||
/mob/living/carbon/human/adjustFireLoss(var/amount)
|
||||
amount = amount * burn_damage_modifier
|
||||
|
||||
if(invoke_event(/event/damaged, list("kind" = BURN, "amount" = amount)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = BURN, "amount" = amount))
|
||||
return 0
|
||||
|
||||
if(amount > 0)
|
||||
@@ -83,7 +83,7 @@
|
||||
/mob/living/carbon/human/proc/adjustBruteLossByPart(var/amount, var/organ_name, var/obj/damage_source = null)
|
||||
amount = amount * brute_damage_modifier
|
||||
|
||||
if(invoke_event(/event/damaged, list("kind" = BRUTE, "amount" = amount)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = BRUTE, "amount" = amount))
|
||||
return 0
|
||||
|
||||
if (organ_name in organs_by_name)
|
||||
@@ -100,7 +100,7 @@
|
||||
/mob/living/carbon/human/proc/adjustFireLossByPart(var/amount, var/organ_name, var/obj/damage_source = null)
|
||||
amount = amount * burn_damage_modifier
|
||||
|
||||
if(invoke_event(/event/damaged, list("kind" = BURN, "amount" = amount)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = BURN, "amount" = amount))
|
||||
return 0
|
||||
|
||||
if (organ_name in organs_by_name)
|
||||
@@ -137,7 +137,7 @@
|
||||
if(isslimeperson(src))
|
||||
amount = 0
|
||||
|
||||
if(invoke_event(/event/damaged, list("kind" = CLONE, "amount" = amount)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = CLONE, "amount" = amount))
|
||||
return 0
|
||||
|
||||
var/heal_prob = max(0, 80 - getCloneLoss())
|
||||
@@ -375,7 +375,7 @@ This function restores all organs.
|
||||
if(blocked)
|
||||
damage = (damage/100)*(100-blocked)
|
||||
|
||||
if(!ignore_events && invoke_event(/event/damaged, list("kind" = damagetype, "amount" = damage)))
|
||||
if(!ignore_events && INVOKE_EVENT(src, /event/damaged, "kind" = damagetype, "amount" = damage))
|
||||
return 0
|
||||
|
||||
switch(damagetype)
|
||||
@@ -494,7 +494,7 @@ This function restores all organs.
|
||||
if(species.flags & RAD_IMMUNE)
|
||||
return
|
||||
if(application == RAD_EXTERNAL)
|
||||
invoke_event(/event/irradiate, list("user" = src, "rads" = rads))
|
||||
INVOKE_EVENT(src, /event/irradiate, "user" = src, "rads" = rads)
|
||||
if(reagents)
|
||||
if(reagents.has_reagent(LITHOTORCRAZINE))
|
||||
rads /= 2
|
||||
|
||||
@@ -484,8 +484,8 @@ emp_act
|
||||
var/damage_blocked = 0
|
||||
|
||||
//INVOKE_EVENT may return null sometimes - this doesn't work nice with bitflags (which is what's being done here). Hence the !! operator - it turns a null into a 0.
|
||||
var/brute_resolved = !!invoke_event(/event/damaged, list("kind" = BRUTE, "amount" = b_loss))
|
||||
var/burn_resolved = !!invoke_event(/event/damaged, list("kind" = BURN, "amount" = f_loss))
|
||||
var/brute_resolved = !!INVOKE_EVENT(src, /event/damaged, "kind" = BRUTE, "amount" = b_loss)
|
||||
var/burn_resolved = !!INVOKE_EVENT(src, /event/damaged, "kind" = BURN, "amount" = f_loss)
|
||||
damage_blocked |= (brute_resolved | burn_resolved)
|
||||
|
||||
if(damage_blocked)
|
||||
|
||||
@@ -348,7 +348,7 @@
|
||||
else
|
||||
return 0
|
||||
// Call update_name AFTER the inventory gets updated.
|
||||
invoke_event(/event/unequipped, list(W))
|
||||
INVOKE_EVENT(src, /event/unequipped, W)
|
||||
if(success)
|
||||
update_hidden_item_icons(W)
|
||||
|
||||
@@ -500,7 +500,7 @@
|
||||
W.equipped(src, slot)
|
||||
if(client)
|
||||
client.screen |= W
|
||||
invoke_event(/event/equipped, list(W, slot))
|
||||
INVOKE_EVENT(src, /event/equipped, W, slot)
|
||||
|
||||
/mob/living/carbon/human/get_multitool(var/active_only=0)
|
||||
if(istype(get_active_hand(),/obj/item/device/multitool))
|
||||
|
||||
@@ -102,19 +102,19 @@
|
||||
success = 1
|
||||
slot = slot_head
|
||||
update_inv_hat()
|
||||
invoke_event(/event/unequipped, list(W))
|
||||
INVOKE_EVENT(src, /event/unequipped, W)
|
||||
else if(W == glasses)
|
||||
glasses = null
|
||||
success = 1
|
||||
slot = slot_glasses
|
||||
update_inv_glasses()
|
||||
invoke_event(/event/unequipped, list(W))
|
||||
INVOKE_EVENT(src, /event/unequipped, W)
|
||||
else if(W == uniform)
|
||||
uniform = null
|
||||
success = 1
|
||||
slot = slot_w_uniform
|
||||
update_inv_uniform()
|
||||
invoke_event(/event/unequipped, list(W))
|
||||
INVOKE_EVENT(src, /event/unequipped, W)
|
||||
else
|
||||
success = ..()
|
||||
if(success)
|
||||
|
||||
@@ -82,9 +82,9 @@
|
||||
|
||||
if(prob(33) && canmove && isturf(loc) && !pulledby && !(grabbed_by?.len)) //won't move if being pulled
|
||||
|
||||
invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(src, /event/before_move)
|
||||
step(src, pick(cardinal))
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
|
||||
if(prob(1))
|
||||
passive_emote()
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
target.unarmed_attacked(src, damage, damage_type, zone)
|
||||
after_unarmed_attack(target, damage, damage_type, affecting, armor_block)
|
||||
|
||||
invoke_event(/event/unarmed_attack, list("attacker" = target, "attacked" = src))
|
||||
INVOKE_EVENT(src, /event/unarmed_attack, "attacker" = target, "attacked" = src)
|
||||
|
||||
add_logs(src, target, "attacked ([damage_done]dmg)", admin = (src.ckey && target.ckey) ? TRUE : FALSE) //Only add this to the server logs if both mobs were controlled by player
|
||||
return damage_done
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
if(status_flags & GODMODE)
|
||||
return 0 //godmode
|
||||
|
||||
if(invoke_event(/event/damaged, list("kind" = BRUTE, "amount" = amount)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = BRUTE, "amount" = amount))
|
||||
return 0
|
||||
|
||||
bruteloss = min(max(bruteloss + (amount * brute_damage_modifier), 0),(maxHealth*2))
|
||||
@@ -253,7 +253,7 @@
|
||||
if(status_flags & GODMODE)
|
||||
return 0 //godmode
|
||||
|
||||
if(invoke_event(/event/damaged, list("kind" = OXY, "amount" = amount)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = OXY, "amount" = amount))
|
||||
return 0
|
||||
|
||||
oxyloss = min(max(oxyloss + (amount * oxy_damage_modifier), 0),(maxHealth*2))
|
||||
@@ -270,7 +270,7 @@
|
||||
if(status_flags & GODMODE)
|
||||
return 0 //godmode
|
||||
|
||||
if(invoke_event(/event/damaged, list("kind" = TOX, "amount" = amount)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = TOX, "amount" = amount))
|
||||
return 0
|
||||
|
||||
var/mult = 1
|
||||
@@ -294,7 +294,7 @@
|
||||
return 0 //godmode
|
||||
if(mutations.Find(M_RESIST_HEAT))
|
||||
return 0
|
||||
if(invoke_event(/event/damaged, list("kind" = BURN, "amount" = amount)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = BURN, "amount" = amount))
|
||||
return 0
|
||||
|
||||
fireloss = min(max(fireloss + (amount * burn_damage_modifier), 0),(maxHealth*2))
|
||||
@@ -306,7 +306,7 @@
|
||||
if(status_flags & GODMODE)
|
||||
return 0 //godmode
|
||||
|
||||
if(invoke_event(/event/damaged, list("kind" = CLONE, "amount" = amount)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = CLONE, "amount" = amount))
|
||||
return 0
|
||||
|
||||
if(ishuman(src))
|
||||
@@ -328,7 +328,7 @@
|
||||
if(status_flags & GODMODE)
|
||||
return 0 //godmode
|
||||
|
||||
if(invoke_event(/event/damaged, list("kind" = BRAIN, "amount" = amount)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = BRAIN, "amount" = amount))
|
||||
return 0
|
||||
|
||||
brainloss = min(max(brainloss + (amount * brain_damage_modifier), 0),(maxHealth*2))
|
||||
@@ -713,9 +713,9 @@ Thanks.
|
||||
if (ok)
|
||||
var/atom/movable/secondarypull = M.pulling
|
||||
M.stop_pulling()
|
||||
invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(src, /event/before_move)
|
||||
pulling.Move(T, get_dir(pulling, T), glide_size_override = src.glide_size)
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
if(M && secondarypull)
|
||||
M.start_pulling(secondarypull)
|
||||
else
|
||||
@@ -783,7 +783,7 @@ Thanks.
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
invoke_event(/event/resist, list("user" = src))
|
||||
INVOKE_EVENT(src, /event/resist, "user" = src)
|
||||
|
||||
delayNextSpecial(10) // Special delay, a cooldown to prevent spamming too much.
|
||||
|
||||
@@ -1423,9 +1423,9 @@ Thanks.
|
||||
AM.set_glide_size(src.glide_size)
|
||||
if (ismob(AM))
|
||||
var/mob/M = AM
|
||||
invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(src, /event/before_move)
|
||||
step(M, t)
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
else
|
||||
step(AM, t)
|
||||
now_pushing = 0
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
mind.active = 1 //indicates that the mind is currently synced with a client
|
||||
|
||||
ResendAllUIs() // Re-sends mind UIs
|
||||
invoke_event(/event/living_login, list("user" = src))
|
||||
INVOKE_EVENT(src, /event/living_login, "user" = src)
|
||||
|
||||
//login during ventcrawl
|
||||
if(is_ventcrawling && istype(loc, /obj/machinery/atmospherics)) //attach us back into the pipes
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
head_state = null
|
||||
// Update the MoMMI's head inventory icons
|
||||
update_inv_head()
|
||||
invoke_event(/event/unequipped, list(W))
|
||||
INVOKE_EVENT(src, /event/unequipped, W)
|
||||
|
||||
// Override the default /mob version since we only have one hand slot.
|
||||
/mob/living/silicon/robot/mommi/put_in_active_hand(var/obj/item/W)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
return amount
|
||||
|
||||
/mob/living/silicon/robot/adjustBruteLoss(var/amount)
|
||||
if(invoke_event(/event/damaged, list("kind" = BRUTE, "amount" = amount)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = BRUTE, "amount" = amount))
|
||||
return FALSE
|
||||
if(amount > 0)
|
||||
take_overall_damage(amount, 0)
|
||||
@@ -47,7 +47,7 @@
|
||||
heal_overall_damage(-amount, 0)
|
||||
|
||||
/mob/living/silicon/robot/adjustFireLoss(var/amount)
|
||||
if(invoke_event(/event/damaged, list("kind" = BURN, "amount" = amount)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = BURN, "amount" = amount))
|
||||
return FALSE
|
||||
if(amount > 0)
|
||||
take_overall_damage(0, amount)
|
||||
|
||||
@@ -8,17 +8,17 @@
|
||||
head = null
|
||||
success = 1
|
||||
update_inv_head()
|
||||
invoke_event(/event/unequipped, list(W))
|
||||
INVOKE_EVENT(src, /event/unequipped, W)
|
||||
if (W == w_uniform)
|
||||
w_uniform = null
|
||||
success = 1
|
||||
update_inv_w_uniform()
|
||||
invoke_event(/event/unequipped, list(W))
|
||||
INVOKE_EVENT(src, /event/unequipped, W)
|
||||
if (W == wear_suit)
|
||||
wear_suit = null
|
||||
success = 1
|
||||
update_inv_wear_suit()
|
||||
invoke_event(/event/unequipped, list(W))
|
||||
INVOKE_EVENT(src, /event/unequipped, W)
|
||||
else
|
||||
success = ..()
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
back = null
|
||||
success = 1
|
||||
update_inv_back()
|
||||
invoke_event(/event/unequipped, list(W))
|
||||
INVOKE_EVENT(src, /event/unequipped, W)
|
||||
else
|
||||
success = ..()
|
||||
|
||||
|
||||
@@ -245,11 +245,11 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t
|
||||
turns_since_move++
|
||||
if(turns_since_move >= turns_per_move)
|
||||
if(!(stop_automated_movement_when_pulled && pulledby)) //Some animals don't move when pulled
|
||||
invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(src, /event/before_move)
|
||||
var/destination = get_step(src, pick(cardinal))
|
||||
wander_move(destination)
|
||||
turns_since_move = 0
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
|
||||
handle_automated_speech()
|
||||
|
||||
@@ -599,7 +599,7 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t
|
||||
|
||||
/mob/living/simple_animal/adjustBruteLoss(damage)
|
||||
|
||||
if(invoke_event(/event/damaged, list("kind" = BRUTE, "amount" = damage)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = BRUTE, "amount" = damage))
|
||||
return 0
|
||||
if (damage > 0)
|
||||
damageoverlaytemp = 20
|
||||
@@ -617,7 +617,7 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t
|
||||
return 0
|
||||
if(mutations.Find(M_RESIST_HEAT))
|
||||
return 0
|
||||
if(invoke_event(/event/damaged, list("kind" = BURN, "amount" = damage)))
|
||||
if(INVOKE_EVENT(src, /event/damaged, "kind" = BURN, "amount" = damage))
|
||||
return 0
|
||||
if(skinned())
|
||||
damage = damage * 2
|
||||
|
||||
@@ -56,6 +56,6 @@
|
||||
send2adminirc("[key_name(src, showantag = FALSE)] logged out - no more non-AFK admins online. - [admin_number_afk] AFK.")
|
||||
send2admindiscord("[key_name(src, showantag = FALSE)] logged out. **No more non-AFK admins online.** - **[admin_number_afk]** AFK", TRUE)
|
||||
|
||||
invoke_event(/event/logout, list("user" = src))
|
||||
INVOKE_EVENT(src, /event/logout, "user" = src)
|
||||
|
||||
..()
|
||||
|
||||
@@ -1561,10 +1561,10 @@ Use this proc preferably at the end of an equipment loadout
|
||||
if(!canface())
|
||||
return 0
|
||||
if (dir!=direction)
|
||||
invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(src, /event/before_move)
|
||||
dir = direction
|
||||
invoke_event(/event/face)
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/face)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
delayNextMove(movement_delay(),additive=1)
|
||||
return 1
|
||||
|
||||
@@ -1586,9 +1586,9 @@ Use this proc preferably at the end of an equipment loadout
|
||||
|
||||
//Like forceMove(), but for dirs! used in atoms_movable.dm, mainly with chairs and vehicles
|
||||
/mob/change_dir(new_dir, var/changer)
|
||||
invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(src, /event/before_move)
|
||||
..()
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
|
||||
/mob/proc/isGoodPickpocket() //If the mob gets bonuses when pickpocketing and such. Currently only used for humans with the Pickpocket's Gloves.
|
||||
return 0
|
||||
|
||||
@@ -348,7 +348,7 @@
|
||||
mob.last_move_intent = world.time + 10
|
||||
mob.set_glide_size(DELAY2GLIDESIZE(move_delay)) //Since we're moving OUT OF OUR OWN VOLITION AND BY OURSELVES we can update our glide_size here!
|
||||
|
||||
mob.invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(mob, /event/before_move)
|
||||
// Something with pulling things
|
||||
var/obj/item/weapon/grab/Findgrab = locate() in mob
|
||||
if(Findgrab)
|
||||
@@ -360,7 +360,7 @@
|
||||
if(M)
|
||||
if ((mob.Adjacent(M) || M.loc == mob.loc))
|
||||
var/turf/T = mob.loc
|
||||
M.invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(M, /event/before_move)
|
||||
step(mob, Dir)
|
||||
if (isturf(M.loc))
|
||||
var/diag = get_dir(mob, M)
|
||||
@@ -368,7 +368,7 @@
|
||||
diag = null
|
||||
if ((get_dist(mob, M) > 1 || diag))
|
||||
step(M, get_dir(M.loc, T))
|
||||
M.invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(M, /event/after_move)
|
||||
else
|
||||
for(var/mob/M in L)
|
||||
M.other_mobs = 1
|
||||
@@ -376,9 +376,9 @@
|
||||
M.animate_movement = 3
|
||||
for(var/mob/M in L)
|
||||
spawn( 0 )
|
||||
M.invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(M, /event/before_move)
|
||||
step(M, dir)
|
||||
M.invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(M, /event/after_move)
|
||||
return
|
||||
spawn( 1 )
|
||||
M.other_mobs = null
|
||||
@@ -395,8 +395,8 @@
|
||||
mob.last_movement=world.time
|
||||
|
||||
if(mob.dir != old_dir)
|
||||
mob.invoke_event(/event/face)
|
||||
mob.invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(mob, /event/face)
|
||||
INVOKE_EVENT(mob, /event/after_move)
|
||||
|
||||
/mob/proc/process_confused(var/Dir)
|
||||
if (confused <= 0)
|
||||
@@ -404,12 +404,12 @@
|
||||
. = TRUE
|
||||
var/old_dir = dir
|
||||
if (confused_intensity == CONFUSED_MAGIC)
|
||||
invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(src, /event/before_move)
|
||||
step_rand(src)
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
return
|
||||
|
||||
invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(src, /event/before_move)
|
||||
switch(Dir)
|
||||
if(NORTH)
|
||||
step(src, pick(NORTHEAST, NORTHWEST))
|
||||
@@ -427,11 +427,11 @@
|
||||
step(src, pick(SOUTH, EAST))
|
||||
if(SOUTHWEST)
|
||||
step(src, pick(SOUTH, WEST))
|
||||
invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(src, /event/after_move)
|
||||
|
||||
last_movement=world.time
|
||||
if(dir != old_dir)
|
||||
invoke_event(/event/face)
|
||||
INVOKE_EVENT(src, /event/face)
|
||||
|
||||
///Process_Grab()
|
||||
///Called by client/Move(NewLoc, Dir = 0, step_x = 0, step_y = 0, glide_size_override = 0)
|
||||
@@ -522,7 +522,7 @@
|
||||
mob.dir = direct
|
||||
else
|
||||
to_chat(mob, "<span class='warning'>Some strange aura is blocking the way!</span>")
|
||||
mob.invoke_event(/event/moved)
|
||||
INVOKE_EVENT(mob, /event/moved)
|
||||
mob.delayNextMove(movedelay)
|
||||
return 1
|
||||
// Crossed is always a bit iffy
|
||||
@@ -583,15 +583,15 @@
|
||||
var/mob/mobpulled = target
|
||||
var/atom/movable/secondarypull = mobpulled.pulling
|
||||
mobpulled.stop_pulling()
|
||||
mobpulled.invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(mobpulled, /event/before_move)
|
||||
step(mobpulled, get_dir(mobpulled.loc, dest))
|
||||
mobpulled.invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(mobpulled, /event/after_move)
|
||||
if(mobpulled && secondarypull)
|
||||
mobpulled.start_pulling(secondarypull)
|
||||
else
|
||||
target.invoke_event(/event/before_move)
|
||||
INVOKE_EVENT(target, /event/before_move)
|
||||
step(target, get_dir(target.loc, dest))
|
||||
target.invoke_event(/event/after_move)
|
||||
INVOKE_EVENT(target, /event/after_move)
|
||||
target.add_fingerprint(src)
|
||||
|
||||
/mob/proc/movement_delay()
|
||||
|
||||
@@ -340,7 +340,7 @@
|
||||
next_beam.set_power(power)
|
||||
update_icon()
|
||||
if(!master)
|
||||
invoke_event(/event/beam_power_change, list("beam" = src))
|
||||
INVOKE_EVENT(src, /event/beam_power_change, "beam" = src)
|
||||
|
||||
/obj/effect/beam/emitter/spawn_child()
|
||||
var/obj/effect/beam/emitter/beam = ..()
|
||||
|
||||
@@ -142,7 +142,7 @@ var/list/razed_large_artifacts = list()//destroyed while still inside a rock wal
|
||||
|
||||
src.add_fingerprint(user)
|
||||
to_chat(user, "<b>You touch [src].</b>")
|
||||
invoke_event(/event/attackhand, list("user" = user, "target" = src))
|
||||
INVOKE_EVENT(src, /event/attackhand, "user" = user, "target" = src)
|
||||
|
||||
/obj/machinery/artifact/attackby(obj/item/weapon/W as obj, mob/living/user as mob)
|
||||
|
||||
@@ -155,17 +155,17 @@ var/list/razed_large_artifacts = list()//destroyed while still inside a rock wal
|
||||
visible_message("<span class='warning'>\The [user] [pick(W.attack_verb)] \the [src] with \the [W].</span>")
|
||||
else
|
||||
visible_message("<span class='warning'>\The [user] hits \the [src] with \the [W].</span>")
|
||||
invoke_event(/event/attackby, list("attacker" = user, "item" = W))
|
||||
INVOKE_EVENT(src, /event/attackby, "attacker" = user, "item" = W)
|
||||
|
||||
/obj/machinery/artifact/Bumped(var/atom/A)
|
||||
if (istype(A,/obj))
|
||||
invoke_event(/event/bumped, list("bumper" = A, "bumped" = src))
|
||||
INVOKE_EVENT(src, /event/bumped, "bumper" = A, "bumped" = src)
|
||||
else if (isliving(A))
|
||||
var/mob/living/L = A
|
||||
if (!ishuman(L) || !istype(L:gloves,/obj/item/clothing/gloves))
|
||||
if (prob(50))
|
||||
to_chat(L, "<b>You accidentally touch [src].<b>")
|
||||
invoke_event(/event/bumped, list("bumper" = L, "bumped" = src))
|
||||
INVOKE_EVENT(src, /event/bumped, "bumper" = L, "bumped" = src)
|
||||
..()
|
||||
|
||||
/obj/machinery/artifact/to_bump(var/atom/A)
|
||||
@@ -174,16 +174,16 @@ var/list/razed_large_artifacts = list()//destroyed while still inside a rock wal
|
||||
if (!ishuman(L) || !istype(L:gloves,/obj/item/clothing/gloves))
|
||||
if (prob(50))
|
||||
to_chat(L, "<b>\The [src] bumps into you.<b>")
|
||||
invoke_event(/event/bumped, list("bumper" = L, "bumped" = src))
|
||||
INVOKE_EVENT(src, /event/bumped, "bumper" = L, "bumped" = src)
|
||||
..()
|
||||
|
||||
/obj/machinery/artifact/bullet_act(var/obj/item/projectile/P)
|
||||
invoke_event(/event/projectile, list("projectile" = P))
|
||||
INVOKE_EVENT(src, /event/projectile, "projectile" = P)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/artifact/beam_connect(var/obj/effect/beam/B)
|
||||
..()
|
||||
invoke_event(/event/beam_connect, list("beam" = B))
|
||||
INVOKE_EVENT(src, /event/beam_connect, "beam" = B)
|
||||
|
||||
/obj/machinery/artifact/ex_act(severity)
|
||||
switch(severity)
|
||||
@@ -197,9 +197,9 @@ var/list/razed_large_artifacts = list()//destroyed while still inside a rock wal
|
||||
ArtifactRepercussion(src, null, "an explosion", "[type]")
|
||||
qdel(src)
|
||||
else
|
||||
invoke_event(/event/explosion, list("severity" = severity))
|
||||
INVOKE_EVENT(src, /event/explosion, "severity" = severity)
|
||||
if(3.0)
|
||||
invoke_event(/event/explosion, list("severity" = severity))
|
||||
INVOKE_EVENT(src, /event/explosion, "severity" = severity)
|
||||
|
||||
/obj/machinery/artifact/Move(NewLoc, Dir = 0, step_x = 0, step_y = 0, glide_size_override = 0)
|
||||
..()
|
||||
|
||||
@@ -113,7 +113,7 @@ var/global/list/falltempoverlays = list()
|
||||
if(C.mob)
|
||||
C.mob.see_fall()
|
||||
|
||||
user.invoke_event(/event/spellcast, list("spell" = src, "user" = user, "targets" = targets))
|
||||
INVOKE_EVENT(user, /event/spellcast, "spell" = src, "user" = user, "targets" = targets)
|
||||
|
||||
//animate(aoe_underlay, transform = null, time = 2)
|
||||
//var/oursound = (invocation == "ZA WARUDO" ? 'sound/effects/theworld.ogg' :'sound/effects/fall.ogg')
|
||||
|
||||
@@ -195,7 +195,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now
|
||||
invocation(user, targets)
|
||||
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>[user.real_name] ([user.ckey]) cast the spell [name].</font>")
|
||||
user.invoke_event(/event/spellcast, list("spell" = src, "user" = user, "targets" = targets))
|
||||
INVOKE_EVENT(user, /event/spellcast, "spell" = src, "user" = user, "targets" = targets)
|
||||
|
||||
if(prob(critfailchance))
|
||||
critfail(targets, user)
|
||||
@@ -242,7 +242,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now
|
||||
invocation(user, target)
|
||||
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>[user.real_name] ([user.ckey]) cast the spell [name].</font>")
|
||||
user.invoke_event(/event/spellcast, list("spell" = src, "user" = user, "targets" = target))
|
||||
INVOKE_EVENT(user, /event/spellcast, "spell" = src, "user" = user, "targets" = target)
|
||||
|
||||
if(prob(critfailchance))
|
||||
critfail(target, holder)
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
*/
|
||||
/datum/proc/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
invoke_event(/event/ui_act, list(usr, action))
|
||||
INVOKE_EVENT(src, /event/ui_act, usr, action)
|
||||
// If UI is not interactive or usr calling Topic is not the UI user, bail.
|
||||
if(!ui || ui.status != UI_INTERACTIVE)
|
||||
return TRUE
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/datum/unit_test/event_does_stuff/start()
|
||||
var/datum/demo_datum = new
|
||||
demo_datum.register_event(/event/demo_event, src, .proc/do_something)
|
||||
demo_datum.invoke_event(/event/demo_event)
|
||||
INVOKE_EVENT(demo_datum, /event/demo_event)
|
||||
if(!did_something)
|
||||
fail("lazy event did nothing")
|
||||
/datum/unit_test/event_does_stuff/proc/do_something()
|
||||
@@ -25,11 +25,11 @@
|
||||
/datum/unit_test/event_arguments/start()
|
||||
var/datum/demo_datum = new
|
||||
demo_datum.register_event(/event/demo_event, src, .proc/do_stuff_with_args)
|
||||
demo_datum.invoke_event(/event/demo_event, list("abc", 123))
|
||||
INVOKE_EVENT(demo_datum, /event/demo_event, "abc", 123)
|
||||
demo_datum.unregister_event(/event/demo_event, src, .proc/do_stuff_with_args)
|
||||
|
||||
demo_datum.register_event(/event/demo_event, src, .proc/do_something_with_named_args)
|
||||
demo_datum.invoke_event(/event/demo_event, list("second_parameter"=1))
|
||||
INVOKE_EVENT(demo_datum, /event/demo_event, "second_parameter"=1)
|
||||
/datum/unit_test/event_arguments/proc/do_stuff_with_args(string, number)
|
||||
assert_eq(string, "abc")
|
||||
assert_eq(number, 123)
|
||||
|
||||
Reference in New Issue
Block a user