mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
Unhardcodes mech ammo empty sprites (#70056)
* Does some code for improving mecha ammo sprites, de-hardcoding it for downstreams, and adds a var to delete itself when empty instead.
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
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
|
||||
/// whether to qdel this mecha_ammo when it becomes empty
|
||||
var/qdel_on_empty = FALSE
|
||||
|
||||
/obj/item/mecha_ammo/update_name()
|
||||
. = ..()
|
||||
@@ -20,7 +22,7 @@
|
||||
desc = rounds ? initial(desc) : "An exosuit ammuniton box that has since been emptied. It can be safely folded for recycling."
|
||||
|
||||
/obj/item/mecha_ammo/update_icon_state()
|
||||
icon_state = rounds ? initial(icon_state) : "empty"
|
||||
icon_state = rounds ? initial(icon_state) : "[initial(icon_state)]_e"
|
||||
return ..()
|
||||
|
||||
/obj/item/mecha_ammo/attack_self(mob/user)
|
||||
|
||||
@@ -418,6 +418,9 @@
|
||||
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.ammo_type][A.rounds > 1?"s":""] to the [gun.name]"))
|
||||
if(A.qdel_on_empty)
|
||||
qdel(A)
|
||||
return TRUE
|
||||
A.rounds = 0
|
||||
A.set_custom_materials(list(/datum/material/iron=2000))
|
||||
A.update_appearance()
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 874 B After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user