A few investigate_log and message_admin fixes

This commit is contained in:
Jordie
2017-11-25 15:42:06 +11:00
committed by CitadelStationBot
parent ff94b3e1e1
commit 4053499c83
5 changed files with 151 additions and 9 deletions
+1 -9
View File
@@ -13,13 +13,6 @@ Gunshots/explosions/opening doors/less rare audio (done)
#define HAL_LINES_FILE "hallucination.json"
/mob/living/carbon
var/image/halimage
var/image/halbody
var/obj/halitem
var/hal_screwyhud = SCREWYHUD_NONE
var/next_hallucination = 0
GLOBAL_LIST_INIT(hallucinations_minor, list(
/datum/hallucination/sounds,
/datum/hallucination/bolts,
@@ -82,6 +75,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list(
/datum/hallucination/Destroy()
target.investigate_log("was afflicted with a hallucination of type [type]. [feedback_details]", INVESTIGATE_HALLUCINATIONS)
target = null
return ..()
/obj/effect/hallucination
@@ -203,7 +197,6 @@ GLOBAL_LIST_INIT(hallucinations_major, list(
flood_turfs = list()
if(target.client)
target.client.images.Remove(flood_images)
target = null
qdel(flood_images)
flood_images = list()
return ..()
@@ -1159,4 +1152,3 @@ GLOBAL_LIST_INIT(hallucinations_major, list(
H.preparePixelProjectile(target, start)
H.fire()
qdel(src)
@@ -49,3 +49,10 @@
var/icon_render_key = ""
var/static/list/limb_icon_cache = list()
//halucination vars
var/image/halimage
var/image/halbody
var/obj/halitem
var/hal_screwyhud = SCREWYHUD_NONE
var/next_hallucination = 0
+47
View File
@@ -94,3 +94,50 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
use_power(max(1000, (MINERAL_MATERIAL_AMOUNT * M.last_amount_inserted / 10)))
add_overlay("protolathe_[stack_name]")
addtimer(CALLBACK(src, /atom/proc/cut_overlay, "protolathe_[stack_name]"), 10)
<<<<<<< HEAD
=======
/obj/machinery/rnd/circuit_imprinter/proc/user_try_print_id(id)
if((!linked_console && requires_console) || !id)
return FALSE
var/datum/design/D = (linked_console || requires_console)? linked_console.stored_research.researched_designs[id] : get_techweb_design_by_id(id)
if(!istype(D))
return FALSE
var/power = 1000
for(var/M in D.materials)
power += round(D.materials[M] / 5)
power = max(4000, power)
use_power(power)
var/list/efficient_mats = list()
for(var/MAT in D.materials)
efficient_mats[MAT] = D.materials[MAT]/efficiency_coeff
if(!materials.has_materials(efficient_mats))
say("Not enough materials to complete prototype.")
return FALSE
for(var/R in D.reagents_list)
if(!reagents.has_reagent(R, D.reagents_list[R]/efficiency_coeff))
say("Not enough reagents to complete prototype.")
return FALSE
busy = TRUE
flick("circuit_imprinter_ani", src)
materials.use_amount(efficient_mats)
for(var/R in D.reagents_list)
reagents.remove_reagent(R, D.reagents_list[R]/efficiency_coeff)
var/P = D.build_path
addtimer(CALLBACK(src, .proc/reset_busy), 16)
addtimer(CALLBACK(src, .proc/do_print, P, efficient_mats, D.dangerous_construction), 16)
return TRUE
/obj/machinery/rnd/circuit_imprinter/proc/do_print(path, list/matlist, notify_admins)
if(notify_admins && usr)
investigate_log("[key_name(usr)] built [path] at a circuit imprinter.", INVESTIGATE_RESEARCH)
message_admins("[ADMIN_LOOKUPFLW(usr)] has built [path] at a circuit imprinter.")
var/obj/item/I = new path(get_turf(src))
I.materials = matlist.Copy()
SSblackbox.record_feedback("nested_tally", "circuit_printed", 1, list("[type]", "[path]"))
>>>>>>> b09b1c3... A few investigate_log and message_admin fixes (#32993)
+57
View File
@@ -95,3 +95,60 @@ Note: Must be placed west/left of and R&D console to function.
use_power(max(1000, (MINERAL_MATERIAL_AMOUNT * M.last_amount_inserted / 10)))
add_overlay("protolathe_[stack_name]")
addtimer(CALLBACK(src, /atom/proc/cut_overlay, "protolathe_[stack_name]"), 10)
<<<<<<< HEAD
=======
/obj/machinery/rnd/protolathe/proc/user_try_print_id(id, amount)
if((!istype(linked_console) && requires_console) || !id)
return FALSE
if(istext(amount))
amount = text2num(amount)
if(isnull(amount))
amount = 1
var/datum/design/D = (linked_console || requires_console)? linked_console.stored_research.researched_designs[id] : get_techweb_design_by_id(id)
if(!istype(D))
return FALSE
if(D.make_reagents.len)
return FALSE
var/power = 1000
amount = Clamp(amount, 1, 10)
for(var/M in D.materials)
power += round(D.materials[M] * amount / 5)
power = max(3000, power)
use_power(power)
var/list/efficient_mats = list()
for(var/MAT in D.materials)
efficient_mats[MAT] = D.materials[MAT]*efficiency_coeff
if(!materials.has_materials(efficient_mats, amount))
say("Not enough materials to complete prototype[amount > 1? "s" : ""].")
return FALSE
for(var/R in D.reagents_list)
if(!reagents.has_reagent(R, D.reagents_list[R]*efficiency_coeff))
say("Not enough reagents to complete prototype[amount > 1? "s" : ""].")
return FALSE
materials.use_amount(efficient_mats, amount)
for(var/R in D.reagents_list)
reagents.remove_reagent(R, D.reagents_list[R]*efficiency_coeff)
busy = TRUE
flick("protolathe_n", src)
var/timecoeff = efficiency_coeff * D.lathe_time_factor
addtimer(CALLBACK(src, .proc/reset_busy), (32 * timecoeff * amount) ** 0.8)
addtimer(CALLBACK(src, .proc/do_print, D.build_path, amount, efficient_mats, D.dangerous_construction), (32 * timecoeff * amount) ** 0.8)
return TRUE
/obj/machinery/rnd/protolathe/proc/do_print(path, amount, list/matlist, notify_admins)
if(notify_admins && usr)
investigate_log("[key_name(usr)] built [amount] of [path] at a protolathe.", INVESTIGATE_RESEARCH)
message_admins("[ADMIN_LOOKUPFLW(usr)] has built [amount] of [path] at a protolathe")
for(var/i in 1 to amount)
var/obj/item/I = new path(get_turf(src))
if(!istype(I, /obj/item/stack/sheet) && !istype(I, /obj/item/ore/bluespace_crystal))
I.materials = matlist.Copy()
SSblackbox.record_feedback("nested_tally", "item_printed", amount, list("[type]", "[path]"))
>>>>>>> b09b1c3... A few investigate_log and message_admin fixes (#32993)
+39
View File
@@ -133,6 +133,45 @@ won't update every console in existence) but it's more of a hassle to do. Also,
. = ..()
updateUsrDialog()
<<<<<<< HEAD
=======
/obj/machinery/computer/rdconsole/proc/research_node(id, mob/user)
if(!stored_research.available_nodes[id] || stored_research.researched_nodes[id])
say("Node unlock failed: Either already researched or not available!")
return FALSE
var/datum/techweb_node/TN = SSresearch.techweb_nodes[id]
if(!istype(TN))
say("Node unlock failed: Unknown error.")
return FALSE
var/price = TN.get_price(stored_research)
if(stored_research.research_points >= price)
investigate_log("[key_name(user)] researched [id]([price]) on techweb id [stored_research.id].", INVESTIGATE_RESEARCH)
if(stored_research == SSresearch.science_tech)
SSblackbox.record_feedback("associative", "science_techweb_unlock", 1, list("id" = "[id]", "price" = "[price]", "time" = "[SQLtime()]"))
if(stored_research.research_node(SSresearch.techweb_nodes[id]))
say("Sucessfully researched [TN.display_name].")
var/logname = "Unknown"
if(isAI(user))
logname = "AI: [user.name]"
if(iscarbon(user))
var/obj/item/card/id/idcard = user.get_active_held_item()
if(istype(idcard))
logname = "User: [idcard.registered_name]"
if(ishuman(user))
var/mob/living/carbon/human/H = user
var/obj/item/I = H.wear_id
if(istype(I))
var/obj/item/card/id/ID = I.GetID()
if(istype(ID))
logname = "User: [ID.registered_name]"
stored_research.research_logs += "[logname] researched node id [id] for [price] points."
return TRUE
else
say("Failed to research node: Internal database error!")
return FALSE
say("Not enough research points...")
return FALSE
>>>>>>> b09b1c3... A few investigate_log and message_admin fixes (#32993)
/obj/machinery/computer/rdconsole/on_deconstruction()
if(linked_destroy)