another day another ammo-related pr: RMB ejects, killing off a runtime, fixing an ammo issue (#23072)

* fixes and qol

* homing ammo (hilarious)

* i hate the black mesa gateway

* free code

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>

* me? gongaga

* forgot to check if it compiled lol

* the part where i hit spacebar

* forgot to hit spacebar again

* it compiled this time i swear

---------

Co-authored-by: Hatterhat <Hatterhat@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
This commit is contained in:
Hatterhat
2023-08-24 18:01:37 -04:00
committed by GitHub
co-authored by GoldenAlpharex Hatterhat Bloop
parent 9c1cba82b1
commit 6d56fb07d7
9 changed files with 127 additions and 78 deletions
+3 -3
View File
@@ -4676,7 +4676,7 @@
/turf/open/floor/iron/textured,
/area/awaymission/black_mesa/hecu_zone_atrium)
"ciB" = (
/obj/item/ammo_casing/a277/weak,
/obj/item/ammo_casing/a223/weak,
/turf/open/floor/iron/textured,
/area/awaymission/black_mesa/black_ops_entrance)
"ciK" = (
@@ -5570,8 +5570,8 @@
/turf/open/floor/iron/smooth_large,
/area/awaymission/black_mesa/high_security_surgery)
"dPS" = (
/obj/item/ammo_casing/a277/weak,
/obj/item/ammo_casing/a277/weak,
/obj/item/ammo_casing/a223/weak,
/obj/item/ammo_casing/a223/weak,
/turf/open/floor/iron/textured,
/area/awaymission/black_mesa/black_ops_entrance)
"dQa" = (
@@ -22,10 +22,8 @@
/// The caliber used by the Ripper gen2
#define CALIBER_B577 ".577 Snider"
/// The caliber used by the Oldarms 'Mk.11.4 rifle'
#define CALIBER_223 ".223 Stinger"
/// The caliber used by the Oldarms 'Mk.11.4 rifle', designed to be worse .223.
#define CALIBER_223S ".223 Stinger"
/// Caliber used by the giant anti materiel rifle in guncargo
#define CALIBER_60STRELA ".60 Strela"
#define CALIBER_A277 "a277"
@@ -10,27 +10,50 @@
* these updated, more consistent defines make it so that a single round's total materials should total 20% of a sheet, or 2 SMALL_MATERIAL_AMOUNT
*/
#define AMMO_MATS_BASIC list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 2)
#define AMMO_MATS_BASIC list( \
/datum/material/iron = SMALL_MATERIAL_AMOUNT * 2, \
)
#define AMMO_MATS_AP list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1.6,\
/datum/material/titanium = SMALL_MATERIAL_AMOUNT * 0.4)
#define AMMO_MATS_AP list( \
/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1.6, \
/datum/material/titanium = SMALL_MATERIAL_AMOUNT * 0.4, \
)
#define AMMO_MATS_TEMP list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1.6,\
/datum/material/plasma = SMALL_MATERIAL_AMOUNT * 0.4)
#define AMMO_MATS_TEMP list( \
/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1.6, \
/datum/material/plasma = SMALL_MATERIAL_AMOUNT * 0.4, \
)
#define AMMO_MATS_EMP list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1.6,\
/datum/material/uranium = SMALL_MATERIAL_AMOUNT * 0.4)
#define AMMO_MATS_EMP list( \
/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1.6, \
/datum/material/uranium = SMALL_MATERIAL_AMOUNT * 0.4, \
)
#define AMMO_MATS_PHASIC list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1.6,\
/datum/material/bluespace = SMALL_MATERIAL_AMOUNT * 0.4)
#define AMMO_MATS_PHASIC list( \
/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1.6, \
/datum/material/bluespace = SMALL_MATERIAL_AMOUNT * 0.4, \
)
#define AMMO_MATS_TRAC list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1.6,\
/datum/material/silver = SMALL_MATERIAL_AMOUNT * 0.2,\
/datum/material/gold = SMALL_MATERIAL_AMOUNT * 0.2)
#define AMMO_MATS_TRAC list( \
/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1.6, \
/datum/material/silver = SMALL_MATERIAL_AMOUNT * 0.2, \
/datum/material/gold = SMALL_MATERIAL_AMOUNT * 0.2, \
)
#define AMMO_MATS_HOMING list( \
/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1, \
/datum/material/silver = SMALL_MATERIAL_AMOUNT * 0.2, \
/datum/material/gold = SMALL_MATERIAL_AMOUNT * 0.2, \
/datum/material/plasma = SMALL_MATERIAL_AMOUNT * 0.2, \
/datum/material/diamond = SMALL_MATERIAL_AMOUNT * 0.2, \
/datum/material/bluespace = SMALL_MATERIAL_AMOUNT * 0.2, \
)
// for .35 Sol Ripper. one day, anon. one day
#define AMMO_MATS_RIPPER list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1.6,\
/datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.4)
#define AMMO_MATS_RIPPER list( \
/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1.6, \
/datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.4, \
)
/obj/item/ammo_casing
custom_materials = AMMO_MATS_BASIC
@@ -327,13 +350,23 @@
max_ammo = 20
// GUBMAN3 - FULL BULLET RENAME
// i loathe the above
/obj/item/ammo_casing/a277
// overrides for .310 Strilka-derived ammo, e.g. lionhunter ammo, because you don't want to give security the ability to print infinite wallhack ammo, right?
/obj/item/ammo_casing/strilka310/lionhunter
name = "hunter's rifle round"
can_be_printed = FALSE // trust me bro you dont wanna give security homing wallhack Better Rubbers
/obj/item/ammo_casing/strilka310/enchanted
name = "enchanted rifle round"
can_be_printed = FALSE // these are Really Really Better Rubbers
// overrides for tgcode's .223 (formerly 5.56), used in the M90-gl - renamed to .277 Aestus
/obj/item/ammo_casing/a223
name = ".277 Aestus casing"
desc = "A .277 bullet casing."
caliber = CALIBER_A277
/obj/item/ammo_casing/a277/phasic
/obj/item/ammo_casing/a223/phasic
name = ".277 Aestus phasic casing"
desc = "A .277 Aestus bullet casing.\
<br><br>\
@@ -343,9 +376,7 @@
// shotgun ammo overrides moved to modular_skyrat\modules\shotgunrebalance\code\shotgun.dm
// i'd've put more can_be_printed overrides for the cargo shells but, like... some of them actually do have defined materials so you can't just shit them out with metal?
// kinda weird that none of these others do but, whatever??
// overrides for tgcode .50cal, used in their sniper/anti-materiel rifles
/obj/item/ammo_casing/p50
name = ".416 Stabilis polymer casing"
desc = "A .416 bullet casing."
@@ -365,6 +396,7 @@
<br><br>\
<i>PENETRATOR: Goes through every surface, and every mob. Goes through everything. Yes, really.</i>"
// overrides for tgcode 4.6x30mm, used in the WT-550
/obj/item/ammo_casing/c46x30mm
name = "8mm Usurpator bullet casing"
desc = "An 8mm bullet casing."
@@ -385,6 +417,7 @@
custom_materials = AMMO_MATS_TEMP
advanced_print_req = TRUE
// overrides for tgcode .45, used in the M1911 and C20-r
/obj/item/ammo_casing/c45
name = ".460 Ceres bullet casing"
desc = "A .460 bullet casing."
@@ -405,12 +438,14 @@
custom_materials = AMMO_MATS_TEMP
advanced_print_req = TRUE
// overrides for .50AE, used in the deagle
/obj/item/ammo_casing/a50ae
name = ".454 Trucidator bullet casing"
desc = "A .454 Trucidator bullet casing. Extremely powerful.\
<br><br>\
<i>HAND CANNON: Fired out of a handgun, deals disproportionately large damage.</i>"
// overrides for .357, used in the .357 revolver
/obj/item/ammo_casing/a357 //We can keep the Magnum classic.
name = ".357 bullet casing"
desc = "A .357 bullet casing.\
@@ -418,11 +453,25 @@
<i>HAND CANNON: Fired out of a handgun, deals disproportionately large damage.</i>"
/obj/item/ammo_casing/a357/match
name = ".357 match bullet casing"
desc = "A .357 bullet casing, manufactured to exceedingly high standards.\
<br><br>\
<i>MATCH: Ricochets everywhere. Like crazy.</i>"
/obj/item/ammo_casing/a357/phasic
desc = "A .357 phasic bullet casing.\
<br><br>\
<i>PHASIC: Ignores all surfaces except organic matter.</i>"
advanced_print_req = TRUE
custom_materials = AMMO_MATS_PHASIC
/obj/item/ammo_casing/a357/heartseeker
desc = "A .357 heartseeker bullet casing.\
<br><br>\
<i>HEARTSEEKER: Has homing capabilities, methodology unknown.</i>"
advanced_print_req = TRUE
custom_materials = AMMO_MATS_HOMING // meme ammo. meme print cost
// overrides for .38 Special, used in the .38 revolvers, including the det's
/obj/item/ammo_box/c38
caliber = CALIBER_38
@@ -443,11 +492,11 @@
// The ones above are the casings for the ammo, whereas the ones below are the actual projectiles that give you feedback when you're shot
/obj/projectile/bullet/a277
/obj/projectile/bullet/a223
name = ".277 Aestus bullet"
/obj/projectile/bullet/a277/phasic
name = ".277 PHASE bullet"
/obj/projectile/bullet/a223/phasic
name = ".277 phasic bullet"
/obj/projectile/bullet/c9mm
name = "9x25mm bullet"
@@ -72,7 +72,6 @@
200000, \
MATCONTAINER_EXAMINE, \
allowed_items = /obj/item/stack, \
container_signals = list(COMSIG_MATCONTAINER_ITEM_CONSUMED = TYPE_PROC_REF(/obj/machinery/autolathe, AfterMaterialInsert)) \
)
. = ..()
set_wires(new /datum/wires/ammo_workbench(src))
@@ -275,9 +274,13 @@
creation_efficiency = base_efficiency
update_ammotypes()
/obj/machinery/ammo_workbench/proc/ejectItem()
/obj/machinery/ammo_workbench/proc/ejectItem(mob/living/user)
if(loaded_magazine)
loaded_magazine.forceMove(drop_location())
if(user)
try_put_in_hand(loaded_magazine, user)
loaded_magazine = null
busy = FALSE
error_message = ""
@@ -452,7 +455,7 @@
var/mat_capacity = 0
for(var/datum/stock_part/matter_bin/new_matter_bin in component_parts)
mat_capacity += new_matter_bin.tier * 75000
mat_capacity += new_matter_bin.tier * (40 * SHEET_MATERIAL_AMOUNT)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
materials.max_amount = mat_capacity
@@ -463,17 +466,6 @@
if(loaded_magazine)
. += "ammobench_loaded"
/obj/machinery/ammo_workbench/proc/AfterMaterialInsert(obj/item/item_inserted, id_inserted, amount_inserted)
if(istype(item_inserted, /obj/item/stack/ore/bluespace_crystal))
use_power(SHEET_MATERIAL_AMOUNT / 10)
else if(item_inserted.has_material_type(/datum/material/glass))
flick("autolathe_r", src)//plays glass insertion animation by default otherwise
else
flick("autolathe_o", src)//plays metal insertion animation
use_power(min(1000, amount_inserted / 100))
updateUsrDialog()
/obj/machinery/ammo_workbench/Destroy()
QDEL_NULL(wires)
if(timer_id)
@@ -511,6 +503,23 @@
else
return ..()
/obj/machinery/ammo_workbench/attack_hand_secondary(mob/user, list/modifiers)
. = ..()
if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN)
return
if(!can_interact(user) || !user.can_perform_action(src, ALLOW_SILICON_REACH | FORBID_TELEKINESIS_REACH))
return
ejectItem(user)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
/obj/machinery/ammo_workbench/attack_robot_secondary(mob/user, list/modifiers)
return attack_hand_secondary(user, modifiers)
/obj/machinery/ammo_workbench/attack_ai_secondary(mob/user, list/modifiers)
return attack_hand_secondary(user, modifiers)
/obj/machinery/ammo_workbench/proc/Insert_Item(obj/item/O, mob/living/user)
if(user.combat_mode)
@@ -33,31 +33,30 @@
desc = "A double-stack solid magazine that looks rather dated. Holds 20 rounds of .223 Stinger."
icon = 'modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_items.dmi'
icon_state = "m16"
ammo_type = /obj/item/ammo_casing/oldarms/a223
caliber = CALIBER_223
ammo_type = /obj/item/ammo_casing/oldarms/a223s
caliber = CALIBER_223S
max_ammo = 20
multiple_sprites = AMMO_BOX_FULL_EMPTY
/obj/item/ammo_casing/oldarms/a223
/obj/item/ammo_casing/oldarms/a223s
name = ".223 Stinger bullet casing"
desc = "A cheaply made .233 Stinger bullet casing."
caliber = CALIBER_223
projectile_type = /obj/projectile/bullet/oldarms/a223
desc = "A cheaply made .223 Stinger bullet casing."
caliber = CALIBER_223S
projectile_type = /obj/projectile/bullet/oldarms/a223s
/obj/projectile/bullet/oldarms/a223
/obj/projectile/bullet/oldarms/a223s
name = ".223 bullet"
damage = 26
armour_penetration = 5
wound_bonus = -20
/obj/item/ammo_casing/oldarms/a223/rubber
/obj/item/ammo_casing/oldarms/a223s/rubber
name = ".223 Stinger rubber bullet casing"
desc = "A cheaply made .233 Stinger bullet casing, now in rubber."
caliber = CALIBER_223
projectile_type = /obj/projectile/bullet/oldarms/a223/rubber
projectile_type = /obj/projectile/bullet/oldarms/a223s/rubber
/obj/projectile/bullet/oldarms/a223/rubber
name = ".223 Rubber"
/obj/projectile/bullet/oldarms/a223s/rubber
name = ".223 Rubber bullet"
damage = 5
stamina = 25
ricochets_max = 3
@@ -219,7 +219,7 @@
minimum_distance = 5
icon_state = "blackops_ranged"
icon_living = "blackops_ranged"
casingtype = /obj/item/ammo_casing/a277/weak
casingtype = /obj/item/ammo_casing/a223/weak
projectilesound = 'modular_skyrat/modules/gunsgalore/sound/guns/fire/m16_fire.ogg'
attack_sound = 'sound/weapons/punch1.ogg'
loot = list(/obj/effect/gibspawner/human, /obj/item/ammo_box/magazine/m16)
@@ -1,10 +1,10 @@
/obj/projectile/bullet/a277/weak
/obj/projectile/bullet/a223/weak
name = "surplus .277 bullet"
damage = 25
armour_penetration = 10
wound_bonus = -40
/obj/item/ammo_casing/a277/weak
/obj/item/ammo_casing/a223/weak
name = ".277 surplus bullet casing"
desc = "A .277 surplus bullet casing."
projectile_type = /obj/projectile/bullet/a277/weak
projectile_type = /obj/projectile/bullet/a223/weak
@@ -28,8 +28,8 @@
desc = "A double-stack translucent polymer magazine for use with the XM-2537 rifles. Holds 30 rounds of .277 Aestus."
icon = 'modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_items.dmi'
icon_state = "m16e"
ammo_type = /obj/item/ammo_casing/a277
caliber = CALIBER_A277
ammo_type = /obj/item/ammo_casing/a223
caliber = CALIBER_A223
max_ammo = 30
multiple_sprites = AMMO_BOX_FULL_EMPTY
@@ -38,8 +38,6 @@
desc = "A double-stack solid magazine that looks rather dated. Holds 20 rounds of .277 Aestus."
icon = 'modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_items.dmi'
icon_state = "m16"
ammo_type = /obj/item/ammo_casing/a277
caliber = CALIBER_A277
max_ammo = 20
multiple_sprites = AMMO_BOX_FULL_EMPTY
@@ -73,7 +71,5 @@
desc = "A double-stack solid polymer drum made for use with the Amans Patriae rifle. Holds 50 rounds of .277 ammo."
icon = 'modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_items.dmi'
icon_state = "m16"
ammo_type = /obj/item/ammo_casing/a277
caliber = CALIBER_A277
max_ammo = 50
multiple_sprites = AMMO_BOX_FULL_EMPTY
@@ -9,7 +9,7 @@
// 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
* .460 Ceres (renamed tgcode .45)
*/
/obj/item/ammo_casing/c45/rubber
@@ -45,7 +45,7 @@
weak_against_armour = TRUE
/*
* 8mm Usurpator
* 8mm Usurpator (renamed tg c46x30mm, used in the WT550)
*/
/obj/projectile/bullet/c46x30mm_rubber
@@ -70,19 +70,18 @@
harmful = FALSE
/*
* .277 Aestus
* .277 Aestus (renamed tgcode .223, used in the M-90gl)
*/
/obj/item/ammo_casing/a277/rubber
/obj/item/ammo_casing/a223/rubber
name = ".277 rubber bullet casing"
desc = "A .277 rubber bullet casing.\
<br><br>\
<i>RUBBER: Less than lethal ammo. Deals both stamina damage and regular damage.</i>"
caliber = CALIBER_A277
projectile_type = /obj/projectile/bullet/a277/rubber
projectile_type = /obj/projectile/bullet/a223/rubber
harmful = FALSE
/obj/projectile/bullet/a277/rubber
/obj/projectile/bullet/a223/rubber
name = ".277 rubber bullet"
damage = 10
armour_penetration = 10
@@ -96,17 +95,16 @@
embedding = null
wound_bonus = -50
/obj/item/ammo_casing/a277/ap
/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?"
caliber = CALIBER_A277
projectile_type = /obj/projectile/bullet/a277/ap
projectile_type = /obj/projectile/bullet/a223/ap
advanced_print_req = TRUE
custom_materials = AMMO_MATS_AP
/obj/projectile/bullet/a277/ap
/obj/projectile/bullet/a223/ap
name = ".277 armor-piercing bullet"
armour_penetration = 60