Skip to content

Commit

Permalink
Better mech ammo names and new ammo defines (tgstation#65817)
Browse files Browse the repository at this point in the history
Co-authored-by: TiviPlus <[email protected]>
  • Loading branch information
TiviPlus and TiviPlus authored Mar 31, 2022
1 parent f914e8e commit 7dff2d0
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 27 deletions.
18 changes: 13 additions & 5 deletions code/__DEFINES/mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,16 @@

// Some mechs must (at least for now) use snowflake handling of their UI elements, these defines are for that
// when changing MUST update the same-named tsx file constants
#define MECHA_SNOWFLAKE_ID_SLEEPER "sleeper_snowflake"
#define MECHA_SNOWFLAKE_ID_SYRINGE "syringe_snowflake"
#define MECHA_SNOWFLAKE_ID_MODE "mode_snowflake"
#define MECHA_SNOWFLAKE_ID_EXTINGUISHER "extinguisher_snowflake"
#define MECHA_SNOWFLAKE_ID_EJECTOR "ejector_snowflake"
#define MECHA_SNOWFLAKE_ID_SLEEPER "sleeper_snowflake"
#define MECHA_SNOWFLAKE_ID_SYRINGE "syringe_snowflake"
#define MECHA_SNOWFLAKE_ID_MODE "mode_snowflake"
#define MECHA_SNOWFLAKE_ID_EXTINGUISHER "extinguisher_snowflake"
#define MECHA_SNOWFLAKE_ID_EJECTOR "ejector_snowflake"

#define MECHA_AMMO_INCENDIARY "Incendiary bullet"
#define MECHA_AMMO_BUCKSHOT "Buckshot shell"
#define MECHA_AMMO_LMG "LMG bullet"
#define MECHA_AMMO_MISSILE_HE "HE missile"
#define MECHA_AMMO_MISSILE_AP "AP missile"
#define MECHA_AMMO_FLASHBANG "Flashbang"
#define MECHA_AMMO_CLUSTERBANG "Clusterbang"
4 changes: 2 additions & 2 deletions code/modules/vehicles/mecha/_mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@
else
gun.projectiles_cache = gun.projectiles_cache + ammo_needed
playsound(get_turf(user),A.load_audio,50,TRUE)
to_chat(user, span_notice("You add [ammo_needed] [A.round_term][ammo_needed > 1?"s":""] to the [gun.name]"))
to_chat(user, span_notice("You add [ammo_needed] [A.ammo_type][ammo_needed > 1?"s":""] to the [gun.name]"))
A.rounds = A.rounds - ammo_needed
if(A.custom_materials)
A.set_custom_materials(A.custom_materials, A.rounds / initial(A.rounds))
Expand All @@ -1284,7 +1284,7 @@
else
gun.projectiles_cache = gun.projectiles_cache + A.rounds
playsound(get_turf(user),A.load_audio,50,TRUE)
to_chat(user, span_notice("You add [A.rounds] [A.round_term][A.rounds > 1?"s":""] to the [gun.name]"))
to_chat(user, span_notice("You add [A.rounds] [A.ammo_type][A.rounds > 1?"s":""] to the [gun.name]"))
A.rounds = 0
A.set_custom_materials(list(/datum/material/iron=2000))
A.update_name()
Expand Down
21 changes: 8 additions & 13 deletions code/modules/vehicles/mecha/equipment/weapons/mecha_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
var/rounds = 0
var/round_term = "round"
var/direct_load //For weapons where we re-load the weapon itself rather than adding to the ammo storage.
var/load_audio = 'sound/weapons/gun/general/mag_bullet_insert.ogg'
var/ammo_type
Expand Down Expand Up @@ -38,45 +37,43 @@
/obj/item/mecha_ammo/examine(mob/user)
. = ..()
if(rounds)
. += "There [rounds > 1?"are":"is"] [rounds] [round_term][rounds > 1?"s":""] left."
. += "There [rounds > 1?"are":"is"] [rounds] [ammo_type][rounds > 1?"s":""] left."

/obj/item/mecha_ammo/incendiary
name = "incendiary ammo box"
desc = "A box of incendiary ammunition for use with exosuit weapons."
icon_state = "incendiary"
rounds = 24
ammo_type = "incendiary"
ammo_type = MECHA_AMMO_INCENDIARY

/obj/item/mecha_ammo/scattershot
name = "scattershot ammo box"
desc = "A box of scaled-up buckshot, for use in exosuit shotguns."
icon_state = "scattershot"
rounds = 40
ammo_type = "scattershot"
ammo_type = MECHA_AMMO_BUCKSHOT

/obj/item/mecha_ammo/lmg
name = "machine gun ammo box"
desc = "A box of linked ammunition, designed for the Ultra AC 2 exosuit weapon."
icon_state = "lmg"
rounds = 300
ammo_type = "lmg"
ammo_type = MECHA_AMMO_LMG

/obj/item/mecha_ammo/missiles_br
name = "breaching missiles"
desc = "A box of large missiles, ready for loading into a BRM-6 exosuit missile rack."
icon_state = "missile_br"
rounds = 6
round_term = "missile"
direct_load = TRUE
load_audio = 'sound/weapons/gun/general/mag_bullet_insert.ogg'
ammo_type = "missiles_br"
ammo_type = MECHA_AMMO_MISSILE_HE

/obj/item/mecha_ammo/missiles_he
name = "anti-armor missiles"
desc = "A box of large missiles, ready for loading into an SRM-8 exosuit missile rack."
icon_state = "missile_he"
icon_state = MECHA_AMMO_MISSILE_AP
rounds = 8
round_term = "missile"
direct_load = TRUE
load_audio = 'sound/weapons/gun/general/mag_bullet_insert.ogg'
ammo_type = "missiles_he"
Expand All @@ -87,14 +84,12 @@
desc = "A box of smooth flashbangs, for use with a large exosuit launcher. Cannot be primed by hand."
icon_state = "flashbang"
rounds = 6
round_term = "grenade"
ammo_type = "flashbang"
ammo_type = MECHA_AMMO_FLASHBANG

/obj/item/mecha_ammo/clusterbang
name = "launchable flashbang clusters"
desc = "A box of clustered flashbangs, for use with a specialized exosuit cluster launcher. Cannot be primed by hand."
icon_state = "clusterbang"
rounds = 3
round_term = "cluster"
direct_load = TRUE
ammo_type = "clusterbang"
ammo_type = MECHA_AMMO_CLUSTERBANG
14 changes: 7 additions & 7 deletions code/modules/vehicles/mecha/equipment/weapons/weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
projectiles_cache = 24
projectiles_cache_max = 96
harmful = TRUE
ammo_type = "incendiary"
ammo_type = MECHA_AMMO_INCENDIARY

/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/silenced
name = "\improper S.H.H. \"Quietus\" Carbine"
Expand All @@ -294,7 +294,7 @@
projectiles_per_shot = 4
variance = 25
harmful = TRUE
ammo_type = "scattershot"
ammo_type = MECHA_AMMO_BUCKSHOT

/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg
name = "\improper Ultra AC 2"
Expand All @@ -310,7 +310,7 @@
randomspread = 1
projectile_delay = 2
harmful = TRUE
ammo_type = "lmg"
ammo_type = MECHA_AMMO_LMG

/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack
name = "\improper SRM-8 missile rack"
Expand All @@ -324,7 +324,7 @@
disabledreload = TRUE
equip_cooldown = 60
harmful = TRUE
ammo_type = "missiles_he"
ammo_type = MECHA_AMMO_MISSILE_HE

/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/breaching
name = "\improper BRM-6 missile rack"
Expand All @@ -338,7 +338,7 @@
disabledreload = TRUE
equip_cooldown = 60
harmful = TRUE
ammo_type = "missiles_br"
ammo_type = MECHA_AMMO_MISSILE_AP


/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher
Expand Down Expand Up @@ -373,8 +373,8 @@
projectiles_cache_max = 24
missile_speed = 1.5
equip_cooldown = 60
ammo_type = MECHA_AMMO_FLASHBANG
var/det_time = 20
ammo_type = "flashbang"

/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang/proj_init(obj/item/grenade/flashbang/F, mob/user)
var/turf/T = get_turf(src)
Expand All @@ -391,7 +391,7 @@
disabledreload = TRUE
projectile = /obj/item/grenade/clusterbuster
equip_cooldown = 90
ammo_type = "clusterbang"
ammo_type = MECHA_AMMO_CLUSTERBANG

/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/banana_mortar
name = "banana mortar"
Expand Down

0 comments on commit 7dff2d0

Please sign in to comment.