Skip to content

Commit

Permalink
RnD порт Tau (#2351)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lexanx authored Jul 10, 2024
1 parent ba98b6c commit f519150
Show file tree
Hide file tree
Showing 81 changed files with 4,834 additions and 1,390 deletions.
38 changes: 22 additions & 16 deletions code/game/machinery/robotics_fabricator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,18 @@
if(..())
return

//[SIERRA-EDIT] - MODPACK_RND
if(href_list["build"])
add_to_queue(text2num(href_list["build"]))
var/datum/design/D = locate(href_list["build"]) in files.known_designs
if(D)
add_to_queue(D)

if(href_list["remove"])
remove_from_queue(text2num(href_list["remove"]))
var/num = text2num(href_list["remove"])
if(num)
num = clamp(num, 1,LAZYLEN(queue))
remove_from_queue(num)
//[/SIERRA-EDIT] - MODPACK_RND

if(href_list["category"])
if(href_list["category"] in categories)
Expand Down Expand Up @@ -202,8 +209,7 @@
else
busy = 0

/obj/machinery/robotics_fabricator/proc/add_to_queue(index)
var/datum/design/D = files.known_designs[index]
/obj/machinery/robotics_fabricator/proc/add_to_queue(datum/design/D)
queue += D
update_busy()

Expand Down Expand Up @@ -243,17 +249,19 @@

/obj/machinery/robotics_fabricator/proc/get_queue_names()
. = list()
//[SIERRA-ADD] - MODPACK_RND
for(var/i = 2 to length(queue))
var/datum/design/D = queue[i]
. += D.name

/obj/machinery/robotics_fabricator/proc/get_build_options()
. = list()
for(var/i = 1 to length(files.known_designs))
var/datum/design/D = files.known_designs[i]
if(!D.build_path || !(D.build_type & MECHFAB))
for(var/i in files.known_designs)
var/datum/design/D = i
if(!(D.build_type & MECHFAB))
continue
. += list(list("name" = D.name, "id" = i, "category" = D.category, "resourses" = get_design_resourses(D), "time" = get_design_time(D)))
. += list(list("name" = D.name, "id" = "\ref[D]", "category" = D.category, "resourses" = get_design_resourses(D), "time" = get_design_time(D)))
//[/SIERRA-ADD] - MODPACK_RND

/obj/machinery/robotics_fabricator/proc/get_design_resourses(datum/design/D)
var/list/F = list()
Expand All @@ -273,8 +281,8 @@
if(!D.build_path || !(D.build_type & MECHFAB))
continue
categories |= D.category
if(!category || !(category in categories))
category = categories[1]
// if(!category || !(category in categories))
// category = categories[1]

/obj/machinery/robotics_fabricator/proc/get_materials()
. = list()
Expand Down Expand Up @@ -328,10 +336,8 @@
for(var/obj/machinery/computer/rdconsole/RDC in get_area_all_atoms(get_area(src)))
if(!RDC.sync)
continue
for(var/datum/tech/T in RDC.files.known_tech)
files.AddTech2Known(T)
for(var/datum/design/D in RDC.files.known_designs)
files.AddDesign2Known(D)
files.RefreshResearch()
sync_message = "Sync complete."
files.download_from(RDC.files)
//[SIERRA-EDIT] - MODPACK_RND
sync_message = "Sync complete."
update_categories()
//[/SIERRA-EDIT] - MODPACK_RND
5 changes: 5 additions & 0 deletions code/game/objects/explosion_recursive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ var/global/explosion_in_progress = 0

if(power <= 0) return
epicenter = get_turf(epicenter)
//[SIERRA-ADD] - MODPACK_RND
if(!epicenter) return
for(var/obj/item/device/beacon/explosion_watcher/W in explosion_watcher_list)
if(get_dist(W, epicenter) < 10)
W.react_explosion(epicenter, power)
//[/SIERRA-ADD] - MODPACK_RND

explosion_in_progress = 1
explosion_turfs = list()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
desc_comp += "[SPAN_NOTICE("Testing potentials:")]<BR>"
//var/list/techlvls = params2list(origin_tech)
for(var/T in origin_tech)
desc_comp += "Tech: Level [origin_tech[T]] [CallTechName(T)] <BR>"
desc_comp += "Tech: Level [origin_tech[T]] [(T)] <BR>"
else
desc_comp += "No tech origins detected.<BR>"

Expand Down
26 changes: 25 additions & 1 deletion code/game/objects/items/devices/scanners/plant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
/obj/machinery/portable_atmospherics/hydroponics,
/obj/item/seeds
)
//[SIERRA-ADD] - MODPACK_RND
var/potency
//[/SIERRA-ADD] - MODPACK_RND


/obj/item/device/scanner/plant/is_valid_scan_target(atom/O)
if(is_type_in_list(O, valid_targets))
Expand All @@ -22,8 +26,15 @@
scan_title = "[A] at [get_area(A)]"
scan_data = plant_scan_results(A)
show_menu(user)
//[SIERRA-ADD] - MODPACK_RND
var/datum/seed/grown_seed
if(istype(A,/obj/item/reagent_containers/food/snacks/grown))
var/obj/item/reagent_containers/food/snacks/grown/G = A
grown_seed = SSplants.seeds[G.plantname]
potency = grown_seed.get_trait(TRAIT_POTENCY)
//[/SIERRA-ADD] - MODPACK_RND

