Skip to content

Commit

Permalink
Replaces PTSD with service/officer pistols (#11106)
Browse files Browse the repository at this point in the history
* Replaces PTSD with a service pistol

* Sprite fixes

* Removes the PTSD

* Fixes the icons

* Removes the hole in the middle of the gun's sprite

* Fixes an issue with compilation

* Update recharger.dm

* Corrects grammar

* Adds an EMP effect to rechargable magazines

* Description issue

* Magazine sprite update

* Fixes missing icon

* Fixes energy gun duplicate icon glitch
  • Loading branch information
PowerfulBacon authored Aug 8, 2024
1 parent 8b2f535 commit 6c4ff2d
Show file tree
Hide file tree
Showing 16 changed files with 108 additions and 20 deletions.
13 changes: 12 additions & 1 deletion code/game/machinery/recharger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
. += "<span class='notice'>- Recharging <b>[recharge_coeff*10]%</b> cell charge per cycle.</span>"
if(charging)
var/obj/item/stock_parts/cell/C = charging.get_cell()
if(C)
if (istype(charging, /obj/item/ammo_box/magazine/recharge))
var/obj/item/ammo_box/magazine/recharge/magazine = charging
. += "<span class='notice'>- \The [charging]'s cell is at <b>[magazine.ammo_count() / magazine.max_ammo]%</b>.</span>"
else if(C)
. += "<span class='notice'>- \The [charging]'s cell is at <b>[C.percent()]%</b>.</span>"
else
. += "<span class='notice'>- \The [charging] has no power cell installed.</span>"
Expand Down Expand Up @@ -85,6 +88,14 @@
var/obj/item/gun/energy/E = G
if(!E.can_charge)
to_chat(user, "<span class='notice'>Your gun has no external power connector.</span>")
balloon_alert(user, "This gun cannot be charged.")
return 1

if (istype(G, /obj/item/gun/ballistic))
var/obj/item/gun/ballistic/gun = G
if (ispath(gun.mag_type, /obj/item/ammo_box/magazine/recharge))
to_chat(user, "<span class='notice'>You need to charge the magazine of this gun!</span>")
balloon_alert(user, "Remove the magazine first!")
return 1

if(!user.transferItemToLoc(G, src))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
new /obj/item/assembly/flash/handheld(src)
new /obj/item/storage/box/suitbox/ce_tools(src)
new /obj/item/clothing/glasses/meson/engine(src)
new /obj/item/gun/energy/e_gun/mini/heads(src)
new /obj/item/gun/ballistic/automatic/pistol/service/ce(src)

/obj/item/storage/box/suitbox/ce_tools
name = "compression box of chief engineer tools"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
new /obj/item/assembly/flash/handheld(src)
new /obj/item/healthanalyzer/advanced(src)
new /obj/item/wallframe/defib_mount(src)
new /obj/item/gun/energy/e_gun/mini/heads(src)
new /obj/item/gun/ballistic/automatic/pistol/service/cmo(src)

/obj/item/storage/box/suitbox/cmo
name = "compression box of chief medical officer outfits"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
new /obj/item/clothing/glasses/science(src)
new /obj/item/door_remote/research_director(src)
new /obj/item/assembly/flash/handheld(src)
new /obj/item/gun/energy/e_gun/mini/heads(src)
new /obj/item/gun/ballistic/automatic/pistol/service/rd(src)

/obj/item/storage/box/suitbox/rd
name = "compression box of research director outfits"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
new /obj/item/clothing/neck/cloak/cap(src)
new /obj/item/door_remote/captain(src)
new /obj/item/storage/belt/sabre(src)
new /obj/item/gun/energy/e_gun/mini/heads(src)
new /obj/item/gun/ballistic/automatic/pistol/service/captain(src)

/obj/item/storage/box/suitbox/cap
name = "compression box of captain outfits"
Expand Down Expand Up @@ -90,7 +90,7 @@
new /obj/item/clothing/glasses/sunglasses/advanced(src)
new /obj/item/clothing/suit/armor/vest/alt(src)
new /obj/item/megaphone/command(src)
new /obj/item/gun/energy/e_gun/mini/heads(src)
new /obj/item/gun/ballistic/automatic/pistol/service/hop(src)


/obj/item/storage/box/suitbox/hop
Expand Down Expand Up @@ -167,6 +167,7 @@
new /obj/item/clothing/suit/armor/hos/trenchcoat(src)
new /obj/item/shield/riot/tele(src)
new /obj/item/storage/belt/security/full(src)
new /obj/item/gun/ballistic/automatic/pistol/service/hos(src)

/obj/item/storage/box/suitbox/hos
name = "compression box of head of security outfits"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/head_of_security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
gloves = /obj/item/clothing/gloves/color/black
head = /obj/item/clothing/head/hats/hos/beret
glasses = /obj/item/clothing/glasses/hud/security/sunglasses
suit_store = /obj/item/gun/energy/e_gun/mini/heads
suit_store = /obj/item/gun/energy/disabler
r_pocket = /obj/item/modular_computer/tablet/pda/heads/head_of_security

backpack = /obj/item/storage/backpack/security
Expand Down
6 changes: 6 additions & 0 deletions code/modules/projectiles/ammunition/caseless/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
fire_sound = 'sound/weapons/laser.ogg'
firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect/energy

/obj/item/ammo_casing/caseless/laser/bounce_away(still_warm, bounce_delay)
qdel(src)

/obj/item/ammo_casing/caseless/laser/gatling
projectile_type = /obj/projectile/beam/weak/penetrator
variance = 0.8
click_cooldown_override = 1

/obj/item/ammo_casing/caseless/laser/lesslethal
projectile_type = /obj/projectile/beam/laser/lesslethal
33 changes: 33 additions & 0 deletions code/modules/projectiles/boxes_magazines/external/rechargable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,36 @@

/obj/item/ammo_box/magazine/recharge/attack_self() //No popping out the "bullets"
return

/obj/item/ammo_box/magazine/recharge/emp_act(severity)
. = ..()
if (obj_flags & OBJ_EMPED)
return
obj_flags |= OBJ_EMPED
playsound(src, 'sound/machines/capacitor_discharge.ogg', 60, TRUE)
addtimer(CALLBACK(src, PROC_REF(emp_reset)), rand(1, 200 / severity))
// Unload the gun we are inside
if (isgun(loc))
var/obj/item/gun/gun = loc
QDEL_NULL(gun.chambered)

/obj/item/ammo_box/magazine/recharge/proc/emp_reset()
obj_flags &= ~OBJ_EMPED
playsound(src, 'sound/machines/capacitor_charge.ogg', 100, TRUE)

/obj/item/ammo_box/magazine/recharge/get_round(keep = FALSE)
if (obj_flags & OBJ_EMPED)
return null
return ..()

/obj/item/ammo_box/magazine/recharge/service
name = "energy pistol magazine"
desc = "A rechargeable energy pack used by service pistols."
icon_state = "officer-10"
max_ammo = 10
multiple_sprites = 1
ammo_type = /obj/item/ammo_casing/caseless/laser/lesslethal

/obj/item/ammo_box/magazine/recharge/service/update_icon()
..()
icon_state = "officer-[round(ammo_count(),2)]"
45 changes: 45 additions & 0 deletions code/modules/projectiles/guns/ballistic/pistol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,48 @@
to_chat(user, "<span class='notice'>..and falls into view. Whew, that was a close one.</span>")
user.dropItemToGround(src)


// ==================================
// Officer's Pistol
// ==================================

/obj/item/gun/ballistic/automatic/pistol/service
name = "service pistol"
desc = "A commemorative pistol given to Nanotrasen officers designed to use higher densities of energy to emulate the ballistic service pistols that they replaced. \
It primarilly serves as a symbol of power, but has proven to be an effective tool at enforcing the power that is portrays. \
It fires less-lethal rounds which stun the area of the body that they burn."
icon_state = "officer"
w_class = WEIGHT_CLASS_NORMAL
mag_type = /obj/item/ammo_box/magazine/recharge/service
can_suppress = FALSE
fire_sound = 'sound/weapons/laser.ogg'
casing_ejector = FALSE
fire_rate = 4
can_suppress = FALSE
worn_icon_state = "officer_pistol"
var/stripe_state = "officer_com"

/obj/item/gun/ballistic/automatic/pistol/service/update_icon()
. = ..()
var/mutable_appearance/stripe = mutable_appearance(icon, stripe_state)
if (bolt_locked)
stripe.pixel_x = -5
add_overlay(stripe)

/obj/item/gun/ballistic/automatic/pistol/service/captain
stripe_state = "officer_com"

/obj/item/gun/ballistic/automatic/pistol/service/hop
stripe_state = "officer_srv"

/obj/item/gun/ballistic/automatic/pistol/service/hos
stripe_state = "officer_sec"

/obj/item/gun/ballistic/automatic/pistol/service/ce
stripe_state = "officer_eng"

/obj/item/gun/ballistic/automatic/pistol/service/rd
stripe_state = "officer_sci"

/obj/item/gun/ballistic/automatic/pistol/service/cmo
stripe_state = "officer_med"
13 changes: 0 additions & 13 deletions code/modules/projectiles/guns/energy/energy_gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,6 @@
overlay_x = 19, \
overlay_y = 13)

