Skip to content

Commit

Permalink
add: makeshift MOD-revolver. (#4131)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daeberdir authored Feb 21, 2024
1 parent 289f325 commit 0101faa
Show file tree
Hide file tree
Showing 28 changed files with 362 additions and 189 deletions.
1 change: 1 addition & 0 deletions _maps/map_files/Delta/delta.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -106444,6 +106444,7 @@
/obj/item/clothing/suit/jacket/leather/overcoat,
/obj/item/reagent_containers/food/drinks/bottle/whiskey,
/obj/item/clothing/head/fedora,
/obj/item/ammo_box/magazine/internal/cylinder/improvised/steel,
/turf/simulated/floor/plating,
/area/maintenance/detectives_office)
"sWX" = (
Expand Down
5 changes: 4 additions & 1 deletion code/game/objects/effects/spawners/lootdrop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@
/obj/item/wirecutters = 10,
/obj/item/wrench = 40,
/obj/item/relic = 35,
/obj/item/weaponcrafting/revolverbarrel = 3,
/obj/item/weaponcrafting/revolverbarrel/steel = 2,
/obj/item/ammo_box/magazine/internal/cylinder/improvised/steel = 2,
/obj/item/weaponcrafting/receiver = 2,
/obj/item/clothing/gloves/knuckles = 1,
/obj/item/clothing/shoes/brown = 30,
Expand Down Expand Up @@ -162,7 +165,7 @@
/obj/item/storage/pill_bottle/fakedeath = 2,
/obj/item/storage/box/syndie_kit/mr_chang_technique = 1,
/obj/item/clothing/glasses/chameleon/meson = 7,
"" = 68
"" = 61
)

/obj/effect/spawner/lootdrop/crate_spawner // for ruins
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/chrono_eraser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
icon_state = "chronobolt"
range = CHRONO_BEAM_RANGE
color = null
nodamage = 1
nodamage = TRUE
var/obj/item/gun/energy/chrono_gun/gun = null

/obj/item/projectile/energy/chrono_beam/fire()
Expand Down
30 changes: 22 additions & 8 deletions code/modules/crafting/guncrafting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,25 @@
icon = 'icons/obj/improvised.dmi'
icon_state = "riflestock"

/obj/item/weaponcrafting/revolverbarrel
name = "improvised revolver barrel"
desc = "A roughly made revolver barrel."
icon = 'icons/obj/improvised.dmi'
icon_state = "rev_barrel"
w_class = WEIGHT_CLASS_SMALL
var/new_fire_sound = 'sound/weapons/gunshots/1rev257.ogg'

/obj/item/weaponcrafting/revolverbarrel/steel
name = "steel revolver barrel"
desc = "High quality heavy steel gun barrel to increase stability."
icon = 'icons/obj/improvised.dmi'
icon_state = "s_rev_barrel"
new_fire_sound = 'sound/weapons/gunshots/1rev257S.ogg'


// CRAFTING //

/obj/item/weaponcrafting/receiver/attackby(obj/item/W as obj, mob/user as mob, params)
/obj/item/weaponcrafting/receiver/attackby(obj/item/W, mob/user, params)
if(istype(W,/obj/item/pipe))
to_chat(user, "You attach the shotgun barrel to the receiver. The pins seem loose.")
var/obj/item/weaponcrafting/ishotgunconstruction/I = new(drop_location())
Expand All @@ -36,13 +51,13 @@
icon = 'icons/obj/improvised.dmi'
icon_state = "ishotgunstep1"

/obj/item/weaponcrafting/ishotgunconstruction/attackby(var/obj/item/I, mob/user as mob, params)
/obj/item/weaponcrafting/ishotgunconstruction/attackby(obj/item/I, mob/user, params)
..()
if(I.tool_behaviour == TOOL_SCREWDRIVER)
var/obj/item/weaponcrafting/ishotgunconstruction2/C = new(drop_location())
user.temporarily_remove_item_from_inventory(src)
user.put_in_hands(C, ignore_anim = FALSE)
to_chat(user, "<span class='notice'>You screw the pins into place, securing the pipe to the receiver.</span>")
to_chat(user, span_notice("You screw the pins into place, securing the pipe to the receiver."))
qdel(src)

