Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gun Resprite #20431

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions code/game/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@
'sound/weapons/gunshot/gunshot2.ogg',
'sound/weapons/gunshot/gunshot3.ogg',
'sound/weapons/gunshot/musket.ogg',
'sound/weapons/gunshot/slammer.ogg'
'sound/weapons/gunshot/plasma.ogg'
)

/singleton/sound_category/gunshots/ballistic
Expand All @@ -798,7 +798,7 @@
'sound/weapons/gunshot/gunshot2.ogg',
'sound/weapons/gunshot/gunshot3.ogg',
'sound/weapons/gunshot/musket.ogg',
'sound/weapons/gunshot/slammer.ogg'
'sound/weapons/gunshot/plasma.ogg'
)

/singleton/sound_category/gunshots/energy
Expand Down
11 changes: 4 additions & 7 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
desc_info = "This is a gun. To fire the weapon, ensure your intent is *not* set to 'help', have your gun mode set to 'fire', \
then click where you want to fire."
icon = 'icons/obj/guns/pistol.dmi'
var/gun_gui_icons = 'icons/obj/guns/gun_gui.dmi'
icon_state = "pistol"
item_state = "pistol"
contained_sprite = TRUE
Expand Down Expand Up @@ -154,7 +153,6 @@
var/tmp/lock_time = -100
var/safety_state = TRUE
var/has_safety = TRUE
var/image/safety_overlay

var/iff_capable = FALSE // if true, applies the user's ID iff_faction to the projectile

Expand Down Expand Up @@ -198,11 +196,10 @@
underlays += I

if(has_safety)
CutOverlays(safety_overlay, ATOM_ICON_CACHE_PROTECTED)
safety_overlay = null
if(!isturf(loc)) // In a mob, holster or bag or something
safety_overlay = image(gun_gui_icons,"[safety()]")
AddOverlays(safety_overlay, ATOM_ICON_CACHE_PROTECTED)
if(safety_state)
check_maptext(SMALL_FONTS(7, SPAN_COLOR(COLOR_BRIGHT_GREEN, "S")))
else
check_maptext(SMALL_FONTS(7, SPAN_RED("F")))

if(is_wieldable)
if(wielded)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/projectiles/guns/energy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
desc_info = "This is an energy weapon. To fire this weapon, toggle the safety with ctrl-click (or enable HARM intent), \
then click where you want to fire. Most energy weapons can fire through windows harmlessly. To recharge this weapon, use a weapon recharger."
icon = 'icons/obj/guns/ecarbine.dmi'
icon_state = "energykill100"
item_state = "energykill100"
icon_state = "energykill"
item_state = "energykill"
fire_sound = 'sound/weapons/Taser.ogg'
fire_sound_text = "laser blast"
update_icon_on_init = TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/energy/blaster.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
item_state = "himeoblaster"
projectile_type = /obj/projectile/energy/blaster
usesound = 'sound/weapons/plasma_cutter.ogg'
fire_sound = 'sound/weapons/gunshot/slammer.ogg'
fire_sound = 'sound/weapons/gunshot/plasma.ogg'
cell_type = /obj/item/cell/hydrogen
needspin = FALSE // can't remove the cell if it has a pin
charge_cost = 500 // 20 mag
Expand Down
6 changes: 2 additions & 4 deletions code/modules/projectiles/guns/energy/laser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "laser carbine"
desc = "A NanoTrasen G40E carbine, designed to kill with concentrated energy blasts."
icon = 'icons/obj/guns/laserrifle.dmi'
icon_state = "laserrifle100"
item_state = "laserrifle100"
icon_state = "laser"
item_state = "laser"
has_item_ratio = FALSE // the back and suit slots have ratio sprites but the in-hands dont
fire_sound = 'sound/weapons/laser1.ogg'
slot_flags = SLOT_BELT|SLOT_BACK
Expand All @@ -17,8 +17,6 @@
turret_is_lethal = 1
turret_sprite_set = "laser"

modifystate = "laserrifle"

/obj/item/gun/energy/laser/mounted
name = "mounted laser carbine"
has_safety = FALSE
Expand Down
6 changes: 4 additions & 2 deletions code/modules/projectiles/guns/energy/rifle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
desc = "A NanoTrasen designed laser weapon, designed to kill with concentrated energy blasts."
desc_extended = "The NT LR-6 is a laser rifle developed and produced by NanoTrasen. Designed to kill with concentrated energy blasts focused through a crystal lens. It is considered to be the template of other standard laser weaponry."
icon = 'icons/obj/guns/laserrifle.dmi'
icon_state = "laserrifle"
item_state = "laserrifle"
icon_state = "laser"
item_state = "laser"
has_item_ratio = FALSE // the back and suit slots have ratio sprites but the in-hands dont
fire_sound = 'sound/weapons/laser1.ogg'
max_shots = 15
Expand All @@ -62,6 +62,8 @@
/obj/item/gun/energy/rifle/laser/practice
name = "practice laser rifle"
desc = "A modified version of the NT LR-6. It fires less concentrated laser beams that are visible, but ultimately harmless, designed for target practice."
icon_state = "laserp"
item_state = "laser"
projectile_type = /obj/projectile/beam/practice

