Merge remote-tracking branch 'upstream/master' into cool-ipcs
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
var/energy_transfer = delta_temperature*hot_air_heat_capacity*cold_air_heat_capacity/(hot_air_heat_capacity+cold_air_heat_capacity)
|
||||
|
||||
var/heat = energy_transfer*(1-efficiency)
|
||||
lastgen += LOGISTIC_FUNCTION(1000000,0.0034,delta_temperature,2000)
|
||||
lastgen += LOGISTIC_FUNCTION(1250000,0.0001,delta_temperature,50000)
|
||||
|
||||
hot_air.set_temperature(hot_air.return_temperature() - energy_transfer/hot_air_heat_capacity)
|
||||
cold_air.set_temperature(cold_air.return_temperature() + heat/cold_air_heat_capacity)
|
||||
@@ -139,7 +139,6 @@
|
||||
. = ..()
|
||||
var/datum/browser/popup = new(user, "teg", "Thermo-Electric Generator", 460, 300)
|
||||
popup.set_content(get_menu())
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/power/generator/Topic(href, href_list)
|
||||
|
||||
@@ -639,7 +639,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
if(produces_gas)
|
||||
env.merge(removed)
|
||||
air_update_turf()
|
||||
|
||||
|
||||
/*********
|
||||
END CITADEL CHANGES
|
||||
*********/
|
||||
@@ -985,6 +985,13 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
layer = ABOVE_MOB_LAYER
|
||||
moveable = TRUE
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/shard/examine(mob/user)
|
||||
. = ..()
|
||||
if(anchored)
|
||||
. += "<span class='notice'>[src] is <b>anchored</b> to the floor.</span>"
|
||||
else
|
||||
. += "<span class='notice'>[src] is <i>unanchored</i>, but can be <b>bolted</b> down.</span>"
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/shard/engine
|
||||
name = "anchored supermatter shard"
|
||||
is_main_engine = TRUE
|
||||
@@ -1026,12 +1033,12 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
if(L)
|
||||
switch(type)
|
||||
if(FLUX_ANOMALY)
|
||||
var/obj/effect/anomaly/flux/A = new(L, 300, FALSE)
|
||||
var/obj/effect/anomaly/flux/A = new(L, 300, SUPERMATTER_ANOMALY_DROP_CHANCE)
|
||||
A.explosive = FALSE
|
||||
if(GRAVITATIONAL_ANOMALY)
|
||||
new /obj/effect/anomaly/grav(L, 250, FALSE)
|
||||
new /obj/effect/anomaly/grav(L, 250, SUPERMATTER_ANOMALY_DROP_CHANCE)
|
||||
if(PYRO_ANOMALY)
|
||||
new /obj/effect/anomaly/pyro(L, 200, FALSE)
|
||||
new /obj/effect/anomaly/pyro(L, 200, SUPERMATTER_ANOMALY_DROP_CHANCE)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/proc/supermatter_zap(atom/zapstart = src, range = 5, zap_str = 4000, zap_flags = ZAP_SUPERMATTER_FLAGS, list/targets_hit = list())
|
||||
if(QDELETED(zapstart))
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
var/produced_power
|
||||
var/energy_to_raise = 32
|
||||
var/energy_to_lower = -20
|
||||
var/obj/machinery/power/grounding_rod/rodtarget
|
||||
|
||||
/obj/singularity/energy_ball/Initialize(mapload, starting_energy = 50, is_miniball = FALSE)
|
||||
miniball = is_miniball
|
||||
@@ -60,11 +61,12 @@
|
||||
return //don't annnounce miniballs
|
||||
..()
|
||||
|
||||
|
||||
/obj/singularity/energy_ball/process()
|
||||
if(!orbiting)
|
||||
handle_energy()
|
||||
|
||||
determine_containment()
|
||||
|
||||
move_the_basket_ball(4 + orbiting_balls.len * 1.5)
|
||||
|
||||
playsound(src.loc, 'sound/magic/lightningbolt.ogg', 100, TRUE, extrarange = 30)
|
||||
@@ -87,12 +89,19 @@
|
||||
if(orbiting_balls.len)
|
||||
. += "There are [orbiting_balls.len] mini-balls orbiting it."
|
||||
|
||||
|
||||
/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/move_dir
|
||||
for(var/rod in GLOB.grounding_rods) // grounding rods pull the tesla ball, picks the nearest one
|
||||
if(!rodtarget || 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(rodtarget)
|
||||
move_dir = pick(GLOB.alldirs + get_dir(src,rodtarget))
|
||||
else
|
||||
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)
|
||||
@@ -102,6 +111,20 @@
|
||||
for(var/mob/living/carbon/C in loc)
|
||||
dust_mobs(C)
|
||||
|
||||
/obj/singularity/energy_ball/proc/determine_containment()
|
||||
contained=0
|
||||
var/found
|
||||
var/tiletocheck
|
||||
for(var/direction in GLOB.cardinals) // check a radius of 10 tiles around the ball for a full containment field
|
||||
tiletocheck=get_step(src,direction)
|
||||
for(var/tile in 1 to 10)
|
||||
found=locate(/obj/machinery/field/containment) in tiletocheck
|
||||
if(found)
|
||||
continue
|
||||
else if (!found && tile==10)
|
||||
return // if one side is lacking a field it doesn't bother checking the others
|
||||
tiletocheck=get_step(tiletocheck,direction)
|
||||
contained=1
|
||||
|
||||
/obj/singularity/energy_ball/proc/handle_energy()
|
||||
if(energy >= energy_to_raise)
|
||||
@@ -121,6 +144,10 @@
|
||||
else if(orbiting_balls.len)
|
||||
dissipate() //sing code has a much better system.
|
||||
|
||||
if(energy<=0)
|
||||
investigate_log("fizzled.", INVESTIGATE_SINGULO)
|
||||
qdel(src)
|
||||
|
||||
/obj/singularity/energy_ball/proc/new_mini_ball()
|
||||
if(!loc)
|
||||
return
|
||||
@@ -134,7 +161,6 @@
|
||||
|
||||
EB.orbit(src, orbitsize, pick(FALSE, TRUE), rand(10, 25), pick(3, 4, 5, 6, 36))
|
||||
|
||||
|
||||
/obj/singularity/energy_ball/Bump(atom/A)
|
||||
dust_mobs(A)
|
||||
|
||||
@@ -166,7 +192,6 @@
|
||||
if (!QDELETED(src))
|
||||
qdel(src)
|
||||
|
||||
|
||||
/obj/singularity/energy_ball/proc/dust_mobs(atom/A)
|
||||
if(isliving(A))
|
||||
var/mob/living/L = A
|
||||
@@ -329,6 +354,12 @@
|
||||
|
||||
else
|
||||
power = closest_atom.zap_act(power, zap_flags, shocked_targets)
|
||||
|
||||
var/obj/singularity/energy_ball/tesla = source
|
||||
if(istype(tesla))
|
||||
if(istype(closest_atom,/obj/machinery/power/grounding_rod) && tesla.energy>13 && !tesla.contained)
|
||||
qdel(closest_atom) // each rod deletes two miniballs,
|
||||
tesla.energy = round(tesla.energy/1.5625) // if there are no miniballs the rod stays and continues to pull the ball in
|
||||
if(prob(20))//I know I know
|
||||
tesla_zap(closest_atom, next_range, power * 0.5, zap_flags, shocked_targets)
|
||||
tesla_zap(closest_atom, next_range, power * 0.5, zap_flags, shocked_targets)
|
||||
|
||||
Reference in New Issue
Block a user