Skip to content

Commit

Permalink
TGS Test Merge (#6072)
Browse files Browse the repository at this point in the history
  • Loading branch information
Blue authored and Blue committed Oct 19, 2023
2 parents d0d215f + 8c8c7df commit 6ff7aa2
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 140 deletions.
4 changes: 3 additions & 1 deletion code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
var/fire_sound_text = "gunshot"
var/fire_anim = null
var/recoil = 0 //screen shake
var/silenced = 0
var/suppressible = FALSE
var/silenced = FALSE
var/silenced_icon = null
var/muzzle_flash = 3
var/accuracy = 65 //Accuracy is measured in percents. +15 accuracy means that everything is effectively one tile closer for the purpose of miss chance, -15 means the opposite. launchers are not supported, at the moment.
var/scoped_accuracy = null
Expand Down
28 changes: 28 additions & 0 deletions code/modules/projectiles/guns/ballistic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
allowed_magazines += /obj/item/ammo_magazine/smart
update_icon()

/obj/item/gun/ballistic/update_icon_state()
. = ..()
var/silenced_state = silenced ? silenced_icon : initial(icon_state)
var/magazine_state = ammo_magazine ? "" : "-empty"
if(magazine_type)
icon_state = "[silenced_state][magazine_state]"

/obj/item/gun/ballistic/consume_next_projectile()
//get the next casing
if(loaded.len)
Expand Down Expand Up @@ -236,6 +243,27 @@
..()
load_ammo(A, user)

if(suppressible)
if(istype(A, /obj/item/silencer))
if(!user.is_holding(src)) //if we're not in his hands
to_chat(user, "<span class='notice'>You'll need [src] in your hands to do that.</span>")
return CLICKCHAIN_DO_NOT_PROPAGATE
if(!user.attempt_insert_item_for_installation(A, src))
return CLICKCHAIN_DO_NOT_PROPAGATE
to_chat(user, "<span class='notice'>You screw [A] onto [src].</span>")
silenced = TRUE
w_class = ITEMSIZE_NORMAL
update_icon()
return CLICKCHAIN_DO_NOT_PROPAGATE
else if(istype(A, /obj/item/tool/wrench))
if(silenced)
var/obj/item/silencer/S = new (get_turf(user))
to_chat(user, "<span class='notice'>You unscrew [S]] from [src].</span>")
user.put_in_hands(S)
silenced = FALSE
w_class = ITEMSIZE_SMALL
update_icon()

/obj/item/gun/ballistic/attack_self(mob/user)
if(firemodes.len > 1)
switch_firemodes(user)
Expand Down
22 changes: 6 additions & 16 deletions code/modules/projectiles/guns/projectile/automatic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/obj/item/gun/ballistic/automatic/advanced_smg
name = "advanced SMG"
desc = "The NT-S3W is an advanced submachine gun design, using a reflective laser optic for increased accuracy over competing models. Chambered for 9mm rounds."
icon_state = "advanced_smg-empty"
icon_state = "advanced_smg"
w_class = ITEMSIZE_NORMAL
load_method = MAGAZINE
caliber = "9mm"
Expand All @@ -31,10 +31,6 @@
list(mode_name="3-round bursts", burst=3, fire_delay=null, move_delay=4, burst_accuracy=list(60,30,20), dispersion=list(0.0, 0.3, 0.6))
)

/obj/item/gun/ballistic/automatic/advanced_smg/update_icon_state()
. = ..()
icon_state = (ammo_magazine)? "advanced_smg" : "advanced_smg-empty"

/obj/item/gun/ballistic/automatic/advanced_smg/loaded
magazine_type = /obj/item/ammo_magazine/m9mmAdvanced

Expand Down Expand Up @@ -95,8 +91,6 @@
. = ..()
if(istype(ammo_magazine,/obj/item/ammo_magazine/m556/small))
icon_state = "arifle-small" // If using the small magazines, use the small magazine sprite.
else
icon_state = (ammo_magazine)? "arifle" : "arifle-empty"

/obj/item/gun/ballistic/automatic/sts35/update_icon(ignore_inhands)
. = ..()
Expand Down Expand Up @@ -335,7 +329,7 @@
name = "automatic shotgun"
desc = "The AS-24 is a rugged looking automatic shotgun produced for the military by Gurov Projectile Weapons LLC. For very obvious reasons, it's illegal to own in many juristictions. Uses 12g rounds."
icon_state = "ashot"
item_state = null
item_state = "ashot"
w_class = ITEMSIZE_LARGE
damage_force = 10
caliber = "12g"
Expand Down Expand Up @@ -436,7 +430,7 @@

