Merge pull request #2809 from VOREStation/vplk-multi-engine

Dynamic Engine Loading
This commit is contained in:
Arokha Sieyes
2018-01-21 17:48:45 -05:00
committed by GitHub
19 changed files with 1108 additions and 34 deletions
+22 -3
View File
@@ -55,13 +55,14 @@
/obj/singularity/energy_ball/process(var/wait = 20)
set waitfor = FALSE
if(!orbiting)
handle_energy()
if (handle_energy())
return
move_the_basket_ball(max(wait - 5, 4 + orbiting_balls.len * 1.5))
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))
@@ -91,6 +92,11 @@
sleep(1) // So movement is smooth
/obj/singularity/energy_ball/proc/handle_energy()
if (energy <= 0)
investigate_log("collapsed.", I_SINGULO)
qdel(src)
return TRUE
if(energy >= energy_to_raise)
energy_to_lower = energy_to_raise - 20
energy_to_raise = energy_to_raise * 1.25
@@ -265,11 +271,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 +298,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
+1 -1
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