Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making Glock accept silencer and autolathe emaggable to build silencers #968

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion code/game/machinery/autolathe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ var/global/list/autolathe_recipes_hidden = list( \
/* new /obj/item/weapon/shield/riot(), */ \
)

var/global/list/autolathe_recipes_emagged = list( \
new /obj/item/weapon/silencer(), \
)

/obj/machinery/autolathe
name = "autolathe"
desc = "It produces items using metal and glass."
Expand All @@ -88,6 +92,7 @@ var/global/list/autolathe_recipes_hidden = list( \
anchored = 1.0
var/list/L = list()
var/list/LL = list()
var/list/LLL = list()
var/hacked = 0
var/disabled = 0
var/shocked = 0
Expand Down Expand Up @@ -115,6 +120,7 @@ var/global/list/autolathe_recipes_hidden = list( \
wires = new(src)
src.L = autolathe_recipes
src.LL = autolathe_recipes_hidden
src.LLL = autolathe_recipes_emagged

/obj/machinery/autolathe/interact(mob/user)
if(..())
Expand Down Expand Up @@ -151,6 +157,15 @@ var/global/list/autolathe_recipes_hidden = list( \
else
attack_hand(user)
return 1

else if(istype(O, /obj/item/weapon/card/emag) && !emagged)
src.emagged = 1
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
user << "You short out the [src]'s circuit board, enabling debug mode."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a span class please. Preferably 'warning' but 'notice' works.

visible_message("\red BZZzZZzZZzZT")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should never use \red, \blue, or \any color. Instead use span class.

return

if (src.m_amount + O.m_amt > max_m_amount)
user << "<span class=\"alert\">The autolathe is full. Please remove metal from the autolathe in order to insert more.</span>"
Expand Down Expand Up @@ -214,7 +229,7 @@ var/global/list/autolathe_recipes_hidden = list( \
if(!attempting_to_build)
return

if(locate(attempting_to_build, src.L) || locate(attempting_to_build, src.LL)) // see if the requested object is in one of the construction lists, if so, it is legit -walter0o
if(locate(attempting_to_build, src.L) || locate(attempting_to_build, src.LL) || locate(attempting_to_build, src.LLL)) // see if the requested object is in one of the construction lists, if so, it is legit -walter0o
template = attempting_to_build

else // somebody is trying to exploit, alert admins -walter0o
Expand Down Expand Up @@ -293,6 +308,8 @@ var/global/list/autolathe_recipes_hidden = list( \
objs += src.L
if(src.hacked)
objs += src.LL
if(src.emagged)
objs += src.LLL
for(var/obj/t in objs)
if(disabled || m_amount<t.m_amt || g_amount<t.g_amt)
dat += replacetext("<span class='linkOff'>[t]</span>", "The ", "")
Expand Down
18 changes: 9 additions & 9 deletions code/modules/projectiles/guns/projectile/pistol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@
icon_state = "[initial(icon_state)][silenced ? "-silencer" : ""][chambered ? "" : "-e"]"
return

/obj/item/weapon/gun/projectile/automatic/pistol/glock
name = "glock"
desc = "A Glock pistol. Uses 9mm ammo."
icon_state = "glock"
force = 10.0
origin_tech = "combat=4;materials=3"
mag_type = /obj/item/ammo_box/magazine/m9mm

/obj/item/weapon/gun/projectile/automatic/deagle/m1911
name = "\improper M1911"
Expand All @@ -95,14 +102,6 @@
origin_tech = "combat=4;materials=4"
mag_type = /obj/item/ammo_box/magazine/sm45

/obj/item/weapon/gun/projectile/automatic/deagle/glock
name = "glock"
desc = "A glock pistol. Uses 9mm ammo."
icon_state = "glock"
force = 10.0
origin_tech = "combat=4;materials=3"
mag_type = /obj/item/ammo_box/magazine/m9mm

/obj/item/glockbarrel
name = "handgun barrel"
desc = "One third of a low-caliber handgun."
Expand All @@ -129,7 +128,7 @@
if(istype(W,/obj/item/weapon/screwdriver))
if(construction)
user << "You finish the handgun."
new /obj/item/weapon/gun/projectile/automatic/deagle/glock(user.loc)
new /obj/item/weapon/gun/projectile/automatic/pistol/glock(user.loc)
del(src)
return

Expand Down Expand Up @@ -160,3 +159,4 @@
icon_state = "silencer"
w_class = 2
var/oldsound = 0 //Stores the true sound the gun made before it was silenced
m_amt = 200000
Binary file modified icons/obj/gun.dmi
Binary file not shown.