/obj/item/gun/ballistic/automatic/p90/update_icon_state()
. = ..()
icon_state = "p90smg-[ammo_magazine ? round(ammo_magazine.stored_ammo.len, 6) : "empty"]"
icon_state = "p90smg-[ammo_magazine ? round(ammo_magazine.stored_ammo.len, 6) : "e"]"

/obj/item/gun/ballistic/automatic/p90/custom
name = "custom personal defense weapon"
Expand All @@ -448,7 +442,7 @@

/obj/item/gun/ballistic/automatic/p90/custom/update_icon_state()
. = ..()
icon_state = "p90smgC-[ammo_magazine ? round(ammo_magazine.stored_ammo.len, 6) : "empty"]"
icon_state = "p90smgC-[ammo_magazine ? round(ammo_magazine.stored_ammo.len, 6) : "e"]"

/obj/item/gun/ballistic/automatic/tommygun
name = "\improper Tommy Gun"
Expand Down Expand Up @@ -498,10 +492,6 @@
. = ..()
if(istype(ammo_magazine,/obj/item/ammo_magazine/m762))
icon_state = "bullpup-small"
else if(istype(ammo_magazine,/obj/item/ammo_magazine/m762m))
icon_state = "bullpup"
else
item_state = "bullpup-empty"

/obj/item/gun/ballistic/automatic/bullpup/update_icon()
. = ..()
Expand Down Expand Up @@ -572,7 +562,7 @@
name = "Holy automatic shotgun"
desc = "Based off of an ancient design, this hand crafted weapon has been gilded with the gold of melted icons and inscribed with sacred runes and hexagrammic wards. Works best with blessed 12g rounds."
icon_state = "holyshotgun"
item_state = null
item_state = "holy_shot"
w_class = ITEMSIZE_LARGE
heavy = TRUE
damage_force = 10
Expand All @@ -596,7 +586,7 @@
if(ammo_magazine)
icon_state = "holyshotgun"
else
icon_state = "holyshotgun_empty"
icon_state = "holyshotgun-empty"

//Clown Rifle
/obj/item/gun/ballistic/automatic/clown_rifle
Expand Down
134 changes: 14 additions & 120 deletions code/modules/projectiles/guns/projectile/pistol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
icon_state = initial(icon_state)
else
if(unique_reskin)
icon_state = "[unique_reskin]-e"
icon_state = "[unique_reskin]-empty"
else
icon_state = "[initial(icon_state)]-e"
icon_state = "[initial(icon_state)]-empty"

/obj/item/gun/ballistic/colt/detective
desc = "A Martian recreation of an old pistol. Uses .45 rounds."
Expand Down Expand Up @@ -92,13 +92,6 @@
origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 2)
load_method = MAGAZINE

/obj/item/gun/ballistic/sec/update_icon_state()
. = ..()
if(ammo_magazine)
icon_state = "secguncomp"
else
icon_state = "secguncomp-e"

/obj/item/gun/ballistic/sec/flash
name = ".45 signal pistol"
magazine_type = /obj/item/ammo_magazine/m45/flash
Expand All @@ -108,13 +101,6 @@
name = "custom .45 pistol"
icon_state = "secgundark"

/obj/item/gun/ballistic/sec/wood/update_icon_state()
. = ..()
if(ammo_magazine)
icon_state = "secgundark"
else
icon_state = "secgundark-e"

/obj/item/gun/ballistic/silenced
name = "silenced pistol"
desc = "A small, quiet, easily concealable gun. Uses .45 rounds."
Expand Down Expand Up @@ -142,13 +128,6 @@
magazine_type = /obj/item/ammo_magazine/m44
allowed_magazines = list(/obj/item/ammo_magazine/m44)

/obj/item/gun/ballistic/deagle/update_icon_state()
. = ..()
if(ammo_magazine)
icon_state = "[initial(icon_state)]"
else
icon_state = "[initial(icon_state)]-e"

/obj/item/gun/ballistic/deagle/gold
desc = "A gold plated gun folded over a million times by superior martian gunsmiths. Uses .44 rounds."
icon_state = "deagleg"
Expand Down Expand Up @@ -179,73 +158,26 @@
auto_eject = 1
auto_eject_sound = 'sound/weapons/smg_empty_alarm.ogg'

/obj/item/gun/ballistic/gyropistol/update_icon_state()
. = ..()
if(ammo_magazine)
icon_state = "gyropistolloaded"
else
icon_state = "gyropistol"

