diff --git a/code/WorkInProgress/computer3/computers/communications.dm b/code/WorkInProgress/computer3/computers/communications.dm
index b1a4adfa2c2..58c7f904f06 100644
--- a/code/WorkInProgress/computer3/computers/communications.dm
+++ b/code/WorkInProgress/computer3/computers/communications.dm
@@ -130,6 +130,9 @@
if("cancelshuttle" in href_list)
state = STATE_DEFAULT
if(authenticated)
+ cancel_call_proc(usr)
+ if(emergency_shuttle.online())
+ post_status("shuttle")
state = STATE_CANCELSHUTTLE
if("messagelist" in href_list)
currmsg = 0
@@ -286,11 +289,11 @@
dat += "
\[ Restore Backup Routing Data \]"
dat += "
\[ Change alert level \]"
- if(emergency_shuttle.location())
+ /*if(emergency_shuttle.location())
if (emergency_shuttle.online())
dat += "
\[ Cancel Shuttle Call \]"
else
- dat += "
\[ Call Emergency Shuttle \]"
+ dat += "
\[ Call Emergency Shuttle \]"*/
dat += "
\[ Set Status Display \]"
else
diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm
index ab27aeb73df..fcc16310b40 100755
--- a/code/datums/supplypacks.dm
+++ b/code/datums/supplypacks.dm
@@ -341,6 +341,12 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
containername = "cat crate"
group = "Organic"
+/datum/supply_packs/organic/fox
+ name = "Fox Crate"
+ cost = 55 //Foxes are cool.
+ containertype = /obj/structure/closet/critter/fox
+ containername = "fox crate"
+
/datum/supply_packs/seeds
name = "Seeds Crate"
contains = list(/obj/item/seeds/chiliseed,
@@ -1120,7 +1126,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
containertype = /obj/structure/closet/crate
containername = "autodrobe supply crate"
group = "Operations"
-
+
/datum/supply_packs/clothingvendor
name = "Clothing Vendor Supply crate"
contains = list(/obj/item/weapon/vending_refill/hatdispenser,
diff --git a/code/datums/wires/autolathe.dm b/code/datums/wires/autolathe.dm
new file mode 100644
index 00000000000..e382ce620f1
--- /dev/null
+++ b/code/datums/wires/autolathe.dm
@@ -0,0 +1,58 @@
+/datum/wires/autolathe
+
+ holder_type = /obj/machinery/autolathe
+ wire_count = 10
+
+var/const/AUTOLATHE_HACK_WIRE = 1
+var/const/AUTOLATHE_SHOCK_WIRE = 2
+var/const/AUTOLATHE_DISABLE_WIRE = 4
+
+/datum/wires/autolathe/GetInteractWindow()
+ var/obj/machinery/autolathe/A = holder
+ . += ..()
+ . += text("
The red light is [A.disabled ? "off" : "on"].
The green light is [A.shocked ? "off" : "on"].
The blue light is [A.hacked ? "off" : "on"].
")
+
+/datum/wires/autolathe/CanUse()
+ var/obj/machinery/autolathe/A = holder
+ if(A.panel_open)
+ return 1
+ return 0
+
+/datum/wires/autolathe/Interact(var/mob/living/user)
+ if(CanUse(user))
+ var/obj/machinery/autolathe/V = holder
+ V.attack_hand(user)
+
+/datum/wires/autolathe/UpdateCut(index, mended)
+ var/obj/machinery/autolathe/A = holder
+ switch(index)
+ if(AUTOLATHE_HACK_WIRE)
+ A.hacked = !mended
+ if(AUTOLATHE_SHOCK_WIRE)
+ A.shocked = !mended
+ if(AUTOLATHE_DISABLE_WIRE)
+ A.disabled = !mended
+
+/datum/wires/autolathe/UpdatePulsed(index)
+ if(IsIndexCut(index))
+ return
+ var/obj/machinery/autolathe/A = holder
+ switch(index)
+ if(AUTOLATHE_HACK_WIRE)
+ A.hacked = !A.hacked
+ spawn(50)
+ if(A && !IsIndexCut(index))
+ A.hacked = 0
+ Interact(usr)
+ if(AUTOLATHE_SHOCK_WIRE)
+ A.shocked = !A.shocked
+ spawn(50)
+ if(A && !IsIndexCut(index))
+ A.shocked = 0
+ Interact(usr)
+ if(AUTOLATHE_DISABLE_WIRE)
+ A.disabled = !A.disabled
+ spawn(50)
+ if(A && !IsIndexCut(index))
+ A.disabled = 0
+ Interact(usr)
\ No newline at end of file
diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm
index 88deaa2dd93..35ae358aea7 100644
--- a/code/game/area/Space Station 13 areas.dm
+++ b/code/game/area/Space Station 13 areas.dm
@@ -1240,10 +1240,6 @@ var/list/ghostteleportlocs = list()
name = "\improper Mechanic Workshop"
icon_state = "engine"
-/area/engine/gravity_generator
- name = "\improper Gravity Generator Room"
- icon_state = "blue"
-
//Solars
/area/solar
@@ -2065,6 +2061,14 @@ area/security/podbay
/area/aisat
name = "\improper AI Satellite Exterior"
icon_state = "yellow"
+
+/area/aisat/entrance
+ name = "\improper AI Satellite Entrance"
+ icon_state = "ai_foyer"
+
+/area/aisat/maintenance
+ name = "\improper AI Satellite Maintenance"
+ icon_state = "storage"
/area/turret_protected/aisat_interior
name = "\improper AI Satellite Antechamber"
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index eb8a458c865..3c04e9cf951 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -1,6 +1,16 @@
// Areas.dm
-
+// Added to fix mech fabs 05/2013 ~Sayu
+// This is necessary due to lighting subareas. If you were to go in assuming that things in
+// the same logical /area have the parent /area object... well, you would be mistaken. If you
+// want to find machines, mobs, etc, in the same logical area, you will need to check all the
+// related areas. This returns a master contents list to assist in that.
+/proc/area_contents(var/area/A)
+ if(!istype(A)) return null
+ var/list/contents = list()
+ for(var/area/LSA in A.related)
+ contents += LSA.contents
+ return contents
// ===
/area
diff --git a/code/game/dna/genes/vg_powers.dm b/code/game/dna/genes/vg_powers.dm
index b8464ff9e59..b4bdee1b464 100644
--- a/code/game/dna/genes/vg_powers.dm
+++ b/code/game/dna/genes/vg_powers.dm
@@ -223,16 +223,18 @@ Obviously, requires DNA2.
var/list/targets = new /list()
var/list/validtargets = new /list()
for(var/mob/M in living_mob_list)
- var/special_role = M.mind.special_role
- if (special_role == "Wizard" || special_role == "Ninja" || special_role == "Syndicate" || special_role == "Syndicate Commando" || special_role == "Vox Raider" || special_role == "Alien")
- continue
-
- validtargets += M
+ if(M && M.mind)
+ var/special_role = M.mind.special_role
+ if (special_role == "Wizard" || special_role == "Ninja" || special_role == "Syndicate" || special_role == "Syndicate Commando" || special_role == "Vox Raider" || special_role == "Alien")
+ continue
+
+ validtargets += M
if(!validtargets.len || validtargets.len == 1)
- usr << "There are no valid targets in range!"
+ usr << "There are no valid targets!"
start_recharge()
return
+
targets += input("Choose the target to talk to.", "Targeting") as mob in validtargets
perform(targets)
diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm
index 26ea6b40bd9..2cf5b94c1df 100644
--- a/code/game/gamemodes/changeling/changeling_powers.dm
+++ b/code/game/gamemodes/changeling/changeling_powers.dm
@@ -769,6 +769,12 @@ var/list/datum/dna/hivemind_bank = list()
if(!(T in view(changeling.sting_range))) return
if(!sting_can_reach(T, changeling.sting_range)) return
if(!changeling_power(required_chems)) return
+
+ if(ishuman(T))
+ var/mob/living/carbon/human/H = T
+ if(H.species.flags & IS_SYNTHETIC)
+ src << "This won't work on synthetics."
+ return
changeling.chem_charges -= required_chems
changeling.sting_range = 1
@@ -885,7 +891,7 @@ var/list/datum/dna/hivemind_bank = list()
var/mob/living/carbon/T = changeling_sting(5,/mob/proc/changeling_unfat_sting)
if(!T) return 0
- T << "you feel a small prick as stomach churns violently and you become to feel skinnier."
+ T << "You feel a small prick as stomach churns violently and you become to feel skinnier."
T.overeatduration = 0
T.nutrition -= 100
feedback_add_details("changeling_powers","US")
diff --git a/code/game/gamemodes/xenos/xenos.dm b/code/game/gamemodes/xenos/xenos.dm
index 511ae7fd06c..5cac584e335 100644
--- a/code/game/gamemodes/xenos/xenos.dm
+++ b/code/game/gamemodes/xenos/xenos.dm
@@ -20,7 +20,7 @@
var/xenoai = 0 //Should the Xenos have their own AI?
var/xenoborg = 0 //Should the Xenos have their own borg?
- var/gammaratio = 3 //At what alien to human ratio will the Gamma security level be called and the nuke be made available?
+ var/gammaratio = 4 //At what alien to human ratio will the Gamma security level be called and the nuke be made available?
/datum/game_mode/xenos/announce()
world << "The current game mode is - Xenos!"
@@ -183,7 +183,9 @@
/datum/game_mode/xenos/check_win()
var/xenosalive = xenos_alive()
var/playersalive = players_alive()
- var/playeralienratio = player_alien_ratio()
+ var/playeralienratio = 0
+ if(playersalive)
+ playeralienratio = xenosalive / playersalive
if(emergency_shuttle && emergency_shuttle.returned())
return ..()
if(!xenosalive)
@@ -240,24 +242,6 @@
if(ishuman(M))
livingplayers += 1
return livingplayers.len
-
-/datum/game_mode/xenos/proc/player_alien_ratio()
- var/list/livingplayers = list()
- var/list/livingxenos = list()
- for(var/mob/M in player_list)
- if((M) && (M.stat != 2) && M.client)
- if(ishuman(M))
- livingplayers += 1
- for(var/datum/mind/xeno in xenos)
- if((xeno) && (xeno.current) && (xeno.current.stat != 2) && (xeno.current.client))
- if(istype(xeno.current,/mob/living/carbon/alien) || (xenoborg && isrobot(xeno.current)) || (xenoai && isAI(xeno.current)))
- livingxenos += xeno
-
- if(!livingxenos.len || !livingplayers.len)
- return 0
-
- var/ratio = livingxenos.len / livingplayers.len
- return ratio
/datum/game_mode/xenos/declare_completion()
if(result == 1)
diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm
index 2f3a569a6d0..ccf95a5b417 100644
--- a/code/game/machinery/autolathe.dm
+++ b/code/game/machinery/autolathe.dm
@@ -1,76 +1,3 @@
-//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
-
-var/global/list/autolathe_recipes = list( \
- new /obj/item/stack/sheet/metal(), \
- new /obj/item/stack/sheet/glass(), \
- new /obj/item/stack/sheet/rglass(), \
- new /obj/item/stack/sheet/fur(), \
- new /obj/item/stack/rods(), \
- new /obj/item/weapon/crowbar(), \
- new /obj/item/weapon/screwdriver(), \
- new /obj/item/weapon/weldingtool(), \
- new /obj/item/weapon/wirecutters(), \
- new /obj/item/weapon/wrench(), \
- new /obj/item/device/multitool(), \
- new /obj/item/device/analyzer(), \
- new /obj/item/device/t_scanner(), \
- new /obj/item/device/flashlight(), \
- new /obj/item/weapon/extinguisher(), \
- new /obj/item/clothing/head/welding(), \
- new /obj/item/weapon/stock_parts/console_screen(), \
- new /obj/item/weapon/airlock_electronics(), \
- new /obj/item/weapon/airalarm_electronics(), \
- new /obj/item/weapon/firealarm_electronics(), \
- new /obj/item/weapon/kitchenknife(), \
- new /obj/item/weapon/scalpel(), \
- new /obj/item/weapon/circular_saw(), \
- new /obj/item/weapon/surgicaldrill(),\
- new /obj/item/weapon/retractor(),\
- new /obj/item/weapon/cautery(),\
- new /obj/item/weapon/hemostat(),\
- new /obj/item/weapon/reagent_containers/glass/beaker(), \
- new /obj/item/weapon/reagent_containers/glass/beaker/large(), \
- new /obj/item/weapon/reagent_containers/glass/bucket(), \
- new /obj/item/device/taperecorder(), \
- new /obj/item/device/assembly/igniter(), \
- new /obj/item/device/assembly/signaler(), \
- new /obj/item/device/radio/headset(), \
- new /obj/item/device/radio/off(), \
- new /obj/item/device/assembly/infra(), \
- new /obj/item/device/assembly/timer(), \
- new /obj/item/device/assembly/prox_sensor(), \
- new /obj/item/device/assembly/voice(), \
- new /obj/item/weapon/light/tube(), \
- new /obj/item/weapon/light/bulb(), \
- new /obj/item/weapon/camera_assembly(), \
- new /obj/item/weapon/rcd_ammo(), \
- new /obj/item/ammo_casing/shotgun/beanbag(), \
- new /obj/item/ammo_box/c38(), \
- new /obj/item/clothing/ears/earmuffs/tribblemuffs(), \
- new /obj/item/clothing/gloves/furgloves(), \
- new /obj/item/clothing/head/furcap(), \
- new /obj/item/clothing/shoes/furboots(), \
- new /obj/item/clothing/suit/furcoat(), \
- new /obj/item/clothing/suit/furcape(), \
- )
-
-var/global/list/autolathe_recipes_hidden = list( \
- new /obj/item/weapon/flamethrower/full(), \
- new /obj/item/weapon/rcd(), \
- new /obj/item/device/radio/electropack(), \
- new /obj/item/weapon/weldingtool/largetank(), \
- new /obj/item/weapon/handcuffs(), \
- new /obj/item/weapon/hatchet(), \
- new /obj/item/ammo_box/a357(), \
- new /obj/item/ammo_box/c10mm(), \
- new /obj/item/ammo_box/c45(), \
- new /obj/item/ammo_box/c9mm(), \
- new /obj/item/ammo_casing/shotgun(), \
- new /obj/item/ammo_casing/shotgun/buckshot(), \
- new /obj/item/ammo_casing/shotgun/dart(), \
- new /obj/item/ammo_casing/shotgun/incendiary(), \
-/* new /obj/item/weapon/shield/riot(),*/ \
- )
/obj/machinery/autolathe
name = "autolathe"
desc = "It produces items using metal and glass."
@@ -83,18 +10,13 @@ var/global/list/autolathe_recipes_hidden = list( \
var/g_amount = 0.0
var/max_g_amount = 75000.0
- var/f_amount = 0.0
- var/max_f_amount = 50000.0
-
var/operating = 0.0
- var/opened = 0.0
anchored = 1.0
var/list/L = list()
var/list/LL = list()
var/hacked = 0
var/disabled = 0
var/shocked = 0
- var/list/wires = list()
var/hack_wire
var/disable_wire
var/shock_wire
@@ -103,70 +25,278 @@ var/global/list/autolathe_recipes_hidden = list( \
active_power_usage = 100
var/busy = 0
var/prod_coeff
+ var/datum/wires/autolathe/wires = null
- l_color = "#7BF9FF"
- power_change()
- ..()
- if(!(stat & (BROKEN|NOPOWER)))
- SetLuminosity(2)
- else
- SetLuminosity(0)
+ var/datum/design/being_built
+ var/datum/research/files
+ var/selected_category
+ var/screen = 1
+
+ var/list/categories = list(
+ "Communication",
+ "Construction",
+ "Electronics",
+ "Medical",
+ "Miscellaneous",
+ "Security",
+ "Tools"
+ )
/obj/machinery/autolathe/New()
..()
component_parts = list()
- component_parts += new /obj/item/weapon/circuitboard/autolathe(src)
- component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
- component_parts += new /obj/item/weapon/stock_parts/matter_bin(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/stock_parts/console_screen(src)
+ component_parts += new /obj/item/weapon/circuitboard/autolathe(null)
+ component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
+ component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
+ component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
+ component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
+ component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
RefreshParts()
wires = new(src)
- src.L = autolathe_recipes
- src.LL = autolathe_recipes_hidden
+ files = new /datum/research/autolathe(src)
-/obj/machinery/autolathe/proc/wires_win(mob/user as mob)
- var/dat as text
- dat += "Autolathe Wires:
"
- for(var/wire in src.wires)
- dat += text("[wire] Wire: [src.wires[wire] ? "Mend" : "Cut"] Pulse
")
+/obj/machinery/autolathe/interact(mob/user)
+ if(shocked && !(stat & NOPOWER))
+ shock(user,50)
- dat += text("The red light is [src.disabled ? "off" : "on"].
")
- dat += text("The green light is [src.shocked ? "off" : "on"].
")
- dat += text("The blue light is [src.hacked ? "off" : "on"].
")
- user << browse("
Autolathe Hacking[dat]","window=autolathe_hack")
- onclose(user, "autolathe_hack")
+ user.set_machine(src)
+ var/dat
-/obj/machinery/autolathe/proc/regular_win(mob/user as mob)
- var/coeff = 2 ** prod_coeff
- var/dat as text
- dat = text("Metal Amount: [src.m_amount] cm3 (MAX: [max_m_amount])
\nGlass Amount: [src.g_amount] cm3 (MAX: [max_g_amount])
\nFur Amount: [src.f_amount] cm3 (MAX: [max_f_amount])
")
- var/list/objs = list()
- objs += src.L
- if (src.hacked)
- objs += src.LL
- for(var/obj/t in objs)
- var/title = "[t.name] ([t.m_amt/coeff] m / [t.g_amt/coeff] g / [t.f_amt/coeff] f)"
- if (m_amount"
+ if(panel_open)
+ dat = wires.GetInteractWindow()
+
+ else
+ if(screen == 1)
+ dat = main_win(user)
+ else
+ dat += category_win(user,selected_category)
+
+ var/datum/browser/popup = new(user, "autolathe", name, 500, 500)
+ popup.set_content(dat)
+ popup.open()
+
+ return
+
+/obj/machinery/autolathe/attackby(obj/item/O, mob/user)
+ if (busy)
+ user << "The autolathe is busy. Please wait for completion of previous operation."
+ return 1
+
+ if(default_deconstruction_screwdriver(user, "autolathe_t", "autolathe", O))
+ updateUsrDialog()
+ return
+
+ if(exchange_parts(user, O))
+ return
+
+ if (panel_open)
+ if(istype(O, /obj/item/weapon/crowbar))
+ if(m_amount >= MINERAL_MATERIAL_AMOUNT)
+ var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(src.loc)
+ G.amount = round(m_amount / MINERAL_MATERIAL_AMOUNT)
+ if(g_amount >= MINERAL_MATERIAL_AMOUNT)
+ var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
+ G.amount = round(g_amount / MINERAL_MATERIAL_AMOUNT)
+ default_deconstruction_crowbar(O)
+ return 1
+ else
+ attack_hand(user)
+ return 1
+ if (stat)
+ return 1
+
+ if (src.m_amount + O.m_amt > max_m_amount)
+ user << "The autolathe is full. Please remove metal from the autolathe in order to insert more."
+ return 1
+ if (src.g_amount + O.g_amt > max_g_amount)
+ user << "The autolathe is full. Please remove glass from the autolathe in order to insert more."
+ return 1
+ if (O.m_amt == 0 && O.g_amt == 0)
+ user << "This object does not contain significant amounts of metal or glass, or cannot be accepted by the autolathe due to size or hazardous materials."
+ return 1
+
+ var/amount = 1
+ var/obj/item/stack/stack
+ var/m_amt = O.m_amt
+ var/g_amt = O.g_amt
+ if (istype(O, /obj/item/stack))
+ stack = O
+ amount = stack.amount
+ if (m_amt)
+ amount = min(amount, round((max_m_amount-src.m_amount)/m_amt))
+ flick("autolathe_o",src)//plays metal insertion animation
+ if (g_amt)
+ amount = min(amount, round((max_g_amount-src.g_amount)/g_amt))
+ flick("autolathe_r",src)//plays glass insertion animation
+ stack.use(amount)
+ else
+ if(!user.before_take_item(O))
+ user << "/the [O] is stuck to your hand, you can't put it in \the [src]!"
+ O.loc = src
+ icon_state = "autolathe"
+ busy = 1
+ use_power(max(1000, (m_amt+g_amt)*amount/10))
+ src.m_amount += m_amt * amount
+ src.g_amount += g_amt * amount
+ user << "You insert [amount] sheet[amount>1 ? "s" : ""] to the autolathe."
+ if (O && O.loc == src)
+ qdel(O)
+ busy = 0
+ src.updateUsrDialog()
+
+/obj/machinery/autolathe/attack_paw(mob/user)
+ return attack_hand(user)
+
+/obj/machinery/autolathe/attack_hand(mob/user)
+ if(..(user, 0))
+ return
+ interact(user)
+
+/obj/machinery/autolathe/Topic(href, href_list)
+ if(..())
+ return
+ if (!busy)
+ if(href_list["menu"])
+ screen = text2num(href_list["menu"])
+
+ if(href_list["category"])
+ selected_category = href_list["category"]
+
+ if(href_list["make"])
+
+ var/turf/T = get_step(src.loc, get_dir(src,usr))
+
+ /////////////////
+ //href protection
+ being_built = files.FindDesignByID(href_list["make"]) //check if it's a valid design
+ if(!being_built)
+ return
+
+ //multiplier checks : only stacks can have one and its value is 1, 10 ,25 or max_multiplier
+ var/multiplier = text2num(href_list["multiplier"])
+ var/max_multiplier = min(50, being_built.materials["$metal"] ?round(m_amount/being_built.materials["$metal"]):INFINITY,being_built.materials["$glass"]?round(g_amount/being_built.materials["$glass"]):INFINITY)
+ var/is_stack = ispath(being_built.build_path, /obj/item/stack)
+
+ if(!is_stack && (multiplier > 1))
+ return
+ if (!(multiplier in list(1,10,25,max_multiplier))) //"enough materials ?" is checked further down
+ return
+ /////////////////
+
+ var/coeff = (is_stack ? 1 : 2 ** prod_coeff) //stacks are unaffected by production coefficient
+ var/metal_cost = being_built.materials["$metal"]
+ var/glass_cost = being_built.materials["$glass"]
+
+ var/power = max(2000, (metal_cost+glass_cost)*multiplier/5)
+
+ if((m_amount >= metal_cost*multiplier/coeff) && (g_amount >= glass_cost*multiplier/coeff))
+ busy = 1
+ use_power(power)
+ icon_state = "autolathe"
+ flick("autolathe_n",src)
+ spawn(32/coeff)
+ use_power(power)
+ if(is_stack)
+ m_amount -= metal_cost*multiplier
+ g_amount -= glass_cost*multiplier
+ var/obj/item/stack/S = new being_built.build_path(T)
+ S.amount = multiplier
+ else
+ m_amount -= metal_cost/coeff
+ g_amount -= glass_cost/coeff
+ var/obj/item/new_item = new being_built.build_path(T)
+ new_item.m_amt /= coeff
+ new_item.g_amt /= coeff
+ if(m_amount < 0)
+ m_amount = 0
+ if(g_amount < 0)
+ g_amount = 0
+ busy = 0
+ src.updateUsrDialog()
+ else
+ usr << "The autolathe is busy. Please wait for completion of previous operation."
+
+ src.updateUsrDialog()
+
+ return
+
+/obj/machinery/autolathe/RefreshParts()
+ var/tot_rating = 0
+ prod_coeff = 0
+ for(var/obj/item/weapon/stock_parts/matter_bin/MB in component_parts)
+ tot_rating += MB.rating
+ tot_rating *= 25000
+ max_m_amount = tot_rating * 2
+ max_g_amount = tot_rating
+ for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
+ prod_coeff += M.rating - 1
+
+/obj/machinery/autolathe/proc/main_win(mob/user)
+ var/dat = "Autolathe Menu:
"
+ dat += "
Metal amount: [src.m_amount] / [max_m_amount] cm
3"
+ dat += "
Glass amount: [src.g_amount] / [max_g_amount] cm
3
"
+
+ var/line_length = 1
+ dat += "
"
+
+ for(var/C in categories)
+ if(line_length > 2)
+ dat += "
"
+ line_length = 1
+
+ dat += "| [C] | "
+ line_length++
+
+ dat += "
"
+ return dat
+
+/obj/machinery/autolathe/proc/category_win(mob/user,var/selected_category)
+ var/dat = "Return to category screen"
+ dat += "Browsing [selected_category]:
"
+ dat += "
Metal amount: [src.m_amount] / [max_m_amount] cm
3"
+ dat += "
Glass amount: [src.g_amount] / [max_g_amount] cm
3
"
+
+ for(var/datum/design/D in files.known_designs)
+ if(!(selected_category in D.category))
continue
- dat += "
[title]"
- if (istype(t, /obj/item/stack))
- var/obj/item/stack/S = t
- var/max_multiplier = min(S.max_amount, S.m_amt?round(m_amount/S.m_amt):INFINITY, S.g_amt?round(g_amount/S.g_amt):INFINITY, S.f_amt?round(f_amount/S.f_amt):INFINITY)
- if (max_multiplier>1)
- dat += " |"
- if (max_multiplier>10)
- dat += "
x[10]"
- if (max_multiplier>25)
- dat += "
x[25]"
- if (max_multiplier>1)
- dat += "
x[max_multiplier]"
- dat += "
"
- user << browse("
Autolathe Control Panel[dat]", "window=autolathe_regular")
- onclose(user, "autolathe_regular")
+
+ if(disabled || !can_build(D))
+ dat += "
[D.name]"
+ else
+ dat += "
[D.name]"
+
+ if(ispath(D.build_path, /obj/item/stack))
+ var/max_multiplier = min(50, D.materials["$metal"] ?round(m_amount/D.materials["$metal"]):INFINITY,D.materials["$glass"]?round(g_amount/D.materials["$glass"]):INFINITY)
+ if (max_multiplier>10 && !disabled)
+ dat += "
x10"
+ if (max_multiplier>25 && !disabled)
+ dat += "
x25"
+ if(max_multiplier > 0 && !disabled)
+ dat += "
x[max_multiplier]"
+
+ dat += "[get_design_cost(D)]
"
+
+ dat += "
"
+ return dat
+
+/obj/machinery/autolathe/proc/can_build(var/datum/design/D)
+ var/coeff = (ispath(D.build_path,/obj/item/stack) ? 1 : 2 ** prod_coeff)
+
+ if(D.materials["$metal"] && (m_amount < (D.materials["$metal"] / coeff)))
+ return 0
+ if(D.materials["$glass"] && (g_amount < (D.materials["$glass"] / coeff)))
+ return 0
+ return 1
+
+/obj/machinery/autolathe/proc/get_design_cost(var/datum/design/D)
+ var/coeff = (ispath(D.build_path,/obj/item/stack) ? 1 : 2 ** prod_coeff)
+ var/dat
+ if(D.materials["$metal"])
+ dat += "[D.materials["$metal"] / coeff] metal "
+ if(D.materials["$glass"])
+ dat += "[D.materials["$glass"] / coeff] glass"
+ return dat
/obj/machinery/autolathe/proc/shock(mob/user, prb)
if(stat & (BROKEN|NOPOWER)) // unpowered, no shock
@@ -181,290 +311,14 @@ var/global/list/autolathe_recipes_hidden = list( \
else
return 0
-/obj/machinery/autolathe/interact(mob/user as mob)
- if(..())
- return
+/obj/machinery/autolathe/proc/adjust_hacked(var/hack)
+ hacked = hack
- if (src.shocked)
- src.shock(user,50)
-
- if (src.panel_open)
- wires_win(user,50)
- return
-
- if (src.disabled)
- user << "\red You press the button, but nothing happens."
- return
-
- regular_win(user)
- return
-
-/obj/machinery/autolathe/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if (stat)
- return 1
-
- if (busy)
- user << "\red The autolathe is busy. Please wait for completion of previous operation."
- return 1
-
- if (istype(O, /obj/item/weapon/screwdriver))
- default_deconstruction_screwdriver(user, "autolathe_t", "autolathe", O)
- return 1
-
- if(exchange_parts(user, O))
- return
-
- if (panel_open)
- //Don't eat multitools or wirecutters used on an open lathe.
- if(istype(O, /obj/item/device/multitool) || istype(O, /obj/item/weapon/wirecutters))
- attack_hand(user)
- return
-
- //Dismantle the frame.
- if(istype(O, /obj/item/weapon/crowbar))
- for(var/obj/I in component_parts)
- 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 / 3750)
- 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)
- default_deconstruction_crowbar(O)
- return 1
- else
- user.set_machine(src)
- interact(user)
- return 1
-
- if (src.m_amount + O.m_amt > max_m_amount)
- user << "\red The autolathe is full. Please remove metal from the autolathe in order to insert more."
- return 1
- if (src.g_amount + O.g_amt > max_g_amount)
- user << "\red The autolathe is full. Please remove glass from the autolathe in order to insert more."
- return 1
- if (src.f_amount + O.f_amt > max_f_amount)
- user << "\red The autolathe is full. Please remove fur from the autolathe in order to insert more."
- return 1
- if (O.m_amt == 0 && O.g_amt == 0 && O.f_amt == 0)
- user << "\red This object does not contain significant amounts of metal or glass, or cannot be accepted by the autolathe due to size or hazardous materials."
- return 1
- /*
- if (istype(O, /obj/item/weapon/grab) && src.hacked)
- var/obj/item/weapon/grab/G = O
- if (prob(25) && G.affecting)
- G.affecting.gib()
- m_amount += 50000
- f_amount += 1000
- return
- */
-
- var/amount = 1
- var/obj/item/stack/stack
- var/m_amt = O.m_amt
- var/g_amt = O.g_amt
- var/f_amt = O.f_amt
- if (istype(O, /obj/item/stack))
- stack = O
- amount = stack.amount
- if (m_amt)
- amount = min(amount, round((max_m_amount-src.m_amount)/m_amt))
- flick("autolathe_o",src)//plays metal insertion animation
- if (g_amt)
- amount = min(amount, round((max_g_amount-src.g_amount)/g_amt))
- flick("autolathe_r",src)//plays glass insertion animation
- if (f_amt)
- amount = min(amount, round((max_f_amount-src.f_amount)/f_amt))
- flick("autolathe_f",src)//plays fur insertion animation
- stack.use(amount)
+ if(hack)
+ for(var/datum/design/D in files.possible_designs)
+ if((D.build_type & 4) && ("hacked" in D.category))
+ files.known_designs += D
else
- usr.before_take_item(O)
- O.loc = src
- icon_state = "autolathe"
- busy = 1
- use_power(max(1000, (m_amt+g_amt)*amount/10))
- src.m_amount += m_amt * amount
- src.g_amount += g_amt * amount
- src.f_amount += f_amt * amount
- user << "You insert [amount] sheet[amount>1 ? "s" : ""] to the autolathe."
- if (O && O.loc == src)
- del(O)
- busy = 0
- src.updateUsrDialog()
-
-/obj/machinery/autolathe/attack_paw(mob/user as mob)
- return src.attack_hand(user)
-
-/obj/machinery/autolathe/attack_hand(mob/user as mob)
- user.set_machine(src)
- interact(user)
-
-
-/obj/machinery/autolathe/Topic(href, href_list)
- if(..())
- return
- usr.set_machine(src)
- src.add_fingerprint(usr)
- if (!busy)
- if(href_list["make"])
- var/coeff = 2 ** prod_coeff
- var/turf/T = get_step(src.loc, get_dir(src,usr))
-
- // critical exploit fix start -walter0o
- var/obj/item/template = null
- var/attempting_to_build = locate(href_list["make"])
-
- if(!attempting_to_build)
- return
-
- if(locate(attempting_to_build, src.L) || locate(attempting_to_build, src.LL)) // see if the requested object is in one of the construction lists, if so, it is legit -walter0o
- template = attempting_to_build
-
- else // somebody is trying to exploit, alert admins -walter0o
-
- var/turf/LOC = get_turf(usr)
- message_admins("[key_name_admin(usr)] tried to exploit an autolathe to duplicate [attempting_to_build] ! ([LOC ? "JMP" : "null"])", 0)
- log_admin("EXPLOIT : [key_name(usr)] tried to exploit an autolathe to duplicate [attempting_to_build] !")
- return
-
- // now check for legit multiplier, also only stacks should pass with one to prevent raw-materials-manipulation -walter0o
-
- var/multiplier = text2num(href_list["multiplier"])
-
- if (!multiplier) multiplier = 1
- var/max_multiplier = 1
-
- if(istype(template, /obj/item/stack)) // stacks are the only items which can have a multiplier higher than 1 -walter0o
- var/obj/item/stack/S = template
- max_multiplier = min(S.max_amount, S.m_amt?round(m_amount/S.m_amt):INFINITY, S.g_amt?round(g_amount/S.g_amt):INFINITY) // pasta from regular_win() to make sure the numbers match -walter0o
-
- if( (multiplier > max_multiplier) || (multiplier <= 0) ) // somebody is trying to exploit, alert admins-walter0o
-
- var/turf/LOC = get_turf(usr)
- message_admins("[key_name_admin(usr)] tried to exploit an autolathe with multiplier set to [multiplier] on [template] ! ([LOC ? "JMP" : "null"])" , 0)
- log_admin("EXPLOIT : [key_name(usr)] tried to exploit an autolathe with multiplier set to [multiplier] on [template] !")
- return
-
- var/power = max(2000, (template.m_amt+template.g_amt+template.f_amt)*multiplier/5)
- if(src.m_amount >= template.m_amt*multiplier/coeff && src.g_amount >= template.g_amt*multiplier/coeff && src.f_amount >= template.f_amt*multiplier/coeff)
- busy = 1
- use_power(power)
- icon_state = "autolathe"
- flick("autolathe_n",src)
- spawn(32/coeff)
- use_power(power)
- if(istype(template, /obj/item/stack))
- src.m_amount -= template.m_amt*multiplier
- src.g_amount -= template.g_amt*multiplier
- src.f_amount -= template.f_amt*multiplier
- var/obj/new_item = new template.type(T)
- var/obj/item/stack/S = new_item
- S.amount = multiplier
- else
- src.m_amount -= template.m_amt/coeff
- src.g_amount -= template.g_amt/coeff
- src.f_amount -= template.f_amt/coeff
- var/obj/item/new_item = new template.type(T)
- new_item.m_amt /= coeff
- new_item.g_amt /= coeff
- new_item.f_amt /= coeff
- if(src.m_amount < 0)
- src.m_amount = 0
- if(src.g_amount < 0)
- src.g_amount = 0
- if(src.f_amount < 0)
- src.f_amount = 0
- busy = 0
-
- if(href_list["act"])
- var/temp_wire = href_list["wire"]
- if(href_list["act"] == "pulse")
- if (!istype(usr.get_active_hand(), /obj/item/device/multitool))
- usr << "You need a multitool!"
- else
- if(src.wires[temp_wire])
- usr << "You can't pulse a cut wire."
- else
- if(src.hack_wire == temp_wire)
- src.hacked = !src.hacked
- spawn(100) src.hacked = !src.hacked
- if(src.disable_wire == temp_wire)
- src.disabled = !src.disabled
- src.shock(usr,50)
- spawn(100) src.disabled = !src.disabled
- if(src.shock_wire == temp_wire)
- src.shocked = !src.shocked
- src.shock(usr,50)
- spawn(100) src.shocked = !src.shocked
- if(href_list["act"] == "wire")
- if (!istype(usr.get_active_hand(), /obj/item/weapon/wirecutters))
- usr << "You need wirecutters!"
- else
- wires[temp_wire] = !wires[temp_wire]
- if(src.hack_wire == temp_wire)
- src.hacked = !src.hacked
- if(src.disable_wire == temp_wire)
- src.disabled = !src.disabled
- src.shock(usr,50)
- if(src.shock_wire == temp_wire)
- src.shocked = !src.shocked
- src.shock(usr,50)
- else
- usr << "\red The autolathe is busy. Please wait for completion of previous operation."
- src.updateUsrDialog()
- return
-
-/obj/machinery/autolathe/RefreshParts()
- var/tot_rating = 0
- prod_coeff = 0
- for(var/obj/item/weapon/stock_parts/matter_bin/MB in component_parts)
- tot_rating += MB.rating
- tot_rating *= 25000
- max_m_amount = tot_rating * 2
- max_g_amount = tot_rating
- max_f_amount = tot_rating
- for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
- prod_coeff += M.rating - 1
-
-/obj/machinery/autolathe/RefreshParts()
- ..()
- var/tot_rating = 0
- for(var/obj/item/weapon/stock_parts/matter_bin/MB in component_parts)
- tot_rating += MB.rating
- tot_rating *= 25000
- max_m_amount = tot_rating * 2
- max_g_amount = tot_rating
- max_f_amount = tot_rating
-
-/obj/machinery/autolathe/New()
- ..()
- component_parts = list()
- component_parts += new /obj/item/weapon/circuitboard/autolathe(src)
- component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
- component_parts += new /obj/item/weapon/stock_parts/matter_bin(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/stock_parts/console_screen(src)
- RefreshParts()
-
- src.L = autolathe_recipes
- src.LL = autolathe_recipes_hidden
- src.wires["Light Red"] = 0
- src.wires["Dark Red"] = 0
- src.wires["Blue"] = 0
- src.wires["Green"] = 0
- src.wires["Yellow"] = 0
- src.wires["Black"] = 0
- src.wires["White"] = 0
- src.wires["Gray"] = 0
- src.wires["Orange"] = 0
- src.wires["Pink"] = 0
- var/list/w = list("Light Red","Dark Red","Blue","Green","Yellow","Black","White","Gray","Orange","Pink")
- src.hack_wire = pick(w)
- w -= src.hack_wire
- src.shock_wire = pick(w)
- w -= src.shock_wire
- src.disable_wire = pick(w)
- w -= src.disable_wire
+ for(var/datum/design/D in files.known_designs)
+ if("hacked" in D.category)
+ files.known_designs -= D
diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm
index 29b6edf937f..3256818b3df 100644
--- a/code/game/machinery/computer/camera.dm
+++ b/code/game/machinery/computer/camera.dm
@@ -25,6 +25,7 @@
networks["Fire Alarms"] = list(access_ce,access_hos,access_captain)
networks["Power Alarms"] = list(access_ce,access_hos,access_captain)
networks["Supermatter"] = list(access_ce,access_hos,access_captain)
+ networks["MiniSat"] = list(access_rd,access_hos,access_captain)
networks["Singularity"] = list(access_ce,access_hos,access_captain)
networks["Anomaly Isolation"] = list(access_rd,access_hos,access_captain)
networks["Toxins"] = list(access_rd,access_hos,access_captain)
@@ -34,10 +35,7 @@
networks["Thunderdome"] = list(access_cent_captain)
attack_ai(var/mob/user as mob)
- if(isAI(user))
- return ui_interact(user)
- else
- return attack_hand(user)
+ return attack_hand(user)
attack_paw(var/mob/user as mob)
return attack_hand(user)
@@ -50,6 +48,7 @@
// Network configuration
attackby(I as obj, user as mob)
+ access = list()
if(istype(I,/obj/item/weapon/card/emag)) // If hit by an emag.
var/obj/item/weapon/card/emag/E = I
if(!emagged)
@@ -70,18 +69,45 @@
..()
ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
- if(..())
- return
- if(stat & (NOPOWER|BROKEN))
- return
+ if(src.z > 6) return
+ if(stat & (NOPOWER|BROKEN)) return
+ if(user.stat) return
+
+ var/data[0]
+
+ data["current"] = null
+
+ var/list/L = list()
+ for (var/obj/machinery/camera/C in cameranet.viewpoints)
+ if(can_access_camera(C))
+ L.Add(C)
+
+ camera_sort(L)
+
+ var/cameras[0]
+ for(var/obj/machinery/camera/C in L)
+ var/cam[0]
+ cam["name"] = C.c_tag
+ cam["deact"] = !C.can_use()
+ cam["camera"] = "\ref[C]"
+ cam["x"] = C.x
+ cam["y"] = C.y
+ cam["z"] = C.z
+
+ cameras[++cameras.len] = cam
+
+ if(C == current)
+ data["current"] = cam
+
+ data["cameras"] = cameras
- data.Cut()
tempnets.Cut()
if(emagged)
access = list(access_captain) // Assume captain level access when emagged
data["emagged"] = 1
- if(isAI(user))
+ if(isAI(user) || isrobot (user))
access = list(access_captain) // Assume captain level access when AI
+
// Loop through the ID's permission, and check which networks the ID has access to.
for(var/l in networks) // Loop through networks.
for(var/m in networks[l]) // Loop through access levels of the networks.
@@ -92,16 +118,36 @@
tempnets.Add(list(list("name" = l, "active" = 0)))
break
data["networks"] = tempnets
+
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if(!ui)
- ui = new(user, src, ui_key, "camera_console.tmpl", "Camera Monitor UI", 660, 280)
+ if (!ui)
+ ui = new(user, src, ui_key, "sec_camera.tmpl", "Camera Console", 900, 800)
+
+ // adding a template with the key "mapContent" enables the map ui functionality
+ ui.add_template("mapContent", "sec_camera_map_content.tmpl")
+ // adding a template with the key "mapHeader" replaces the map header content
+ ui.add_template("mapHeader", "sec_camera_map_header.tmpl")
+
ui.set_initial_data(data)
ui.open()
-
+ ui.set_auto_update(1)
+
Topic(href, href_list)
- if(..())
- return
- if(href_list["activate"]) // Activate: enable or disable networks
+ if(href_list["switchTo"])
+ if(src.z>6 || stat&(NOPOWER|BROKEN)) return
+ if(usr.stat || ((get_dist(usr, src) > 1 || !( usr.canmove ) || usr.blinded) && !istype(usr, /mob/living/silicon))) return
+ var/obj/machinery/camera/C = locate(href_list["switchTo"]) in cameranet.viewpoints
+ if(!C) return
+
+ switch_to_camera(usr, C)
+ return 1
+ else if(href_list["reset"])
+ if(src.z>6 || stat&(NOPOWER|BROKEN)) return
+ if(usr.stat || ((get_dist(usr, src) > 1 || !( usr.canmove ) || usr.blinded) && !istype(usr, /mob/living/silicon))) return
+ current = null
+ usr.check_eye(current)
+ return 1
+ else if(href_list["activate"]) // Activate: enable or disable networks
var/net = href_list["activate"] // Network to be enabled or disabled.
var/active = href_list["active"] // Is the network currently active.
for(var/a in networks[net])
@@ -113,50 +159,26 @@
src.network += net
break
nanomanager.update_uis(src)
+ else
+ . = ..()
attack_hand(var/mob/user as mob)
- if(src.z > 6)
- user << "\red Unable to establish a connection: \black You're too far away from the station!"
- return
- if(stat & (NOPOWER|BROKEN))
+ access = list()
+ if (src.z > 6)
+ user << "\red Unable to establish a connection: \black You're too far away from the station!"
return
+ if(stat & (NOPOWER|BROKEN)) return
if(!isAI(user))
user.set_machine(src)
- if(network.len == 0)
- user << "\red No networks configured! Swipe the monitor with an authorized ID to configure them."
- return
-
- // Camera listing
- var/list/L = list()
- for (var/obj/machinery/camera/C in cameranet.viewpoints)
- L.Add(C)
- camera_sort(L)
-
- var/list/D = list()
- D["Cancel"] = "Cancel"
- for(var/obj/machinery/camera/C in L)
- if(can_access_camera(C))
- D[text("[][]", C.c_tag, (C.status ? null : " (Deactivated)"))] = C
- C.watcherslist -= user
- var/t = input(user, "Which camera should you change to?") as null|anything in D
- if(!t)
- user.unset_machine()
- return 0
-
- var/obj/machinery/camera/C = D[t]
+ if(ishuman(user))
+ var/mob/living/carbon/human/H = user
+ if(H.wear_id)
+ var/obj/item/weapon/card/id/gold/C = H.wear_id
+ access = C.access
- if(t == "Cancel")
- user.unset_machine()
- return 0
-
- if(C)
- C.watcherslist += user
- switch_to_camera(user, C)
- spawn(5)
- attack_hand(user)
- return
+ ui_interact(user)
// Check if camera is accessible when jumping
proc/can_access_camera(var/obj/machinery/camera/C)
diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm
index e87f9003383..a007c324ac4 100644
--- a/code/game/machinery/computer/crew.dm
+++ b/code/game/machinery/computer/crew.dm
@@ -1,5 +1,5 @@
/obj/machinery/computer/crew
- name = "Crew monitoring computer"
+ name = "Crew Monitoring Computer"
desc = "Used to monitor active health sensors built into most of the crew's uniforms."
icon_state = "crew"
use_power = 1
diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm
index 72d77cd5a60..aa479a28846 100644
--- a/code/game/mecha/mech_fabricator.dm
+++ b/code/game/mecha/mech_fabricator.dm
@@ -1,11 +1,7 @@
-/////////////////////////////
-///// Part Fabricator ///////
-/////////////////////////////
-
/obj/machinery/mecha_part_fabricator
icon = 'icons/obj/robotics.dmi'
icon_state = "fab-idle"
- name = "Exosuit Fabricator"
+ name = "exosuit fabricator"
desc = "Nothing is being built."
density = 1
anchored = 1
@@ -18,367 +14,187 @@
var/time_coeff_tech = 1
var/resource_coeff_tech = 1
var/list/resources = list(
- "metal"=0,
- "glass"=0,
- "gold"=0,
- "silver"=0,
- "diamond"=0,
- "plasma"=0,
- "uranium"=0,
- "bananium"=0
- )
+ "$metal"=0,
+ "$glass"=0,
+ "$bananium"=0,
+ "$diamond"=0,
+ "$gold"=0,
+ "$plasma"=0,
+ "$silver"=0,
+ "$uranium"=0
+ )
var/res_max_amount = 200000
var/datum/research/files
var/id
var/sync = 0
var/part_set
- var/obj/being_built
+ var/datum/design/being_built
var/list/queue = list()
var/processing_queue = 0
var/screen = "main"
- var/opened = 0
var/temp
- var/list/part_sets = list( //set names must be unique
- "Robot"=list(
- /obj/item/robot_parts/robot_suit,
- /obj/item/robot_parts/chest,
- /obj/item/robot_parts/head,
- /obj/item/robot_parts/l_arm,
- /obj/item/robot_parts/r_arm,
- /obj/item/robot_parts/l_leg,
- /obj/item/robot_parts/r_leg
- ),
-
-"Robot Repair"=list(
- /obj/item/robot_parts/robot_component/binary_communication_device,
- /obj/item/robot_parts/robot_component/radio,
- /obj/item/robot_parts/robot_component/actuator,
- /obj/item/robot_parts/robot_component/diagnosis_unit,
- /obj/item/robot_parts/robot_component/camera,
- /obj/item/robot_parts/robot_component/armour
- ),
- "Ripley"=list(
- /obj/item/mecha_parts/chassis/ripley,
- /obj/item/mecha_parts/part/ripley_torso,
- /obj/item/mecha_parts/part/ripley_left_arm,
- /obj/item/mecha_parts/part/ripley_right_arm,
- /obj/item/mecha_parts/part/ripley_left_leg,
- /obj/item/mecha_parts/part/ripley_right_leg
- ),
- "Odysseus"=list(
- /obj/item/mecha_parts/chassis/odysseus,
- /obj/item/mecha_parts/part/odysseus_torso,
- /obj/item/mecha_parts/part/odysseus_head,
- /obj/item/mecha_parts/part/odysseus_left_arm,
- /obj/item/mecha_parts/part/odysseus_right_arm,
- /obj/item/mecha_parts/part/odysseus_left_leg,
- /obj/item/mecha_parts/part/odysseus_right_leg
- ),
-
- "Gygax"=list(
- /obj/item/mecha_parts/chassis/gygax,
- /obj/item/mecha_parts/part/gygax_torso,
- /obj/item/mecha_parts/part/gygax_head,
- /obj/item/mecha_parts/part/gygax_left_arm,
- /obj/item/mecha_parts/part/gygax_right_arm,
- /obj/item/mecha_parts/part/gygax_left_leg,
- /obj/item/mecha_parts/part/gygax_right_leg,
- /obj/item/mecha_parts/part/gygax_armour
- ),
- "Durand"=list(
- /obj/item/mecha_parts/chassis/durand,
- /obj/item/mecha_parts/part/durand_torso,
- /obj/item/mecha_parts/part/durand_head,
- /obj/item/mecha_parts/part/durand_left_arm,
- /obj/item/mecha_parts/part/durand_right_arm,
- /obj/item/mecha_parts/part/durand_left_leg,
- /obj/item/mecha_parts/part/durand_right_leg,
- /obj/item/mecha_parts/part/durand_armor
- ),
- "Phazon"=list(
- /obj/item/mecha_parts/chassis/phazon,
- /obj/item/mecha_parts/part/phazon_torso,
- /obj/item/mecha_parts/part/phazon_head,
- /obj/item/mecha_parts/part/phazon_left_arm,
- /obj/item/mecha_parts/part/phazon_right_arm,
- /obj/item/mecha_parts/part/phazon_left_leg,
- /obj/item/mecha_parts/part/phazon_right_leg,
- /obj/item/mecha_parts/part/phazon_armor
- ),
- "H.O.N.K"=list(
- /obj/item/mecha_parts/chassis/honker,
- /obj/item/mecha_parts/part/honker_torso,
- /obj/item/mecha_parts/part/honker_head,
- /obj/item/mecha_parts/part/honker_left_arm,
- /obj/item/mecha_parts/part/honker_right_arm,
- /obj/item/mecha_parts/part/honker_left_leg,
- /obj/item/mecha_parts/part/honker_right_leg
- ),
- "Exosuit Equipment"=list(
- /obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp,
- /obj/item/mecha_parts/mecha_equipment/tool/drill,
- /obj/item/mecha_parts/mecha_equipment/tool/extinguisher,
- /obj/item/mecha_parts/mecha_equipment/tool/cable_layer,
- /obj/item/mecha_parts/mecha_equipment/tool/sleeper,
- /obj/item/mecha_parts/mecha_equipment/tool/syringe_gun,
- /obj/item/mecha_parts/chassis/firefighter,
- ///obj/item/mecha_parts/mecha_equipment/repair_droid,
- /obj/item/mecha_parts/mecha_equipment/generator,
- ///obj/item/mecha_parts/mecha_equipment/jetpack, //TODO MECHA JETPACK SPRITE MISSING
- /obj/item/mecha_parts/mecha_equipment/weapon/energy/taser,
- /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg,
- /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/mousetrap_mortar,
- /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar,
- /obj/item/mecha_parts/mecha_equipment/weapon/honker
- ),
-
- "Robotic Upgrade Modules" = list(
- /obj/item/borg/upgrade/reset,
- /obj/item/borg/upgrade/rename,
- /obj/item/borg/upgrade/restart,
- /obj/item/borg/upgrade/vtec,
- /obj/item/borg/upgrade/tasercooler,
- /obj/item/borg/upgrade/jetpack
- ),
-
- "Space Pod" = list(
- /obj/item/pod_parts/core
- ),
-
- "Misc"=list(/obj/item/mecha_parts/mecha_tracking)
- )
-
-
-
+ var/list/part_sets = list(
+ "Cyborg",
+ "Ripley",
+ "Firefighter",
+ "Odysseus",
+ "Gygax",
+ "Durand",
+ "H.O.N.K",
+ "Phazon",
+ "Exosuit Equipment",
+ "Cyborg Upgrade Modules",
+ "Misc"
+ )
/obj/machinery/mecha_part_fabricator/New()
..()
component_parts = list()
- component_parts += new /obj/item/weapon/circuitboard/mechfab(src)
- component_parts += new /obj/item/weapon/stock_parts/matter_bin(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/stock_parts/micro_laser(src)
- component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
+ component_parts += new /obj/item/weapon/circuitboard/mechfab(null)
+ component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
+ component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
+ component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
+ component_parts += new /obj/item/weapon/stock_parts/micro_laser(null)
+ component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
RefreshParts()
-
- // part_sets["Cyborg Upgrade Modules"] = typesof(/obj/item/borg/upgrade/) - /obj/item/borg/upgrade/ // Eh. This does it dymaically, but to support having the items referenced otherwhere in the code but not being constructable, going to do it manaully.
-
- for(var/part_set in part_sets)
- convert_part_set(part_set)
files = new /datum/research(src) //Setup the research data holder.
- /*
- if(!id)
- for(var/obj/machinery/r_n_d/server/centcom/S in world)
- S.initialize()
- break
- */
- return
/obj/machinery/mecha_part_fabricator/RefreshParts()
var/T = 0
+
+ //maximum stocking amount (max 412000)
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
T += M.rating
- res_max_amount = (187500+(T * 37500))
- T = 0
+ res_max_amount = (187000+(T * 37500))
+
+ //ressources adjustment coefficient (1 -> 0.88 -> 0.75)
+ T = -1
for(var/obj/item/weapon/stock_parts/micro_laser/Ma in component_parts)
T += Ma.rating
- T -= 1
- var/diff
- diff = round(initial(resource_coeff) - (initial(resource_coeff)*(T))/8,0.01)
- if(resource_coeff!=diff)
- resource_coeff = diff
- T = 0
+ resource_coeff = round(initial(resource_coeff) - (initial(resource_coeff)*(T))/8,0.01)
+
+ //building time adjustment coefficient (1 -> 0.8 -> 0.6)
+ T = -1
for(var/obj/item/weapon/stock_parts/manipulator/Ml in component_parts)
T += Ml.rating
- T -= 1
- diff = round(initial(time_coeff) - (initial(time_coeff)*(T))/5,0.01)
- if(time_coeff!=diff)
- time_coeff = diff
+ time_coeff = round(initial(time_coeff) - (initial(time_coeff)*(T))/5,0.01)
-/obj/machinery/mecha_part_fabricator/Destroy()
- for(var/atom/A in src)
- del A
- ..()
- return
-
-/obj/machinery/mecha_part_fabricator/proc/operation_allowed(mob/M)
- if(isrobot(M) || isAI(M))
- return 1
- if(!istype(req_access) || !req_access.len)
- return 1
- else if(istype(M, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = M
- for(var/ID in list(H.get_active_hand(), H.wear_id, H.belt))
- if(src.check_access(ID))
- return 1
- M << "You don't have required permissions to use [src]"
- return 0
+/obj/machinery/mecha_part_fabricator/check_access(obj/item/weapon/card/id/I)
+ if(istype(I, /obj/item/device/pda))
+ var/obj/item/device/pda/pda = I
+ I = pda.id
+ if(!istype(I) || !I.access) //not ID or no access
+ return 0
+ for(var/req in req_access)
+ if(!(req in I.access)) //doesn't have this access
+ return 0
+ return 1
/obj/machinery/mecha_part_fabricator/proc/emag()
- sleep()
switch(emagged)
if(0)
emagged = 0.5
- src.visible_message("\icon[src] [src] beeps: \"DB error \[Code 0x00F1\]\"")
+ visible_message("\icon[src] \The [src] beeps: \"DB error \[Code 0x00F1\]\"")
sleep(10)
- src.visible_message("\icon[src] [src] beeps: \"Attempting auto-repair\"")
+ visible_message("\icon[src] \The [src] beeps: \"Attempting auto-repair\"")
sleep(15)
- src.visible_message("\icon[src] [src] beeps: \"User DB corrupted \[Code 0x00FA\]. Truncating data structure...\"")
+ visible_message("\icon[src] \The [src] beeps: \"User DB corrupted \[Code 0x00FA\]. Truncating data structure...\"")
sleep(30)
- src.visible_message("\icon[src] [src] beeps: \"User DB truncated. Please contact your Nanotrasen system operator for future assistance.\"")
+ visible_message("\icon[src] \The [src] beeps: \"User DB truncated. Please contact your Nanotrasen system operator for future assistance.\"")
req_access = null
emagged = 1
if(0.5)
- src.visible_message("\icon[src] [src] beeps: \"DB not responding \[Code 0x0003\]...\"")
+ visible_message("\icon[src] \The [src] beeps: \"DB not responding \[Code 0x0003\]...\"")
if(1)
- src.visible_message("\icon[src] [src] beeps: \"No records in User DB\"")
- return
-
-/obj/machinery/mecha_part_fabricator/proc/convert_part_set(set_name as text)
- var/list/parts = part_sets[set_name]
- if(istype(parts, /list))
- for(var/i=1;i<=parts.len;i++)
- var/path = parts[i]
- var/part = new path(src)
- if(part)
- parts[i] = part
- //debug below
- if(!istype(parts[i],/obj/item)) return 0
- return
-
-
-/obj/machinery/mecha_part_fabricator/proc/add_part_set(set_name as text,parts=null)
- if(set_name in part_sets)//attempt to create duplicate set
- return 0
- if(isnull(parts))
- part_sets[set_name] = list()
- else
- part_sets[set_name] = parts
- convert_part_set(set_name)
- return 1
-
-/obj/machinery/mecha_part_fabricator/proc/add_part_to_set(set_name as text,part)
- if(!part) return 0
- src.add_part_set(set_name)//if no "set_name" set exists, create
- var/list/part_set = part_sets[set_name]
- var/atom/apart
- if(ispath(part))
- apart = new part(src)
- else
- apart = part
- if(!istype(apart)) return 0
- for(var/obj/O in part_set)
- if(O.type == apart.type)
- del apart
- return 0
- part_set[++part_set.len] = apart
- return 1
-
-/obj/machinery/mecha_part_fabricator/proc/remove_part_set(set_name as text)
- for(var/i=1,i<=part_sets.len,i++)
- if(part_sets[i]==set_name)
- part_sets.Cut(i,++i)
+ visible_message("\icon[src] \The [src] beeps: \"No records in User DB\"")
return
/obj/machinery/mecha_part_fabricator/proc/output_parts_list(set_name)
var/output = ""
- var/list/part_set = listgetindex(part_sets, set_name)
- if(istype(part_set))
- for(var/obj/item/part in part_set)
- var/resources_available = check_resources(part)
- output += ""
+ for(var/datum/design/D in files.known_designs)
+ if(D.build_type & MECHFAB)
+ if(!(set_name in D.category))
+ continue
+ var/resources_available = check_resources(D)
+ output += ""
return output
-/obj/machinery/mecha_part_fabricator/proc/output_part_info(var/obj/item/part)
- var/output = "[part.name] (Cost: [output_part_cost(part)]) [get_construction_time_w_coeff(part)/10]sec"
+/obj/machinery/mecha_part_fabricator/proc/output_part_info(datum/design/D)
+ var/output = "[initial(D.name)] (Cost: [output_part_cost(D)]) [get_construction_time_w_coeff(D)/10]sec"
return output
-/obj/machinery/mecha_part_fabricator/proc/output_part_cost(var/obj/item/part)
+/obj/machinery/mecha_part_fabricator/proc/output_part_cost(datum/design/D)
var/i = 0
var/output
- if(part.vars.Find("construction_time") && part.vars.Find("construction_cost"))//The most efficient way to go about this. Not all objects have these vars, but if they don't then they CANNOT be made by the mech fab. Doing it this way reduces a major amount of typecasting and switches, while cutting down maintenece for them as well -Sieve
- for(var/c in part:construction_cost)//The check should ensure that anything without the var doesn't make it to this point
- if(c in resources)
- output += "[i?" | ":null][get_resource_cost_w_coeff(part,c)] [c]"
- i++
- return output
- else
- return 0
+ for(var/c in D.materials)
+ if(c in resources)
+ output += "[i?" | ":null][get_resource_cost_w_coeff(D,c)] [material2name(c)]"
+ i++
+ return output
/obj/machinery/mecha_part_fabricator/proc/output_available_resources()
var/output
for(var/resource in resources)
var/amount = min(res_max_amount, resources[resource])
- output += "[resource]: [amount] cm³"
+ output += "[material2name(resource)]: [amount] cm³"
if(amount>0)
- output += " - Remove \[1\] | \[10\] | \[All\]"
+ output += " - Remove \[1\] | \[10\] | \[All\]"
output += "
"
return output
-/obj/machinery/mecha_part_fabricator/proc/remove_resources(var/obj/item/part)
-//Be SURE to add any new equipment to this switch, but don't be suprised if it spits out children objects
- if(part.vars.Find("construction_time") && part.vars.Find("construction_cost"))
- for(var/resource in part:construction_cost)
- if(resource in src.resources)
- src.resources[resource] -= get_resource_cost_w_coeff(part,resource)
- else
- return
+/obj/machinery/mecha_part_fabricator/proc/remove_resources(datum/design/D)
+ for(var/resource in D.materials)
+ if(resource in resources)
+ resources[resource] -= get_resource_cost_w_coeff(D,resource)
-/obj/machinery/mecha_part_fabricator/proc/check_resources(var/obj/item/part)
-// if(istype(part, /obj/item/robot_parts) || istype(part, /obj/item/mecha_parts) || istype(part,/obj/item/borg/upgrade))
-//Be SURE to add any new equipment to this switch, but don't be suprised if it spits out children objects
- if(part.vars.Find("construction_time") && part.vars.Find("construction_cost"))
- for(var/resource in part:construction_cost)
- if(resource in src.resources)
- if(src.resources[resource] < get_resource_cost_w_coeff(part,resource))
- return 0
- return 1
- else
- return 0
+/obj/machinery/mecha_part_fabricator/proc/check_resources(datum/design/D)
+ for(var/R in D.materials)
+ if(R in resources)
+ if(resources[R] < get_resource_cost_w_coeff(D, R))
+ return 0
+ else
+ return 0
+ return 1
-/obj/machinery/mecha_part_fabricator/proc/build_part(var/obj/item/part)
- if(!part) return
+/obj/machinery/mecha_part_fabricator/proc/build_part(datum/design/D)
+ being_built = D
+ desc = "It's building \a [initial(D.name)]."
+ remove_resources(D)
+ overlays += "fab-active"
+ use_power = 2
+ updateUsrDialog()
+ sleep(get_construction_time_w_coeff(D))
+ use_power = 1
+ overlays -= "fab-active"
+ desc = initial(desc)
- // critical exploit prevention, do not remove unless you replace it -walter0o
- if( !(locate(part, src.contents)) || !(part.vars.Find("construction_time")) || !(part.vars.Find("construction_cost")) ) // these 3 are the current requirements for an object being buildable by the mech_fabricator
- return
+ var/obj/item/I = new D.build_path
+ I.loc = get_step(src,SOUTH)
+ I.m_amt = get_resource_cost_w_coeff(D,"$metal")
+ I.g_amt = get_resource_cost_w_coeff(D,"$glass")
+ visible_message("\icon[src] \The [src] beeps, \"\The [I] is complete.\"")
+ being_built = null
- src.being_built = new part.type(src)
- src.desc = "It's building [src.being_built]."
- src.remove_resources(part)
- src.overlays += "fab-active"
- src.use_power = 2
- src.updateUsrDialog()
- sleep(get_construction_time_w_coeff(part))
- src.use_power = 1
- src.overlays -= "fab-active"
- src.desc = initial(src.desc)
- if(being_built)
- src.being_built.Move(get_step(src,SOUTH))
- src.visible_message("\icon[src] [src] beeps, \"The following has been completed: [src.being_built] is built\".")
- src.being_built = null
- src.updateUsrDialog()
+ updateUsrDialog()
return 1
/obj/machinery/mecha_part_fabricator/proc/update_queue_on_page()
- send_byjax(usr,"mecha_fabricator.browser","queue",src.list_queue())
+ send_byjax(usr,"mecha_fabricator.browser","queue",list_queue())
return
/obj/machinery/mecha_part_fabricator/proc/add_part_set_to_queue(set_name)
if(set_name in part_sets)
- var/list/part_set = part_sets[set_name]
- if(islist(part_set))
- for(var/obj/item/part in part_set)
- add_to_queue(part)
- return
+ for(var/datum/design/D in files.known_designs)
+ if(D.build_type & MECHFAB)
+ if(set_name in D.category)
+ add_to_queue(D)
-/obj/machinery/mecha_part_fabricator/proc/add_to_queue(part)
+/obj/machinery/mecha_part_fabricator/proc/add_to_queue(D)
if(!istype(queue))
queue = list()
- if(part)
- queue[++queue.len] = part
+ if(D)
+ queue[++queue.len] = D
return queue.len
/obj/machinery/mecha_part_fabricator/proc/remove_from_queue(index)
@@ -388,30 +204,26 @@
return 1
/obj/machinery/mecha_part_fabricator/proc/process_queue()
- var/obj/item/part = listgetindex(src.queue, 1)
- if(!part)
+ var/datum/design/D = queue[1]
+ if(!D)
remove_from_queue(1)
- if(src.queue.len)
+ if(queue.len)
return process_queue()
else
return
- if(!(part.vars.Find("construction_time")) || !(part.vars.Find("construction_cost")))//If it shouldn't be printed
- remove_from_queue(1)//Take it out of the quene
- return process_queue()//Then reprocess it
temp = null
- while(part)
+ while(D)
if(stat&(NOPOWER|BROKEN))
return 0
- if(!check_resources(part))
- src.visible_message("\icon[src] [src] beeps, \"Not enough resources. Queue processing stopped\".")
- temp = {"Not enough resources to build next part.
+ if(!check_resources(D))
+ visible_message("\icon[src] \The [src] beeps, \"Not enough resources. Queue processing stopped.\"")
+ temp = {"Not enough resources to build next part.
Try again | Return"}
return 0
remove_from_queue(1)
- build_part(part)
- part = listgetindex(src.queue, 1)
- src.visible_message("\icon[src] [src] beeps, \"Queue processing finished successfully\".")
- return 1
+ build_part(D)
+ D = listgetindex(queue, 1)
+ visible_message("\icon[src] \The [src] beeps, \"Queue processing finished successfully.\"")
/obj/machinery/mecha_part_fabricator/proc/list_queue()
var/output = "Queue contains:"
@@ -419,67 +231,45 @@
output += "
Nothing"
else
output += ""
- for(var/i=1;i<=queue.len;i++)
- var/obj/item/part = listgetindex(src.queue, i)
- if(istype(part))
- if(part.vars.Find("construction_time") && part.vars.Find("construction_cost"))
- output += "- [part.name] - [i>1?"↑":null] [i↓
":null] Remove"
- else//Prevents junk items from even appearing in the list, and they will be silently removed when the fab processes
- remove_from_queue(i)//Trash it
- return list_queue()//Rebuild it
+ var/i = 0
+ for(var/datum/design/D in queue)
+ i++
+ var/obj/part = D.build_path
+ output += "[initial(part.name)] - [i>1?"↑":null] [i↓":null] Remove"
+
output += ""
output += "\[Process queue | Clear queue\]"
return output
-/obj/machinery/mecha_part_fabricator/proc/convert_designs()
- if(!files) return
- var/i = 0
- for(var/datum/design/D in files.known_designs)
- if(D.build_type&16)
- if(D.category in part_sets)//Checks if it's a valid category
- if(add_part_to_set(D.category, text2path(D.build_path)))//Adds it to said category
- i++
- else
- if(add_part_to_set("Misc", text2path(D.build_path)))//If in doubt, chunk it into the Misc
- i++
- return i
-
/obj/machinery/mecha_part_fabricator/proc/update_tech()
- if(!files) return
+ if(!files)
+ return
var/output
for(var/datum/tech/T in files.known_tech)
if(T && T.level > 1)
var/diff
- switch(T.id) //bad, bad formulas
+ switch(T.id)
if("materials")
- var/pmat = 0//Calculations to make up for the fact that these parts and tech modify the same thing
- for(var/obj/item/weapon/stock_parts/micro_laser/Ml in component_parts)
- pmat += Ml.rating
- if(pmat >= 1)
- pmat -= 1//So the equations don't have to be reworked, upgrading a single part from T1 to T2 is == to 1 tech level
- diff = round(initial(resource_coeff_tech) - (initial(resource_coeff_tech)*(T.level+pmat))/30,0.01)
- if(resource_coeff_tech > diff)
+ //one materials level is 1/32, so that max level is 0.75 coefficient
+ diff = round(initial(resource_coeff_tech) - (initial(resource_coeff_tech)*(T.level-1))/32,0.01)
+ if(resource_coeff_tech>diff)
resource_coeff_tech = diff
- output += "Production efficiency increased.
"
+ output+="Production efficiency increased.
"
if("programming")
- var/ptime = 0
- for(var/obj/item/weapon/stock_parts/manipulator/Ma in component_parts)
- ptime += Ma.rating
- if(ptime >= 2)
- ptime -= 2
- diff = round(initial(time_coeff_tech) - (initial(time_coeff_tech)*(T.level+ptime))/25,0.1)
- if(time_coeff_tech > diff)
+ //one materials level is 1/40, so that max level is 0.8 coefficient
+ diff = round(initial(time_coeff_tech) - (initial(time_coeff_tech)*(T.level-1))/40,0.1)
+ if(time_coeff_tech>diff)
time_coeff_tech = diff
- output += "Production routines updated.
"
+ output+="Production routines updated.
"
return output
-/obj/machinery/mecha_part_fabricator/proc/sync(silent=null)
- if(!silent)
- temp = "Updating local R&D database..."
- src.updateUsrDialog()
- sleep(30) //only sleep if called by user
- for(var/obj/machinery/computer/rdconsole/RDC in get_area(src))
+/obj/machinery/mecha_part_fabricator/proc/sync()
+ temp = "Updating local R&D database..."
+ updateUsrDialog()
+ sleep(30) //only sleep if called by user
+
+ for(var/obj/machinery/computer/rdconsole/RDC in area_contents(get_area(src)))
if(!RDC.sync)
continue
for(var/datum/tech/T in RDC.files.known_tech)
@@ -487,48 +277,43 @@
for(var/datum/design/D in RDC.files.known_designs)
files.AddDesign2Known(D)
files.RefreshResearch()
- var/i = src.convert_designs()
- var/tech_output = update_tech()
- if(!silent)
- temp = "Processed [i] equipment designs.
"
- temp += tech_output
- temp += "Return"
- src.updateUsrDialog()
- if(i || tech_output)
- src.visible_message("\icon[src] [src] beeps, \"Succesfully synchronized with R&D server. New data processed.\"")
+ temp = "Processed equipment designs.
"
+ //check if the tech coefficients have changed
+ temp += update_tech()
+ temp += "Return"
+
+ updateUsrDialog()
+ visible_message("\icon[src] \The [src] beeps, \"Successfully synchronized with R&D server.\"")
+ return
+
+ temp = "Unable to connect to local R&D Database.
Please check your connections and try again.
Return"
+ updateUsrDialog()
return
-/obj/machinery/mecha_part_fabricator/proc/get_resource_cost_w_coeff(var/obj/item/part as obj,var/resource as text, var/roundto=1)
- if(part.vars.Find("construction_time") && part.vars.Find("construction_cost"))
- if (resource=="iron" && !("iron" in part:construction_cost))
- resource="metal"
- return round(part:construction_cost[resource]*resource_coeff*resource_coeff_tech, roundto)
- else
- return 0
+/obj/machinery/mecha_part_fabricator/proc/get_resource_cost_w_coeff(datum/design/D, resource, roundto = 1)
+ return round(D.materials[resource]*resource_coeff*resource_coeff_tech, roundto)
-/obj/machinery/mecha_part_fabricator/proc/get_construction_time_w_coeff(var/obj/item/part as obj, var/roundto=1)
-//Be SURE to add any new equipment to this switch, but don't be suprised if it spits out children objects
- if(part.vars.Find("construction_time") && part.vars.Find("construction_cost"))
- return round(part:construction_time*time_coeff*time_coeff_tech, roundto)
- else
- return 0
+/obj/machinery/mecha_part_fabricator/proc/get_construction_time_w_coeff(datum/design/D, roundto = 1) //aran
+ return round(initial(D.construction_time)*time_coeff*time_coeff_tech, roundto)
+/obj/machinery/mecha_part_fabricator/attack_hand(mob/user)
+ if(!(..()))
+ return interact(user)
-/obj/machinery/mecha_part_fabricator/attack_hand(mob/user as mob)
+/obj/machinery/mecha_part_fabricator/interact(mob/user as mob)
var/dat, left_part
if (..())
return
- if(!operation_allowed(user))
- return
user.set_machine(src)
var/turf/exit = get_step(src,SOUTH)
if(exit.density)
- src.visible_message("\icon[src] [src] beeps, \"Error! Part outlet is obstructed\".")
+ visible_message("\icon[src] \The [src] beeps, \"Error! Part outlet is obstructed.\"")
return
if(temp)
left_part = temp
- else if(src.being_built)
- left_part = {"Building [src.being_built.name].
+ else if(being_built)
+ var/obj/I = being_built.build_path
+ left_part = {"Building [initial(I.name)].
Please wait until completion..."}
else
switch(screen)
@@ -536,13 +321,13 @@
left_part = output_available_resources()+"
"
left_part += "Sync with R&D servers
"
for(var/part_set in part_sets)
- left_part += "[part_set] - \[Add all parts to queue\]
"
+ left_part += "[part_set] - \[Add all parts to queue\]
"
if("parts")
left_part += output_parts_list(part_set)
left_part += "
Return"
dat = {"
- [src.name]
+ [name]