/obj/item/gun/energy/rifle/laser/noctiluca
Expand Down
8 changes: 8 additions & 0 deletions code/modules/projectiles/guns/launcher/grenade_launcher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

needspin = FALSE

is_wieldable = TRUE

var/blacklisted_grenades = list(
/obj/item/grenade/flashbang/clusterbang,
/obj/item/grenade/frag
Expand Down Expand Up @@ -79,6 +81,9 @@
return TRUE

/obj/item/gun/launcher/grenade/unique_action(mob/user)
if(!wielded)
to_chat(user, SPAN_WARNING("You can't pump \the [src] without wielding it first!"))
return
pump(user)

/obj/item/gun/launcher/grenade/attackby(obj/item/attacking_item, mob/user)
Expand Down Expand Up @@ -116,6 +121,9 @@
force = 11
max_grenades = 0

/obj/item/gun/launcher/grenade/underslung/unique_action(mob/user)
pump(user)

//load and unload directly into chambered
/obj/item/gun/launcher/grenade/underslung/load(obj/item/grenade/G, mob/user)
if(chambered)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/projectile/automatic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
desc = "A variant of the ZI Bulldog assault carbine, the ZI Terrier is a slimmer and lighter version, only capable of accepting smaller magazines. \
It also lacks the integrated grenade launcher and burst fire of the Bulldog."
desc_extended = "It makes you feel like a corporate goon when you hold it."
icon = 'icons/obj/guns/crew_rifle.dmi'
icon = 'icons/obj/guns/civcarbine.dmi'
magazine_type = /obj/item/ammo_magazine/a556/carbine/polymer
allowed_magazines = list(/obj/item/ammo_magazine/a556/carbine, /obj/item/ammo_magazine/a556/carbine/polymer)
icon_state = "civcarbine"
Expand Down
50 changes: 26 additions & 24 deletions code/modules/projectiles/guns/projectile/plasma.dm
Original file line number Diff line number Diff line change
@@ -1,44 +1,60 @@
/obj/item/gun/projectile/plasma
name = "plasma shotgun"
desc = "A marvel of Elyran weapons technology which utilizes superheated plasma to pierce thick armor with gruesome results."
icon = 'icons/obj/guns/slammer.dmi'
icon_state = "slammer"
item_state = "slammer"
icon = 'icons/obj/guns/plasma.dmi'
icon_state = "plasma"
item_state = "plasma"
w_class = WEIGHT_CLASS_BULKY
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 3)
ammo_type = /obj/item/ammo_casing/plasma_slug
magazine_type = /obj/item/ammo_magazine/plasma
allowed_magazines = list(/obj/item/ammo_magazine/plasma)
caliber = "plasma slug"
fire_sound = 'sound/weapons/gunshot/slammer.ogg'
fire_sound = 'sound/weapons/gunshot/plasma.ogg'
load_method = MAGAZINE
handle_casings = DELETE_CASINGS
fire_delay = ROF_HEAVY
is_wieldable = TRUE

/obj/item/gun/projectile/plasma/special_check(mob/user)
if(!wielded && is_wieldable)
to_chat(user, SPAN_WARNING("You can't fire without stabilizing \the [src]!"))
return FALSE
return ..()

/obj/item/gun/projectile/plasma/update_icon()
..()
if(ammo_magazine)
icon_state = "[initial(icon_state)]"
var/ratio = length(ammo_magazine.stored_ammo) / ammo_magazine.max_ammo
if(!length(ammo_magazine.stored_ammo))
ratio = 0
else
ratio = max((round(ratio, 0.25) * 100), 25)
icon_state = "[initial(icon_state)][ratio]"
item_state = "[initial(item_state)][ratio]"
else
icon_state = "[initial(icon_state)]-empty"
item_state = "[initial(item_state)]-empty"
..()

