Removing priority overlays, update_icon() splitup for guns.
This commit is contained in:
@@ -18,13 +18,15 @@
|
||||
/obj/item/gun/ballistic/automatic/proto/unrestricted
|
||||
pin = /obj/item/firing_pin
|
||||
|
||||
/obj/item/gun/ballistic/automatic/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/update_overlays()
|
||||
. = ..()
|
||||
if(automatic_burst_overlay)
|
||||
if(!select)
|
||||
add_overlay("[initial(icon_state)]semi")
|
||||
. += ("[initial(icon_state)]semi")
|
||||
if(select == 1)
|
||||
add_overlay("[initial(icon_state)]burst")
|
||||
. += "[initial(icon_state)]burst"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][magazine ? "-[magazine.max_ammo]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/attackby(obj/item/A, mob/user, params)
|
||||
@@ -115,8 +117,7 @@
|
||||
. = ..()
|
||||
empty_alarm()
|
||||
|
||||
/obj/item/gun/ballistic/automatic/c20r/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/c20r/update_icon_state()
|
||||
icon_state = "c20r[magazine ? "-[CEILING(get_ammo(0)/4, 1)*4]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/wt550
|
||||
@@ -141,9 +142,8 @@
|
||||
. = ..()
|
||||
spread = 0
|
||||
|
||||
/obj/item/gun/ballistic/automatic/wt550/update_icon()
|
||||
..()
|
||||
icon_state = "wt550[magazine ? "-[CEILING(( (get_ammo(FALSE) / magazine.max_ammo) * 20) /4, 1)*4]" : "-0"]" //Sprites only support up to 20.
|
||||
/obj/item/gun/ballistic/automatic/wt550/update_icon_state()
|
||||
icon_state = "wt550[magazine ? "-[CEILING(((get_ammo(FALSE) / magazine.max_ammo) * 20) /4, 1)*4]" : "-0"]" //Sprites only support up to 20.
|
||||
|
||||
/obj/item/gun/ballistic/automatic/mini_uzi
|
||||
name = "\improper Type U3 Uzi"
|
||||
@@ -160,6 +160,7 @@
|
||||
mag_type = /obj/item/ammo_box/magazine/m556
|
||||
fire_sound = 'sound/weapons/gunshot_smg.ogg'
|
||||
can_suppress = FALSE
|
||||
automatic_burst_overlay = FALSE
|
||||
var/obj/item/gun/ballistic/revolver/grenadelauncher/underbarrel
|
||||
burst_size = 3
|
||||
burst_shot_delay = 2
|
||||
@@ -191,18 +192,19 @@
|
||||
underbarrel.attackby(A, user, params)
|
||||
else
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/m90/update_icon()
|
||||
..()
|
||||
cut_overlays()
|
||||
/obj/item/gun/ballistic/automatic/m90/update_overlays()
|
||||
. = ..()
|
||||
switch(select)
|
||||
if(0)
|
||||
add_overlay("[initial(icon_state)]semi")
|
||||
. += "[initial(icon_state)]semi"
|
||||
if(1)
|
||||
add_overlay("[initial(icon_state)]burst")
|
||||
. += "[initial(icon_state)]burst"
|
||||
if(2)
|
||||
add_overlay("[initial(icon_state)]gren")
|
||||
. += "[initial(icon_state)]gren"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/m90/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][magazine ? "" : "-e"]"
|
||||
return
|
||||
|
||||
/obj/item/gun/ballistic/automatic/m90/burst_select()
|
||||
var/mob/living/carbon/human/user = usr
|
||||
switch(select)
|
||||
@@ -257,6 +259,7 @@
|
||||
weapon_weight = WEAPON_MEDIUM
|
||||
mag_type = /obj/item/ammo_box/magazine/m12g
|
||||
fire_sound = 'sound/weapons/gunshot.ogg'
|
||||
automatic_burst_overlay = FALSE
|
||||
can_suppress = FALSE
|
||||
burst_size = 1
|
||||
pin = /obj/item/firing_pin/implant/pindicate
|
||||
@@ -269,10 +272,13 @@
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/gun/ballistic/automatic/shotgun/bulldog/update_icon()
|
||||
cut_overlays()
|
||||
/obj/item/gun/ballistic/automatic/shotgun/bulldog/update_icon_state()
|
||||
return
|
||||
|
||||
/obj/item/gun/ballistic/automatic/shotgun/bulldog/update_overlays()
|
||||
. = ..()
|
||||
if(magazine)
|
||||
add_overlay("[magazine.icon_state]")
|
||||
. += "[magazine.icon_state]"
|
||||
icon_state = "bulldog[chambered ? "" : "-e"]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/shotgun/bulldog/afterattack()
|
||||
@@ -298,6 +304,7 @@
|
||||
burst_shot_delay = 1
|
||||
spread = 7
|
||||
pin = /obj/item/firing_pin/implant/pindicate
|
||||
automatic_burst_overlay = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/l6_saw/unrestricted
|
||||
pin = /obj/item/firing_pin
|
||||
@@ -316,7 +323,7 @@
|
||||
playsound(user, 'sound/weapons/sawclose.ogg', 60, 1)
|
||||
update_icon()
|
||||
|
||||
/obj/item/gun/ballistic/automatic/l6_saw/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/l6_saw/update_icon_state()
|
||||
icon_state = "l6[cover_open ? "open" : "closed"][magazine ? CEILING(get_ammo(0)/12.5, 1)*25 : "-empty"][suppressed ? "-suppressed" : ""]"
|
||||
item_state = "l6[cover_open ? "openmag" : "closedmag"]"
|
||||
|
||||
@@ -369,9 +376,10 @@
|
||||
zoom_amt = 10 //Long range, enough to see in front of you, but no tiles behind you.
|
||||
zoom_out_amt = 13
|
||||
slot_flags = ITEM_SLOT_BACK
|
||||
automatic_burst_overlay = FALSE
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/gun/ballistic/automatic/sniper_rifle/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/sniper_rifle/update_icon_state()
|
||||
if(magazine)
|
||||
icon_state = "sniper-mag"
|
||||
else
|
||||
@@ -397,9 +405,10 @@
|
||||
can_suppress = TRUE
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
slot_flags = ITEM_SLOT_BACK
|
||||
automatic_burst_overlay = FALSE
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/gun/ballistic/automatic/surplus/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/surplus/update_icon_state()
|
||||
if(magazine)
|
||||
icon_state = "surplus"
|
||||
else
|
||||
@@ -413,6 +422,7 @@
|
||||
icon_state = "oldrifle"
|
||||
item_state = "arg"
|
||||
mag_type = /obj/item/ammo_box/magazine/recharge
|
||||
automatic_burst_overlay = FALSE
|
||||
fire_delay = 2
|
||||
can_suppress = FALSE
|
||||
burst_size = 1
|
||||
@@ -420,7 +430,5 @@
|
||||
fire_sound = 'sound/weapons/laser.ogg'
|
||||
casing_ejector = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/laser/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/laser/update_icon_state()
|
||||
icon_state = "oldrifle[magazine ? "-[CEILING(get_ammo(0)/4, 1)*4]" : ""]"
|
||||
return
|
||||
|
||||
@@ -42,8 +42,7 @@
|
||||
actions_types = list()
|
||||
casing_ejector = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/gyropistol/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/gyropistol/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][magazine ? "loaded" : ""]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/speargun
|
||||
@@ -54,6 +53,7 @@
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
force = 10
|
||||
can_suppress = FALSE
|
||||
automatic_burst_overlay = FALSE
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/speargun
|
||||
fire_sound = 'sound/weapons/grenadelaunch.ogg'
|
||||
burst_size = 1
|
||||
@@ -62,8 +62,9 @@
|
||||
actions_types = list()
|
||||
casing_ejector = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/speargun/update_icon()
|
||||
return
|
||||
/obj/item/gun/ballistic/automatic/speargun/ComponentInitialize()
|
||||
. = ..()
|
||||
AddElement(/datum/element/update_icon_blocker)
|
||||
|
||||
/obj/item/gun/ballistic/automatic/speargun/attack_self()
|
||||
return
|
||||
@@ -137,7 +138,7 @@
|
||||
chamber_round()
|
||||
update_icon()
|
||||
|
||||
/obj/item/gun/ballistic/rocketlauncher/update_icon()
|
||||
/obj/item/gun/ballistic/rocketlauncher/update_icon_state()
|
||||
icon_state = "[initial(icon_state)]-[chambered ? "1" : "0"]"
|
||||
|
||||
/obj/item/gun/ballistic/rocketlauncher/suicide_act(mob/living/user)
|
||||
|
||||
@@ -75,8 +75,7 @@
|
||||
recoil = 2
|
||||
weapon_weight = WEAPON_HEAVY
|
||||
|
||||
/obj/item/gun/ballistic/automatic/magrifle/hyperburst/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/magrifle/hyperburst/update_icon_state()
|
||||
icon_state = "hyperburst[magazine ? "-[get_ammo()]" : ""][chambered ? "" : "-e"]"
|
||||
|
||||
///magpistol///
|
||||
@@ -92,12 +91,14 @@
|
||||
fire_delay = 2
|
||||
inaccuracy_modifier = 0.25
|
||||
cell_type = /obj/item/stock_parts/cell/magnetic/pistol
|
||||
automatic_burst_overlay = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/magrifle/pistol/update_icon()
|
||||
..()
|
||||
cut_overlays()
|
||||
/obj/item/gun/ballistic/automatic/magrifle/pistol/update_overlays()
|
||||
. = ..()
|
||||
if(magazine)
|
||||
add_overlay("magpistol-magazine")
|
||||
. += "magpistol-magazine"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/magrifle/pistol/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/magrifle/pistol/nopin
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
actions_types = list()
|
||||
automatic_burst_overlay = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/no_mag
|
||||
spawnwithmagazine = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/pistol/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/suppressed/Initialize(mapload)
|
||||
@@ -28,6 +28,7 @@
|
||||
icon = 'modular_citadel/icons/obj/guns/cit_guns.dmi'
|
||||
icon_state = "cde"
|
||||
can_unsuppress = TRUE
|
||||
automatic_burst_overlay = FALSE
|
||||
obj_flags = UNIQUE_RENAME
|
||||
unique_reskin = list("Default" = "cde",
|
||||
"N-99" = "n99",
|
||||
@@ -38,20 +39,18 @@
|
||||
"PX4 Storm" = "px4"
|
||||
)
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/modular/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/pistol/modular/update_icon_state()
|
||||
if(current_skin)
|
||||
icon_state = "[unique_reskin[current_skin]][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
else
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/modular/update_overlays()
|
||||
. = ..()
|
||||
if(magazine && suppressed)
|
||||
cut_overlays()
|
||||
add_overlay("[unique_reskin[current_skin]]-magazine-sup") //Yes, this means the default iconstate can't have a magazine overlay
|
||||
. += "[unique_reskin[current_skin]]-magazine-sup" //Yes, this means the default iconstate can't have a magazine overlay
|
||||
else if (magazine)
|
||||
cut_overlays()
|
||||
add_overlay("[unique_reskin[current_skin]]-magazine")
|
||||
else
|
||||
cut_overlays()
|
||||
. += "[unique_reskin[current_skin]]-magazine"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/m1911
|
||||
name = "\improper M1911"
|
||||
@@ -77,14 +76,14 @@
|
||||
force = 14
|
||||
mag_type = /obj/item/ammo_box/magazine/m50
|
||||
can_suppress = FALSE
|
||||
automatic_burst_overlay = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/deagle/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/pistol/deagle/update_overlays()
|
||||
. = ..()
|
||||
if(magazine)
|
||||
cut_overlays()
|
||||
add_overlay("deagle_magazine")
|
||||
else
|
||||
cut_overlays()
|
||||
. += "deagle_magazine"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/deagle/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/deagle/gold
|
||||
@@ -142,14 +141,14 @@
|
||||
actions_types = list()
|
||||
fire_sound = 'sound/weapons/blastcannon.ogg'
|
||||
spread = 20 //damn thing has no rifling.
|
||||
automatic_burst_overlay = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/antitank/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/pistol/antitank/update_overlays()
|
||||
. = ..()
|
||||
if(magazine)
|
||||
cut_overlays()
|
||||
add_overlay("atp-mag")
|
||||
else
|
||||
cut_overlays()
|
||||
. += "atp-mag"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/antitank/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/antitank/syndicate
|
||||
|
||||
@@ -348,10 +348,10 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need at least ten lengths of cable if you want to make a sling!</span>")
|
||||
|
||||
/obj/item/gun/ballistic/revolver/doublebarrel/improvised/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/revolver/doublebarrel/improvised/update_overlays()
|
||||
. = ..()
|
||||
if(slung)
|
||||
icon_state += "sling"
|
||||
. += "[icon_state]sling"
|
||||
|
||||
/obj/item/gun/ballistic/revolver/doublebarrel/improvised/sawoff(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -164,10 +164,10 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need at least ten lengths of cable if you want to make a sling!</span>")
|
||||
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/improvised/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/improvised/update_overlays()
|
||||
. = ..()
|
||||
if(slung)
|
||||
icon_state += "sling"
|
||||
. += "[icon_state]sling"
|
||||
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/enchanted
|
||||
name = "enchanted bolt action rifle"
|
||||
@@ -272,7 +272,7 @@
|
||||
spread = 2
|
||||
update_icon()
|
||||
|
||||
/obj/item/gun/ballistic/shotgun/automatic/combat/compact/update_icon()
|
||||
/obj/item/gun/ballistic/shotgun/automatic/combat/compact/update_icon_state()
|
||||
icon_state = "[current_skin ? unique_reskin[current_skin] : "cshotgun"][stock ? "" : "c"]"
|
||||
|
||||
//Dual Feed Shotgun
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
actions_types = list()
|
||||
automatic_burst_overlay = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/toy/pistol/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/toy/pistol/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/toy/pistol/riot
|
||||
|
||||
Reference in New Issue
Block a user