Merge remote-tracking branch 'upstream/dev' into gun-rewrite

Conflicts:
	code/modules/clothing/under/ties.dm
	code/modules/projectiles/projectile.dm
This commit is contained in:
mwerezak
2015-02-10 20:59:22 -05:00
97 changed files with 3568 additions and 2565 deletions

View File

@@ -14,138 +14,136 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
var/diamond_amount = 0
var/uranium_amount = 0
var/max_material_amount = 75000.0
var/mat_efficiency = 1
use_power = 1
idle_power_usage = 30
active_power_usage = 2500
New()
..()
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/circuit_imprinter(src)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src)
component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src)
RefreshParts()
/obj/machinery/r_n_d/circuit_imprinter/New()
..()
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/circuit_imprinter(src)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src)
component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src)
RefreshParts()
var/T = 0
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
T += G.reagents.maximum_volume
var/datum/reagents/R = new/datum/reagents(T) //Holder for the reagents used as materials.
reagents = R
R.my_atom = src
T = 0
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
T += M.rating
max_material_amount = T * 75000.0
/obj/machinery/r_n_d/circuit_imprinter/RefreshParts()
var/T = 0
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
T += G.reagents.maximum_volume
var/datum/reagents/R = new/datum/reagents(T) //Holder for the reagents used as materials.
reagents = R
R.my_atom = src
T = 0
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
T += M.rating
max_material_amount = T * 75000.0
T = 0
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
T += M.rating
mat_efficiency = 1 - (T - 1) / 4
blob_act()
if (prob(50))
del(src)
/obj/machinery/r_n_d/circuit_imprinter/update_icon()
if(panel_open)
icon_state = "circuit_imprinter_t"
else
icon_state = "circuit_imprinter"
meteorhit()
/obj/machinery/r_n_d/circuit_imprinter/blob_act()
if(prob(50))
del(src)
/obj/machinery/r_n_d/circuit_imprinter/meteorhit()
del(src)
return
/obj/machinery/r_n_d/circuit_imprinter/proc/TotalMaterials()
return g_amount + gold_amount + diamond_amount + uranium_amount
/obj/machinery/r_n_d/circuit_imprinter/dismantle()
for(var/obj/I in component_parts)
if(istype(I, /obj/item/weapon/reagent_containers/glass/beaker))
reagents.trans_to(I, reagents.total_volume)
if(g_amount >= 3750)
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(loc)
G.amount = round(g_amount / 3750)
if(gold_amount >= 2000)
var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold(loc)
G.amount = round(gold_amount / 2000)
if(diamond_amount >= 2000)
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(loc)
G.amount = round(diamond_amount / 2000)
if(uranium_amount >= 2000)
var/obj/item/stack/sheet/mineral/uranium/G = new /obj/item/stack/sheet/mineral/uranium(loc)
G.amount = round(uranium_amount / 2000)
..()
/obj/machinery/r_n_d/circuit_imprinter/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(shocked)
shock(user, 50)
if(default_deconstruction_screwdriver(user, O))
if(linked_console)
linked_console.linked_imprinter = null
linked_console = null
return
if(default_deconstruction_crowbar(user, O))
return
if(default_part_replacement(user, O))
return
if(panel_open)
user << "<span class='notice'>You can't load \the [src] while it's opened.</span>"
return 1
if(disabled)
user << "\The [src] appears to not be working!"
return
if(!linked_console)
user << "\The [src] must be linked to an R&D console first!"
return 1
if(O.is_open_container())
return 0
if(!istype(O, /obj/item/stack/sheet/glass) && !istype(O, /obj/item/stack/sheet/mineral/gold) && !istype(O, /obj/item/stack/sheet/mineral/diamond) && !istype(O, /obj/item/stack/sheet/mineral/uranium))
user << "<span class='notice'>You cannot insert this item into \the [src]!</span>"
return 1
if(stat)
return 1
if(busy)
user << "<span class='notice'>\The [src] is busy. Please wait for completion of previous operation.</span>"
return 1
var/obj/item/stack/sheet/stack = O
if((TotalMaterials() + stack.perunit) > max_material_amount)
user << "<span class='notice'>\The [src] is full. Please remove glass from \the [src] in order to insert more.</span>"
return 1
proc/TotalMaterials()
return g_amount + gold_amount + diamond_amount + uranium_amount
var/amount = round(input("How many sheets do you want to add?") as num)
if(amount < 0)
amount = 0
if(amount == 0)
return
if(amount > stack.amount)
amount = min(stack.amount, round((max_material_amount - TotalMaterials()) / stack.perunit))
attackby(var/obj/item/O as obj, var/mob/user as mob)
if (shocked)
shock(user,50)
if (istype(O, /obj/item/weapon/screwdriver))
if (!opened)
opened = 1
if(linked_console)
linked_console.linked_imprinter = null
linked_console = null
icon_state = "circuit_imprinter_t"
user << "You open the maintenance hatch of [src]."
else
opened = 0
icon_state = "circuit_imprinter"
user << "You close the maintenance hatch of [src]."
return
if (opened)
if(istype(O, /obj/item/weapon/crowbar))
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
M.state = 2
M.icon_state = "box_1"
for(var/obj/I in component_parts)
if(istype(I, /obj/item/weapon/reagent_containers/glass/beaker))
reagents.trans_to(I, reagents.total_volume)
if(I.reliability != 100 && crit_fail)
I.crit_fail = 1
I.loc = src.loc
if(g_amount >= 3750)
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
G.amount = round(g_amount / 3750)
if(gold_amount >= 2000)
var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold(src.loc)
G.amount = round(gold_amount / 2000)
if(diamond_amount >= 2000)
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(src.loc)
G.amount = round(diamond_amount / 2000)
if(uranium_amount >= 2000)
var/obj/item/stack/sheet/mineral/uranium/G = new /obj/item/stack/sheet/mineral/uranium(src.loc)
G.amount = round(uranium_amount / 2000)
del(src)
return 1
else
user << "\red You can't load the [src.name] while it's opened."
return 1
if (disabled)
user << "\The [name] appears to not be working!"
return
if (!linked_console)
user << "\The [name] must be linked to an R&D console first!"
return 1
if (O.is_open_container())
return 0
if (!istype(O, /obj/item/stack/sheet/glass) && !istype(O, /obj/item/stack/sheet/mineral/gold) && !istype(O, /obj/item/stack/sheet/mineral/diamond) && !istype(O, /obj/item/stack/sheet/mineral/uranium))
user << "\red You cannot insert this item into the [name]!"
return 1
if (stat)
return 1
if (busy)
user << "\red The [name] is busy. Please wait for completion of previous operation."
return 1
var/obj/item/stack/sheet/stack = O
if ((TotalMaterials() + stack.perunit) > max_material_amount)
user << "\red The [name] is full. Please remove glass from the protolathe in order to insert more."
return 1
var/amount = round(input("How many sheets do you want to add?") as num)
if(amount < 0)
amount = 0
if(amount == 0)
return
if(amount > stack.amount)
amount = min(stack.amount, round((max_material_amount-TotalMaterials())/stack.perunit))
busy = 1
use_power(max(1000, (3750*amount/10)))
var/stacktype = stack.type
stack.use(amount)
if(do_after(usr,16))
user << "\blue You add [amount] sheets to the [src.name]."
switch(stacktype)
if(/obj/item/stack/sheet/glass)
g_amount += amount * 3750
if(/obj/item/stack/sheet/mineral/gold)
gold_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/diamond)
diamond_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/uranium)
uranium_amount += amount * 2000
else
new stacktype(src.loc, amount)
busy = 0
src.updateUsrDialog()
busy = 1
use_power(max(1000, (3750 * amount / 10)))
var/stacktype = stack.type
stack.use(amount)
if(do_after(usr, 16))
user << "<span class='notice'>You add [amount] sheets to \the [src].</span>"
switch(stacktype)
if(/obj/item/stack/sheet/glass)
g_amount += amount * 3750
if(/obj/item/stack/sheet/mineral/gold)
gold_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/diamond)
diamond_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/uranium)
uranium_amount += amount * 2000
else
new stacktype(loc, amount)
busy = 0
updateUsrDialog()
//This is to stop these machines being hackable via clicking.
/obj/machinery/r_n_d/circuit_imprinter/attack_hand(mob/user as mob)