/obj/item/weaponcrafting/ishotgunconstruction2
Expand All @@ -51,7 +66,7 @@
icon = 'icons/obj/improvised.dmi'
icon_state = "ishotgunstep1"

/obj/item/weaponcrafting/ishotgunconstruction2/attackby(obj/item/W as obj, mob/user as mob, params)
/obj/item/weaponcrafting/ishotgunconstruction2/attackby(obj/item/W, mob/user, params)
if(istype(W,/obj/item/weaponcrafting/stock))
to_chat(user, "You attach the stock to the receiver-barrel assembly.")
var/obj/item/weaponcrafting/ishotgunconstruction3/I = new(drop_location())
Expand All @@ -67,7 +82,7 @@
icon = 'icons/obj/improvised.dmi'
icon_state = "ishotgunstep2"

/obj/item/weaponcrafting/ishotgunconstruction3/attackby(var/obj/item/I, mob/user as mob, params)
/obj/item/weaponcrafting/ishotgunconstruction3/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/stack/packageWrap))
var/obj/item/stack/packageWrap/C = I
Expand All @@ -76,9 +91,8 @@
investigate_log("[key_name_log(user)] crafted [W]", INVESTIGATE_CRAFTING)
user.temporarily_remove_item_from_inventory(src)
user.put_in_hands(W, ignore_anim = FALSE)
to_chat(user, "<span class='notice'>You tie the wrapping paper around the stock and the barrel to secure it.</span>")
to_chat(user, span_notice("You tie the wrapping paper around the stock and the barrel to secure it."))
qdel(src)
else
to_chat(user, "<span class='warning'>You need at least five feet of wrapping paper to secure the stock.</span>")
to_chat(user, span_warning("You need at least five feet of wrapping paper to secure the stock."))
return

41 changes: 26 additions & 15 deletions code/modules/crafting/recipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,29 @@
subcategory = CAT_WEAPON
alert_admins_on_craft = TRUE

/datum/crafting_recipe/revolver_ibullet
name = "Improvised Revolver Shell"
result = /obj/item/ammo_casing/revolver/improvised
reqs = list(/obj/item/stack/sheet/metal = 1,
/obj/item/stack/cable_coil = 1,
/datum/reagent/fuel = 5,)
tools = list(TOOL_SCREWDRIVER)
time = 2
category = CAT_WEAPONRY
subcategory = CAT_AMMO

/datum/crafting_recipe/revolver_pbullet
name = "Phosphorous Revolver Bullet"
result = /obj/item/ammo_casing/revolver/improvised/phosphorus
reqs = list(/obj/item/stack/sheet/metal = 1,
/obj/item/stack/cable_coil = 1,
/datum/reagent/phosphorus = 5,
/datum/reagent/fuel = 5,)
tools = list(TOOL_SCREWDRIVER)
time = 2
category = CAT_WEAPONRY
subcategory = CAT_AMMO

/datum/crafting_recipe/pulseslug
name = "Pulse Slug Shell"
result = /obj/item/ammo_casing/shotgun/pulseslug
Expand Down Expand Up @@ -255,18 +278,6 @@
category = CAT_WEAPONRY
subcategory = CAT_AMMO

/datum/crafting_recipe/improvisedbullet
name = "Improvised Revolver Shell"
result = /obj/item/ammo_casing/revolver/improvised
reqs = list(/obj/item/stack/sheet/metal = 1,
/obj/item/stack/cable_coil = 1,
/datum/reagent/fuel = 5)
tools = list(TOOL_SCREWDRIVER)
time = 2
category = CAT_WEAPONRY
subcategory = CAT_AMMO


/datum/crafting_recipe/improvisedslugoverload
name = "Overload Improvised Shell"
result = /obj/item/ammo_casing/shotgun/improvised/overload
Expand Down Expand Up @@ -302,8 +313,8 @@
subcategory = CAT_WEAPON

