Fixes tesla bugs, makes code better (#49260)

* Cleans shit up, adds some upper limits on zap count, makes explosions less commen. Need to fix apc issue before
I test how it plays

* Mood, buffs and nerfs tesla

* Cherry-Picking

* eyyo

* back to basics

* aight

* broooooooooooooooooo

* adds else

* range

* fixes shit

* Sure

* Cleans shit up

* Fixes prob issue

* Gee I like this spooky guy

* I swear to god if prob picks just makes a list I am gonna blow a gasket
This commit is contained in:
LemonInTheDark
2020-02-27 03:06:52 -08:00
committed by GitHub
parent 5d55e64398
commit df9d859da8
14 changed files with 41 additions and 40 deletions
+2 -4
View File
@@ -229,12 +229,10 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
///Called when the obj is hit by a tesla bolt.
/obj/proc/zap_act(power, zap_flags, shocked_targets)
if(QDELETED(src))
return
return 0
obj_flags |= BEING_SHOCKED
if(zap_flags & ZAP_IS_TESLA)
var/power_bounced = power / 2
tesla_zap(src, 3, power_bounced, zap_flags, shocked_targets)
addtimer(CALLBACK(src, .proc/reset_shocked), 10)
return power / 2
//The surgeon general warns that being buckled to certain objects receiving powerful shocks is greatly hazardous to your health
///Only tesla coils, vehicles, and grounding rods currently call this because mobs are already targeted over all other objects, but this might be useful for more things later.
+1 -1
View File
@@ -261,7 +261,7 @@
var/obj/structure/cable/C = T.get_cable_node()
if(C)
playsound(src, 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5)
tesla_zap(src, 3, C.newavail() * 0.01, ZAP_MOB_DAMAGE | ZAP_OBJ_DAMAGE | ZAP_MOB_STUN | ZAP_ALLOW_DUPLICATES | ZAP_IS_TESLA) //Zap for 1/100 of the amount of power. At a million watts in the grid, it will be as powerful as a tesla revolver shot.
tesla_zap(src, 3, C.newavail() * 0.01, ZAP_MOB_DAMAGE | ZAP_OBJ_DAMAGE | ZAP_MOB_STUN | ZAP_ALLOW_DUPLICATES) //Zap for 1/100 of the amount of power. At a million watts in the grid, it will be as powerful as a tesla revolver shot.
C.add_delayedload(C.newavail() * 0.0375) // you can gain up to 3.5 via the 4x upgrades power is halved by the pole so thats 2x then 1X then .5X for 3.5x the 3 bounces shock.
return ..()