[MIRROR] Makes toy/riot C20R45's show the correct dart types in their magazines (#28370)

* Makes toy/riot C20R45's show the correct dart types in their magazines (#84095)

![image](https://github.com/tgstation/tgstation/assets/6209658/d8325450-1ca3-40d4-99d8-1dac74b7b1f1)

🆑 ShizCalev
image: Foam darts in the magazine of a toy/riot C20R45 will now show the
correct color corresponding to the type of said dart loaded in it
instead of a generic bullet sprite.
/🆑

* Makes toy/riot C20R45's show the correct dart types in their magazines

---------

Co-authored-by: Afevis <ShizCalev@users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-06-25 16:22:20 +05:30
committed by GitHub
co-authored by Afevis
parent 87c357dc0b
commit b775ad8ffb
4 changed files with 19 additions and 3 deletions
@@ -10,6 +10,8 @@
harmful = FALSE
var/modified = FALSE
var/static/list/insertable_items_hint = list(/obj/item/pen)
///For colored magazine overlays.
var/tip_color = "blue"
/obj/item/ammo_casing/foam_dart/Initialize(mapload)
. = ..()
@@ -56,4 +58,5 @@
projectile_type = /obj/projectile/bullet/foam_dart/riot
icon_state = "foamdart_riot"
base_icon_state = "foamdart_riot"
tip_color = "red"
custom_materials = list(/datum/material/iron = HALF_SHEET_MATERIAL_AMOUNT* 1.125)
+1 -1
View File
@@ -76,7 +76,7 @@
/obj/item/ammo_box/magazine/smgm45
name = "SMG magazine (.45)"
icon_state = "c20r45-24"
icon_state = "c20r45"
base_icon_state = "c20r45"
ammo_type = /obj/item/ammo_casing/c45
caliber = CALIBER_45
+15 -2
View File
@@ -29,17 +29,30 @@
/obj/item/ammo_box/magazine/toy/smgm45
name = "donksoft SMG magazine"
icon_state = "c20r45-toy"
base_icon_state = "c20r45"
base_icon_state = "c20r45-toy"
caliber = CALIBER_FOAM
ammo_type = /obj/item/ammo_casing/foam_dart
max_ammo = 20
/obj/item/ammo_box/magazine/toy/smgm45/update_icon_state()
. = ..()
icon_state = "[base_icon_state]-[round(ammo_count(), 2)]"
icon_state = "[base_icon_state]-base"
/obj/item/ammo_box/magazine/toy/smgm45/update_overlays()
. = ..()
if(!LAZYLEN(stored_ammo))
return
for(var/i in 1 to stored_ammo.len)
var/round_number = round(i, 2) //i meant the number of the round in the magazine, but i guess it's a round number too lol.
if(round_number == i) //only count odd numbers.
continue
var/obj/item/ammo_casing/foam_dart/boolet = stored_ammo[i]
. += "c20r45-foam-[boolet.tip_color]-[round_number]"
/obj/item/ammo_box/magazine/toy/smgm45/riot
icon_state = "c20r45-riot"
base_icon_state = "c20r45-riot"
ammo_type = /obj/item/ammo_casing/foam_dart/riot
/obj/item/ammo_box/magazine/toy/m762
Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 28 KiB