From 160e8c1ec5863d4d5c6ae0f7fba096bbc18e0163 Mon Sep 17 00:00:00 2001 From: Seris02 Date: Fri, 27 Dec 2019 23:21:40 +0800 Subject: [PATCH 1/2] stunglasses --- code/datums/action.dm | 3 ++ code/modules/clothing/glasses/_glasses.dm | 30 +++++++++++++++++++ .../crafting/recipes/recipes_clothing.dm | 10 +++++++ 3 files changed, 43 insertions(+) diff --git a/code/datums/action.dm b/code/datums/action.dm index 77aa729eb1..44a0e0c7ba 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -533,6 +533,9 @@ cooldown = world.time owner.playsound_local(box, 'sound/misc/box_deploy.ogg', 50, TRUE) +/datum/action/item_action/flash + name = "Flash" + //Preset for spells /datum/action/spell_action check_flags = 0 diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 206165a495..db5f79dfaf 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -247,6 +247,36 @@ throwforce = 12 glass_colour_type = /datum/client_colour/glass_colour/red +/obj/item/clothing/glasses/sunglasses/stunglasses + name = "stunglasses" + desc = "Sunglasses with inbuilt flashes. Made for those who prefer to walk around in style, who needs clumsy flashes anyway?" + actions_types = list(/datum/action/item_action/flash) + var/obj/item/assembly/flash/installed + +/obj/item/clothing/glasses/sunglasses/stunglasses/Initialize() + ..() + if (!installed) + installed = new(src) + +/obj/item/clothing/glasses/sunglasses/stunglasses/ui_action_click(mob/user) + if (installed && !installed.crit_fail) + installed.attack_self(user) + else + to_chat(user, "Install a new flash in [src]!") + + +/obj/item/clothing/glasses/sunglasses/stunglasses/attackby(obj/item/W,mob/user) + if (istype(W,/obj/item/screwdriver)) + if (installed) + installed.forceMove(get_turf(src)) + to_chat(user, "You remove [installed] from [src].") + installed = null + if (istype(W,/obj/item/assembly/flash)) + if (!installed) + W.forceMove(src) + to_chat(user, "You install [W] into [src].") + installed = W + /obj/item/clothing/glasses/welding name = "welding goggles" desc = "Protects the eyes from welders; approved by the mad scientist association." diff --git a/code/modules/crafting/recipes/recipes_clothing.dm b/code/modules/crafting/recipes/recipes_clothing.dm index 4f06a44811..088cf30196 100644 --- a/code/modules/crafting/recipes/recipes_clothing.dm +++ b/code/modules/crafting/recipes/recipes_clothing.dm @@ -87,6 +87,16 @@ reqs = list(/obj/item/clothing/glasses/sunglasses/reagent = 1) category = CAT_CLOTHING +/datum/crafting_recipe/stunglasses + name = "Stunglasses" + result = /obj/item/clothing/glasses/sunglasses/stunglasses + time = 60 + tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER) + reqs = list(/obj/item/assembly/flash = 1, + /obj/item/clothing/glasses/sunglasses = 1, + /obj/item/stack/cable_coil = 5) + category = CAT_CLOTHING + /datum/crafting_recipe/ghostsheet name = "Ghost Sheet" result = /obj/item/clothing/suit/ghost_sheet From 1d449fcd129a98a0259821ae372f7268478643e1 Mon Sep 17 00:00:00 2001 From: Seris02 Date: Sun, 29 Dec 2019 19:46:47 +0800 Subject: [PATCH 2/2] changes --- code/modules/clothing/glasses/_glasses.dm | 4 ++-- code/modules/crafting/recipes/recipes_clothing.dm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index db5f79dfaf..330e10db0e 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -254,7 +254,7 @@ var/obj/item/assembly/flash/installed /obj/item/clothing/glasses/sunglasses/stunglasses/Initialize() - ..() + . = ..() if (!installed) installed = new(src) @@ -264,7 +264,6 @@ else to_chat(user, "Install a new flash in [src]!") - /obj/item/clothing/glasses/sunglasses/stunglasses/attackby(obj/item/W,mob/user) if (istype(W,/obj/item/screwdriver)) if (installed) @@ -276,6 +275,7 @@ W.forceMove(src) to_chat(user, "You install [W] into [src].") installed = W + . = ..() /obj/item/clothing/glasses/welding name = "welding goggles" diff --git a/code/modules/crafting/recipes/recipes_clothing.dm b/code/modules/crafting/recipes/recipes_clothing.dm index 088cf30196..83e82654a2 100644 --- a/code/modules/crafting/recipes/recipes_clothing.dm +++ b/code/modules/crafting/recipes/recipes_clothing.dm @@ -86,7 +86,7 @@ tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER) reqs = list(/obj/item/clothing/glasses/sunglasses/reagent = 1) category = CAT_CLOTHING - +/* //Kevinz doesn't want it as a recipe for now, leaving it in if anything ever changes to let it in /datum/crafting_recipe/stunglasses name = "Stunglasses" result = /obj/item/clothing/glasses/sunglasses/stunglasses @@ -96,7 +96,7 @@ /obj/item/clothing/glasses/sunglasses = 1, /obj/item/stack/cable_coil = 5) category = CAT_CLOTHING - +*/ /datum/crafting_recipe/ghostsheet name = "Ghost Sheet" result = /obj/item/clothing/suit/ghost_sheet