[READY]Refactors techwebs to have different types of points - PR HAS NO GAMEPLAY IMPACT

This commit is contained in:
kevinz000
2018-05-19 18:51:51 -05:00
committed by letterjay
parent 94d7c7b85c
commit d54667c81b
13 changed files with 313 additions and 172 deletions
+14 -11
View File
@@ -108,13 +108,17 @@ Note: Must be placed within 3 tiles of the R&D Console
if(isnull(can_boost[id]))
return FALSE
var/dpath = loaded_item.type
var/worth = TN.boost_item_paths[dpath]
if(isnull(worth))
var/list/worths = TN.boost_item_paths[dpath]
var/list/differences = list()
var/list/already_boosted = linked_console.stored_research.boosted_nodes[TN.id]
for(var/i in worths)
var/used = already_boosted? already_boosted[i] : 0
var/value = min(worths[i], TN.research_costs[i]) - used
if(value > 0)
differences[i] = value
if(!length(differences))
return FALSE
var/difference = min(worth, TN.research_cost) - linked_console.stored_research.boosted_nodes[TN.id]
if(worth && difference <= 0)
return FALSE
var/choice = input("Are you sure you want to destroy [loaded_item] to [!worth ? "reveal [TN.display_name]" : "boost [TN.display_name] by [difference] point\s"]?") in list("Proceed", "Cancel")
var/choice = input("Are you sure you want to destroy [loaded_item] to [!length(worths) ? "reveal [TN.display_name]" : "boost [TN.display_name] by [json_encode(differences)] point\s"]?") in list("Proceed", "Cancel")
if(choice == "Cancel")
return FALSE
if(QDELETED(loaded_item) || QDELETED(linked_console) || !user.Adjacent(linked_console) || QDELETED(src))
@@ -124,19 +128,18 @@ Note: Must be placed within 3 tiles of the R&D Console
linked_console.stored_research.boost_with_path(SSresearch.techweb_nodes[TN.id], dpath)
else
var/point_value = techweb_item_point_check(loaded_item)
var/list/point_value = techweb_item_point_check(loaded_item)
if(linked_console.stored_research.deconstructed_items[loaded_item.type])
point_value = 0
var/choice = input("Are you sure you want to destroy [loaded_item] for [point_value ? "[point_value] research points" : "material reclamation"]?") in list("Proceed", "Cancel")
point_value = list()
var/choice = input("Are you sure you want to destroy [loaded_item] for [length(point_value) ? "[json_encode(point_value)] points" : "material reclamation"]?") in list("Proceed", "Cancel")
if(choice == "Cancel")
return FALSE
if(QDELETED(loaded_item) || QDELETED(linked_console) || !user.Adjacent(linked_console) || QDELETED(src))
return FALSE
var/loaded_type = loaded_item.type
if(destroy_item(loaded_item))
linked_console.stored_research.research_points += point_value
linked_console.stored_research.add_point_list(point_value)
linked_console.stored_research.deconstructed_items[loaded_type] = point_value
return TRUE
/obj/machinery/rnd/destructive_analyzer/proc/unload_item()