Merge branch 'master' into algaegen

This commit is contained in:
Cyantime
2017-12-01 19:14:56 -05:00
committed by GitHub
21 changed files with 233 additions and 140 deletions

View File

@@ -41,7 +41,7 @@
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
default_apply_parts()
update_icon()
// TODO - Make these in acutal icon states so its not silly like this
// TODO - Make these in actual icon states so its not silly like this
var/image/I = image(icon = icon, icon_state = "algae-pipe-overlay", dir = dir)
I.color = PIPE_COLOR_BLUE
overlays += I
@@ -60,8 +60,14 @@
if(inoperable() || use_power < 2)
ui_error = null
update_icon()
if(use_power == 1)
last_power_draw = idle_power_usage
else
last_power_draw = 0
return 0
last_power_draw = active_power_usage
// STEP 1 - Check material resources
if(stored_material[MATERIAL_ALGAE] < algae_per_mole)
ui_error = "Insufficient [material_display_name(MATERIAL_ALGAE)] to process."
@@ -73,7 +79,7 @@
return
var/moles_to_convert = min(moles_per_tick,\
stored_material[MATERIAL_ALGAE] * algae_per_mole,\
storage_capacity[MATERIAL_CARBON] - stored_material[MATERIAL_CARBON] * carbon_per_mole)
storage_capacity[MATERIAL_CARBON] - stored_material[MATERIAL_CARBON])
// STEP 2 - Take the CO2 out of the input!
var/power_draw = scrub_gas(src, list(input_gas), air1, internal, moles_to_convert)
@@ -118,7 +124,7 @@
return 1
/obj/machinery/atmospherics/binary/algae_farm/attackby(obj/item/weapon/W as obj, mob/user as mob)
src.add_fingerprint(user)
add_fingerprint(user)
if(default_deconstruction_screwdriver(user, W))
return
if(default_deconstruction_crowbar(user, W))
@@ -128,11 +134,12 @@
if(try_load_materials(user, W))
return
else
user << "<span class='notice'>You cannot insert this item into \the [src]!</span>"
to_chat(user, "<span class='notice'>You cannot insert this item into \the [src]!</span>")
return
/obj/machinery/atmospherics/binary/algae_farm/attack_hand(mob/user)
if(..()) return 1
if(..())
return 1
ui_interact(user)
/obj/machinery/atmospherics/binary/algae_farm/RefreshParts()
@@ -251,7 +258,7 @@
if(!istype(S))
return 0
if(!(S.material.name in stored_material))
user << "<span class='warning'>\The [src] doesn't accept [material_display_name(S.material)]!</span>"
to_chat(user, "<span class='warning'>\The [src] doesn't accept [material_display_name(S.material)]!</span>")
return 1
var/max_res_amount = storage_capacity[S.material.name]
if(stored_material[S.material.name] + S.perunit <= max_res_amount)
@@ -263,7 +270,7 @@
user.visible_message("\The [user] inserts [S.name] into \the [src].", "<span class='notice'>You insert [count] [S.name] into \the [src].</span>")
updateUsrDialog()
else
user << "<span class='warning'>\The [src] cannot hold more [S.name].</span>"
to_chat(user, "<span class='warning'>\The [src] cannot hold more [S.name].</span>")
return 1
/material/algae