View File

@@ -760,6 +760,14 @@ datum/design/item/stock_part/AssembleDesignDesc()
if(!desc)
desc = "A stock part used in the construction of various devices."
/datum/design/item/stock_part/RPED
name = "Rapid Part Exchange Device"
desc = "Special mechanical module made to store, sort, and apply standard machine parts."
id = "rped"
req_tech = list("engineering" = 3, "materials" = 3)
materials = list("$metal" = 15000, "$glass" = 5000)
build_path = /obj/item/weapon/storage/part_replacer
datum/design/item/stock_part/basic_capacitor
build_type = PROTOLATHE | AUTOLATHE
id = "basic_capacitor"
@@ -971,6 +979,18 @@ datum/design/circuit/secure_airlock
req_tech = list("programming" = 3)
build_path = /obj/item/weapon/airlock_electronics/secure
datum/design/circuit/biogenerator
name = "biogenerator"
id = "biogenerator"
req_tech = list("programming" = 2)
build_path = /obj/item/weapon/circuitboard/biogenerator
datum/design/circuit/recharge_station
name = "cyborg recharge station"
id = "recharge_station"
req_tech = list("programming" = 3, "engineering" = 2)
build_path = /obj/item/weapon/circuitboard/recharge_station
/////////////////////////////////////////
////////Power Stuff Circuitboards////////
/////////////////////////////////////////

