diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index c39a74b7c3..214044a88e 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -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 \ No newline at end of file diff --git a/icons/obj/items.dmi b/icons/obj/items.dmi index b23d6dad08..afbbefd304 100644 Binary files a/icons/obj/items.dmi and b/icons/obj/items.dmi differ