This commit is contained in:
Ghommie
2019-06-17 09:51:22 +02:00
530 changed files with 10324 additions and 6354 deletions
+5 -5
View File
@@ -639,7 +639,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
// called when cable_coil is click on an installed obj/cable
// or click on a turf that already contains a "node" cable
/obj/item/stack/cable_coil/proc/cable_join(obj/structure/cable/C, mob/user, var/showerror = TRUE)
/obj/item/stack/cable_coil/proc/cable_join(obj/structure/cable/C, mob/user, showerror = TRUE, forceddir)
var/turf/U = user.loc
if(!isturf(U))
return
@@ -654,14 +654,14 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
return
if(U == T) //if clicked on the turf we're standing on, try to put a cable in the direction we're facing
if(U == T && !forceddir) //if clicked on the turf we're standing on and a direction wasn't supplied, try to put a cable in the direction we're facing
place_turf(T,user)
return
var/dirn = get_dir(C, user)
// one end of the clicked cable is pointing towards us
if(C.d1 == dirn || C.d2 == dirn)
// one end of the clicked cable is pointing towards us and no direction was supplied
if((C.d1 == dirn || C.d2 == dirn) && !forceddir)
if(!U.can_have_cabling()) //checking if it's a plating or catwalk
if (showerror)
to_chat(user, "<span class='warning'>You can only lay cables on catwalks and plating!</span>")
@@ -706,7 +706,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
return
// exisiting cable doesn't point at our position, so see if it's a stub
// exisiting cable doesn't point at our position or we have a supplied direction, so see if it's a stub
else if(C.d1 == 0)
// if so, make it a full cable pointing from it's old direction to our dirn
var/nd1 = C.d2 // these will be the new directions
+6 -7
View File
@@ -20,15 +20,15 @@
var/self_recharge = 0 //does it self recharge, over time, or not?
var/ratingdesc = TRUE
var/grown_battery = FALSE // If it's a grown that acts as a battery, add a wire overlay to it.
container_type = INJECTABLE|DRAINABLE
/obj/item/stock_parts/cell/get_cell()
return src
/obj/item/stock_parts/cell/Initialize(mapload, override_maxcharge)
. = ..()
START_PROCESSING(SSobj, src)
create_reagents(5)
if(self_recharge)
START_PROCESSING(SSobj, src)
create_reagents(5, INJECTABLE | DRAINABLE)
if (override_maxcharge)
maxcharge = override_maxcharge
charge = maxcharge
@@ -70,8 +70,8 @@
return 100*charge/maxcharge
// use power from a cell
/obj/item/stock_parts/cell/use(amount)
if(rigged && amount > 0)
/obj/item/stock_parts/cell/use(amount, can_explode = TRUE)
if(rigged && amount > 0 && can_explode)
explode()
return 0
if(charge < amount)
@@ -104,9 +104,8 @@
return (FIRELOSS)
/obj/item/stock_parts/cell/on_reagent_change(changetype)
rigged = !isnull(reagents.has_reagent("plasma", 5)) //has_reagent returns the reagent datum
..()
rigged = reagents?.has_reagent("plasma", 5) ? TRUE : FALSE //has_reagent returns the reagent datum
/obj/item/stock_parts/cell/proc/explode()
var/turf/T = get_turf(src.loc)
+1 -1
View File
@@ -604,7 +604,7 @@
else
prot = 1
if(prot > 0 || user.has_trait(TRAIT_RESISTHEAT) || user.has_trait(TRAIT_RESISTHEATHANDS))
if(prot > 0 || HAS_TRAIT(user, TRAIT_RESISTHEAT) || HAS_TRAIT(user, TRAIT_RESISTHEATHANDS))
to_chat(user, "<span class='notice'>You remove the light [fitting].</span>")
else if(istype(user) && user.dna.check_mutation(TK))
to_chat(user, "<span class='notice'>You telekinetically remove the light [fitting].</span>")
+8 -11
View File
@@ -43,11 +43,10 @@
playsound(src, 'sound/machines/ding.ogg', 50, 1)
eject()
else
var/gasdrained = min(powerproduction_drain*drainratio,loaded_tank.air_contents.gases[/datum/gas/plasma][MOLES])
loaded_tank.air_contents.gases[/datum/gas/plasma][MOLES] -= gasdrained
loaded_tank.air_contents.assert_gas(/datum/gas/tritium)
loaded_tank.air_contents.gases[/datum/gas/tritium][MOLES] += gasdrained
loaded_tank.air_contents.garbage_collect()
var/gasdrained = min(powerproduction_drain*drainratio,loaded_tank.air_contents.gases[/datum/gas/plasma])
loaded_tank.air_contents.gases[/datum/gas/plasma] -= gasdrained
loaded_tank.air_contents.gases[/datum/gas/tritium] += gasdrained
GAS_GARBAGE_COLLECT(loaded_tank.air_contents.gases)
var/power_produced = RAD_COLLECTOR_OUTPUT
add_avail(power_produced)
@@ -58,11 +57,10 @@
eject()
else
var/gasdrained = bitcoinproduction_drain*drainratio
loaded_tank.air_contents.gases[/datum/gas/tritium][MOLES] -= gasdrained
loaded_tank.air_contents.gases[/datum/gas/oxygen][MOLES] -= gasdrained
loaded_tank.air_contents.assert_gas(/datum/gas/carbon_dioxide)
loaded_tank.air_contents.gases[/datum/gas/carbon_dioxide][MOLES] += gasdrained*2
loaded_tank.air_contents.garbage_collect()
loaded_tank.air_contents.gases[/datum/gas/tritium] -= gasdrained
loaded_tank.air_contents.gases[/datum/gas/oxygen] -= gasdrained
loaded_tank.air_contents.gases[/datum/gas/carbon_dioxide] += gasdrained*2
GAS_GARBAGE_COLLECT(loaded_tank.air_contents.gases)
var/bitcoins_mined = RAD_COLLECTOR_OUTPUT
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, bitcoins_mined*RAD_COLLECTOR_MINING_CONVERSION_RATE)
stored_power-=bitcoins_mined
@@ -76,7 +74,6 @@
var/fuel
if(loaded_tank)
fuel = loaded_tank.air_contents.gases[/datum/gas/plasma]
fuel = fuel ? fuel[MOLES] : 0
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [key_name(user)]. [loaded_tank?"Fuel: [round(fuel/0.29)]%":"<font color='red'>It is empty</font>"].", INVESTIGATE_SINGULO)
return
else
@@ -351,16 +351,15 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
if(damage > damage_archived && prob(10))
playsound(get_turf(src), 'sound/effects/empulse.ogg', 50, 1)
removed.assert_gases(/datum/gas/oxygen, /datum/gas/plasma, /datum/gas/carbon_dioxide, /datum/gas/nitrous_oxide, /datum/gas/nitrogen)
//calculating gas related values
combined_gas = max(removed.total_moles(), 0)
plasmacomp = max(removed.gases[/datum/gas/plasma][MOLES]/combined_gas, 0)
o2comp = max(removed.gases[/datum/gas/oxygen][MOLES]/combined_gas, 0)
co2comp = max(removed.gases[/datum/gas/carbon_dioxide][MOLES]/combined_gas, 0)
plasmacomp = max(removed.gases[/datum/gas/plasma]/combined_gas, 0)
o2comp = max(removed.gases[/datum/gas/oxygen]/combined_gas, 0)
co2comp = max(removed.gases[/datum/gas/carbon_dioxide]/combined_gas, 0)
n2ocomp = max(removed.gases[/datum/gas/nitrous_oxide][MOLES]/combined_gas, 0)
n2comp = max(removed.gases[/datum/gas/nitrogen][MOLES]/combined_gas, 0)
n2ocomp = max(removed.gases[/datum/gas/nitrous_oxide]/combined_gas, 0)
n2comp = max(removed.gases[/datum/gas/nitrogen]/combined_gas, 0)
gasmix_power_ratio = min(max(plasmacomp + o2comp + co2comp - n2comp, 0), 1)
@@ -412,9 +411,9 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
removed.temperature = max(0, min(removed.temperature, 2500 * dynamic_heat_modifier))
//Calculate how much gas to release
removed.gases[/datum/gas/plasma][MOLES] += max((device_energy * dynamic_heat_modifier) / PLASMA_RELEASE_MODIFIER, 0)
removed.gases[/datum/gas/plasma] += max((device_energy * dynamic_heat_modifier) / PLASMA_RELEASE_MODIFIER, 0)
removed.gases[/datum/gas/oxygen][MOLES] += max(((device_energy + removed.temperature * dynamic_heat_modifier) - T0C) / OXYGEN_RELEASE_MODIFIER, 0)
removed.gases[/datum/gas/oxygen] += max(((device_energy + removed.temperature * dynamic_heat_modifier) - T0C) / OXYGEN_RELEASE_MODIFIER, 0)
if(produces_gas)
env.merge(removed)