/proc/plant_scan_results(obj/target)
/obj/item/device/scanner/plant/proc/plant_scan_results(obj/target)
var/datum/seed/grown_seed
var/datum/reagents/grown_reagents
if(istype(target,/obj/item/reagent_containers/food/snacks/grown))
Expand Down Expand Up @@ -180,3 +191,16 @@
dat += "<br>It will remove gas from the environment."

return JOINTEXT(dat)
//[SIERRA-ADD] - MODPACK_RND

/obj/item/device/scanner/plant/print_report(mob/living/user)
if(!scan_data)
to_chat(user, "There is no scan data to print.")
return
var/obj/item/paper/plant_report/P = new(get_turf(src), scan_data, "paper - [scan_title]")
P.potency = potency
if(printout_color)
P.color = printout_color
user.put_in_hands(P)
user.visible_message("\The [src] spits out a piece of paper.")
//[/SIERRA-ADD] - MODPACK_RND
25 changes: 22 additions & 3 deletions code/game/objects/items/devices/scanners/xenobio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
scan_sound = 'sound/effects/scanbeep.ogg'
printout_color = "#f3e6ff"
origin_tech = list(TECH_MAGNET = 1, TECH_BIO = 1)
var/new_species = FALSE

var/list/valid_targets = list(
/mob/living/carbon/human,
Expand All @@ -26,15 +27,16 @@
scan_title = O.name
scan_data = xenobio_scan_results(O)
user.show_message(SPAN_NOTICE(scan_data))

/proc/list_gases(gases)
//[SIERRA-EDIT] - MODPACK_RND
/obj/item/device/scanner/xenobio/proc/list_gases(gases)
RETURN_TYPE(/list)
. = list()
for(var/g in gases)
. += "[gas_data.name[g]] ([gases[g]]%)"
return english_list(.)

/proc/xenobio_scan_results(mob/target)
/obj/item/device/scanner/xenobio/proc/xenobio_scan_results(mob/target)
//[/SIERRA-EDIT] - MODPACK_RND
. = list()
if(istype(target, /obj/machinery/stasis_cage))
var/obj/machinery/stasis_cage/cagie = target
Expand Down Expand Up @@ -65,6 +67,9 @@
if((A in P.animals) || is_type_in_list(A, P.repopulate_types))
GLOB.stat_fauna_scanned |= "[P.name]-[A.type]"
. += "New xenofauna species discovered!"
//[SIERRA-ADD] - MODPACK_RND
new_species = TRUE
//[/SIERRA-ADD] - MODPACK_RND
break
else if(istype(target, /mob/living/carbon/slime))
var/mob/living/carbon/slime/T = target
Expand Down Expand Up @@ -105,3 +110,17 @@
. += "Incompatible life form, analysis failed."

. = jointext(., "<br>")

//[SIERRA-ADD] - MODPACK_RND
/obj/item/device/scanner/xenobio/print_report(mob/living/user)
if(!scan_data)
to_chat(user, "There is no scan data to print.")
return
var/obj/item/paper/xenofauna_report/P = new(get_turf(src), scan_data, "paper - [scan_title]")
if(new_species)
P.new_species = TRUE
if(printout_color)
P.color = printout_color
user.put_in_hands(P)
user.visible_message("\The [src] spits out a piece of paper.")
//[/SIERRA-ADD] - MODPACK_RND
18 changes: 17 additions & 1 deletion code/game/objects/items/weapons/autopsy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
var/list/chemtraces = list()
var/target_name = null
var/timeofdeath = null
//[SIERRA-ADD] - MODPACK_RND

/obj/item/paper/autopsy_report
var/list/autopsy_data
//[/SIERRA-ADD] - MODPACK_RND

/datum/autopsy_data_scanner
var/weapon = null // this is the DEFINITE weapon type that was used
Expand Down Expand Up @@ -137,7 +142,18 @@

sleep(10)

var/obj/item/paper/P = new(usr.loc, "<tt>[scan_data]</tt>", "Autopsy Data ([target_name])")
//[SIERRA-ADD] - MODPACK_RND
var/obj/item/paper/autopsy_report/P = new(usr.loc, "<tt>[scan_data]</tt>", "Autopsy Data ([target_name])")
P.name = "Autopsy Data ([target_name])"
P.info = "<tt>[scan_data]</tt>"
P.autopsy_data = list() // Copy autopsy data for science tool
for(var/wdata_idx in wdata)
var/datum/autopsy_data_scanner/D = wdata[wdata_idx]
for(var/wound_idx in D.organs_scanned)
var/datum/autopsy_data/W = D.organs_scanned[wound_idx]
P.autopsy_data += W.copy()
P.icon_state = "paper_words"
//[/SIERRA-ADD] - MODPACK_RND
if(istype(usr,/mob/living/carbon))
// place the item in the usr's hand if possible
usr.put_in_hands(P)
Expand Down
11 changes: 11 additions & 0 deletions code/modules/client/preference_setup/loadout/lists/utility.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ modular computers
path = /obj/item/modular_computer/laptop/preset/custom_loadout/advanced
cost = 6

//[SIERRA-ADD] - MODPACK_RND
/datum/gear/utility/usb
display_name = "Basic data crystal"
path = /obj/item/stock_parts/computer/hard_drive/portable
cost = 1

/datum/gear/utility/usb_adv
display_name = "Advanced data crystal"
path = /obj/item/stock_parts/computer/hard_drive/portable/advanced
cost = 2
//[/SIERRA-ADD] - MODPACK_RND
/****************
Pouches and kits
****************/
Expand Down
54 changes: 18 additions & 36 deletions code/modules/clothing/spacesuits/rig/modules/computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,12 @@

interface_name = "contact datajack"
interface_desc = "An induction-powered high-throughput datalink suitable for hacking encrypted networks."
var/list/stored_research
//[SIERRA-EDIT] - MODPACK_RND
var/datum/research/files

/obj/item/rig_module/datajack/Initialize()
. =..()
stored_research = list()
/obj/item/rig_module/datajack/New()
..()
files = new(src)

/obj/item/rig_module/datajack/engage(atom/target)

Expand All @@ -258,20 +259,19 @@

/obj/item/rig_module/datajack/accepts_item(obj/item/input_device, mob/living/user)

if(istype(input_device,/obj/item/disk/tech_disk))
to_chat(user, "You slot the disk into [src].")
var/obj/item/disk/tech_disk/disk = input_device
if(disk.stored)
if(load_data(disk.stored))
to_chat(user, SPAN_INFO("Download successful; disk erased."))
disk.stored = null
if(istype(input_device, /obj/item/stock_parts/computer/hard_drive))
to_chat(user, "You connect the disk to [src].")
var/obj/item/stock_parts/computer/hard_drive/disk = input_device
if(disk.used_capacity)
if(load_data(disk))
to_chat(user, SPAN_NOTICE("Download successful."))
else
to_chat(user, SPAN_WARNING("The disk is corrupt. It is useless to you."))
to_chat(user, SPAN_WARNING("The disk does not contain any new research data. It is useless to you."))
else
to_chat(user, SPAN_WARNING("The disk is blank. It is useless to you."))
return 1

// I fucking hate R&D code. This typecheck spam would be totally unnecessary in a sane setup.
//This typecheck spam would be totally unnecessary in a sane setup.
else if(istype(input_device,/obj/machinery))
var/datum/research/incoming_files
if(istype(input_device,/obj/machinery/computer/rdconsole))
Expand All @@ -281,38 +281,20 @@
var/obj/machinery/r_n_d/server/input_machine = input_device
incoming_files = input_machine.files

if(!incoming_files || !incoming_files.known_tech || !length(incoming_files.known_tech))
if(!incoming_files || !incoming_files.known_designs || !length(incoming_files.known_designs))
to_chat(user, SPAN_WARNING("Memory failure. There is nothing accessible stored on this terminal."))
else
// Maybe consider a way to drop all your data into a target repo in the future.
if(load_data(incoming_files.known_tech))
if(load_data(incoming_files.known_designs))
to_chat(user, SPAN_INFO("Download successful; local and remote repositories synchronized."))
else
to_chat(user, SPAN_WARNING("Scan complete. There is nothing useful stored on this terminal."))
return 1
return 0

/obj/item/rig_module/datajack/proc/load_data(incoming_data)

if(islist(incoming_data))
for(var/entry in incoming_data)
load_data(entry)
return 1

if(istype(incoming_data, /datum/tech))
var/data_found
var/datum/tech/new_data = incoming_data
for(var/datum/tech/current_data in stored_research)
if(current_data.id == new_data.id)
data_found = 1
if(current_data.level < new_data.level)
current_data.level = new_data.level
break
if(!data_found)
stored_research += incoming_data
return 1
return 0

/obj/item/rig_module/datajack/proc/load_data(datum/research/incoming_files)
return files.download_from(incoming_files)
//[/SIERRA-EDIT] - MODPACK_RND
/obj/item/rig_module/electrowarfare_suite

name = "electrowarfare module"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/item_worth/worths_list.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ var/global/list/worths = list(
/obj/item/slimepotion2 = 300,
/obj/item/slimesteroid = 150,
/obj/item/slimesteroid2 = 250,
/obj/item/portable_destructive_analyzer = 780,
// /obj/item/portable_destructive_analyzer = 780,
/obj/item/inflatable_dispenser = 300,
/obj/item/matter_decompiler = 400,
//COMPUTER HARDWARE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"Droid" = "droid-science"
)
equipment = list(
/obj/item/portable_destructive_analyzer,
// /obj/item/portable_destructive_analyzer,
/obj/item/gripper/research,
/obj/item/gripper/no_use/loader,
/obj/item/device/robotanalyzer,
Expand Down
Loading

0 comments on commit f519150

Please sign in to comment.