mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
[TM] Verb Queue - Port of TG SSverb subsystem (#19863)
* Some verbs queue up now * Damn you 515 * Screw you Topic * Update client_procs.dm * Fixes for unit testing * Update MC.dm * verb * Update callback.dm * Tweaks * Linters might not have liked that, * More tweaks, and fix * Update verb_manager.dm
This commit is contained in:
@@ -745,7 +745,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
//this is a mob verb instead of atom for performance reasons
|
||||
//see /mob/verb/examinate() in mob.dm for more info
|
||||
//overriden here and in /mob/living for different point span classes and sanity checks
|
||||
/mob/dead/observer/pointed(atom/A as mob|obj|turf in view())
|
||||
/mob/dead/observer/run_pointed(atom/A as mob|obj|turf in view())
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/follow_link
|
||||
|
||||
@@ -10,6 +10,11 @@
|
||||
set name = "quick-equip"
|
||||
set hidden = 1
|
||||
|
||||
|
||||
DEFAULT_QUEUE_OR_CALL_VERB(VERB_CALLBACK(src, PROC_REF(run_quick_equip)))
|
||||
|
||||
///proc extender of [/mob/verb/quick_equip] used to make the verb queuable if the server is overloaded
|
||||
/mob/proc/run_quick_equip()
|
||||
var/obj/item/I = get_active_hand()
|
||||
if(I)
|
||||
I.equip_to_best_slot(src)
|
||||
|
||||
@@ -249,6 +249,9 @@
|
||||
return FALSE
|
||||
if(HAS_TRAIT(src, TRAIT_FAKEDEATH))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/mob/living/run_pointed(atom/A)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/obj/item/hand_item = get_active_hand()
|
||||
@@ -721,6 +724,10 @@
|
||||
set name = "Resist"
|
||||
set category = "IC"
|
||||
|
||||
DEFAULT_QUEUE_OR_CALL_VERB(VERB_CALLBACK(src, PROC_REF(run_resist)))
|
||||
|
||||
///proc extender of [/mob/living/verb/resist] meant to make the process queable if the server is overloaded when the verb is called
|
||||
/mob/living/proc/run_resist()
|
||||
if(!can_resist())
|
||||
return
|
||||
changeNext_move(CLICK_CD_RESIST)
|
||||
|
||||
@@ -843,8 +843,8 @@
|
||||
else
|
||||
return null
|
||||
|
||||
/mob/living/simple_animal/bot/mulebot/resist()
|
||||
..()
|
||||
/mob/living/simple_animal/bot/mulebot/run_resist()
|
||||
. = ..()
|
||||
if(load)
|
||||
unload()
|
||||
|
||||
|
||||
@@ -95,8 +95,7 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/diona/resist()
|
||||
..()
|
||||
/mob/living/simple_animal/diona/run_resist()
|
||||
split()
|
||||
|
||||
/mob/living/simple_animal/diona/attack_hand(mob/living/carbon/human/M)
|
||||
|
||||
@@ -597,6 +597,9 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
|
||||
set name = "Examine"
|
||||
set category = "IC"
|
||||
|
||||
DEFAULT_QUEUE_OR_CALL_VERB(VERB_CALLBACK(src, PROC_REF(run_examinate), A))
|
||||
|
||||
/mob/proc/run_examinate(atom/A)
|
||||
if(!has_vision(information_only = TRUE) && !isobserver(src))
|
||||
to_chat(src, "<span class='notice'>Something is there but you can't see it.</span>")
|
||||
return 1
|
||||
@@ -649,6 +652,10 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
|
||||
set category = null
|
||||
set src = usr
|
||||
|
||||
DEFAULT_QUEUE_OR_CALL_VERB(VERB_CALLBACK(src, PROC_REF(run_mode)))
|
||||
|
||||
///proc version to finish /mob/verb/mode() execution. used in case the proc needs to be queued for the tick after its first called
|
||||
/mob/proc/run_mode()
|
||||
if(ismecha(loc)) return
|
||||
|
||||
if(hand)
|
||||
@@ -1569,3 +1576,13 @@ GLOBAL_LIST_INIT(holy_areas, typecacheof(list(
|
||||
. = stat
|
||||
stat = new_stat
|
||||
SEND_SIGNAL(src, COMSIG_MOB_STATCHANGE, new_stat, .)
|
||||
|
||||
///Makes a call in the context of a different usr. Use sparingly
|
||||
/world/proc/invoke_callback_with_usr(mob/user_mob, datum/callback/invoked_callback, ...)
|
||||
var/temp = usr
|
||||
usr = user_mob
|
||||
if (length(args) > 2)
|
||||
. = invoked_callback.Invoke(arglist(args.Copy(3)))
|
||||
else
|
||||
. = invoked_callback.Invoke()
|
||||
usr = temp
|
||||
|
||||
Reference in New Issue
Block a user