/obj/item/gun/ballistic/pistol
name = "compact pistol"
desc = "The Lumoco Arms P3 Whisper. A compact, easily concealable gun, though it's only compatible with compact magazines. Uses 9mm rounds."
desc = "An ultra-compact pistol with a matte black finish. Uses 9mm."
description_fluff = "The Lumoco Arms P3 Whisper is a compact, easily concealable gun. Designed by GMC as a simplified improvement to the Konigin, the Whisper comes with a threaded barrel and slender profile. This weapon was favored by Syndicate special operatives during the Phoron War, and retains a somewhat sinister reputation to this day. Due to its slim design it is only compatible with compact 9mm magazines."
icon_state = "pistol"
item_state = null
w_class = ITEMSIZE_SMALL
caliber = "9mm"
silenced = 0
suppressible = TRUE
silenced_icon = "pistol_silencer"
origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 2, TECH_ILLEGAL = 2)
load_method = MAGAZINE
magazine_type = /obj/item/ammo_magazine/m9mm/compact
allowed_magazines = list(/obj/item/ammo_magazine/m9mm/compact)
projectile_type = /obj/projectile/bullet/pistol

/obj/item/gun/ballistic/pistol/update_icon_state()
. = ..()
if(ammo_magazine)
icon_state = "[initial(icon_state)]"
else
icon_state = "[initial(icon_state)]-e"

/obj/item/gun/ballistic/pistol/flash
name = "compact signal pistol"
magazine_type = /obj/item/ammo_magazine/m9mm/compact/flash

/obj/item/gun/ballistic/pistol/attack_hand(mob/user, list/params)
if(user.get_inactive_held_item() == src)
if(silenced)
if(!user.is_holding(src))
..()
return
to_chat(user, "<span class='notice'>You unscrew [silenced] from [src].</span>")
user.put_in_hands(silenced)
silenced = 0
w_class = ITEMSIZE_SMALL
update_icon()
return
..()

/obj/item/gun/ballistic/pistol/attackby(obj/item/I as obj, mob/living/user as mob)
if(istype(I, /obj/item/silencer))
if(!user.is_holding(src)) //if we're not in his hands
to_chat(user, "<span class='notice'>You'll need [src] in your hands to do that.</span>")
return CLICKCHAIN_DO_NOT_PROPAGATE
if(!user.attempt_insert_item_for_installation(I, src))
return CLICKCHAIN_DO_NOT_PROPAGATE
to_chat(user, "<span class='notice'>You screw [I] onto [src].</span>")
silenced = I //dodgy?
w_class = ITEMSIZE_NORMAL
update_icon()
return CLICKCHAIN_DO_NOT_PROPAGATE
return ..()

/obj/item/gun/ballistic/pistol/update_icon_state()
. = ..()
if(silenced)
icon_state = "pistol-silencer"
else
icon_state = "pistol"

/obj/item/silencer
name = "silencer"
desc = "a silencer"
Expand Down Expand Up @@ -345,13 +277,6 @@
allowed_magazines = list(/obj/item/ammo_magazine/m9mm/compact)
projectile_type = /obj/projectile/bullet/pistol

/obj/item/gun/ballistic/luger/update_icon_state()
. = ..()
if(ammo_magazine)
icon_state = "[initial(icon_state)]"
else
icon_state = "[initial(icon_state)]-e"

/obj/item/gun/ballistic/luger/brown
icon_state = "p08b"

Expand All @@ -365,13 +290,6 @@
magazine_type = /obj/item/ammo_magazine/m9mm
allowed_magazines = list(/obj/item/ammo_magazine/m9mm) // Can accept illegal large capacity magazines, or compact magazines.

/obj/item/gun/ballistic/p92x/update_icon_state()
. = ..()
if(ammo_magazine)
icon_state = "[initial(icon_state)]"
else
icon_state = "[initial(icon_state)]-e"

/obj/item/gun/ballistic/p92x/sec
desc = "A widespread sidearm called the P92X which is used by military, police, and security forces across the galaxy. This one is a less-lethal variant that only accepts 9mm rubber or flash magazines."
magazine_type = /obj/item/ammo_magazine/m9mm/rubber
Expand Down Expand Up @@ -422,25 +340,20 @@
allowed_magazines = list(/obj/item/ammo_magazine/mcompressedbio/compact)
projectile_type = /obj/projectile/bullet/organic

/obj/item/gun/ballistic/clown_pistol/update_icon_state()
. = ..()
if(ammo_magazine)
icon_state = "[initial(icon_state)]"
else
icon_state = "[initial(icon_state)]-e"