/obj/item/gun/energy/e_gun/mini/heads
name = "Personal Tiny Self Defense Gun"
desc = "The PTSD gun has a built-in flashlight and the ability to recharge itself in two minutes. PTSD is standard issue for leadership within Nanotrasen. It has two settings: disable and kill."
ammo_type = list(/obj/item/ammo_casing/energy/disabler/hos, /obj/item/ammo_casing/energy/laser) ///uses the hos disabler rounds to slightly weaken the disabler count and also to avoid encountering a visual bug where the gun is out of charge but displays that it has one enough for another shot.
selfcharge = 1
charge_delay = 20
can_charge = FALSE ///Not compatible with fast charging stations, must recharge slowly.
icon_state = "personal"
item_state = "gun"
ammo_x_offset = 2
charge_sections = 2
single_shot_type_overlay = FALSE

/obj/item/gun/energy/e_gun/stun
name = "tactical energy gun"
desc = "Military issue energy gun, is able to fire stun rounds."
Expand Down
5 changes: 5 additions & 0 deletions code/modules/projectiles/projectile/beams.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
else if(isturf(target))
impact_effect_type = /obj/effect/temp_visual/impact_effect/red_laser/wall

/obj/projectile/beam/laser/lesslethal
damage = 10
stamina = 18
icon_state = "minilaser"

/obj/projectile/beam/weak
damage = 12

Expand Down
Binary file modified icons/mob/clothing/belt.dmi
Binary file not shown.
Binary file modified icons/obj/ammo.dmi
Binary file not shown.
Binary file modified icons/obj/guns/energy.dmi
Binary file not shown.
Binary file modified icons/obj/guns/projectile.dmi
Binary file not shown.
Binary file modified icons/obj/projectiles.dmi
Binary file not shown.

0 comments on commit 6c4ff2d

Please sign in to comment.