Files
Polaris/code/modules/tools/tools/combitool.dm
Atermonera 4d8c43f106 What was supposed to be another straightforward major system overhaul that once again spiraled out of control (#8220)
* get_tool_quality has numerical meaning

* Basic tools set tool quality

* Toolspeed is replaced by tool quality checks

* Addresses assorted results from live test

* Extra cleanup
2022-01-16 15:52:55 -08:00

66 lines
1.9 KiB
Plaintext

// File is unticked because this is entirely untested old code
/*
* Combitool
*/
/obj/item/weapon/combitool
name = "combi-tool"
desc = "It even has one of those nubbins for doing the thingy."
icon = 'icons/obj/items.dmi'
icon_state = "combitool"
w_class = ITEMSIZE_SMALL
drop_sound = 'sound/items/drop/multitool.ogg'
pickup_sound = 'sound/items/pickup/multitool.ogg'
var/list/spawn_tools = list(
/obj/item/weapon/tool/screwdriver,
/obj/item/weapon/tool/wrench,
/obj/item/weapon/tool/wirecutters,
/obj/item/weapon/material/knife,
/obj/item/weapon/material/kitchen/utensil/fork,
/obj/item/weapon/material/knife/machete/hatchet
)
var/list/tools = list()
var/current_tool = 1
/obj/item/weapon/combitool/examine(mob/user)
. = ..()
if(loc == user && tools.len)
. += "It has the following fittings:"
for(var/obj/item/tool in tools)
. += "[bicon(tool)] - [tool.name][tools[current_tool]==tool?" (selected)":""]"
/obj/item/weapon/combitool/Initialize()
. = ..()
for(var/type in spawn_tools)
tools |= new type(src)
/obj/item/weapon/combitool/attack_self(mob/user as mob)
if(++current_tool > tools.len) current_tool = 1
var/obj/item/tool = tools[current_tool]
if(!tool)
to_chat(user, "You can't seem to find any fittings in \the [src].")
else
to_chat(user, "You switch \the [src] to the [tool.name] fitting.")
return 1
/obj/item/weapon/combitool/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!M.Adjacent(user))
return 0
var/obj/item/tool = tools[current_tool]
if(!tool) return 0
return (tool ? tool.attack(M,user) : 0)
/obj/item/weapon/combitool/afterattack(var/atom/target, var/mob/living/user, proximity, params)
if(!proximity)
return 0
var/obj/item/tool = tools[current_tool]
if(!tool) return 0
tool.loc = user
var/resolved = target.attackby(tool,user)
if(!resolved && tool && target)
tool.afterattack(target,user,1)
if(tool)
tool.loc = src