//Hey did you ever see Kingsman? Well, you know this gun then.
/obj/item/gun/ballistic/konigin
name = "Konigin-63 compact"
desc = "Originally produced in 2463 by GMC, the Konigin is generally considered to be a direct ancestor to the P3 Whisper. By the time GMC ended production, the Konigin-63 had undergone significant design changes - including the installment of a single capacity shotgun on the underbarrel. This rare design is certainly inspired, and has become something of a collector's item post-war."
desc = "A compact pistol with an underslung single-round shotgun barrel. Uses 9mm."
description_fluff = "Originally produced in 2463 by GMC, the Konigin is considered to be the direct ancestor to the P3 Whisper. Considerably more expensive to manufacture and maintain, the Konigin saw limited use outside of Syndicate special operations cells. By the time GMC ended production of the Konigin-63, the weapon had undergone significant design changes - most notably the installment of a single capacity underbarrel shotgun. This rare design is certainly inspired, and has become something of a collector's item post-war."
icon_state = "konigin"
item_state = null
w_class = ITEMSIZE_SMALL
caliber = "9mm"
silenced = 0
suppressible = TRUE
silenced_icon = "konigin_silencer"
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 2, TECH_ILLEGAL = 3)
load_method = MAGAZINE
magazine_type = /obj/item/ammo_magazine/m9mm/compact
magazine_type = /obj/item/ammo_magazine/m9mm/compact/double
allowed_magazines = list(/obj/item/ammo_magazine/m9mm/compact)
projectile_type = /obj/projectile/bullet/pistol

Expand Down Expand Up @@ -477,13 +390,6 @@
else
..()

/obj/item/gun/ballistic/konigin/update_icon_state()
. = ..()
if(ammo_magazine)
icon_state = "[initial(icon_state)]"
else
icon_state = "[initial(icon_state)]-e"

/* Having issues with getting this to work atm.
/obj/item/gun/ballistic/konigin/examine(mob/user, dist)
. = ..()
Expand Down Expand Up @@ -517,9 +423,9 @@
else if(extended && ammo_magazine)
icon_state = "ntles_extended"
else if(extended && !ammo_magazine)
icon_state = "ntles_extended-e"
icon_state = "ntles_extended-empty"
else
icon_state = "ntles-e"
icon_state = "ntles-empty"

/obj/item/gun/ballistic/ntles/attack_self(mob/user, obj/item/gun/G)
if(collapsible && !extended)
Expand Down Expand Up @@ -558,11 +464,6 @@
. = ..()
if(istype(ammo_magazine,/obj/item/ammo_magazine/m57x28mm/fiveseven/highcap))
icon_state = "fiveseven-extended"
else
if(ammo_magazine)
icon_state = "fiveseven"
else
icon_state = "fiveseven-e"

//Apidean Weapons
/obj/item/gun/ballistic/apinae_pistol
Expand All @@ -580,7 +481,7 @@

/obj/item/gun/ballistic/apinae_pistol/update_icon_state()
. = ..()
icon_state = "apipistol-[ammo_magazine ? round(ammo_magazine.stored_ammo.len, 2) : "empty"]"
icon_state = "apipistol-[ammo_magazine ? round(ammo_magazine.stored_ammo.len, 2) : "e"]"

//Tyrmalin Weapons
/obj/item/gun/ballistic/pirate/junker_pistol
Expand Down Expand Up @@ -609,13 +510,6 @@
allowed_magazines = list(/obj/item/ammo_magazine/mfoam/pistol)
fire_sound = 'sound/items/syringeproj.ogg'

/obj/item/gun/ballistic/pistol/foam/update_icon_state()
. = ..()
if(ammo_magazine)
icon_state = "[initial(icon_state)]"
else
icon_state = "[initial(icon_state)]-e"

/obj/item/gun/ballistic/pistol/foam/handle_suicide(mob/living/user)
user.show_message("<span class = 'warning'>You feel rather silly, trying to commit suicide with a toy.</span>")
mouthshoot = 0
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/projectile/semiauto.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@

/obj/item/gun/ballistic/apinae_stinger/update_icon_state()
. = ..()
icon_state = "apigun-[ammo_magazine ? round(ammo_magazine.stored_ammo.len, 2) : "empty"]"
icon_state = "apigun-[ammo_magazine ? round(ammo_magazine.stored_ammo.len, 2) : "e"]"
Loading

0 comments on commit 6ff7aa2

Please sign in to comment.