mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 19:47:47 +01:00
@@ -472,3 +472,50 @@
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
/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"
|
||||
|
||||
var/list/spawn_tools = list(
|
||||
/obj/item/weapon/screwdriver,
|
||||
/obj/item/weapon/wrench,
|
||||
/obj/item/weapon/wirecutters,
|
||||
/obj/item/weapon/kitchen/utensil/knife,
|
||||
/obj/item/weapon/kitchen/utensil/fork,
|
||||
/obj/item/weapon/hatchet
|
||||
)
|
||||
var/list/tools = list()
|
||||
var/current_tool = 1
|
||||
|
||||
/obj/item/weapon/combitool/examine()
|
||||
..()
|
||||
if(loc == usr && tools.len)
|
||||
usr << "It has the following fittings:"
|
||||
for(var/obj/item/tool in tools)
|
||||
usr << "\icon[tool] - [tool.name][tools[current_tool]==tool?" (selected)":""]"
|
||||
|
||||
/obj/item/weapon/combitool/New()
|
||||
..()
|
||||
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)
|
||||
user << "You can't seem to find any fittings in \the [src]."
|
||||
else
|
||||
user << "You switch \the [src] to the [tool.name] fitting."
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/combitool/attack(var/atom/target, var/mob/living/user)
|
||||
var/obj/item/tool = tools[current_tool]
|
||||
if(!tool)
|
||||
return ..()
|
||||
var/resolved = target.attackby(tool,user)
|
||||
if(!resolved && tool && target)
|
||||
tool.afterattack(target,user,1)
|
||||
return 1
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Reference in New Issue
Block a user