Fix miniature egun overlays

This commit is contained in:
Elizabeth Lavenza
2024-04-13 19:41:43 -04:00
parent 54f584fa80
commit e37fbc72e0
2 changed files with 9 additions and 2 deletions

View File

@@ -20,7 +20,9 @@
var/obj/item/stock_parts/cell/cell //What type of power cell this uses
var/cell_type = /obj/item/stock_parts/cell
var/modifystate = 0
var/modifystate = FALSE
/// If TRUE, when modifystate is TRUE this energy gun gets an overlay based on its selected shot type, like "[icon_state]_disable".
var/shot_type_overlay = TRUE
/// = TRUE/FALSE decides if the user can switch to it of their own accord
var/list/ammo_type = list(/obj/item/ammo_casing/energy = TRUE)
/// The index of the ammo_types/firemodes which we're using right now
@@ -259,6 +261,10 @@
var/ratio = get_charge_ratio()
if (modifystate)
var/obj/item/ammo_casing/energy/shot = ammo_type[current_firemode_index]
// Some guns, like the mini egun, don't have non-charge mode states. Remove or rework this check when that's fixed.
// Currently, it's entirely too hyperspecific; there's no way to have the non-charge overlay without the charge overlay, for example.
// Oh, well.
if (shot_type_overlay)
. += "[icon_state]_[shot.select_name]"
overlay_icon_state += "_[shot.select_name]"
if(ratio == 0)

View File

@@ -21,6 +21,7 @@
charge_sections = 3
gunlight_state = "mini-light"
can_flashlight = 0 // Can't attach or detach the flashlight, and override it's icon update
shot_type_overlay = FALSE
/obj/item/gun/energy/e_gun/mini/Initialize(mapload)
gun_light = new /obj/item/flashlight/seclite(src)