View File

@@ -12,6 +12,7 @@ Note: Must be placed within 3 tiles of the R&D Console
icon_state = "d_analyzer"
var/obj/item/weapon/loaded_item = null
var/decon_mod = 1
var/min_reliability = 90
use_power = 1
idle_power_usage = 30
@@ -29,9 +30,9 @@ Note: Must be placed within 3 tiles of the R&D Console
/obj/machinery/r_n_d/destructive_analyzer/RefreshParts()
var/T = 0
for(var/obj/item/weapon/stock_parts/S in src)
T += S.rating * 0.1
T = between (0, T, 1)
decon_mod = T
T += S.rating
decon_mod = T * 0.1
min_reliability = 93 - T
/obj/machinery/r_n_d/destructive_analyzer/meteorhit()
del(src)
@@ -43,65 +44,58 @@ Note: Must be placed within 3 tiles of the R&D Console
temp_list[O] = text2num(temp_list[O])
return temp_list
/obj/machinery/r_n_d/destructive_analyzer/update_icon()
if(panel_open)
icon_state = "d_analyzer_t"
else if(loaded_item)
icon_state = "d_analyzer_l"
else
icon_state = "d_analyzer"
/obj/machinery/r_n_d/destructive_analyzer/attackby(var/obj/O as obj, var/mob/user as mob)
if (shocked)
shock(user,50)
if (istype(O, /obj/item/weapon/screwdriver))
if (!opened)
opened = 1
if(linked_console)
linked_console.linked_destroy = null
linked_console = null
icon_state = "d_analyzer_t"
user << "You open the maintenance hatch of [src]."
else
opened = 0
icon_state = "d_analyzer"
user << "You close the maintenance hatch of [src]."
if(shocked)
shock(user, 50)
if(default_deconstruction_screwdriver(user, O))
if(linked_console)
linked_console.linked_destroy = null
linked_console = null
return
if (opened)
if(istype(O, /obj/item/weapon/crowbar))
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
M.state = 2
M.icon_state = "box_1"
for(var/obj/I in component_parts)
I.loc = src.loc
del(src)
return 1
else
user << "\red You can't load the [src.name] while it's opened."
return 1
if (disabled)
if(default_deconstruction_crowbar(user, O))
return
if (!linked_console)
user << "\red The destructive analyzer must be linked to an R&D console first!"
if(default_part_replacement(user, O))
return
if (busy)
user << "\red The destructive analyzer is busy right now."
if(panel_open)
user << "<span class='notice'>You can't load \the [src] while it's opened.</span>"
return 1
if(disabled)
return
if (istype(O, /obj/item) && !loaded_item)
if(!linked_console)
user << "<span class='notice'>\The [src] must be linked to an R&D console first!</span>"
return
if(busy)
user << "<span class='notice'>\The [src] is busy right now.</span>"
return
if(istype(O, /obj/item) && !loaded_item)
if(isrobot(user)) //Don't put your module items in there!
return
if(!O.origin_tech)
user << "\red This doesn't seem to have a tech origin!"
user << "<span class='notice'>This doesn't seem to have a tech origin!</span>"
return
var/list/temp_tech = ConvertReqString2List(O.origin_tech)
if (temp_tech.len == 0)
user << "\red You cannot deconstruct this item!"
if(temp_tech.len == 0)
user << "<span class='notice'>You cannot deconstruct this item!</span>"
return
if(O.reliability < 90 && O.crit_fail == 0)
usr << "\red Item is neither reliable enough nor broken enough to learn from."
if(O.reliability < min_reliability && O.crit_fail == 0)
usr << "<span class='warning'>Item is neither reliable enough nor broken enough to learn from.</span>"
return
busy = 1
loaded_item = O
user.drop_item()
O.loc = src
user << "\blue You add the [O.name] to the machine!"
user << "<span class='notice'>You add \the [O] to \the [src]!</span>"
flick("d_analyzer_la", src)
spawn(10)
icon_state = "d_analyzer_l"
update_icon()
busy = 0
return 1
return

