Skip to content

Commit

Permalink
[MIRROR] [NO GBP]Fix tesla coil zaps. [MDB IGNORE] (#24447)
Browse files Browse the repository at this point in the history
* [NO GBP]Fix tesla coil zaps. (#79061)

## About The Pull Request
Fixes tesla coil zap cutoff being scaled high when it didn't need to.
Tesla coil zaps didn't scale with the old power scaling before it got
removed, so the tesla coil zaps got nerfed due to the scaling changes of
zap effects. This PR does not fix the fact that tesla coil zaps will
deal less damage though. An easy clean fix doesn't seem possible, and
adding a damage multiplier is cringe.

For fixing tesla coil zap damage, the only reasonable solution seems to
be to unscale almost every other zapper (the vast majority of them don't
seem to be able to power the grid, so it doesn't matter), and then
scaling zap damage scaling back up. I haven't setup my development
environment yet, so I'll fix that in another PR.
## Why It's Good For The Game
So the tesla coil doesn't need unreasonably high requirements to zap
properly.
## Changelog
:cl:
fix: Fixed tesla coil zaps cutting off too early.
/:cl:

* [NO GBP]Fix tesla coil zaps.

---------

Co-authored-by: Pickle-Coding <[email protected]>
  • Loading branch information
2 people authored and FFMirrorBot committed Oct 20, 2023
1 parent dbbe12a commit 8f4676d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/modules/power/tesla/coil.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
power = min(surplus(), power) //Take the smaller of the two
add_load(power)
playsound(src.loc, 'sound/magic/lightningshock.ogg', zap_sound_volume, TRUE, zap_sound_range)
tesla_zap(src, 10, power, zap_flags)
tesla_zap(src, 10, power, 1e3, zap_flags)
zap_buckle_check(power)

/obj/machinery/power/energy_accumulator/grounding_rod
Expand Down
4 changes: 2 additions & 2 deletions code/modules/power/tesla/energy_ball.dm
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@
C.investigate_log("has been dusted by an energy ball.", INVESTIGATE_DEATHS)
C.dust()

/proc/tesla_zap(atom/source, zap_range = 3, power, zap_flags = ZAP_DEFAULT_FLAGS, list/shocked_targets = list())
/proc/tesla_zap(atom/source, zap_range = 3, power, cutoff = 4e5, zap_flags = ZAP_DEFAULT_FLAGS, list/shocked_targets = list())
if(QDELETED(source))
return
if(!(zap_flags & ZAP_ALLOW_DUPLICATES))
LAZYSET(shocked_targets, source, TRUE) //I don't want no null refs in my list yeah?
. = source.dir
if(power < 4e5)
if(power < cutoff)
return

/*
Expand Down

0 comments on commit 8f4676d

Please sign in to comment.