NT researchers make shocking breakthrough in flux anomalogics! Tesla Cannon Resprite / Resound (#92031)

## About The Pull Request

![tesla_card](https://github.com/user-attachments/assets/27d0777b-3014-4785-b06e-f5e7fe0d5a36)

Resprites:

Tesla Cannon 
Tesla Cannon crafting kit

### New SFX / VFX

The tesla cannon now uses a new type of beam effect that randomly picks
sprite variants for each segment instead of a tracer.

This makes the arc look more dynamic and less distorted. 

Autofire guns can now choose to use a looping sound datum when firing.


![image](https://github.com/user-attachments/assets/b9c0c494-fce6-48bc-9d09-ea2e6257c86c)

#### Balance changes

The tesla cannon must now have its stock unfolded before firing, this
takes 1.5 seconds and makes the gun bulky.

It is still normal sized when folded, and folding it is instant.

### Bug fixes

Fixed a bug where looping_sound.stop() would fail to stop sounds.

The tesla cannon is an incredibly powerfu 

## Why It's Good For The Game

### My reasons for respriting

The old sprite was not bad, by all means but I had a few gripes with it.

* The old sprite does not incorporate the flux anomaly yellow colour.

* The old sprite looks a bit much like a real, professionally produced
sci-fi weapon,

* The old sprite looks pretty small for such a ultra high dps full auto
weapon.

* The old inhand is quite indistinct for something that can game end you
in like one second.

### My design

I think that anomaly items should be very mad science coded and, since
anomaly science is by definition a poorly studied field, they should
look more like prototypes created by a scientist rather than something
professionally made in a factory.

## Changelog

🆑
image: The tesla cannon has new sprites.
image: The tesla parts kit has new sprites.
image: The tesla cannon has a new shocking beam effect when firing.
sound: The tesla cannon has new sounds.
balance: The tesla cannon must now be unfolded to fire.
fix: looping sounds now stop playing sounds when commaned to do so.
/🆑
This commit is contained in:
Krysonism
2025-08-12 23:43:28 +02:00
committed by GitHub
parent 6d8c65ecdd
commit 45e76d80fc
22 changed files with 171 additions and 36 deletions

View File

@@ -63,11 +63,11 @@
harmful = FALSE
/obj/item/ammo_casing/energy/tesla_cannon
fire_sound = 'sound/effects/magic/lightningshock.ogg'
fire_sound = null
e_cost = LASER_SHOTS(33, STANDARD_CELL_CHARGE)
select_name = "shock"
projectile_type = /obj/projectile/energy/tesla_cannon
firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect/blue
firing_effect_type = null
/obj/item/ammo_casing/energy/shrink
projectile_type = /obj/projectile/magic/shrink/alien

View File

@@ -360,18 +360,72 @@
return FALSE
return ..()
/**
-----------------Tesla Cannon--------------------------------
An advanced weapon that provides extremely high dps output at pinpoint accuracy due to its hitscan nature.
Due to its normal w_class when folded it is suitable as a heavy reinforcement weapon, since the cell drains very quickly when firing.
The power level is somewhat tempered by several drawbacks such as research requirements, anomalock, two handed firing requirement, and insultation providing damage reduction.
it is often confused with the mech weapon of the same name, since it is a bit more obscure despite being very powerful. Formerly called the tesla revolver.
**/
/obj/item/gun/energy/tesla_cannon
name = "tesla cannon"
icon = 'icons/obj/weapons/guns/wide_guns.dmi'
icon_state = "tesla"
inhand_icon_state = "tesla"
desc = "A gun powered by a flux anomaly that shoots lightning bolts. Electrically insulating clothing may protect from some of the damage."
lefthand_file = 'icons/mob/inhands/weapons/64x_guns_left.dmi'
righthand_file = 'icons/mob/inhands/weapons/64x_guns_right.dmi'
inhand_icon_state = null //null so we build the correct inhand.
desc = "A high voltage flux projector prototype created using the latest advancements in the anomaly science.\n\nThe anomalous nature of the flux core allows the tesla arc to be guided from the electrode to the target without being diverted to stray conductors outside the target field."
SET_BASE_VISUAL_PIXEL(-8, 0)
ammo_type = list(/obj/item/ammo_casing/energy/tesla_cannon)
inhand_x_dimension = 64
shaded_charge = TRUE
charge_sections = 2
display_empty = FALSE
weapon_weight = WEAPON_HEAVY
w_class = WEIGHT_CLASS_BULKY
///if our stpck is extended and we are ready to fire.
var/ready_to_fire = FALSE
/obj/item/gun/energy/tesla_cannon/Initialize(mapload)
. = ..()
AddComponent(/datum/component/automatic_fire, 0.1 SECONDS)
AddComponent(/datum/component/automatic_fire, autofire_shot_delay = 100 MILLISECONDS, firing_sound_loop = /datum/looping_sound/tesla_cannon)
/obj/item/gun/energy/tesla_cannon/can_trigger_gun(mob/living/user, akimbo_usage)
if(ready_to_fire)
return ..()
//If we have charge, but the stock is folded, do sparks.
if(can_shoot())
balloon_alert(user, "electricity arcing to stock!")
if(prob(75)) //fake sparks to cut on spark spam
playsound(user, 'sound/effects/sparks/sparks1.ogg', 50, TRUE)
else
do_sparks(3, FALSE, user)
return FALSE
/obj/item/gun/energy/tesla_cannon/attack_self(mob/living/user)
. = ..()
if(ready_to_fire)
w_class = WEIGHT_CLASS_NORMAL
ready_to_fire = FALSE
icon_state = "tesla"
playsound(user, 'sound/items/weapons/gun/tesla/squeak_latch.ogg', 100)
else
playsound(user, 'sound/items/weapons/gun/tesla/click_creak.ogg', 100)
if(!do_after(user, 1.5 SECONDS))
return
w_class = WEIGHT_CLASS_BULKY
ready_to_fire = TRUE
icon_state = "tesla_unfolded"
playsound(user, 'sound/items/weapons/gun/tesla/squeak_latch.ogg', 100)
update_appearance()
balloon_alert_to_viewers("[ready_to_fire ? "unfolded" : "folded"] stock")
/obj/item/gun/energy/marksman_revolver
name = "marksman revolver"

View File

@@ -29,13 +29,14 @@
name = "tesla bolt"
icon_state = null
hitscan = TRUE
tracer_type = /obj/effect/projectile/tracer/lightning
impact_effect_type = null
damage = 5
var/shock_damage = 10
/obj/projectile/energy/tesla_cannon/on_hit(atom/target, blocked = 0, pierce_hit)
. = ..()
firer.Beam(target, icon_state = "tesla", time = 1, icon_state_variants = 24)
if(isliving(target))
var/mob/living/victim = target
victim.electrocute_act(shock_damage, src, siemens_coeff = 1, flags = SHOCK_NOSTUN|SHOCK_TESLA)