first attempt
This commit is contained in:
raspy-on-osu
2020-08-24 20:29:25 -04:00
parent 19d5a1bc4b
commit 580afaf74a
3 changed files with 23 additions and 1 deletions
+1
View File
@@ -13,6 +13,7 @@ GLOBAL_LIST_EMPTY(deliverybeacontags) //list of all tags associated with d
GLOBAL_LIST_EMPTY(nuke_list)
GLOBAL_LIST_EMPTY(alarmdisplay) //list of all machines or programs that can display station alerts
GLOBAL_LIST_EMPTY(singularities) //list of all singularities on the station (actually technically all engines)
GLOBAL_LIST_EMPTY(grounding_rods) //list of all grounding rods on the station
GLOBAL_LIST(chemical_reactions_list) //list of all /datum/chemical_reaction datums. Used during chemical reactions
GLOBAL_LIST(chemical_reagents_list) //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff
+8
View File
@@ -160,6 +160,14 @@
buckle_lying = FALSE
buckle_requires_restraints = TRUE
/obj/machinery/power/grounding_rod/Initialize()
GLOB.grounding_rods |= src
return ..()
/obj/machinery/power/grounding_rod/Destroy()
GLOB.grounding_rods.Remove(src)
return ..()
/obj/machinery/power/grounding_rod/default_unfasten_wrench(mob/user, obj/item/I, time = 20)
. = ..()
if(. == SUCCESSFUL_UNFASTEN)
+14 -1
View File
@@ -31,6 +31,7 @@
var/produced_power
var/energy_to_raise = 32
var/energy_to_lower = -20
var/rodtarget
/obj/singularity/energy_ball/Initialize(mapload, starting_energy = 50, is_miniball = FALSE)
miniball = is_miniball
@@ -91,8 +92,20 @@
/obj/singularity/energy_ball/proc/move_the_basket_ball(var/move_amount)
//we face the last thing we zapped, so this lets us favor that direction a bit
var/move_bias = pick(GLOB.alldirs)
var/rods = GLOB.grounding_rods
if(rods) // grounding rods pull the tesla ball, picks the nearest one
for(var/rod in rods)
if(!rodtarget)
rodtarget=rod
if(get_dist(src,rod)<get_dist(src,rodtarget))
rodtarget=rod
for(var/i in 0 to move_amount)
var/move_dir = pick(GLOB.alldirs + move_bias) //ensures large-ball teslas don't just sit around
if(rods)
var/move_dir = pick(GLOB.alldirs + move_bias + rodtarget)
else
var/move_dir = pick(GLOB.alldirs + move_bias) //ensures large-ball teslas don't just sit around
if(target && prob(10))
move_dir = get_dir(src,target)
var/turf/T = get_step(src, move_dir)