Changes AMMO_BOX_FULL_EMPTY to be either -full or -empty on a magazine, rather than the old behavior of using the max ammo of the magazine (#73736)

## About The Pull Request

As the title might imply:

AMMO_BOX_FULL_EMPTY will now look for sprites with -full and -empty,
rather than -[whatever the max ammo was] and -0
## Why It's Good For The Game

If a magazine is only going to have two states, that being having ammo
and not having ammo, why do I have to fuck with finding the capacity of
the magazine? On the other hand, why should anyone trying to change the
ammo count of a magazine have to fuck with the sprite naming for what
should otherwise just be a change of a var.
## Changelog
🆑
code: AMMO_BOX_FULL_EMPTY now looks for -full and -empty for sprites,
rather than -[max ammo of that magazine] and -0
/🆑
This commit is contained in:
Paxilmaniac
2023-03-04 23:47:12 -05:00
committed by GitHub
parent b1e629ea1f
commit ebeec530ff
6 changed files with 5 additions and 11 deletions
@@ -2465,16 +2465,13 @@
pixel_x = 2
},
/obj/item/ammo_box/magazine/m10mm{
icon_state = "9x19p-8";
pixel_x = -3;
pixel_y = 6
},
/obj/item/ammo_box/magazine/m10mm{
icon_state = "9x19p-8";
pixel_y = 3
},
/obj/item/ammo_box/magazine/m10mm{
icon_state = "9x19p-8";
pixel_x = 3
},
/obj/structure/extinguisher_cabinet/directional/east,
@@ -2701,16 +2698,13 @@
"iv" = (
/obj/structure/table,
/obj/item/ammo_box/magazine/m10mm{
icon_state = "9x19p-8";
pixel_x = -3;
pixel_y = 6
},
/obj/item/ammo_box/magazine/m10mm{
icon_state = "9x19p-8";
pixel_y = 3
},
/obj/item/ammo_box/magazine/m10mm{
icon_state = "9x19p-8";
pixel_x = 3
},
/obj/item/assembly/flash/handheld,
+1 -1
View File
@@ -216,7 +216,7 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
#define AMMO_BOX_ONE_SPRITE 0
///ammo box will have a different state for each bullet; <icon_state>-<bullets left>
#define AMMO_BOX_PER_BULLET 1
///ammo box will have a different state for full and empty; <icon_state>-max_ammo and <icon_state>-0
/// Ammo box will have a different sprite for any ammo at all, and no ammo, <icon_state>-full <icon_state>-empty
#define AMMO_BOX_FULL_EMPTY 2
#define SUPPRESSED_NONE 0
@@ -177,7 +177,7 @@
if(AMMO_BOX_PER_BULLET)
icon_state = "[multiple_sprite_use_base ? base_icon_state : initial(icon_state)]-[shells_left]"
if(AMMO_BOX_FULL_EMPTY)
icon_state = "[multiple_sprite_use_base ? base_icon_state : initial(icon_state)]-[shells_left ? "[max_ammo]" : "0"]"
icon_state = "[multiple_sprite_use_base ? base_icon_state : initial(icon_state)]-[shells_left ? "full" : "empty"]"
return ..()
/// Updates the amount of material in this ammo box according to how many bullets are left in it.
@@ -1,7 +1,7 @@
/obj/item/ammo_box/magazine/m10mm
name = "pistol magazine (10mm)"
desc = "A gun magazine."
icon_state = "9x19p-8"
icon_state = "9x19p-full"
base_icon_state = "9x19p"
ammo_type = /obj/item/ammo_casing/c10mm
caliber = CALIBER_10MM
@@ -42,7 +42,7 @@
/obj/item/ammo_box/magazine/m9mm
name = "pistol magazine (9mm)"
icon_state = "9x19p-8"
icon_state = "9x19p-full"
base_icon_state = "9x19p"
ammo_type = /obj/item/ammo_casing/c9mm
caliber = CALIBER_9MM
+1 -1
View File
@@ -1,7 +1,7 @@
/obj/item/ammo_box/magazine/m10mm/rifle
name = "rifle magazine (10mm)"
desc = "A well-worn magazine fitted for the surplus rifle."
icon_state = "75-8"
icon_state = "75-full"
base_icon_state = "75"
ammo_type = /obj/item/ammo_casing/c10mm
max_ammo = 10
Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 22 KiB