Files
Bubberstation/code/modules/projectiles/projectile/energy/tesla.dm
SkyratBot eb75696ae9 [MIRROR] [NO GBP]Fixes tesla zaps. [MDB IGNORE] (#24698)
* [NO GBP]Fixes tesla zaps. (#79398)

## About The Pull Request
Closes #79297
Closes #79312

Due to the new cutoff parameter being added to tesla_zap() (from
#78310), and most callers used positional arguments instead of keywords,
the zap flags was getting fed the shocked_targets list and maybe other
junk. This caused a bunch of unusual phenomena. This is fixed by using
keyword arguments.

Tesla zaps that use the grid were significantly weaker in terms of
damage than they're supposed to be. This was a byproduct of trying to
convert everything to joules and removing unnecessary power multipliers.
This is fixed by reverting the damage scaling and zap power of zap
sources that aren't based on grid. Technically this will cause the zaps
from other sources to have less power, but these tend to not be able to
put power on grid, so this wouldn't have any change other than what a
grounding rod displays. Doesn't really matter.

Logs machine explosions from zap_act. Not the most helpful log (would
take a lot of effort to add an extra parameter to pass the source), but
better than nothing.

Probably other stuff I did, lol.
## Why It's Good For The Game
Stops zap fuckery. Admins can now find the explosions when a 9GeV engine
decides to go haywire or whatever.
## Changelog
🆑
fix: Fixes tesla zaps being weird.
admin: Logs explosions from explosive zaps.
/🆑

* [NO GBP]Fixes tesla zaps.

---------

Co-authored-by: Pickle-Coding <58013024+Pickle-Coding@users.noreply.github.com>
2023-10-31 10:29:50 -07:00

40 lines
1.2 KiB
Plaintext

/obj/projectile/energy/tesla
name = "tesla bolt"
icon_state = "tesla_projectile"
impact_effect_type = /obj/effect/temp_visual/impact_effect/blue_laser
damage = 10 //A worse lasergun
var/zap_flags = ZAP_MOB_DAMAGE | ZAP_OBJ_DAMAGE | ZAP_LOW_POWER_GEN
var/zap_range = 3
var/power = 1e4
/obj/projectile/energy/tesla/on_hit(atom/target, blocked = 0, pierce_hit)
. = ..()
tesla_zap(source = src, zap_range = zap_range, power = power, cutoff = 1e3, zap_flags = zap_flags)
qdel(src)
/obj/projectile/energy/tesla/process()
. = ..()
//Many coders have given their blood for this speed
tesla_zap(source = src, zap_range = zap_range, power = power, cutoff = 1e3, zap_flags = zap_flags)
/obj/projectile/energy/tesla/revolver
name = "energy orb"
/obj/projectile/energy/tesla/cannon
name = "tesla orb"
power = 2e4
damage = 15 //Mech man big
/obj/projectile/energy/tesla_cannon
name = "tesla orb"
icon_state = "ice_1"
damage = 0
speed = 1.5
var/shock_damage = 5
/obj/projectile/energy/tesla_cannon/on_hit(atom/target, blocked = 0, pierce_hit)
. = ..()
if(isliving(target))
var/mob/living/victim = target
victim.electrocute_act(shock_damage, src, siemens_coeff = 1, flags = SHOCK_NOSTUN|SHOCK_TESLA)