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 = "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
@@ -178,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 Biomass: [points] units.
"
dat += "Wallet:
Make ([100/efficiency])
"
- /*dat += "Book bag:
Make ([200/efficiency])
"
+ dat += "Book bag:
Make ([200/efficiency])
"
dat += "Plant bag:
Make ([200/efficiency])
"
- dat += "Mining satchel:
Make ([200/efficiency])
"*/
+ dat += "Mining satchel:
Make ([200/efficiency])
"
dat += "Botanical gloves:
Make ([250/efficiency])
"
dat += "Utility belt:
Make ([300/efficiency])
"
dat += "Leather Satchel:
Make ([400/efficiency])
"
dat += "Cash Bag:
Make ([400/efficiency])
"
- /*dat += "Leather Jacket:
Make ([500/efficiency])
"*/
+ dat += "Leather Jacket:
Make ([500/efficiency])
"
//dat += "
Other:
"
//dat += "Monkey:
Make ([400/efficiency])
"
dat += "
"
@@ -225,26 +227,38 @@
if(check_container_volume(10)) return 0
else if (check_cost(20/efficiency)) return 0
else beaker.reagents.add_reagent("milk",10)
- /*if("cream")
+ if("cream")
if(check_container_volume(10)) return 0
else if (check_cost(30/efficiency)) return 0
- else beaker.reagents.add_reagent("cream",10)*/
+ else beaker.reagents.add_reagent("cream",10)
if("meat")
if (check_cost(250/efficiency)) return 0
else new/obj/item/weapon/reagent_containers/food/snacks/monkeycube(src.loc)
if("ez")
if (check_cost(10/efficiency)) return 0
- else new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(src.loc)
+ if(in_beaker)
+ if(check_container_volume(10)) return 0
+ else beaker.reagents.add_reagent("eznutrient",10)
+ else
+ new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(src.loc)
if("l4z")
if (check_cost(20/efficiency)) return 0
- else new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(src.loc)
+ if(in_beaker)
+ if(check_container_volume(10)) return 0
+ else beaker.reagents.add_reagent("left4zed",10)
+ else
+ new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(src.loc)
if("rh")
if (check_cost(25/efficiency)) return 0
- else new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(src.loc)
+ if(in_beaker)
+ if(check_container_volume(10)) return 0
+ else beaker.reagents.add_reagent("robustharvest",10)
+ else
+ new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(src.loc)
if("wallet")
if (check_cost(100/efficiency)) return 0
else new/obj/item/weapon/storage/wallet(src.loc)
- /*if("bkbag")
+ if("bkbag")
if (check_cost(200/efficiency)) return 0
else new/obj/item/weapon/storage/bag/books(src.loc)
if("ptbag")
@@ -252,7 +266,7 @@
else new/obj/item/weapon/storage/bag/plants(src.loc)
if("mnbag")
if (check_cost(200/efficiency)) return 0
- else new/obj/item/weapon/storage/bag/ore(src.loc)*/
+ else new/obj/item/weapon/storage/bag/ore(src.loc)
if("gloves")
if (check_cost(250/efficiency)) return 0
else new/obj/item/clothing/gloves/botanic_leather(src.loc)
@@ -265,9 +279,9 @@
if("cashbag")
if (check_cost(400/efficiency)) return 0
else new/obj/item/weapon/storage/bag/cash(src.loc)
- /*if("jacket")
+ if("jacket")
if (check_cost(500/efficiency)) return 0
- else new/obj/item/clothing/suit/jacket/leather(src.loc)*/
+ else new/obj/item/clothing/suit/jacket/leather(src.loc)
//if("monkey")
// if (check_cost(500)) return 0
// else new/mob/living/carbon/monkey(src.loc)
@@ -309,4 +323,8 @@
else if(href_list["menu"])
menustat = "menu"
+ updateUsrDialog()
+
+ else if(href_list["inbeaker"])
+ in_beaker = !in_beaker
updateUsrDialog()
\ No newline at end of file
diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm
index 41cf368ecef..d1edd7f2564 100644
--- a/code/game/machinery/bots/bots.dm
+++ b/code/game/machinery/bots/bots.dm
@@ -30,6 +30,7 @@
var/mob/living/silicon/ai/calling_ai //Links a bot to the AI calling it.
var/obj/item/device/radio/Radio //The bot's radio, for speaking to people.
var/radio_frequency //The bot's default radio speaking freqency. Recommended to be on a department frequency.
+ var/radio_name = "Common"
//var/emagged = 0 //Urist: Moving that var to the general /bot tree as it's used by most bots
var/auto_patrol = 0// set to make bot automatically patrol
var/turf/patrol_target // this is turf to navigate to (location of beacon)
@@ -55,6 +56,7 @@
#define FLOOR_BOT 3 // Floorbots
#define CLEAN_BOT 4 // Cleanbots
#define MED_BOT 5 // Medibots
+ var/bot_type_name = "Bot"
#define DEFAULT_SCAN_RANGE 7 //default view range for finding targets.
@@ -101,6 +103,7 @@
set_custom_texts()
Radio = new /obj/item/device/radio(src)
Radio.listening = 0 //Makes bot radios transmit only so no one hears things while adjacent to one.
+ Radio.config(list("[radio_name]" = 0))
/obj/machinery/bot/proc/add_to_beacons(bot_filter) //Master filter control for bots. Must be placed in the bot's local New() to support map spawned bots.
@@ -335,14 +338,13 @@
/obj/machinery/bot/attack_ai(mob/user as mob)
attack_hand(user)
-/obj/machinery/bot/proc/speak(var/message, freq) //Pass a message to have the bot say() it. Pass a frequency to say it on the radio.
+/obj/machinery/bot/proc/speak(var/message, freq, var/freqname = null) //Pass a message to have the bot say() it. Pass a frequency to say it on the radio.
if((!on) || (!message))
return
if(freq)
- return
- // Commenting out the radio code until our say code's compatible with /tg/'s
- /* Radio.set_frequency(radio_frequency)
- Radio.talk_into_atom(src, message, radio_frequency) */
+ Radio.set_frequency(radio_frequency)
+ if(freqname)
+ Radio.autosay(message, src.name, freqname, list(src.z))
else
for(var/mob/O in hearers(src, null))
O.show_message("