Merge branch 'master' into upstream-merge-33246

This commit is contained in:
LetterJay
2017-12-20 00:27:06 -06:00
committed by GitHub
808 changed files with 14650 additions and 10287 deletions
+1 -1
View File
@@ -339,7 +339,7 @@
if(href_list["ejectjar"])
if(fueljar)
fueljar.loc = src.loc
fueljar.forceMove(drop_location())
fueljar = null
//fueljar.control_unit = null currently it does not care where it is
//update_icon() when we have the icon for it
+3 -3
View File
@@ -153,7 +153,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
@@ -972,7 +972,7 @@
else
to_chat(occupier, "<span class='danger'>Primary core damaged, unable to return core processes.</span>")
if(forced)
occupier.loc = src.loc
occupier.forceMove(drop_location())
occupier.death()
occupier.gib()
for(var/obj/item/pinpointer/nuke/P in GLOB.pinpointer_list)
@@ -1253,7 +1253,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)
+2 -1
View File
@@ -427,7 +427,7 @@ By design, d1 is the smallest direction and d2 is the highest
var/obj/O = P_list[1]
// remove the cut cable from its turf and powernet, so that it doesn't get count in propagate_network worklist
if(remove)
loc = null
moveToNullspace()
powernet.remove_cable(src) //remove the cut cable from its powernet
addtimer(CALLBACK(O, .proc/auto_propogate_cut_cable, O), 0) //so we don't rebuild the network X times when singulo/explosion destroys a line of X cables
@@ -472,6 +472,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
attack_verb = list("whipped", "lashed", "disciplined", "flogged")
singular_name = "cable piece"
full_w_class = WEIGHT_CLASS_SMALL
grind_results = list("copper" = 2) //2 copper per cable in the coil
/obj/item/stack/cable_coil/cyborg
is_cyborg = 1
+7 -13
View File
@@ -6,7 +6,6 @@
item_state = "cell"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
origin_tech = "powerstorage=1"
force = 5
throwforce = 5
throw_speed = 2
@@ -15,6 +14,7 @@
var/charge = 0 // note %age conveted to actual charge in New
var/maxcharge = 1000
materials = list(MAT_METAL=700, MAT_GLASS=50)
grind_results = list("lithium" = 15, "iron" = 5, "silicon" = 5)
var/rigged = 0 // true if rigged to explode
var/chargerate = 100 //how much power is given every tick in a recharger
var/self_recharge = 0 //does it self recharge, over time, or not?
@@ -24,9 +24,11 @@
/obj/item/stock_parts/cell/get_cell()
return src
/obj/item/stock_parts/cell/New()
/obj/item/stock_parts/cell/Initialize(mapload, override_maxcharge)
. = ..()
START_PROCESSING(SSobj, src)
if (override_maxcharge)
maxcharge = override_maxcharge
charge = maxcharge
if(ratingdesc)
desc += " This one has a rating of [DisplayEnergy(maxcharge)], and you should not swallow it."
@@ -106,6 +108,7 @@
to_chat(user, "<span class='notice'>You inject the solution into the power cell.</span>")
if(S.reagents.has_reagent("plasma", 5))
rigged = 1
grind_results["plasma"] = 5
S.reagents.clear_reagents()
@@ -154,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
@@ -185,7 +188,6 @@
/obj/item/stock_parts/cell/secborg
name = "security borg rechargeable D battery"
origin_tech = null
maxcharge = 600 //600 max charge / 100 charge per shot = six shots
materials = list(MAT_GLASS=40)
rating = 2.5
@@ -210,7 +212,6 @@
/obj/item/stock_parts/cell/high
name = "high-capacity power cell"
origin_tech = "powerstorage=2"
icon_state = "hcell"
maxcharge = 10000
materials = list(MAT_GLASS=60)
@@ -230,7 +231,6 @@
/obj/item/stock_parts/cell/super
name = "super-capacity power cell"
origin_tech = "powerstorage=3;materials=3"
icon_state = "scell"
maxcharge = 20000
materials = list(MAT_GLASS=300)
@@ -243,7 +243,6 @@
/obj/item/stock_parts/cell/hyper
name = "hyper-capacity power cell"
origin_tech = "powerstorage=4;engineering=4;materials=4"
icon_state = "hpcell"
maxcharge = 30000
materials = list(MAT_GLASS=400)
@@ -257,7 +256,6 @@
/obj/item/stock_parts/cell/bluespace
name = "bluespace power cell"
desc = "A rechargeable transdimensional power cell."
origin_tech = "powerstorage=5;bluespace=4;materials=4;engineering=4"
icon_state = "bscell"
maxcharge = 40000
materials = list(MAT_GLASS=600)
@@ -271,7 +269,6 @@
/obj/item/stock_parts/cell/infinite
name = "infinite-capacity power cell!"
icon_state = "icell"
origin_tech = "powerstorage=7"
maxcharge = 30000
materials = list(MAT_GLASS=1000)
rating = 6
@@ -285,7 +282,6 @@
desc = "An alien power cell that produces energy seemingly out of nowhere."
icon = 'icons/obj/abductor.dmi'
icon_state = "cell"
origin_tech = "abductor=5;powerstorage=8;engineering=6"
maxcharge = 50000
rating = 12
ratingdesc = FALSE
@@ -299,7 +295,6 @@
desc = "A rechargeable starch based power cell."
icon = 'icons/obj/hydroponics/harvest.dmi'
icon_state = "potato"
origin_tech = "powerstorage=1;biotech=1"
charge = 100
maxcharge = 300
materials = list()
@@ -309,7 +304,6 @@
/obj/item/stock_parts/cell/high/slime
name = "charged slime core"
desc = "A yellow slime core infused with plasma, it crackles with power."
origin_tech = "powerstorage=5;biotech=4"
icon = 'icons/mob/slimes.dmi'
icon_state = "yellow slime extract"
materials = list()
@@ -342,7 +336,7 @@
return
/obj/item/stock_parts/cell/beam_rifle/emp_act(severity)
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
View File
@@ -680,6 +680,7 @@
var/base_state
var/switchcount = 0 // number of times switched
materials = list(MAT_GLASS=100)
grind_results = list("silicon" = 5, "nitrogen" = 10) //Nitrogen is used as a cheaper alternative to argon in incandescent lighbulbs
var/rigged = 0 // true if rigged to explode
var/brightness = 2 //how much light it gives off
+1 -1
View File
@@ -94,6 +94,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
+1 -1
View File
@@ -132,7 +132,7 @@
var/obj/item/tank/internals/plasma/Z = src.loaded_tank
if (!Z)
return
Z.loc = get_turf(src)
Z.forceMove(drop_location())
Z.layer = initial(Z.layer)
Z.plane = initial(Z.plane)
src.loaded_tank = null
@@ -285,9 +285,8 @@ field_generator power level display
var/field_dir = get_dir(T,get_step(G.loc, NSEW))
T = get_step(T, NSEW)
if(!locate(/obj/machinery/field/containment) in T)
var/obj/machinery/field/containment/CF = new/obj/machinery/field/containment()
var/obj/machinery/field/containment/CF = new(T)
CF.set_master(src,G)
CF.loc = T
CF.setDir(field_dir)
fields += CF
G.fields += CF
+3 -3
View File
@@ -227,7 +227,7 @@
/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)
@@ -382,7 +382,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.ckey)
if("output")
var/target = params["target"]
@@ -404,7 +404,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.ckey)
/obj/machinery/power/smes/proc/log_smes(user = "")
+4 -4
View File
@@ -378,14 +378,14 @@
if("direction")
var/adjust = text2num(params["adjust"])
if(adjust)
currentdir = Clamp((360 + adjust + currentdir) % 360, 0, 359)
currentdir = CLAMP((360 + adjust + currentdir) % 360, 0, 359)
targetdir = currentdir
set_panels(currentdir)
. = TRUE
if("rate")
var/adjust = text2num(params["adjust"])
if(adjust)
trackrate = Clamp(trackrate + adjust, -7200, 7200)
trackrate = CLAMP(trackrate + adjust, -7200, 7200)
if(trackrate)
nexttime = world.time + 36000 / abs(trackrate)
. = TRUE
@@ -419,7 +419,7 @@
new /obj/item/shard( src.loc )
var/obj/item/circuitboard/computer/solar_control/M = new /obj/item/circuitboard/computer/solar_control( A )
for (var/obj/C in src)
C.loc = src.loc
C.forceMove(drop_location())
A.circuit = M
A.state = 3
A.icon_state = "3"
@@ -430,7 +430,7 @@
var/obj/structure/frame/computer/A = new /obj/structure/frame/computer( src.loc )
var/obj/item/circuitboard/computer/solar_control/M = new /obj/item/circuitboard/computer/solar_control( A )
for (var/obj/C in src)
C.loc = src.loc
C.forceMove(drop_location())
A.circuit = M
A.state = 4
A.icon_state = "4"
@@ -317,10 +317,10 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard)
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)
@@ -368,7 +368,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard)
if(!istype(l.glasses, /obj/item/clothing/glasses/meson))
var/D = sqrt(1 / max(1, get_dist(l, src)))
l.hallucination += power * 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) )
@@ -386,7 +386,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard)
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)
-2
View File
@@ -103,8 +103,6 @@
buckle_lying = FALSE
buckle_requires_restraints = TRUE
circuit = /obj/item/circuitboard/machine/grounding_rod
/obj/machinery/power/grounding_rod/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20)
. = ..()
if(. == SUCCESSFUL_UNFASTEN)
+2 -2
View File
@@ -62,7 +62,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, TRUE)
else
energy = 0 // ensure we dont have miniballs of miniballs
@@ -268,7 +268,7 @@
closest_grounding_rod.tesla_act(power, explosive, stun_mobs)
else if(closest_mob)
var/shock_damage = Clamp(round(power/400), 10, 90) + rand(-5, 5)
var/shock_damage = CLAMP(round(power/400), 10, 90) + rand(-5, 5)
closest_mob.electrocute_act(shock_damage, source, 1, tesla_shock = 1, stun = stun_mobs)
if(issilicon(closest_mob))
var/mob/living/silicon/S = closest_mob
+2 -2
View File
@@ -47,7 +47,7 @@
S.glass_type = /obj/item/stack/sheet/glass
S.tracker = 1
S.anchored = TRUE
S.loc = src
S.forceMove(src)
update_icon()
//updates the tracker icon and the facing angle for the control computer
@@ -94,4 +94,4 @@
// Tracker Electronic
/obj/item/electronics/tracker
name = "tracker electronics"
name = "tracker electronics"
-1
View File
@@ -75,7 +75,6 @@
// The inlet of the compressor is the direction it faces
gas_contained = new
inturf = get_step(src, dir)
locate_machinery()
if(!turbine)
stat |= BROKEN