Backward 512 compatibility removal.
This commit is contained in:
@@ -208,7 +208,7 @@
|
||||
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
|
||||
@@ -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)
|
||||
|
||||
@@ -217,7 +217,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 +233,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
|
||||
|
||||
@@ -565,7 +565,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
|
||||
@@ -848,4 +848,4 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
. = ..()
|
||||
var/list/cable_colors = GLOB.cable_colors
|
||||
color = pick(cable_colors)
|
||||
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -220,7 +220,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 +372,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 +394,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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -346,7 +346,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)
|
||||
|
||||
@@ -389,10 +389,10 @@ 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)
|
||||
@@ -442,7 +442,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
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 = 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) )
|
||||
@@ -466,7 +466,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)
|
||||
@@ -736,7 +736,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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user