View File

@@ -25,6 +25,8 @@ Note: Must be placed west/left of and R&D console to function.
var/uranium_amount = 0.0
var/diamond_amount = 0.0
var/mat_efficiency = 1
/obj/machinery/r_n_d/protolathe/New()
..()
component_parts = list()
@@ -51,80 +53,78 @@ Note: Must be placed west/left of and R&D console to function.
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
T += M.rating
max_material_storage = T * 75000
T = 0
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
T += M.rating
mat_efficiency = 1 - (T - 2) / 8
/obj/machinery/r_n_d/protolathe/dismantle()
for(var/obj/I in component_parts)
if(istype(I, /obj/item/weapon/reagent_containers/glass/beaker))
reagents.trans_to(I, reagents.total_volume)
if(m_amount >= 3750)
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(loc)
G.amount = round(m_amount / G.perunit)
if(g_amount >= 3750)
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(loc)
G.amount = round(g_amount / G.perunit)
if(phoron_amount >= 2000)
var/obj/item/stack/sheet/mineral/phoron/G = new /obj/item/stack/sheet/mineral/phoron(loc)
G.amount = round(phoron_amount / G.perunit)
if(silver_amount >= 2000)
var/obj/item/stack/sheet/mineral/silver/G = new /obj/item/stack/sheet/mineral/silver(loc)
G.amount = round(silver_amount / G.perunit)
if(gold_amount >= 2000)
var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold(loc)
G.amount = round(gold_amount / G.perunit)
if(uranium_amount >= 2000)
var/obj/item/stack/sheet/mineral/uranium/G = new /obj/item/stack/sheet/mineral/uranium(loc)
G.amount = round(uranium_amount / G.perunit)
if(diamond_amount >= 2000)
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(loc)
G.amount = round(diamond_amount / G.perunit)
..()
/obj/machinery/r_n_d/protolathe/update_icon()
if(panel_open)
icon_state = "protolathe_t"
else
icon_state = "protolathe"
/obj/machinery/r_n_d/protolathe/attackby(var/obj/item/O as obj, var/mob/user as mob)
if (shocked)
shock(user,50)
if (O.is_open_container())
return 1
if (istype(O, /obj/item/weapon/screwdriver))
if (!opened)
opened = 1
if(linked_console)
linked_console.linked_lathe = null
linked_console = null
icon_state = "protolathe_t"
user << "You open the maintenance hatch of [src]."
else
opened = 0
icon_state = "protolathe"
user << "You close the maintenance hatch of [src]."
if(shocked)
shock(user, 50)
if(default_deconstruction_screwdriver(user, O))
if(linked_console)
linked_console.linked_lathe = null
linked_console = null
return
if (opened)
if(istype(O, /obj/item/weapon/crowbar))
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
M.state = 2
M.icon_state = "box_1"
for(var/obj/I in component_parts)
if(istype(I, /obj/item/weapon/reagent_containers/glass/beaker))
reagents.trans_to(I, reagents.total_volume)
if(I.reliability != 100 && crit_fail)
I.crit_fail = 1
I.loc = src.loc
if(m_amount >= 3750)
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(src.loc)
G.amount = round(m_amount / G.perunit)
if(g_amount >= 3750)
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
G.amount = round(g_amount / G.perunit)
if(phoron_amount >= 2000)
var/obj/item/stack/sheet/mineral/phoron/G = new /obj/item/stack/sheet/mineral/phoron(src.loc)
G.amount = round(phoron_amount / G.perunit)
if(silver_amount >= 2000)
var/obj/item/stack/sheet/mineral/silver/G = new /obj/item/stack/sheet/mineral/silver(src.loc)
G.amount = round(silver_amount / G.perunit)
if(gold_amount >= 2000)
var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold(src.loc)
G.amount = round(gold_amount / G.perunit)
if(uranium_amount >= 2000)
var/obj/item/stack/sheet/mineral/uranium/G = new /obj/item/stack/sheet/mineral/uranium(src.loc)
G.amount = round(uranium_amount / G.perunit)
if(diamond_amount >= 2000)
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(src.loc)
G.amount = round(diamond_amount / G.perunit)
del(src)
return 1
else
user << "\red You can't load the [src.name] while it's opened."
return 1
if (disabled)
if(default_deconstruction_crowbar(user, O))
return
if (!linked_console)
user << "\The protolathe must be linked to an R&D console first!"
if(default_part_replacement(user, O))
return
if(O.is_open_container())
return 1
if (busy)
user << "\red The protolathe is busy. Please wait for completion of previous operation."
if(panel_open)
user << "<span class='notice'>You can't load \the [src] while it's opened.</span>"
return 1
if (!istype(O, /obj/item/stack/sheet))
user << "\red You cannot insert this item into the protolathe!"
if(disabled)
return
if(!linked_console)
user << "<span class='notice'>\The [src] must be linked to an R&D console first!</span>"
return 1
if (stat)
if(busy)
user << "<span class='notice'>\The [src] is busy. Please wait for completion of previous operation.</span>"
return 1
if(!istype(O, /obj/item/stack/sheet))
user << "<span class='notice'>You cannot insert this item into \the [src]!</span>"
return 1
if(stat)
return 1
if(istype(O,/obj/item/stack/sheet))
var/obj/item/stack/sheet/S = O
if (TotalMaterials() + S.perunit > max_material_storage)
user << "\red The protolathe's material bin is full. Please remove material before adding more."
if(TotalMaterials() + S.perunit > max_material_storage)
user << "<span class='notice'>\The [src]'s material bin is full. Please remove material before adding more.</span>"
return 1
var/obj/item/stack/sheet/stack = O
@@ -137,20 +137,20 @@ Note: Must be placed west/left of and R&D console to function.
return
if(amount > stack.get_amount())
amount = stack.get_amount()
if(max_material_storage - TotalMaterials() < (amount*stack.perunit))//Can't overfill
amount = min(stack.amount, round((max_material_storage-TotalMaterials())/stack.perunit))
if(max_material_storage - TotalMaterials() < (amount * stack.perunit))//Can't overfill
amount = min(stack.amount, round((max_material_storage - TotalMaterials()) / stack.perunit))
src.overlays += "protolathe_[stack.name]"
overlays += "protolathe_[stack.name]"
sleep(10)
src.overlays -= "protolathe_[stack.name]"
overlays -= "protolathe_[stack.name]"
icon_state = "protolathe"
busy = 1
use_power(max(1000, (3750*amount/10)))
use_power(max(1000, (3750 * amount / 10)))
var/stacktype = stack.type
stack.use(amount)
if (do_after(user, 16))
user << "\blue You add [amount] sheets to the [src.name]."
if(do_after(user, 16))
user << "<span class='notice'>You add [amount] sheets to \the [src].</span>"
icon_state = "protolathe"
switch(stacktype)
if(/obj/item/stack/sheet/metal)
@@ -168,9 +168,9 @@ Note: Must be placed west/left of and R&D console to function.
if(/obj/item/stack/sheet/mineral/diamond)
diamond_amount += amount * 2000
else
new stacktype(src.loc, amount)
new stacktype(loc, amount)
busy = 0
src.updateUsrDialog()
updateUsrDialog()
return
//This is to stop these machines being hackable via clicking.