/datum/crafting_recipe/irevolver
name = "Improvised revolver"
result = /obj/item/gun/projectile/revolver/improvisedrevolver
name = "Improvised Revolver"
result = /obj/item/gun/projectile/revolver/improvised
reqs = list(/obj/item/weaponcrafting/receiver = 1,
/obj/item/stack/sheet/wood = 2,
/obj/item/stack/sheet/metal = 3,
Expand Down Expand Up @@ -1398,7 +1409,7 @@

/datum/crafting_recipe/makeshift_speedloader
name = "Makeshift Speedloader"
result = /obj/item/ammo_box/speedloader/improvisedrevolver
result = /obj/item/ammo_box/speedloader/improvised
time = 5 SECONDS
reqs = list(/obj/item/c_tube = 4,
/obj/item/stack/packageWrap = 10,
Expand Down
15 changes: 10 additions & 5 deletions code/modules/projectiles/ammunition.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
var/pellets = 1 //Pellets for spreadshot
var/variance = 0 //Variance for inaccuracy fundamental to the casing
var/delay = 0 //Delay for energy weapons
var/randomspread = 0 //Randomspread for automatics
var/randomspread = FALSE //Randomspread for automatics
var/click_cooldown_override = 0 //Override this to make your gun have a faster fire rate, in tenths of a second. 4 is the default gun cooldown.
var/harmful = TRUE //pacifism check for boolet, set to FALSE if bullet is non-lethal
var/leaves_residue //Остается ли порох на руках и одежде?
Expand Down Expand Up @@ -133,7 +133,7 @@
var/multiple_sprites = 0
var/icon_prefix // boxes with multiple sprites use this as their base
var/caliber
var/multiload = 1
var/multiload = TRUE
var/list/initial_mats
var/replacing_sound = 'sound/weapons/gun_interactions/shotguninsert.ogg'
var/remove_sound = 'sound/weapons/gun_interactions/remove_bullet.ogg'
Expand All @@ -154,7 +154,7 @@
stored_ammo = null
return ..()

/obj/item/ammo_box/proc/get_round(keep = 0)
/obj/item/ammo_box/proc/get_round(keep = FALSE)
if(!stored_ammo.len)
return null
else
Expand All @@ -167,8 +167,7 @@
return b

/obj/item/ammo_box/proc/give_round(obj/item/ammo_casing/R, replace_spent = FALSE)
// Boxes don't have a caliber type, magazines do. Not sure if it's intended or not, but if we fail to find a caliber, then we fall back to ammo_type.
if(!R || (caliber && R.caliber != caliber) || (!caliber && R.type != ammo_type))
if(!ammo_suitability(R))
return FALSE

if(stored_ammo.len < max_ammo)
Expand All @@ -192,6 +191,12 @@

return FALSE

/obj/item/ammo_box/proc/ammo_suitability(obj/item/ammo_casing/bullet)
// Boxes don't have a caliber type, magazines do. Not sure if it's intended or not, but if we fail to find a caliber, then we fall back to ammo_type.
if(!bullet || (caliber && bullet.caliber != caliber) || (!caliber && bullet.type != ammo_type))
return FALSE
return TRUE

/obj/item/ammo_box/proc/can_load(mob/user)
return TRUE

Expand Down
9 changes: 7 additions & 2 deletions code/modules/projectiles/ammunition/ammo_casings.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL

/obj/item/ammo_casing/c38/hp
desc = "A .38 Hollow-Point bullet casing"
desc = "A .38 Hollow-Point bullet casing."
icon_state = "rhp-casing"
materials = list(MAT_METAL = 5000)
projectile_type = /obj/item/projectile/bullet/hp38
Expand Down Expand Up @@ -171,13 +171,18 @@
/obj/item/ammo_casing/revolver/improvised
name = "improvised shell"
desc = "Full metal shell leaking oil. This is clearly an unreliable bullet."
icon_state = "improvisedrevolverbullet"
icon_state = "rev-improv-casing"
materials = list(MAT_METAL = 100)
caliber = ".257"
projectile_type = /obj/item/projectile/bullet/weakbullet3/c257
muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL

/obj/item/ammo_casing/revolver/improvised/phosphorus
desc = "Full metal shell leaking oil and phosphorous. This is clearly an unreliable bullet."
icon_state = "rev-phosphor-casing"
projectile_type = /obj/item/projectile/bullet/weakbullet3/c257/phosphorus

/obj/item/ammo_casing/n762
desc = "A 7.62x38mm bullet casing."
materials = list(MAT_METAL = 4000)
Expand Down
Loading

0 comments on commit 0101faa

Please sign in to comment.