Files
0bbe65c881 AmmuNation update PT 1 (#5758)
## About The Pull Request
The ammunitions workbench is Security's (And some others'!) tool for
refilling ammo boxes, magazines and so on. It's one of the pieces of
Skyrat kit I actually enjoyed, but it's got some big problems! In its
current state it has a number of long-standing faults nobody was doing
anything about, a pretty significant one being that it throws a runtime
every single time you interact with it. This PR repairs those faults and
brings the machine in line with the rest of the station's lathey things.

Fixes:

- **Runtimes on every interaction.** The machine called
`default_deconstruction_crowbar()` with the wrong arguments, so
inserting anything (a magazine, an ammo box, a datadisk) threw `Cannot
read null.tool_behaviour`. That has been fixed.
- **Material handling now matches other lathes.** It previously used a
weird old menu. It now uses the standard UI for lathes and shit:
workbenches placed on the map connect to the ore silo at roundstart,
newly built ones can be linked with a multitool.

Additions:

- **Recycle function.** A loaded container can be emptied back into
materials, mirroring the existing recycler/autolathe, etc. This means no
more ugly piles of random bullets on the ground! It also has snazzy
previews, jokes and shit built into the tooltips/UI. This is a complete
overhaul.
- **Emag support.** Emagging the workbench unlocks its full catalogue,
consistent with other restricted fabricators. Wire-cutting remains as an
option too. (Basically just instant hacking with no electrocution risk)
- **Prefilled mapping variant.**
`/obj/machinery/ammo_workbench/prefilled` spawns with mid-tier parts and
a modest local material stock for away missions, ruins, and custom maps,
so it works without also placing loose sheets and a datadisk. I was
debating making it spawn with ammo designs already in it. But decided
against it.

## Why It's Good For The Game

We inherited this machine from Skyrat, and it sucked, behaves unlike any
comparable machine on the station; eye searing green UI. It runtimed on
every interaction, and was just generally a roach hotel of bugginess.
The recycle function is also something nice I've wanted for a long time,
and the prefilled variant should come in handy. Also a lot of people
gave me the "let it connect to the silo" feedback and nobody told me
"no" so here we go.

## Proof Of Testing

<img width="931" height="957" alt="image"
src="https://github.com/user-attachments/assets/a0fc7acb-30e7-4d54-9e49-7227b86af730"
/>
<img width="1650" height="1164" alt="image"
src="https://github.com/user-attachments/assets/31e8a28b-64bc-4d73-aa48-4b978e122168"
/>
<img width="913" height="879" alt="image"
src="https://github.com/user-attachments/assets/7a2287fd-ee51-42bf-9491-6bbfa7a497cb"
/>

</details>

## Changelog
🆑
fix: The ammunitions workbench no longer runtimes every time you
interact with it.
qol: The ammunitions workbench now draws from the ore silo like other
lathes, and newly built ones can be linked with a multitool.
add: The ammunitions workbench can now recycle a loaded container back
into materials.
add: The ammunitions workbench can be emagged to unlock its full
catalogue.
/🆑

---------

Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com>
2026-06-14 12:10:39 -04:00

88 lines
2.7 KiB
Plaintext

/obj/item/ammo_casing
/// Can this bullet casing be printed at an ammunition workbench?
var/can_be_printed = TRUE
/// If it can be printed, does this casing require an advanced ammunition datadisk? Mainly for specialized ammo.
/// Rubbers aren't advanced. Standard ammo (or FMJ if you're particularly pedantic) isn't advanced.
/// Think more specialized or weird, niche ammo, like armor-piercing, incendiary, hollowpoint, or God forbid, phasic.
var/advanced_print_req = FALSE
/// Optional hex color (e.g. "#d85a30") shown as a tip-dot beside this round in the ammo workbench UI. Null shows a neutral dot.
var/workbench_tip_color = null
// whatever goblin decided to spread out bullets over like 3 files and god knows however many overrides i wish you a very stubbed toe
/*
* .460 Ceres (renamed tgcode .45)
*/
/obj/item/ammo_casing/c45/hp
name = ".460 Ceres hollow-point bullet casing"
desc = "A .460 hollow-point bullet casing. Very lethal against unarmored opponents. Suffers against armor."
projectile_type = /obj/projectile/bullet/c45/hp
advanced_print_req = TRUE
/obj/projectile/bullet/c45/hp
name = ".460 Ceres hollow-point bullet"
damage = 40
weak_against_armour = TRUE
/*
* .277 Aestus (renamed tgcode .223, used in the M-90gl)
*/
/obj/item/ammo_casing/a223/ap
name = ".277 Aestus armor-piercing bullet casing"
desc = "A .277 armor-piercing bullet casing.\
<br><br>\
<i>ARMOR PIERCING: Increased armor piercing capabilities. What did you expect?"
projectile_type = /obj/projectile/bullet/a223/ap
advanced_print_req = TRUE
custom_materials = AMMO_MATS_AP
/obj/projectile/bullet/a223/ap
name = ".277 armor-piercing bullet"
armour_penetration = 60
/*
* .34 ACP
*/
// Why? Blame CFA, they want their bullets to be *proprietary*
/obj/item/ammo_casing/c34
name = ".34 bullet casing"
desc = "A .34 bullet casing."
caliber = "c34acp"
projectile_type = /obj/projectile/bullet/c34
/obj/projectile/bullet/c34
name = ".34 bullet"
damage = 15
wound_bonus = 0
/obj/item/ammo_casing/c34/ap
name = ".34 armor-piercing bullet casing"
desc = "A .34 armor-piercing bullet casing."
caliber = "c34acp"
projectile_type = /obj/projectile/bullet/c34/ap
custom_materials = AMMO_MATS_AP
advanced_print_req = TRUE
/obj/projectile/bullet/c34/ap
name = ".34 armor-piercing bullet"
damage = 15
armour_penetration = 40
wound_bonus = -75
/obj/item/ammo_casing/c34_incendiary
name = ".34 incendiary bullet casing"
desc = "A .34 incendiary bullet casing."
caliber = "c34acp"
projectile_type = /obj/projectile/bullet/incendiary/c34_incendiary
custom_materials = AMMO_MATS_TEMP
advanced_print_req = TRUE
/obj/projectile/bullet/incendiary/c34_incendiary
name = ".34 incendiary bullet"
damage = 8
fire_stacks = 1
wound_bonus = -90