View File

@@ -93,7 +93,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
/obj/machinery/computer/rdconsole/proc/SyncRDevices() //Makes sure it is properly sync'ed up with the devices attached to it (if any).
for(var/obj/machinery/r_n_d/D in oview(3,src))
if(D.linked_console != null || D.disabled || D.opened)
if(D.linked_console != null || D.disabled || D.panel_open)
continue
if(istype(D, /obj/machinery/r_n_d/destructive_analyzer))
if(linked_destroy == null)
@@ -255,7 +255,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
usr <<"\red The destructive analyzer appears to be empty."
screen = 1.0
return
if(linked_destroy.loaded_item.reliability >= 90)
if(linked_destroy.loaded_item.reliability >= linked_destroy.min_reliability)
var/list/temp_tech = linked_destroy.ConvertReqString2List(linked_destroy.loaded_item.origin_tech)
for(var/T in temp_tech)
files.UpdateTech(T, temp_tech[T])
@@ -347,21 +347,21 @@ won't update every console in existence) but it's more of a hassle to do. Also,
for(var/M in being_built.materials)
switch(M)
if("$metal")
linked_lathe.m_amount = max(0, (linked_lathe.m_amount-being_built.materials[M]))
linked_lathe.m_amount = max(0, (linked_lathe.m_amount-being_built.materials[M]*linked_lathe.mat_efficiency))
if("$glass")
linked_lathe.g_amount = max(0, (linked_lathe.g_amount-being_built.materials[M]))
linked_lathe.g_amount = max(0, (linked_lathe.g_amount-being_built.materials[M]*linked_lathe.mat_efficiency))
if("$gold")
linked_lathe.gold_amount = max(0, (linked_lathe.gold_amount-being_built.materials[M]))
linked_lathe.gold_amount = max(0, (linked_lathe.gold_amount-being_built.materials[M]*linked_lathe.mat_efficiency))
if("$silver")
linked_lathe.silver_amount = max(0, (linked_lathe.silver_amount-being_built.materials[M]))
linked_lathe.silver_amount = max(0, (linked_lathe.silver_amount-being_built.materials[M]*linked_lathe.mat_efficiency))
if("$phoron")
linked_lathe.phoron_amount = max(0, (linked_lathe.phoron_amount-being_built.materials[M]))
linked_lathe.phoron_amount = max(0, (linked_lathe.phoron_amount-being_built.materials[M]*linked_lathe.mat_efficiency))
if("$uranium")
linked_lathe.uranium_amount = max(0, (linked_lathe.uranium_amount-being_built.materials[M]))
linked_lathe.uranium_amount = max(0, (linked_lathe.uranium_amount-being_built.materials[M]*linked_lathe.mat_efficiency))
if("$diamond")
linked_lathe.diamond_amount = max(0, (linked_lathe.diamond_amount-being_built.materials[M]))
linked_lathe.diamond_amount = max(0, (linked_lathe.diamond_amount-being_built.materials[M]*linked_lathe.mat_efficiency))
else
linked_lathe.reagents.remove_reagent(M, being_built.materials[M])
linked_lathe.reagents.remove_reagent(M, being_built.materials[M]*linked_lathe.mat_efficiency)
if(being_built.build_path)
var/obj/new_item = new being_built.build_path(src)
@@ -375,6 +375,10 @@ won't update every console in existence) but it's more of a hassle to do. Also,
L.name += " ([new_item.name])"*/
else
new_item.loc = linked_lathe.loc
if(linked_lathe.mat_efficiency != 1) // No matter out of nowhere
if(new_item.matter && new_item.matter.len > 0)
for(var/i in new_item.matter)
new_item.matter[i] = new_item.matter[i] * linked_lathe.mat_efficiency
linked_lathe.busy = 0
screen = 3.1
errored = 0
@@ -401,15 +405,15 @@ won't update every console in existence) but it's more of a hassle to do. Also,
for(var/M in being_built.materials)
switch(M)
if("$glass")
linked_imprinter.g_amount = max(0, (linked_imprinter.g_amount-being_built.materials[M]))
linked_imprinter.g_amount = max(0, (linked_imprinter.g_amount-being_built.materials[M]*linked_imprinter.mat_efficiency))
if("$gold")
linked_imprinter.gold_amount = max(0, (linked_imprinter.gold_amount-being_built.materials[M]))
linked_imprinter.gold_amount = max(0, (linked_imprinter.gold_amount-being_built.materials[M]*linked_imprinter.mat_efficiency))
if("$diamond")
linked_imprinter.diamond_amount = max(0, (linked_imprinter.diamond_amount-being_built.materials[M]))
linked_imprinter.diamond_amount = max(0, (linked_imprinter.diamond_amount-being_built.materials[M]*linked_imprinter.mat_efficiency))
if("$uranium")
linked_imprinter.uranium_amount = max(0, (linked_imprinter.uranium_amount-being_built.materials[M]))
linked_imprinter.uranium_amount = max(0, (linked_imprinter.uranium_amount-being_built.materials[M]*linked_imprinter.mat_efficiency))
else
linked_imprinter.reagents.remove_reagent(M, being_built.materials[M])
linked_imprinter.reagents.remove_reagent(M, being_built.materials[M]*linked_imprinter.mat_efficiency)
var/obj/new_item = new being_built.build_path(src)
new_item.reliability = being_built.reliability
if(linked_imprinter.hacked) being_built.reliability = max((reliability / 2), 0)
@@ -752,6 +756,10 @@ won't update every console in existence) but it's more of a hassle to do. Also,
var/list/temp_tech = linked_destroy.ConvertReqString2List(linked_destroy.loaded_item.origin_tech)
for(var/T in temp_tech)
dat += "<LI>[CallTechName(T)] [temp_tech[T]]"
for(var/datum/tech/F in files.known_tech)
if(F.name == CallTechName(T))
dat += " (Current: [F.level])"
break
dat += "</UL>"
dat += "<HR><A href='?src=\ref[src];deconstruct=1'>Deconstruct Item</A> || "
dat += "<A href='?src=\ref[src];eject_item=1'>Eject Item</A> || "
@@ -775,31 +783,33 @@ won't update every console in existence) but it's more of a hassle to do. Also,
var/temp_dat
var/check_materials = 1
for(var/M in D.materials)
temp_dat += ", [D.materials[M]] [CallMaterialName(M)]"
temp_dat += ", [D.materials[M]*linked_lathe.mat_efficiency] [CallMaterialName(M)]"
if(copytext(M, 1, 2) == "$")
switch(M)
if("$glass")
if(D.materials[M] > linked_lathe.g_amount) check_materials = 0
if(D.materials[M]*linked_lathe.mat_efficiency > linked_lathe.g_amount) check_materials = 0
if("$metal")
if(D.materials[M] > linked_lathe.m_amount) check_materials = 0
if(D.materials[M]*linked_lathe.mat_efficiency > linked_lathe.m_amount) check_materials = 0
if("$gold")
if(D.materials[M] > linked_lathe.gold_amount) check_materials = 0
if(D.materials[M]*linked_lathe.mat_efficiency > linked_lathe.gold_amount) check_materials = 0
if("$silver")
if(D.materials[M] > linked_lathe.silver_amount) check_materials = 0
if(D.materials[M]*linked_lathe.mat_efficiency > linked_lathe.silver_amount) check_materials = 0
if("$phoron")
if(D.materials[M] > linked_lathe.phoron_amount) check_materials = 0
if(D.materials[M]*linked_lathe.mat_efficiency > linked_lathe.phoron_amount) check_materials = 0
if("$uranium")
if(D.materials[M] > linked_lathe.uranium_amount) check_materials = 0
if(D.materials[M]*linked_lathe.mat_efficiency > linked_lathe.uranium_amount) check_materials = 0
if("$diamond")
if(D.materials[M] > linked_lathe.diamond_amount) check_materials = 0
else if (!linked_lathe.reagents.has_reagent(M, D.materials[M]))
if(D.materials[M]*linked_lathe.mat_efficiency > linked_lathe.diamond_amount) check_materials = 0
else if (!linked_lathe.reagents.has_reagent(M, D.materials[M]*linked_lathe.mat_efficiency))
check_materials = 0
if(temp_dat)
temp_dat = " \[[copytext(temp_dat,3)]\]"
if (check_materials)
if(check_materials)
dat += "<LI><B><A href='?src=\ref[src];build=[D.id]'>[D.name]</A></B>[temp_dat]"
else
dat += "<LI><B>[D.name]</B>[temp_dat]"
if(D.reliability < 100)
dat += " (Reliability: [D.reliability])"
dat += "</UL>"
if(3.2) //Protolathe Material Storage Sub-menu
@@ -869,18 +879,18 @@ won't update every console in existence) but it's more of a hassle to do. Also,
var/temp_dat
var/check_materials = 1
for(var/M in D.materials)
temp_dat += ", [D.materials[M]] [CallMaterialName(M)]"
temp_dat += ", [D.materials[M]*linked_imprinter.mat_efficiency] [CallMaterialName(M)]"
if(copytext(M, 1, 2) == "$")
switch(M)
if("$glass")
if(D.materials[M] > linked_imprinter.g_amount) check_materials = 0
if(D.materials[M]*linked_imprinter.mat_efficiency > linked_imprinter.g_amount) check_materials = 0
if("$gold")
if(D.materials[M] > linked_imprinter.gold_amount) check_materials = 0
if(D.materials[M]*linked_imprinter.mat_efficiency > linked_imprinter.gold_amount) check_materials = 0
if("$diamond")
if(D.materials[M] > linked_imprinter.diamond_amount) check_materials = 0
if(D.materials[M]*linked_imprinter.mat_efficiency > linked_imprinter.diamond_amount) check_materials = 0
if("$uranium")
if(D.materials[M] > linked_imprinter.uranium_amount) check_materials = 0
else if (!linked_imprinter.reagents.has_reagent(M, D.materials[M]))
if(D.materials[M]*linked_imprinter.mat_efficiency > linked_imprinter.uranium_amount) check_materials = 0
else if (!linked_imprinter.reagents.has_reagent(M, D.materials[M]*linked_imprinter.mat_efficiency))
check_materials = 0
if(temp_dat)
temp_dat = " \[[copytext(temp_dat,3)]\]"
@@ -888,6 +898,8 @@ won't update every console in existence) but it's more of a hassle to do. Also,
dat += "<LI><B><A href='?src=\ref[src];imprint=[D.id]'>[D.name]</A></B>[temp_dat]"
else
dat += "<LI><B>[D.name]</B>[temp_dat]"
if(D.reliability < 100)
dat += " (Reliability: [D.reliability])"
dat += "</UL>"
if(4.2)

