mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
Adds new helper: use_tool, shakes things up in tool code (#35095)
* small changes * Adds a use_tool helper and changes some tools to use it * Ports most tool operations to use_tool * Converts more tool operations to use_tool and tool_act * Changes some things to default_unfasten_wrench * Improves tool_behavior support in mech construction * Code review memes * Fixes all instant use_tool calls failing * Code improvements * merge fixes
This commit is contained in:
@@ -393,18 +393,15 @@
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/WT = W
|
||||
if(!WT.isOn())
|
||||
to_chat(user, "<span class='warning'>\The [W] is off.</span>")
|
||||
return
|
||||
|
||||
if(obj_integrity == max_integrity)
|
||||
to_chat(user, "<span class='warning'>\The [src] does not require repairs.</span>")
|
||||
return
|
||||
|
||||
if(!W.tool_start_check(user, amount=1))
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>You begin repairing damage to \the [src]...</span>")
|
||||
var/dmg = round(max_integrity - obj_integrity)
|
||||
if(WT.remove_fuel(round(dmg/75)) && do_after(usr, dmg/10))
|
||||
if(W.use_tool(src, user, 20, volume=50, amount=1))
|
||||
obj_integrity = max_integrity
|
||||
to_chat(user, "<span class='notice'>You repair \the [src].</span>")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user