Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix unable to research ai tech using ruin type rnd console #22878

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/__DEFINES/research.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@
///This determines how many general points that the ruin_tech techweb gets, since they don't utilize servers
#define RUIN_GENERATION_PER_TICK 70

///This determines how many nanites points that the ruin_tech techweb gets, since they lack research tools.
#define NANITES_RESEARCH_RUIN_PER_TICK 10
///This determines how many nanites/AI points that the ruin_tech techweb gets, since they lack research tools.
#define NANITES_AI_RESEARCH_RUIN_PER_TICK 10
2 changes: 1 addition & 1 deletion code/controllers/subsystem/research.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ SUBSYSTEM_DEF(research)
science_tech.remove_stored_point_type(i, boost_amt)
science_tech.add_point_list(bitcoins)
//add RUIN_GENERATION_PER_TICK even without any servers, for things like freeminers
ruin_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = RUIN_GENERATION_PER_TICK, TECHWEB_POINT_TYPE_NANITES = NANITES_RESEARCH_RUIN_PER_TICK))
ruin_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = RUIN_GENERATION_PER_TICK, TECHWEB_POINT_TYPE_NANITES = NANITES_AI_RESEARCH_RUIN_PER_TICK, TECHWEB_POINT_TYPE_AI = NANITES_AI_RESEARCH_RUIN_PER_TICK))
last_income = world.time

/datum/controller/subsystem/research/proc/calculate_server_coefficient() //Diminishing returns.
Expand Down
1 change: 1 addition & 0 deletions code/game/mecha/mech_fabricator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,7 @@
link_on_init = FALSE
authorization_override = TRUE
hacked = TRUE
circuit = /obj/item/circuitboard/machine/mechfab/ruin

/obj/machinery/mecha_part_fabricator/ruin/Initialize(mapload)
. = ..()
Expand Down
19 changes: 16 additions & 3 deletions code/game/objects/items/circuitboards/machine_circuitboards.dm
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,10 @@
/obj/item/stock_parts/micro_laser = 1,
/obj/item/stack/sheet/glass = 1)

/obj/item/circuitboard/machine/mechfab/ruin
desc = "This board is unofficial, and can be linked experimental R&D console, do not lose this because it's very expensive to accquire."
build_path = /obj/machinery/mecha_part_fabricator/ruin

/obj/item/circuitboard/machine/monkey_recycler
name = "Monkey Recycler (Machine Board)"
greyscale_colors = CIRCUIT_COLOR_SCIENCE
Expand Down Expand Up @@ -1125,9 +1129,18 @@
name = "Rack Creator (Machine Board)"
greyscale_colors = CIRCUIT_COLOR_SCIENCE
build_path = /obj/machinery/rack_creator
req_components = list(
/obj/item/stock_parts/manipulator = 2,
/obj/item/reagent_containers/glass/beaker = 2)
req_components = list(/obj/item/stock_parts/manipulator = 2)
var/unlocked = FALSE

/obj/item/circuitboard/machine/rack_creator/multitool_act(mob/living/user, obj/item/I)
. = ..()
user.visible_message(span_notice("[user] fiddles with [src]."), span_notice( "You fiddle with [src]."))
if(I.use_tool(src, user, 2 SECONDS, volume = 75))
var/datum/effect_system/spark_spread/p = new /datum/effect_system/spark_spread
p.set_up(6, 1, user)
p.start()
unlocked = !unlocked
to_chat(user, span_notice("You changed [src] to [unlocked? "unofficial type" : "official type"]."))

/obj/item/circuitboard/machine/plort
name = "Plort Redemption Machine (Machine Board)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,21 @@

var/datum/component/remote_materials/rmat
var/efficiency_coeff = 1

var/datum/techweb/stored_research

/obj/machinery/rack_creator/Initialize(mapload)
rmat = AddComponent(/datum/component/remote_materials, "rackcreator", mapload)
rmat.set_local_size(200000)
RefreshParts()
return ..()


/obj/machinery/rack_creator/RefreshParts()
var/obj/item/circuitboard/machine/rack_creator/rack_creator = circuit
if(rack_creator.unlocked)
stored_research = SSresearch.ruin_tech
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this mean that it's shared between all neutral factions, even ones which might oppose each other (e.g. free golems and free miners)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well the tech is learned in every factions outside from NT so yeah

desc += " This one is unofficial, you shouldn't let the NT officicals see this."
else
stored_research = SSresearch.science_tech
calculate_efficiency()

/obj/machinery/rack_creator/proc/calculate_efficiency()
Expand Down Expand Up @@ -104,7 +109,7 @@
materials_string += "[M.name]: [D.materials[mat] / efficiency_coeff]"
else
materials_string += ", [M.name]: [D.materials[mat] / efficiency_coeff]"
data["possible_ram"] += list(list("name" = D.name, "capacity" = D.capacity, "cost" = materials_string,"id" = D.id, "unlocked" = SSresearch.science_tech.isDesignResearchedID(D.id) ? TRUE : FALSE))
data["possible_ram"] += list(list("name" = D.name, "capacity" = D.capacity, "cost" = materials_string,"id" = D.id, "unlocked" = stored_research.isDesignResearchedID(D.id) ? TRUE : FALSE))

data["unlocked_ram"] = 1
data["unlocked_cpu"] = 1
Expand Down Expand Up @@ -192,23 +197,23 @@
if(1)
. = TRUE
if(2)
. = SSresearch.science_tech.isNodeResearchedID("ai_cpu_2")
. = stored_research.isNodeResearchedID("ai_cpu_2")
if(3)
. = SSresearch.science_tech.isNodeResearchedID("ai_cpu_3")
. = stored_research.isNodeResearchedID("ai_cpu_3")

if(4)
. = SSresearch.science_tech.isNodeResearchedID("ai_cpu_4")
. = stored_research.isNodeResearchedID("ai_cpu_4")

/obj/machinery/rack_creator/proc/slotUnlockedRAM(slot_number)
switch(slot_number)
if(1)
. = TRUE
if(2)
. = SSresearch.science_tech.isNodeResearchedID("ai_ram_2")
. = stored_research.isNodeResearchedID("ai_ram_2")
if(3)
. = SSresearch.science_tech.isNodeResearchedID("ai_ram_3")
. = stored_research.isNodeResearchedID("ai_ram_3")
if(4)
. = SSresearch.science_tech.isNodeResearchedID("ai_ram_4")
. = stored_research.isNodeResearchedID("ai_ram_4")


/obj/machinery/rack_creator/ui_act(action, params)
Expand Down Expand Up @@ -252,7 +257,7 @@
var/ram_type = params["ram_type"]
if(!ram_type)
return
var/datum/design/ram/D = SSresearch.science_tech.isDesignResearchedID(ram_type)
var/datum/design/ram/D = stored_research.isDesignResearchedID(ram_type)
if(!D)
return
if(slotUnlockedRAM(ram_expansions.len + 1))
Expand Down
Loading