mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 18:22:14 +00:00
Makes toy/riot C20R45's show the correct dart types in their magazines (#84095)
 🆑 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. /🆑
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user