Removing priority overlays, update_icon() splitup for guns.

This commit is contained in:
Ghommie
2020-08-20 18:33:23 +02:00
parent 20648fc1bb
commit fde859bca0
36 changed files with 295 additions and 303 deletions
@@ -35,6 +35,7 @@
slowdown = 1
item_flags = NO_MAT_REDEMPTION | SLOWS_WHILE_IN_HAND | NEEDS_PERMIT
pin = null
automatic_charge_overlays = FALSE
var/aiming = FALSE
var/aiming_time = 14
var/aiming_time_fire_threshold = 5
@@ -152,13 +153,13 @@
current_zoom_x = 0
current_zoom_y = 0
/obj/item/gun/energy/beam_rifle/update_icon()
cut_overlays()
/obj/item/gun/energy/beam_rifle/update_overlays()
. = ..()
var/obj/item/ammo_casing/energy/primary_ammo = ammo_type[1]
if(!QDELETED(cell) && (cell.charge > primary_ammo.e_cost))
add_overlay(charged_overlay)
. += charged_overlay
else
add_overlay(drained_overlay)
. += drained_overlay
/obj/item/gun/energy/beam_rifle/attack_self(mob/user)
if(!structure_piercing)
@@ -41,18 +41,16 @@
user.put_in_hands(bomb)
user.visible_message("<span class='warning'>[user] detaches [bomb] from [src].</span>")
bomb = null
name = initial(name)
desc = initial(desc)
update_icon()
return ..()
/obj/item/gun/blastcannon/update_icon()
/obj/item/gun/blastcannon/update_icon_state()
if(bomb)
icon_state = icon_state_loaded
name = "blast cannon"
desc = "A makeshift device used to concentrate a bomb's blast energy to a narrow wave."
else
icon_state = initial(icon_state)
name = initial(name)
desc = initial(desc)
/obj/item/gun/blastcannon/attackby(obj/O, mob/user)
if(istype(O, /obj/item/transfer_valve))
@@ -65,6 +63,8 @@
return FALSE
user.visible_message("<span class='warning'>[user] attaches [T] to [src]!</span>")
bomb = T
name = "blast cannon"
desc = "A makeshift device used to concentrate a bomb's blast energy to a narrow wave."
update_icon()
return TRUE
return ..()