From 0b6242e25dd3003cb7f31b61fc7bc727e73f5d26 Mon Sep 17 00:00:00 2001 From: Seris02 Date: Sat, 28 Dec 2019 00:40:55 +0800 Subject: [PATCH 1/2] let the adminbus commence --- code/_onclick/other_mobs.dm | 4 ++++ code/modules/clothing/glasses/_glasses.dm | 3 +++ code/modules/clothing/glasses/disablerglasses.dm | 15 +++++++++++++++ tgstation.dme | 1 + 4 files changed, 23 insertions(+) create mode 100644 code/modules/clothing/glasses/disablerglasses.dm diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 30e6883d24..26b9d64c80 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -91,6 +91,10 @@ var/obj/item/clothing/gloves/G = gloves if(istype(G) && G.Touch(A,0)) // for magic gloves return + if (glasses) + var/obj/item/clothing/glasses/Gl = glasses + if (istype(Gl)) + Gl.ranged_attack(src,A,mouseparams) for(var/datum/mutation/human/HM in dna.mutations) HM.on_ranged_attack(src, A, mouseparams) diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 206165a495..7d1ca624e3 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -54,6 +54,9 @@ H.blur_eyes(5) eyes.applyOrganDamage(5) +/obj/item/clothing/glasses/proc/ranged_attack(mob/living/carbon/human/user,atom/A, params) + return + /obj/item/clothing/glasses/meson name = "optical meson scanner" desc = "Used by engineering and mining staff to see basic structural and terrain layouts through walls, regardless of lighting conditions." diff --git a/code/modules/clothing/glasses/disablerglasses.dm b/code/modules/clothing/glasses/disablerglasses.dm new file mode 100644 index 0000000000..a349642d6c --- /dev/null +++ b/code/modules/clothing/glasses/disablerglasses.dm @@ -0,0 +1,15 @@ +/obj/item/clothing/glasses/hud/security/sunglasses/disablers + name = "true stunglasses" + desc = "Made for only the best of shitsec. Wear 'em like you're gonna robust all of those fuckers." + var/beamtype = /obj/item/projectile/beam/disabler //change for adminbus + +/obj/item/clothing/glasses/hud/security/sunglasses/disablers/ranged_attack(mob/living/carbon/human/user,atom/A, params) + user.changeNext_move(CLICK_CD_RANGE) + + var/obj/item/projectile/beam/disabler/LE = new beamtype( loc ) + playsound(usr.loc, 'sound/weapons/taser2.ogg', 75, 1) + LE.firer = src + LE.def_zone = user.get_organ_target() + LE.preparePixelProjectile(A, src, params) + LE.fire() + //shamelessly copied \ No newline at end of file diff --git a/tgstation.dme b/tgstation.dme index e13584b7e3..9e3acf3064 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -1569,6 +1569,7 @@ #include "code\modules\clothing\clothing.dm" #include "code\modules\clothing\ears\_ears.dm" #include "code\modules\clothing\glasses\_glasses.dm" +#include "code\modules\clothing\glasses\disablerglasses.dm" #include "code\modules\clothing\glasses\engine_goggles.dm" #include "code\modules\clothing\glasses\hud.dm" #include "code\modules\clothing\glasses\phantomthief.dm" From f6caff82271b4f1f5b36d40dd25b974aa2332aad Mon Sep 17 00:00:00 2001 From: Seris02 Date: Sun, 29 Dec 2019 20:10:15 +0800 Subject: [PATCH 2/2] hnnnnnng code improvements --- code/_onclick/other_mobs.dm | 6 ++---- code/modules/clothing/glasses/_glasses.dm | 2 +- code/modules/clothing/glasses/disablerglasses.dm | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 26b9d64c80..6ee7d51091 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -91,10 +91,8 @@ var/obj/item/clothing/gloves/G = gloves if(istype(G) && G.Touch(A,0)) // for magic gloves return - if (glasses) - var/obj/item/clothing/glasses/Gl = glasses - if (istype(Gl)) - Gl.ranged_attack(src,A,mouseparams) + if (istype(glasses) && glasses.ranged_attack(src,A,mouseparams)) + return for(var/datum/mutation/human/HM in dna.mutations) HM.on_ranged_attack(src, A, mouseparams) diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 7d1ca624e3..969af341ed 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -55,7 +55,7 @@ eyes.applyOrganDamage(5) /obj/item/clothing/glasses/proc/ranged_attack(mob/living/carbon/human/user,atom/A, params) - return + return FALSE /obj/item/clothing/glasses/meson name = "optical meson scanner" diff --git a/code/modules/clothing/glasses/disablerglasses.dm b/code/modules/clothing/glasses/disablerglasses.dm index a349642d6c..a46e4c8339 100644 --- a/code/modules/clothing/glasses/disablerglasses.dm +++ b/code/modules/clothing/glasses/disablerglasses.dm @@ -5,11 +5,11 @@ /obj/item/clothing/glasses/hud/security/sunglasses/disablers/ranged_attack(mob/living/carbon/human/user,atom/A, params) user.changeNext_move(CLICK_CD_RANGE) - var/obj/item/projectile/beam/disabler/LE = new beamtype( loc ) playsound(usr.loc, 'sound/weapons/taser2.ogg', 75, 1) LE.firer = src LE.def_zone = user.get_organ_target() LE.preparePixelProjectile(A, src, params) LE.fire() + return TRUE //shamelessly copied \ No newline at end of file