/obj/item/gun/projectile/plasma/bolter
name = "plasma bolter"
desc = "A miniaturized, less efficient version of the infamous plasma slammer. Sacrifices much of its power for a more compact frame."
icon = 'icons/obj/guns/bolter.dmi'
icon_state = "bolter"
item_state = "bolter"
icon = 'icons/obj/guns/plasma_bolter.dmi'
icon_state = "plasma_bolter"
item_state = "plasma_bolter"
w_class = WEIGHT_CLASS_NORMAL
ammo_type = /obj/item/ammo_casing/plasma_bolt
magazine_type = /obj/item/ammo_magazine/plasma/light
allowed_magazines = list(/obj/item/ammo_magazine/plasma/light)
caliber = "plasma bolt"
fire_sound = 'sound/weapons/gunshot/bolter.ogg'
fire_delay = ROF_RIFLE
is_wieldable = FALSE

/obj/item/gun/energy/mountedplasma
name = "plasma cannon"
fire_sound = 'sound/weapons/gunshot/slammer.ogg'
icon_state = "plasma_turret"
fire_sound = 'sound/weapons/gunshot/plasma.ogg'
burst = 2
burst_delay = 3
max_shots = 15
Expand All @@ -58,17 +74,3 @@
slot_flags = SLOT_BELT | SLOT_HOLSTER
accuracy = 1
fire_delay = ROF_INTERMEDIATE

/obj/item/gun/projectile/plasma/bolter/pistol/update_icon()
..()
if(ammo_magazine)
var/ratio = length(ammo_magazine.stored_ammo) / ammo_magazine.max_ammo
if(!length(ammo_magazine.stored_ammo))
ratio = 0
else
ratio = max((round(ratio, 0.25) * 100), 25)
icon_state = "[initial(icon_state)][ratio]"
item_state = "[initial(item_state)][ratio]"
else
icon_state = "[initial(icon_state)]-empty"
item_state = "[initial(item_state)]-empty"
61 changes: 61 additions & 0 deletions html/changelogs/wezzy-gun_resprite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# - (fixes bugs)
# wip
# - (work in progress)
# qol
# - (quality of life)
# soundadd
# - (adds a sound)
# sounddel
# - (removes a sound)
# rscadd
# - (adds a feature)
# rscdel
# - (removes a feature)
# imageadd
# - (adds an image or sprite)
# imagedel
# - (removes an image or sprite)
# spellcheck
# - (fixes spelling or grammar)
# experiment
# - (experimental change)
# balance
# - (balance changes)
# code_imp
# - (misc internal code change)
# refactor
# - (refactors code)
# config
# - (makes a change to the config files)
# admin
# - (makes changes to administrator tools)
# server
# - (miscellaneous changes to server)
#################################

# Your name.
author: Wowzewow (Wezzy)

# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True

# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
changes:
- rscadd: "Resprites the laser rifle, energy carbine, laser shotgun, energy rifle, lawgiver, grenade launcher, combat shotgun, bullpup carbine, 9mm SMG, LWAP, plasma bolter, grenade launcher and plasma slammer."
- bugfix: "Grenade launcher now has a back sprite."
- tweak : "You now need to wield the grenade launcher to pump it. No more one-handed pumping."
- tweak : "You can now wield the plasma slammer. To look cool."
alsoandanswer marked this conversation as resolved.
Show resolved Hide resolved
Binary file removed icons/obj/guns/bolter.dmi
Binary file not shown.
Binary file modified icons/obj/guns/carbine.dmi
Binary file not shown.
Binary file added icons/obj/guns/civcarbine.dmi
Binary file not shown.
Binary file removed icons/obj/guns/crew_rifle.dmi
Binary file not shown.
Binary file modified icons/obj/guns/cshotgun.dmi
Binary file not shown.
Binary file modified icons/obj/guns/ecarbine.dmi
Binary file not shown.
Binary file modified icons/obj/guns/erifle.dmi
Binary file not shown.
Binary file modified icons/obj/guns/grenade_launcher.dmi
Binary file not shown.
Binary file modified icons/obj/guns/laserrifle.dmi
Binary file not shown.
Binary file modified icons/obj/guns/lasershotgun.dmi
Binary file not shown.
Binary file modified icons/obj/guns/lawgiver.dmi
Binary file not shown.
Binary file added icons/obj/guns/plasma.dmi
Binary file not shown.
Binary file added icons/obj/guns/plasma_bolter.dmi
Binary file not shown.
Binary file modified icons/obj/guns/plasma_pistol.dmi
Binary file not shown.
Binary file removed icons/obj/guns/slammer.dmi
Binary file not shown.
Binary file modified icons/obj/guns/sniper.dmi
Binary file not shown.
Binary file modified icons/obj/guns/wt550.dmi
Binary file not shown.
File renamed without changes.
Loading