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

Tactical Compact Nailgun #5746

Closed
wants to merge 13 commits into from
4 changes: 3 additions & 1 deletion code/game/machinery/vending/vendor_types/requisitions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@
list("Engineering Pamphlet", floor(scale * 1), /obj/item/pamphlet/skill/engineer, VENDOR_ITEM_REGULAR),
list("Powerloader Certification", 0.75, /obj/item/pamphlet/skill/powerloader, VENDOR_ITEM_REGULAR),
list("Spare PDT/L Battle Buddy Kit", floor(scale * 4), /obj/item/storage/box/pdt_kit, VENDOR_ITEM_REGULAR),
list("W-Y brand rechargeable mini-battery", floor(scale * 3), /obj/item/cell/crap, VENDOR_ITEM_REGULAR)
list("W-Y brand rechargeable mini-battery", floor(scale * 3), /obj/item/cell/crap, VENDOR_ITEM_REGULAR),
list("Nailgun Magazine (7x45mm)", floor(scale * 4), /obj/item/ammo_magazine/smg/nailgun, VENDOR_ITEM_REGULAR),
list("Nailgun Magazine Box (7x45mm)", floor(scale * 2), /obj/item/ammo_box/magazine/nailgun, VENDOR_ITEM_REGULAR)
)

/obj/structure/machinery/cm_vending/sorted/cargo_guns/stock(obj/item/item_to_stock, mob/user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,5 @@ GLOBAL_LIST_INIT(cm_vending_clothing_engi, list(
/obj/item/cell/high,
/obj/item/tool/shovel/etool/folded,
/obj/item/device/lightreplacer,
/obj/item/weapon/gun/smg/nailgun/compact/tactical,
MobiusWon marked this conversation as resolved.
Show resolved Hide resolved
)
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@
list("Binoculars", floor(scale * 1), /obj/item/device/binoculars, VENDOR_ITEM_REGULAR),
list("MB-6 Folding Barricades (x3)", floor(scale * 2), /obj/item/stack/folding_barricade/three, VENDOR_ITEM_REGULAR),
list("Spare PDT/L Battle Buddy Kit", floor(scale * 3), /obj/item/storage/box/pdt_kit, VENDOR_ITEM_REGULAR),
list("W-Y brand rechargeable mini-battery", floor(scale * 2.5), /obj/item/cell/crap, VENDOR_ITEM_REGULAR)
list("W-Y brand rechargeable mini-battery", floor(scale * 2.5), /obj/item/cell/crap, VENDOR_ITEM_REGULAR),
list("Nailgun Magazine (7x45mm)", floor(scale * 4), /obj/item/ammo_magazine/smg/nailgun, VENDOR_ITEM_REGULAR)
)

//--------------SQUAD ATTACHMENTS VENDOR--------------
Expand Down
43 changes: 26 additions & 17 deletions code/game/objects/structures/barricade/barricade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -437,52 +437,61 @@

var/obj/item/weapon/gun/smg/nailgun/nailgun = item

if(!nailgun.in_chamber || !nailgun.current_mag || nailgun.current_mag.current_rounds < 3)
to_chat(user, SPAN_WARNING("You require at least 4 nails to complete this task!"))
return FALSE

// Check if either hand has a metal stack by checking the weapon offhand
// Presume the material is a sheet until proven otherwise.
var/obj/item/stack/sheet/material = null
var/mat_tac = 2 //Material needed to make a repair with a tactical compact nailgun.
if(user.l_hand == nailgun)
material = user.r_hand
else
material = user.l_hand

if(!istype(material, /obj/item/stack/sheet/))
to_chat(user, SPAN_WARNING("You'll need some adequate repair material in your other hand to patch up [src]!"))
if(istype(item,/obj/item/weapon/gun/smg/nailgun/compact/tactical) && !skillcheck(user, SKILL_ENGINEER, SKILL_ENGINEER_ENGI)) //Skill lock for tactical compact nailgun
to_chat(user, SPAN_WARNING("You don't seem to know how to use [item]..."))
return FALSE

if(!nailgun.in_chamber || !nailgun.current_mag || nailgun.current_mag.current_rounds < 3)
to_chat(user, SPAN_WARNING("You require at least 4 nails to complete this task!"))
return FALSE

var/repair_value = 0
for(var/validSheetType in repair_materials)
if(validSheetType == material.sheettype)
if(!isnull(material) && validSheetType == material.sheettype)
Copy link
Contributor

Choose a reason for hiding this comment

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

This runtimes if wield the nailgun and use it on a barricade.
image

repair_value = repair_materials[validSheetType]
MobiusWon marked this conversation as resolved.
Show resolved Hide resolved
break

if(!istype(material, /obj/item/stack/sheet/))
to_chat(user, SPAN_WARNING("You'll need some adequate repair material in your other hand to patch up [src]!"))
return FALSE

if(repair_value == 0)
to_chat(user, SPAN_WARNING("You'll need some adequate repair material in your other hand to patch up [src]!"))
return FALSE

var/soundchannel = playsound(src, nailgun.repair_sound, 25, 1)
if(!do_after(user, nailgun.nailing_speed, INTERRUPT_ALL, BUSY_ICON_FRIENDLY, src))
playsound(src, null, channel = soundchannel)
if(istype(item,/obj/item/weapon/gun/smg/nailgun/compact/tactical) && material.amount < mat_tac) //If less than [mat_tac] material is held, cancel repair.
to_chat(user, SPAN_WARNING("You need at least [mat_tac] [material.singular_name]\s to patch up [src]!"))
return FALSE

if(!material || (material != user.l_hand && material != user.r_hand) || material.amount <= 0)
to_chat(user, SPAN_WARNING("You seems to have misplaced the repair material!"))
to_chat(user, SPAN_WARNING("You seem to have misplaced the repair material!"))
return FALSE

if(!nailgun.in_chamber || !nailgun.current_mag || nailgun.current_mag.current_rounds < 3)
to_chat(user, SPAN_WARNING("You require at least 4 nails to complete this task!"))
var/soundchannel = playsound(src, nailgun.repair_sound, 25, 1)
if(!do_after(user, nailgun.nailing_speed, INTERRUPT_ALL, BUSY_ICON_BUILD, src))
playsound(src, null, channel = soundchannel)
MobiusWon marked this conversation as resolved.
Show resolved Hide resolved
return FALSE

update_health(-repair_value*maxhealth)
to_chat(user, SPAN_WARNING("You nail [material] to [src], restoring some of its integrity!"))
update_damage_state()
material.use(1)
if(istype(item,/obj/item/weapon/gun/smg/nailgun/compact/tactical))
material.use(mat_tac) //Removes [mat_tac] from stack.
else
material.use(1)

nailgun.current_mag.current_rounds -= 3
nailgun.in_chamber = null
nailgun.load_into_chamber()
update_health(-repair_value*maxhealth)
to_chat(user, SPAN_WARNING("You nail [material] to [src], restoring some of its integrity!"))
update_damage_state()
return TRUE

/obj/structure/barricade/proc/can_weld(obj/item/item, mob/user, silent)
Expand Down
11 changes: 9 additions & 2 deletions code/modules/projectiles/guns/smgs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,16 @@
icon_state = "cnailgun"
item_state = "nailgun"
w_class = SIZE_SMALL
flags_gun_features = GUN_NO_DESCRIPTION

/obj/item/weapon/gun/smg/nailgun/compact/able_to_fire(mob/living/user)
. = ..()
if(.)
click_empty(user)
return FALSE

/obj/item/weapon/gun/smg/nailgun/compact/tactical
MobiusWon marked this conversation as resolved.
Show resolved Hide resolved
name = "tactical compact nailgun"
desc = "A carpentry tool, used to drive nails into tough surfaces. This one is military grade, it's olive drab and tacticool. Cannot fire nails as a projectile."
icon_state = "tnailgun"
item_state = "tnailgun"
w_class = SIZE_SMALL
MobiusWon marked this conversation as resolved.
Show resolved Hide resolved

2 changes: 1 addition & 1 deletion code/modules/projectiles/magazines/smgs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
//Nailgun!
/obj/item/ammo_magazine/smg/nailgun
name = "nailgun magazine (7x45mm)"
desc = "A large magazine of oversized plasteel nails. Unfortunately, the production cost of those nail makes them ill-affordable for most military projects, and only some specific construction projects requires them."
desc = "A large magazine of oversized plasteel nails. Useful for making repairs."
default_ammo = /datum/ammo/bullet/smg/nail
flags_magazine = NO_FLAGS // Let's not start messing with nails...
caliber = "7x45mm"
Expand Down
Binary file modified icons/mob/humans/onmob/items_lefthand_1.dmi
Binary file not shown.
Binary file modified icons/mob/humans/onmob/items_righthand_1.dmi
Binary file not shown.
Binary file modified icons/obj/items/weapons/guns/guns_by_faction/colony.dmi
Binary file not shown.
Loading