Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 8 additions & 70 deletions code/modules/projectiles/guns/projectile/pistol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
mag_insert_sound = 'sound/effects/weapons/gun/pistol_magin.ogg'
mag_eject_sound = 'sound/effects/weapons/gun/pistol_magout.ogg'

/obj/item/gun/projectile/pistol/update_icon()
..()
if(ammo_magazine && ammo_magazine.stored_ammo.len)
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)]-e"

/obj/item/gun/projectile/pistol/secgun
name = ".45 pistol"
desc = "The NT Mk58 is a cheap, ubiquitous sidearm, produced by a NanoTrasen subsidiary. This one has a sweet wooden grip, among other modifications. Uses .45 rounds."
icon_state = "secguncomp"
magazine_type = /obj/item/ammo_magazine/c45m
allowed_magazines = /obj/item/ammo_magazine/c45m
caliber = ".45"
/obj/item/gun/projectile/pistol/secgun/update_icon()
..()
if(ammo_magazine && ammo_magazine.stored_ammo.len)
icon_state = "secguncomp"
else
icon_state = "secguncomp-e"

/obj/item/gun/projectile/pistol/secgun/flash
name = ".45 signal pistol"
Expand All @@ -30,13 +31,6 @@
icon_state = "secgundark"
accuracy = 0

/obj/item/gun/projectile/pistol/secgun/wood/update_icon()
..()
if(ammo_magazine && ammo_magazine.stored_ammo.len)
icon_state = "secgundark"
else
icon_state = "secgundark-e"

/obj/item/gun/projectile/pistol/colt
name = "vintage .45 pistol"
desc = "A cheap Martian knock-off of a Colt M1911. Uses .45 rounds."
Expand All @@ -46,27 +40,13 @@
caliber = ".45"
fire_sound = 'sound/effects/weapons/gun/fire_colt2.ogg'

/obj/item/gun/projectile/pistol/colt/update_icon()
..()
if(ammo_magazine && ammo_magazine.stored_ammo.len)
icon_state = "colt"
else
icon_state = "colt-e"

/obj/item/gun/projectile/pistol/colt/officer
name = "military .45 pistol"
desc = "The WT45 - a mass produced kinetic sidearm well-known in films and entertainment programming for being the daily carry choice issued to officers of the Sol Central Government Defense Forces. Uses .45 rounds."
icon_state = "usp"
accuracy = 0.35
fire_delay = 6.5

/obj/item/gun/projectile/pistol/colt/officer/update_icon()
..()
if(ammo_magazine && ammo_magazine.stored_ammo.len)
icon_state = "usp"
else
icon_state = "usp-e"

/obj/item/gun/projectile/pistol/vp78
name = "VP78"
desc = "The VT78 pistol is a common and reliable sidearm, used by security forces and colonial marshalls all over the world. Uses .45 rounds."
Expand All @@ -77,27 +57,13 @@
caliber = ".45"
accuracy = -0.35

/obj/item/gun/projectile/pistol/vp78/update_icon()
..()
if(ammo_magazine && ammo_magazine.stored_ammo.len)
icon_state = "VP78"
else
icon_state = "VP78-e"

/obj/item/gun/projectile/pistol/vp78/wood
name = "VP78 Special"
desc = "The VP78 pistol is a common and reliable sidearm, used by security forces and colonial marshalls all over the world. This one has a sweet wooden grip, among other modifications. Uses .45 rounds."
icon_state = "VP78wood"
accuracy = 0.35
fire_delay = 4.5

/obj/item/gun/projectile/pistol/vp78/wood/update_icon()
..()
if(ammo_magazine && ammo_magazine.stored_ammo.len)
icon_state = "VP78wood"
else
icon_state = "VP78wood-e"

/obj/item/gun/projectile/pistol/vp78/tactical
name = "VP78 Tactical"
desc = "The VT78 pistol is a common and reliable sidearm, used by security forces and colonial marshalls all over the world. This one is heavily modified and painted in green camo. Uses .45 rounds."
Expand All @@ -107,13 +73,6 @@
auto_eject_sound = 'sound/effects/weapons/misc/smg_empty_alarm.ogg'
fire_delay = 6.5

/obj/item/gun/projectile/pistol/vp78/tactical/update_icon()
..()
if(ammo_magazine && ammo_magazine.stored_ammo.len)
icon_state = "VP78tactic"
else
icon_state = "VP78tactic-e"

/obj/item/gun/projectile/pistol/silenced
name = "silenced pistol"
desc = "A handgun with an integral silencer. Uses .45 rounds."
Expand All @@ -129,14 +88,6 @@
magazine_type = /obj/item/ammo_magazine/c45m
allowed_magazines = /obj/item/ammo_magazine/c45m

// TODO(rufus): generalize this repeating "empty icon" boilerplate into a proc + controlling variable
/obj/item/gun/projectile/pistol/silenced/update_icon()
..()
if(ammo_magazine && ammo_magazine.stored_ammo.len)
icon_state = "silenced_pistol"
else
icon_state = "silenced_pistol-e"

/obj/item/gun/projectile/pistol/magnum_pistol
name = ".50 magnum pistol"
desc = "The HelTek Magnus, a robust terran handgun that uses .50 AE ammo."
Expand All @@ -153,13 +104,6 @@
allowed_magazines = /obj/item/ammo_magazine/a50
fire_sound = 'sound/effects/weapons/gun/fire2.ogg'

/obj/item/gun/projectile/pistol/magnum_pistol/update_icon()
..()
if(ammo_magazine && ammo_magazine.stored_ammo.len)
icon_state = "magnum"
else
icon_state = "magnum-e"

/obj/item/gun/projectile/pistol/gyropistol
name = "gyrojet pistol"
desc = "A bulky pistol designed to fire self propelled rounds."
Expand All @@ -178,6 +122,7 @@
fire_sound = 'sound/effects/weapons/gun/fire3.ogg'

/obj/item/gun/projectile/pistol/gyropistol/update_icon()
//TODO: Adjust this code to proc parent proc update_icon() & remove
..()
if(ammo_magazine)
icon_state = "gyropistolloaded"
Expand All @@ -199,13 +144,6 @@
allowed_magazines = /obj/item/ammo_magazine/mc9mm
fire_sound = 'sound/effects/weapons/gun/fire_9mm.ogg'

/obj/item/gun/projectile/pistol/det_m9/update_icon()
..()
if(ammo_magazine && ammo_magazine.stored_ammo.len)
icon_state = "det-m9"
else
icon_state = "det-m9-e"

/obj/item/gun/projectile/pistol/holdout
name = "holdout pistol"
desc = "The Lumoco Arms P3 Whisper. A small, easily concealable gun. Uses 9mm rounds."
Expand Down