mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 19:13:30 +01:00
add an argument that toggles spammability of use_tool() (#30962)
* add an argument that toggles spammability of use_tool() * make argument more specific
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* Called when a mob tries to use the item as a tool.
|
||||
* Handles most checks.
|
||||
*/
|
||||
/obj/item/proc/use_tool(atom/target, mob/living/user, delay, amount=0, volume=0, datum/callback/extra_checks)
|
||||
/obj/item/proc/use_tool(atom/target, mob/living/user, delay, amount=0, volume=0, datum/callback/extra_checks, do_after_once = FALSE)
|
||||
// No delay means there is no start message, and no reason to call tool_start_check before use_tool.
|
||||
// Run the start check here so we wouldn't have to call it manually.
|
||||
target.add_fingerprint(user)
|
||||
@@ -21,9 +21,13 @@
|
||||
if(!do_mob(user, target, delay, extra_checks = list(tool_check)))
|
||||
return
|
||||
|
||||
else
|
||||
else if(!do_after_once)
|
||||
if(!do_after(user, delay, target=target, extra_checks = list(tool_check)))
|
||||
return
|
||||
else
|
||||
if(!do_after_once(user, delay, target=target, extra_checks = list(tool_check)))
|
||||
return
|
||||
|
||||
else
|
||||
// Invoke the extra checks once, just in case.
|
||||
if(extra_checks && !extra_checks.Invoke())
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
cig.light(user, target)
|
||||
return TRUE
|
||||
|
||||
/obj/item/weldingtool/use_tool(atom/target, user, delay, amount, volume, datum/callback/extra_checks)
|
||||
/obj/item/weldingtool/use_tool(atom/target, user, delay, amount, volume, datum/callback/extra_checks, do_after_once)
|
||||
target.add_overlay(GLOB.welding_sparks)
|
||||
var/did_thing = ..()
|
||||
if(did_thing)
|
||||
|
||||
Reference in New Issue
Block a user