VOREStation Tweaks to the Tesla engine

* Let you order the Tesla generator from cargo in case you need another one.
* Make the energy ball dissipate very fast if it escapes from confinement, limiting the number of machines it can blow up.
* Reduce devastation on machine destruction so areas are messed up but not just reduced to space.
This commit is contained in:
Leshana
2018-01-21 16:18:55 -05:00
parent 859c9f2614
commit 62e58702f7
4 changed files with 141 additions and 4 deletions

View File

@@ -61,7 +61,7 @@
playsound(src.loc, 'sound/effects/lightningbolt.ogg', 100, 1, extrarange = 30)
set_dir(tesla_zap(src.loc, 7, TESLA_DEFAULT_POWER, TRUE))
set_dir(tesla_zap(src, 7, TESLA_DEFAULT_POWER, TRUE))
for (var/ball in orbiting_balls)
var/range = rand(1, Clamp(orbiting_balls.len, 3, 7))
@@ -265,11 +265,14 @@
//Alright, we've done our loop, now lets see if was anything interesting in range
if(closest_atom)
//common stuff
source.Beam(closest_atom, icon_state="lightning[rand(1,12)]", time=5, maxdistance = INFINITY)
var/atom/srcLoc = get_turf(source) // VOREStation Edit - Makes beams look nicer
srcLoc.Beam(closest_atom, icon_state="lightning[rand(1,12)]", time=5, maxdistance = INFINITY) // VOREStation Edit - Makes beams look nicer
var/zapdir = get_dir(source, closest_atom)
if(zapdir)
. = zapdir
var/drain_energy = FALSE // VOREStation Edit - Safety First! Drain Tesla fast when its loose
//per type stuff:
if(closest_tesla_coil)
closest_tesla_coil.tesla_act(power, explosive, stun_mobs)
@@ -289,10 +292,20 @@
tesla_zap(closest_mob, 5, power / 1.5, explosive, stun_mobs)
else if(closest_machine)
drain_energy = TRUE // VOREStation Edit - Safety First! Drain Tesla fast when its loose
closest_machine.tesla_act(power, explosive, stun_mobs)
else if(closest_blob)
drain_energy = TRUE // VOREStation Edit - Safety First! Drain Tesla fast when its loose
closest_blob.tesla_act(power, explosive, stun_mobs)
else if(closest_structure)
drain_energy = TRUE // VOREStation Edit - Safety First! Drain Tesla fast when its loose
closest_structure.tesla_act(power, explosive, stun_mobs)
// VOREStation Edit Start - Safety First! Drain Tesla fast when its loose
if(drain_energy && istype(source, /obj/singularity/energy_ball))
var/obj/singularity/energy_ball/EB = source
if (EB.energy > 0)
EB.energy -= min(EB.energy, max(10, round(EB.energy * 0.05)))
// VOREStation Edit End

View File

@@ -30,7 +30,7 @@
/obj/machinery/tesla_act(power, explosive = FALSE)
..()
if(prob(85) && explosive)
explosion(loc, 1, 2, 4, /*flame_range = 2,*/ adminlog = FALSE/*, smoke = FALSE*/)
explosion(loc, 0, 2, 4, /*flame_range = 2,*/ adminlog = FALSE/*, smoke = FALSE*/) // VOREStation Edit - No devastation range
else if(prob(50))
emp_act(2)
else