[MIRROR] Small do-after refactor (#2074)

* Small do-after refactor (#55172)

This is an alternative to the PR Ryll made, it does some things similar e.g. the default limit of 1 interaction per target for a person, however, it refactors do_afters to support overrides for max interaction counts and unique sources.

For example, stripping uses the item being stripped as the source, allowing you to strip multiple items, but not the same item multiple times.

I've also fixed most other edge-cases this could cause where balance would be affected, but feel free to point out any I might've missed, this'll probably require some longer-term testmerging.

* Small do-after refactor

Co-authored-by: Qustinnus <Floydje123@hotmail.com>
This commit is contained in:
SkyratBot
2020-12-07 22:46:59 +01:00
committed by GitHub
co-authored by Qustinnus
parent 0fb65c8e8f
commit 3a0491d3b4
24 changed files with 81 additions and 118 deletions
+1 -1
View File
@@ -49,7 +49,7 @@
Butcher(user, M)
/datum/component/butchering/proc/startNeckSlice(obj/item/source, mob/living/carbon/human/H, mob/living/user)
if(INTERACTING_WITH(user, H))
if(DOING_INTERACTION_WITH_TARGET(user, H))
to_chat(user, "<span class='warning'>You're already interacting with [H]!</span>")
return
+1 -1
View File
@@ -38,7 +38,7 @@
/datum/element/art/proc/on_examine(atom/source, mob/user, list/examine_texts)
SIGNAL_HANDLER
if(!INTERACTING_WITH(user, source))
if(!DOING_INTERACTION_WITH_TARGET(user, source))
INVOKE_ASYNC(src, .proc/appraise, source, user) //Do not sleep the proc.
/datum/element/art/proc/appraise(atom/source, mob/user)
+1 -1
View File
@@ -283,7 +283,7 @@
return FALSE
// now that we've determined we have a valid attempt at treating, we can stomp on their dreams if we're already interacting with the patient or if their part is obscured
if(INTERACTING_WITH(user, victim))
if(DOING_INTERACTION_WITH_TARGET(user, victim))
to_chat(user, "<span class='warning'>You're already interacting with [victim]!</span>")
return TRUE
+1 -1
View File
@@ -145,7 +145,7 @@
/datum/wound/slash/try_handling(mob/living/carbon/human/user)
if(user.pulling != victim || user.zone_selected != limb.body_zone || user.a_intent == INTENT_GRAB || !isfelinid(user) || !victim.can_inject(user, TRUE))
return FALSE
if(INTERACTING_WITH(user, victim))
if(DOING_INTERACTION_WITH_TARGET(user, victim))
to_chat(user, "<span class='warning'>You're already interacting with [victim]!</span>")
return
if(user.is_mouth_covered())