View File

@@ -17,7 +17,6 @@
var/hack_wire
var/disable_wire
var/shock_wire
var/opened = 0
var/obj/machinery/computer/rdconsole/linked_console
/obj/machinery/r_n_d/New()
@@ -39,7 +38,7 @@
/obj/machinery/r_n_d/attack_hand(mob/user as mob)
if (shocked)
shock(user,50)
if(opened)
if(panel_open)
var/dat as text
dat += "[src.name] Wires:<BR>"
for(var/wire in src.wires)

View File

@@ -103,7 +103,7 @@
/obj/machinery/r_n_d/server/proc/produce_heat()
if (!produces_heat)
return
if (!use_power)
return
@@ -118,7 +118,7 @@
if(removed)
var/heat_produced = idle_power_usage //obviously can't produce more heat than the machine draws from it's power source
removed.add_thermal_energy(heat_produced)
env.merge(removed)
@@ -129,16 +129,16 @@
if (shocked)
shock(user,50)
if (istype(O, /obj/item/weapon/screwdriver))
if (!opened)
opened = 1
if (!panel_open)
panel_open = 1
icon_state = "server_o"
user << "You open the maintenance hatch of [src]."
else
opened = 0
panel_open = 0
icon_state = "server"
user << "You close the maintenance hatch of [src]."
return
if (opened)
if (panel_open)
if(istype(O, /obj/item/weapon/crowbar))
griefProtection()
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)