Merge conflict fix

This commit is contained in:
Artur
2020-05-13 12:37:18 +03:00
985 changed files with 295527 additions and 16121 deletions
+15 -15
View File
@@ -196,19 +196,23 @@
switch(tdir)
if(NORTH)
pixel_x = 0
pixel_y = 23
if(SOUTH)
pixel_x = 0
pixel_y = -23
if(EAST)
pixel_y = 0
pixel_x = 24
if(WEST)
pixel_y = 0
pixel_x = -25
/obj/machinery/power/apc/Destroy()
GLOB.apcs_list -= src
if(malfai && operating)
malfai.malf_picker.processing_time = CLAMP(malfai.malf_picker.processing_time - 10,0,1000)
malfai.malf_picker.processing_time = clamp(malfai.malf_picker.processing_time - 10,0,1000)
area.power_light = FALSE
area.power_equip = FALSE
area.power_environ = FALSE
@@ -593,19 +597,15 @@
user.visible_message("[user.name] adds cables to the APC frame.", \
"<span class='notice'>You start adding cables to the APC frame...</span>")
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
if(do_after(user, 20, target = src))
if (C.get_amount() < 10 || !C)
if(C.use_tool(src, user, 20, 10) && !terminal && opened && has_electronics)
var/turf/T = get_turf(src)
var/obj/structure/cable/N = T.get_cable_node()
if (prob(50) && electrocute_mob(usr, N, N, 1, TRUE))
do_sparks(5, TRUE, src)
return
if (C.get_amount() >= 10 && !terminal && opened && has_electronics)
var/turf/T = get_turf(src)
var/obj/structure/cable/N = T.get_cable_node()
if (prob(50) && electrocute_mob(usr, N, N, 1, TRUE))
do_sparks(5, TRUE, src)
return
C.use(10)
to_chat(user, "<span class='notice'>You add cables to the APC frame.</span>")
make_terminal()
terminal.connect_to_network()
to_chat(user, "<span class='notice'>You add cables to the APC frame.</span>")
make_terminal()
terminal.connect_to_network()
else if (istype(W, /obj/item/electronics/apc) && opened)
if (has_electronics)
to_chat(user, "<span class='warning'>There is already a board inside the [src]!</span>")
@@ -1350,7 +1350,7 @@
lighting = autoset(lighting, 0)
environ = autoset(environ, 0)
area.poweralert(0, src)
else if(cell_percent < 15 && longtermpower < 0) // <15%, turn off lighting & equipment
equipment = autoset(equipment, 2)
lighting = autoset(lighting, 2)
@@ -1447,7 +1447,7 @@
/obj/machinery/power/apc/proc/set_broken()
if(malfai && operating)
malfai.malf_picker.processing_time = CLAMP(malfai.malf_picker.processing_time - 10,0,1000)
malfai.malf_picker.processing_time = clamp(malfai.malf_picker.processing_time - 10,0,1000)
stat |= BROKEN
operating = FALSE
if(occupier)
+21 -7
View File
@@ -91,6 +91,21 @@ By design, d1 is the smallest direction and d2 is the highest
d1 = _d1
d2 = _d2
if(dir != SOUTH)
var/angle_to_turn = dir2angle(dir)
if(angle_to_turn == 0 || angle_to_turn == 180)
angle_to_turn += 180
// direct dir set instead of setDir intentional
dir = SOUTH
if(d1)
d1 = turn(d1, angle_to_turn)
if(d2)
d2 = turn(d2, angle_to_turn)
if(d1 > d2)
var/temp = d2
d2 = d1
d1 = temp
var/turf/T = get_turf(src) // hide if turf is not intact
if(level==1)
hide(T.intact)
@@ -217,7 +232,7 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/structure/cable/proc/surplus()
if(powernet)
return CLAMP(powernet.avail-powernet.load, 0, powernet.avail)
return clamp(powernet.avail-powernet.load, 0, powernet.avail)
else
return 0
@@ -233,7 +248,7 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/structure/cable/proc/delayed_surplus()
if(powernet)
return CLAMP(powernet.newavail - powernet.delayedload, 0, powernet.newavail)
return clamp(powernet.newavail - powernet.delayedload, 0, powernet.newavail)
else
return 0
@@ -495,6 +510,7 @@ By design, d1 is the smallest direction and d2 is the highest
full_w_class = WEIGHT_CLASS_SMALL
grind_results = list(/datum/reagent/copper = 2) //2 copper per cable in the coil
usesound = 'sound/items/deconstruct.ogg'
used_skills = list(/datum/skill/level/job/wiring)
/obj/item/stack/cable_coil/cyborg
is_cyborg = 1
@@ -533,7 +549,7 @@ By design, d1 is the smallest direction and d2 is the highest
if(affecting && affecting.status == BODYPART_ROBOTIC)
if(user == H)
user.visible_message("<span class='notice'>[user] starts to fix some of the wires in [H]'s [affecting.name].</span>", "<span class='notice'>You start fixing some of the wires in [H]'s [affecting.name].</span>")
if(!do_after(user, H, 50))
if(!do_mob(user, H, 50))
return
if(item_heal_robotic(H, user, 0, 15))
use(1)
@@ -565,7 +581,7 @@ By design, d1 is the smallest direction and d2 is the highest
return
var/obj/item/restraints/handcuffs/cable/result = new(get_turf(user))
user.put_in_hands(result)
result.color = color
result.color = color
to_chat(user, "<span class='notice'>You make some restraints out of cable</span>")
//add cables to the stack
@@ -576,8 +592,6 @@ By design, d1 is the smallest direction and d2 is the highest
amount += extra
update_icon()
///////////////////////////////////////////////
// Cable laying procedures
//////////////////////////////////////////////
@@ -848,4 +862,4 @@ By design, d1 is the smallest direction and d2 is the highest
. = ..()
var/list/cable_colors = GLOB.cable_colors
color = pick(cable_colors)
+2 -2
View File
@@ -157,7 +157,7 @@
/obj/item/stock_parts/cell/proc/get_electrocute_damage()
if(charge >= 1000)
return CLAMP(round(charge/10000), 10, 90) + rand(-5,5)
return clamp(round(charge/10000), 10, 90) + rand(-5,5)
else
return 0
@@ -334,7 +334,7 @@
. = ..()
if(. & EMP_PROTECT_SELF)
return
charge = CLAMP((charge-(10000/severity)),0,maxcharge)
charge = clamp((charge-(10000/severity)),0,maxcharge)
/obj/item/stock_parts/cell/emergency_light
name = "miniature power cell"
+1 -2
View File
@@ -15,8 +15,7 @@
state = FLOODLIGHT_NEEDS_WIRES
desc = "A bare metal frame looking vaguely like a floodlight. Requires wiring."
else if(istype(O, /obj/item/stack/cable_coil) && (state == FLOODLIGHT_NEEDS_WIRES))
var/obj/item/stack/S = O
if(S.use(5))
if(O.use_tool(src, user, 0, 5))
to_chat(user, "<span class='notice'>You wire [src].</span>")
name = "wired [name]"
desc = "A bare metal frame looking vaguely like a floodlight. Requires securing with a screwdriver."
+13 -12
View File
@@ -118,8 +118,7 @@
return
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/coil = W
if(coil.use(1))
if(W.use_tool(src, user, 0, 1, max_level = JOB_SKILL_TRAINED))
icon_state = "[fixture_type]-construct-stage2"
stage = 2
user.visible_message("[user.name] adds wires to [src].", \
@@ -193,7 +192,7 @@
var/on = FALSE // 1 if on, 0 if off
var/on_gs = FALSE
var/static_power_used = 0
var/brightness = 11 // luminosity when on, also used in power calculation
var/brightness = 9 // luminosity when on, also used in power calculation
var/bulb_power = 0.75 // basically the alpha of the emitted light source
var/bulb_colour = "#FFF6ED" // befault colour of the light.
var/status = LIGHT_OK // LIGHT_OK, _EMPTY, _BURNED or _BROKEN
@@ -232,7 +231,8 @@
icon_state = "bulb"
base_state = "bulb"
fitting = "bulb"
brightness = 6
brightness = 5
nightshift_brightness = 4
bulb_colour = "#FFDDBB"
desc = "A small lighting fixture."
light_type = /obj/item/light/bulb
@@ -274,11 +274,11 @@
spawn(2)
switch(fitting)
if("tube")
brightness = 11
brightness = 9
if(prob(2))
break_light_tube(1)
if("bulb")
brightness = 6
brightness = 5
if(prob(5))
break_light_tube(1)
spawn(1)
@@ -314,7 +314,7 @@
. = ..()
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
if(on && status == LIGHT_OK)
SSvis_overlays.add_vis_overlay(src, overlayicon, base_state, EMISSIVE_LAYER, EMISSIVE_PLANE, dir, CLAMP(light_power*250, 30, 200))
SSvis_overlays.add_vis_overlay(src, overlayicon, base_state, EMISSIVE_LAYER, EMISSIVE_PLANE, dir, clamp(light_power*250, 30, 200))
// update the icon_state and luminosity of the light depending on its state
@@ -361,11 +361,11 @@
set_light(0)
update_icon()
active_power_usage = (brightness * 7.2)
active_power_usage = (brightness * 10)
if(on != on_gs)
on_gs = on
if(on)
static_power_used = brightness * 14.4 * (hijacked ? 2 : 1) //20W per unit luminosity
static_power_used = brightness * 20 * (hijacked ? 2 : 1) //20W per unit luminosity
addStaticPower(static_power_used, STATIC_LIGHT)
else
removeStaticPower(static_power_used, STATIC_LIGHT)
@@ -748,7 +748,7 @@
icon_state = "ltube"
base_state = "ltube"
item_state = "c_tube"
brightness = 11
brightness = 9
/obj/item/light/tube/broken
status = LIGHT_BROKEN
@@ -761,7 +761,7 @@
item_state = "contvapour"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
brightness = 6
brightness = 5
/obj/item/light/bulb/broken
status = LIGHT_BROKEN
@@ -830,7 +830,8 @@
icon = 'icons/obj/lighting.dmi'
base_state = "floor" // base description and icon_state
icon_state = "floor"
brightness = 6
brightness = 5
nightshift_brightness = 4
layer = 2.5
light_type = /obj/item/light/bulb
fitting = "bulb"
+2 -2
View File
@@ -42,7 +42,7 @@
/obj/machinery/power/proc/surplus()
if(powernet)
return CLAMP(powernet.avail-powernet.load, 0, powernet.avail)
return clamp(powernet.avail-powernet.load, 0, powernet.avail)
else
return 0
@@ -58,7 +58,7 @@
/obj/machinery/power/proc/delayed_surplus()
if(powernet)
return CLAMP(powernet.newavail - powernet.delayedload, 0, powernet.newavail)
return clamp(powernet.newavail - powernet.delayedload, 0, powernet.newavail)
else
return 0
+1 -1
View File
@@ -96,6 +96,6 @@
/datum/powernet/proc/get_electrocute_damage()
if(avail >= 1000)
return CLAMP(round(avail/10000), 10, 90) + rand(-5,5)
return clamp(round(avail/10000), 10, 90) + rand(-5,5)
else
return 0
@@ -28,11 +28,19 @@
var/bitcoinproduction_drain = 0.15
var/bitcoinmining = FALSE
rad_insulation = RAD_EXTREME_INSULATION
var/obj/item/radio/Radio
/obj/machinery/power/rad_collector/anchored
anchored = TRUE
/obj/machinery/power/rad_collector/Initialize()
. = ..()
Radio = new /obj/item/radio(src)
Radio.listening = 0
Radio.set_frequency(FREQ_ENGINEERING)
/obj/machinery/power/rad_collector/Destroy()
QDEL_NULL(Radio)
return ..()
/obj/machinery/power/rad_collector/process()
@@ -42,6 +50,7 @@
if(!loaded_tank.air_contents.gases[/datum/gas/plasma])
investigate_log("<font color='red'>out of fuel</font>.", INVESTIGATE_SINGULO)
playsound(src, 'sound/machines/ding.ogg', 50, 1)
Radio.talk_into(src, "Insufficient plasma in [get_area(src)] [src], ejecting \the [loaded_tank].", FREQ_ENGINEERING)
eject()
else
var/gasdrained = min(powerproduction_drain*drainratio,loaded_tank.air_contents.gases[/datum/gas/plasma])
@@ -55,6 +64,7 @@
else if(is_station_level(z) && SSresearch.science_tech)
if(!loaded_tank.air_contents.gases[/datum/gas/tritium] || !loaded_tank.air_contents.gases[/datum/gas/oxygen])
playsound(src, 'sound/machines/ding.ogg', 50, 1)
Radio.talk_into(src, "Insufficient oxygen and tritium in [get_area(src)] [src] to produce research points, ejecting \the [loaded_tank].", FREQ_ENGINEERING)
eject()
else
var/gasdrained = bitcoinproduction_drain*drainratio
+1 -1
View File
@@ -201,7 +201,7 @@
// if(defer_powernet_rebuild != 2)
// defer_powernet_rebuild = 1
for(var/atom/X in urange(consume_range,src,1))
if(isturf(X) || ismovableatom(X))
if(isturf(X) || ismovable(X))
consume(X)
// if(defer_powernet_rebuild != 2)
// defer_powernet_rebuild = 0
@@ -79,8 +79,7 @@
construction_state = PA_CONSTRUCTION_UNSECURED
did_something = TRUE
else if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/CC = W
if(CC.use(1))
if(W.use_tool(src, user, 0, 1))
user.visible_message("[user.name] adds wires to the [name].", \
"You add some wires.")
construction_state = PA_CONSTRUCTION_PANEL_OPEN
@@ -222,8 +222,7 @@
construction_state = PA_CONSTRUCTION_UNSECURED
did_something = TRUE
else if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/CC = W
if(CC.use(1))
if(W.use_tool(src, user, 0, 1))
user.visible_message("<span class='notice'>[user.name] adds wires to the [name].</span>", \
"<span class='notice'>You add some wires.</span>")
construction_state = PA_CONSTRUCTION_PANEL_OPEN
@@ -119,14 +119,13 @@
/obj/singularity/Bump(atom/A)
set waitfor = FALSE
consume(A)
return
/obj/singularity/Bumped(atom/movable/AM)
set waitfor = FALSE
consume(AM)
/obj/singularity/process()
if(current_size >= STAGE_TWO)
move()
@@ -268,6 +267,7 @@
/obj/singularity/proc/eat()
set waitfor = FALSE
for(var/tile in spiral_range_turfs(grav_pull, src))
var/turf/T = tile
if(!T || !isturf(loc))
@@ -284,8 +284,6 @@
else
consume(X)
CHECK_TICK
return
/obj/singularity/proc/consume(atom/A)
var/gain = A.singularity_act(current_size, src)
@@ -295,8 +293,6 @@
name = "supermatter-charged [initial(name)]"
consumedSupermatter = 1
set_light(10)
return
/obj/singularity/proc/move(force_move = 0)
if(!move_self)
+4 -7
View File
@@ -125,15 +125,12 @@
to_chat(user, "<span class='notice'>You start building the power terminal...</span>")
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
if(do_after(user, 20, target = src) && C.get_amount() >= 10)
if(C.get_amount() < 10 || !C)
return
if(C.use_tool(src, user, 20, 10))
var/obj/structure/cable/N = T.get_cable_node() //get the connecting node cable, if there's one
if (prob(50) && electrocute_mob(usr, N, N, 1, TRUE)) //animate the electrocution if uncautious and unlucky
do_sparks(5, TRUE, src)
return
C.use(10)
user.visible_message(\
"[user.name] has built a power terminal.",\
"<span class='notice'>You build the power terminal.</span>")
@@ -220,7 +217,7 @@
. += "smes-og[clevel]"
/obj/machinery/power/smes/proc/chargedisplay()
return CLAMP(round(5.5*charge/capacity),0,5)
return clamp(round(5.5*charge/capacity),0,5)
/obj/machinery/power/smes/process()
if(stat & BROKEN)
@@ -372,7 +369,7 @@
target = text2num(target)
. = TRUE
if(.)
input_level = CLAMP(target, 0, input_level_max)
input_level = clamp(target, 0, input_level_max)
log_smes(usr)
if("output")
var/target = params["target"]
@@ -394,7 +391,7 @@
target = text2num(target)
. = TRUE
if(.)
output_level = CLAMP(target, 0, output_level_max)
output_level = clamp(target, 0, output_level_max)
log_smes(usr)
/obj/machinery/power/smes/proc/log_smes(mob/user)
+3 -5
View File
@@ -28,10 +28,8 @@
/obj/machinery/power/solar/Initialize(mapload, obj/item/solar_assembly/S)
. = ..()
panel = new()
#if DM_VERSION >= 513
panel.vis_flags = VIS_INHERIT_ID|VIS_INHERIT_ICON|VIS_INHERIT_PLANE
vis_contents += panel
#endif
panel.icon = icon
panel.icon_state = "solar_panel"
panel.layer = FLY_LAYER
@@ -170,7 +168,7 @@
else
//dot product of sun and panel -- Lambert's Cosine Law
. = cos(azimuth_current - sun_azimuth)
. = CLAMP(round(., 0.01), 0, 1)
. = clamp(round(., 0.01), 0, 1)
sunfrac = .
/obj/machinery/power/solar/process()
@@ -385,7 +383,7 @@
if(adjust)
value = azimuth_rate + adjust
if(value != null)
azimuth_rate = round(CLAMP(value, -2 * SSsun.base_rotation, 2 * SSsun.base_rotation), 0.01)
azimuth_rate = round(clamp(value, -2 * SSsun.base_rotation, 2 * SSsun.base_rotation), 0.01)
return TRUE
return FALSE
if(action == "tracking")
@@ -464,7 +462,7 @@
///Rotates the panel to the passed angles
/obj/machinery/power/solar_control/proc/set_panels(azimuth)
azimuth = CLAMP(round(azimuth, 0.01), -360, 719.99)
azimuth = clamp(round(azimuth, 0.01), -360, 719.99)
if(azimuth >= 360)
azimuth -= 360
if(azimuth < 0)
+15 -37
View File
@@ -66,8 +66,6 @@
#define SUPERMATTER_COUNTDOWN_TIME 30 SECONDS
#define SUPERMATTER_INTEGRITY_MULT 1.3 //(loss of integrity / 10) ^ 1.3
GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
/obj/machinery/power/supermatter_crystal
@@ -160,8 +158,6 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
var/datum/looping_sound/supermatter/soundloop
var/moveable = FALSE
var/min_damage = 0
var/power_calc = 0
/obj/machinery/power/supermatter_crystal/Initialize()
. = ..()
@@ -253,7 +249,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
add_overlay(causality_field, TRUE)
var/speaking = "[emergency_alert] The supermatter has reached critical integrity failure. Emergency causality destabilization field has been activated."
radio.talk_into(src, speaking, common_channel, language = get_default_language())
radio.talk_into(src, speaking, common_channel, language = get_selected_language())
for(var/i in SUPERMATTER_COUNTDOWN_TIME to 0 step -10)
if(damage < explosion_point) // Cutting it a bit close there engineers
radio.talk_into(src, "[safe_alert] Failsafe has been disengaged.", common_channel)
@@ -346,7 +342,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
else
if(takes_damage)
//causing damage
damage = max(damage + (max(CLAMP(removed.total_moles() / 200, 0.5, 1) * removed.temperature - ((T0C + HEAT_PENALTY_THRESHOLD)*dynamic_heat_resistance), 0) * mole_heat_penalty / 150 ) * DAMAGE_INCREASE_MULTIPLIER, 0)
damage = max(damage + (max(clamp(removed.total_moles() / 200, 0.5, 1) * removed.temperature - ((T0C + HEAT_PENALTY_THRESHOLD)*dynamic_heat_resistance), 0) * mole_heat_penalty / 150 ) * DAMAGE_INCREASE_MULTIPLIER, 0)
damage = max(damage + (max(power - POWER_PENALTY_THRESHOLD, 0)/500) * DAMAGE_INCREASE_MULTIPLIER, 0)
damage = max(damage + (max(combined_gas - MOLE_PENALTY_THRESHOLD, 0)/80) * DAMAGE_INCREASE_MULTIPLIER, 0)
@@ -356,7 +352,6 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
//capping damage
damage = min(damage_archived + (DAMAGE_HARDCAP * explosion_point),damage)
damage = max(min_damage, damage) //max integrity
if(damage > damage_archived && prob(10))
playsound(get_turf(src), 'sound/effects/empulse.ogg', 50, 1)
@@ -389,14 +384,14 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
mole_heat_penalty = max(combined_gas / MOLE_HEAT_PENALTY, 0.25)
if (combined_gas > POWERLOSS_INHIBITION_MOLE_THRESHOLD && co2comp > POWERLOSS_INHIBITION_GAS_THRESHOLD)
powerloss_dynamic_scaling = CLAMP(powerloss_dynamic_scaling + CLAMP(co2comp - powerloss_dynamic_scaling, -0.02, 0.02), 0, 1)
powerloss_dynamic_scaling = clamp(powerloss_dynamic_scaling + clamp(co2comp - powerloss_dynamic_scaling, -0.02, 0.02), 0, 1)
else
powerloss_dynamic_scaling = CLAMP(powerloss_dynamic_scaling - 0.05,0, 1)
powerloss_inhibitor = CLAMP(1-(powerloss_dynamic_scaling * CLAMP(combined_gas/POWERLOSS_INHIBITION_MOLE_BOOST_THRESHOLD,1 ,1.5)),0 ,1)
powerloss_dynamic_scaling = clamp(powerloss_dynamic_scaling - 0.05,0, 1)
powerloss_inhibitor = clamp(1-(powerloss_dynamic_scaling * clamp(combined_gas/POWERLOSS_INHIBITION_MOLE_BOOST_THRESHOLD,1 ,1.5)),0 ,1)
if(matter_power)
var/removed_matter = max(matter_power/MATTER_POWER_CONVERSION, 40)
power_calc = max(power_calc + removed_matter, 0)
power = max(power + removed_matter, 0)
matter_power = max(matter_power - removed_matter, 0)
var/temp_factor = 50
@@ -409,7 +404,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
temp_factor = 30
icon_state = base_icon_state
power_calc = max( (removed.temperature * temp_factor / T0C) * gasmix_power_ratio + power_calc, 0) //Total laser power plus an overload
power = max( (removed.temperature * temp_factor / T0C) * gasmix_power_ratio + power, 0) //Total laser power plus an overload
if(prob(50))
radiation_pulse(src, power * (1 + (tritiumcomp * TRITIUM_RADIOACTIVITY_MODIFIER) + ((pluoxiumcomp * PLUOXIUM_RADIOACTIVITY_MODIFIER) * pluoxiumbonus) * (power_transmission_bonus/(10-(bzcomp * BZ_RADIOACTIVITY_MODIFIER))))) // Rad Modifiers BZ(500%), Tritium(300%), and Pluoxium(-200%)
@@ -441,19 +436,15 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
for(var/mob/living/carbon/human/l in view(src, HALLUCINATION_RANGE(power))) // If they can see it without mesons on. Bad on them.
if(!istype(l.glasses, /obj/item/clothing/glasses/meson))
var/D = sqrt(1 / max(1, get_dist(l, src)))
l.hallucination += power_calc * config_hallucination_power * D
l.hallucination = CLAMP(0, 200, l.hallucination)
l.hallucination += power * config_hallucination_power * D
l.hallucination = clamp(0, 200, l.hallucination)
for(var/mob/living/l in range(src, round((power / 100) ** 0.25)))
var/rads = (power / 10) * sqrt( 1 / max(get_dist(l, src),1) )
l.rad_act(rads)
power_calc -= ((power_calc/500)**3) * powerloss_inhibitor
if ((100-get_integrity()) < 75)
power = (power_calc * ((100 - (0.15*(100-get_integrity()) - 5)**2) / 100)) + power_calc*0.1
else
power = power_calc * (((100-get_integrity())^((3*(100-get_integrity()))/1000) + 2*(100-get_integrity()))/100) //new and improved, more linear
//power = power_calc * ((((100-get_integrity())**1.3)-(2*(100-get_integrity())))/100)
power -= ((power/500)**3) * powerloss_inhibitor
if(power > POWER_PENALTY_THRESHOLD || damage > damage_penalty_point)
if(power > POWER_PENALTY_THRESHOLD)
@@ -466,7 +457,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
supermatter_zap(src, 5, min(power*2, 20000))
else if (damage > damage_penalty_point && prob(20))
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, 1, extrarange = 10)
supermatter_zap(src, 5, CLAMP(power*2, 4000, 20000))
supermatter_zap(src, 5, clamp(power*2, 4000, 20000))
if(prob(15) && power > POWER_PENALTY_THRESHOLD)
supermatter_pull(src, power/750)
@@ -476,9 +467,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
supermatter_anomaly_gen(src, GRAVITATIONAL_ANOMALY, rand(5, 10))
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(2) || prob(0.3) && power > POWER_PENALTY_THRESHOLD)
supermatter_anomaly_gen(src, PYRO_ANOMALY, rand(5, 10))
if (damage - damage_archived > 0)
min_damage += ((damage - damage_archived) / 9) * SUPERMATTER_INTEGRITY_MULT
if(damage > (min_damage < 200 ? min_damage : 0) + warning_point) // while the core is still damaged and it's still worth noting its status
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
if((REALTIMEOFDAY - lastwarning) / 10 >= WARNING_DELAY)
alarm()
@@ -517,7 +506,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
if(!istype(Proj.firer, /obj/machinery/power/emitter))
investigate_log("has been hit by [Proj] fired by [key_name(Proj.firer)]", INVESTIGATE_SUPERMATTER)
if(Proj.flag != "bullet")
power_calc += Proj.damage * config_bullet_energy
power += Proj.damage * config_bullet_energy
if(!has_been_powered)
investigate_log("has been powered for the first time.", INVESTIGATE_SUPERMATTER)
message_admins("[src] has been powered for the first time [ADMIN_JMP(src)].")
@@ -618,17 +607,6 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
to_chat(user, "<span class='notice'>You extract a sliver from \the [src]. \The [src] begins to react violently!</span>")
new /obj/item/nuke_core/supermatter_sliver(drop_location())
matter_power += 200
if (istype(W, /obj/item/supermatterspray))
var/obj/item/supermatterspray/S = W
if (S.usesleft > 0 && do_after(user, 60, target=src))
min_damage = max(0,min_damage - 10)
to_chat(user, "<span class='notice'>You spray \the [src] with [S].</span>")
playsound(user.loc,'sound/effects/spray2.ogg',50,1,-6)
S.usesleft--
if (prob(10))
to_chat(user, "<span class='warning'>Your hands slip and you drop [S] into \the [src]!</span>")
Consume(S)
return
else if(user.dropItemToGround(W))
user.visible_message("<span class='danger'>As [user] touches \the [src] with \a [W], silence fills the room...</span>",\
"<span class='userdanger'>You touch \the [src] with \the [W], and everything suddenly goes silent.</span>\n<span class='notice'>\The [W] flashes into dust as you flinch away from \the [src].</span>",\
@@ -736,7 +714,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
/obj/machinery/power/supermatter_crystal/proc/supermatter_pull(turf/center, pull_range = 10)
playsound(src.loc, 'sound/weapons/marauder.ogg', 100, 1, extrarange = 7)
for(var/atom/P in orange(pull_range,center))
if(ismovableatom(P))
if(ismovable(P))
var/atom/movable/pulled_object = P
if(ishuman(P))
var/mob/living/carbon/human/H = P
+1 -1
View File
@@ -65,7 +65,7 @@
pixel_x = -32
pixel_y = -32
for (var/ball in orbiting_balls)
var/range = rand(1, CLAMP(orbiting_balls.len, 3, 7))
var/range = rand(1, clamp(orbiting_balls.len, 3, 7))
tesla_zap(ball, range, TESLA_MINI_POWER/7*range)
else
energy = 0 // ensure we dont have miniballs of miniballs