TG sync Sunday (#201)
* stage one * datums and shit * game stuff * modules * tgstation.dme * tools * these things for icons * compiling fixes * merge spree on TG * other updates * updated maps with deepfryers * My helpers were not helping
This commit is contained in:
@@ -409,4 +409,12 @@
|
||||
id = "limbgrower"
|
||||
req_tech = list("programming" = 3, "biotech" = 2)
|
||||
build_path = /obj/item/weapon/circuitboard/machine/limbgrower
|
||||
category = list("Medical Machinery")
|
||||
category = list("Medical Machinery")
|
||||
|
||||
/datum/design/board/deepfryer
|
||||
name = "Machine Design (Deep Fryer)"
|
||||
desc = "The circuit board for a Deep Fryer."
|
||||
id = "deepfryer"
|
||||
req_tech = list("programming" = 1)
|
||||
build_path = /obj/item/weapon/circuitboard/machine/deep_fryer
|
||||
category = list ("Misc. Machinery")
|
||||
|
||||
@@ -180,14 +180,14 @@
|
||||
/////////////////////////////////////////
|
||||
|
||||
/datum/design/cyberimp_welding
|
||||
name = "Welding Shield implant"
|
||||
name = "Welding Shield Eyes"
|
||||
desc = "These reactive micro-shields will protect you from welders and flashes without obscuring your vision."
|
||||
id = "ci-welding"
|
||||
req_tech = list("materials" = 4, "biotech" = 4, "engineering" = 5, "plasmatech" = 4)
|
||||
build_type = PROTOLATHE | MECHFAB
|
||||
construction_time = 40
|
||||
materials = list(MAT_METAL = 600, MAT_GLASS = 400)
|
||||
build_path = /obj/item/organ/cyberimp/eyes/shield
|
||||
build_path = /obj/item/organ/eyes/robotic/shield
|
||||
category = list("Misc", "Medical Designs")
|
||||
|
||||
/datum/design/cyberimp_breather
|
||||
@@ -235,25 +235,25 @@
|
||||
category = list("Misc", "Medical Designs")
|
||||
|
||||
/datum/design/cyberimp_xray
|
||||
name = "X-Ray implant"
|
||||
name = "X-Ray eyes"
|
||||
desc = "These cybernetic eyes will give you X-ray vision. Blinking is futile."
|
||||
id = "ci-xray"
|
||||
req_tech = list("materials" = 7, "programming" = 5, "biotech" = 7, "magnets" = 5,"plasmatech" = 6)
|
||||
build_type = PROTOLATHE | MECHFAB
|
||||
construction_time = 60
|
||||
materials = list(MAT_METAL = 600, MAT_GLASS = 600, MAT_SILVER = 600, MAT_GOLD = 600, MAT_PLASMA = 1000, MAT_URANIUM = 1000, MAT_DIAMOND = 2000)
|
||||
build_path = /obj/item/organ/cyberimp/eyes/xray
|
||||
build_path = /obj/item/organ/eyes/robotic/xray
|
||||
category = list("Misc", "Medical Designs")
|
||||
|
||||
/datum/design/cyberimp_thermals
|
||||
name = "Thermals implant"
|
||||
name = "Thermal eyes"
|
||||
desc = "These cybernetic eyes will give you Thermal vision. Vertical slit pupil included."
|
||||
id = "ci-thermals"
|
||||
req_tech = list("materials" = 6, "programming" = 4, "biotech" = 7, "magnets" = 5,"plasmatech" = 4)
|
||||
build_type = PROTOLATHE | MECHFAB
|
||||
construction_time = 60
|
||||
materials = list(MAT_METAL = 600, MAT_GLASS = 600, MAT_SILVER = 600, MAT_GOLD = 600, MAT_PLASMA = 1000, MAT_DIAMOND = 2000)
|
||||
build_path = /obj/item/organ/cyberimp/eyes/thermals
|
||||
build_path = /obj/item/organ/eyes/robotic/thermals
|
||||
category = list("Misc", "Medical Designs")
|
||||
|
||||
/datum/design/cyberimp_antidrop
|
||||
|
||||
@@ -130,68 +130,6 @@ var/global/list/obj/machinery/message_server/message_servers = list()
|
||||
|
||||
return
|
||||
|
||||
|
||||
/datum/feedback_variable
|
||||
var/variable
|
||||
var/value
|
||||
var/details
|
||||
|
||||
/datum/feedback_variable/New(var/param_variable,var/param_value = 0)
|
||||
variable = param_variable
|
||||
value = param_value
|
||||
|
||||
/datum/feedback_variable/proc/inc(num = 1)
|
||||
if (isnum(value))
|
||||
value += num
|
||||
else
|
||||
value = text2num(value)
|
||||
if (isnum(value))
|
||||
value += num
|
||||
else
|
||||
value = num
|
||||
|
||||
/datum/feedback_variable/proc/dec(num = 1)
|
||||
if (isnum(value))
|
||||
value -= num
|
||||
else
|
||||
value = text2num(value)
|
||||
if (isnum(value))
|
||||
value -= num
|
||||
else
|
||||
value = -num
|
||||
|
||||
/datum/feedback_variable/proc/set_value(num)
|
||||
if (isnum(num))
|
||||
value = num
|
||||
|
||||
/datum/feedback_variable/proc/get_value()
|
||||
if (!isnum(value))
|
||||
return 0
|
||||
return value
|
||||
|
||||
/datum/feedback_variable/proc/get_variable()
|
||||
return variable
|
||||
|
||||
/datum/feedback_variable/proc/set_details(text)
|
||||
if (istext(text))
|
||||
details = text
|
||||
|
||||
/datum/feedback_variable/proc/add_details(text)
|
||||
if (istext(text))
|
||||
text = replacetext(text, " ", "_")
|
||||
if (!details)
|
||||
details = text
|
||||
else
|
||||
details += " [text]"
|
||||
|
||||
/datum/feedback_variable/proc/get_details()
|
||||
return details
|
||||
|
||||
/datum/feedback_variable/proc/get_parsed()
|
||||
return list(variable,value,details)
|
||||
|
||||
var/obj/machinery/blackbox_recorder/blackbox
|
||||
|
||||
/obj/machinery/blackbox_recorder
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "blackbox"
|
||||
@@ -202,170 +140,3 @@ var/obj/machinery/blackbox_recorder/blackbox
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
armor = list(melee = 25, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 70)
|
||||
var/list/messages = list() //Stores messages of non-standard frequencies
|
||||
var/list/messages_admin = list()
|
||||
|
||||
var/list/msg_common = list()
|
||||
var/list/msg_science = list()
|
||||
var/list/msg_command = list()
|
||||
var/list/msg_medical = list()
|
||||
var/list/msg_engineering = list()
|
||||
var/list/msg_security = list()
|
||||
var/list/msg_deathsquad = list()
|
||||
var/list/msg_syndicate = list()
|
||||
var/list/msg_service = list()
|
||||
var/list/msg_cargo = list()
|
||||
|
||||
var/list/datum/feedback_variable/feedback = new()
|
||||
|
||||
//Only one can exsist in the world!
|
||||
/obj/machinery/blackbox_recorder/New()
|
||||
if (blackbox)
|
||||
if (istype(blackbox,/obj/machinery/blackbox_recorder))
|
||||
qdel(src)
|
||||
return
|
||||
blackbox = src
|
||||
|
||||
|
||||
/obj/machinery/blackbox_recorder/Destroy()
|
||||
var/turf/T = locate(1,1,2)
|
||||
if (T)
|
||||
blackbox = null
|
||||
var/obj/machinery/blackbox_recorder/BR = new/obj/machinery/blackbox_recorder(T)
|
||||
BR.msg_common = msg_common
|
||||
BR.msg_science = msg_science
|
||||
BR.msg_command = msg_command
|
||||
BR.msg_medical = msg_medical
|
||||
BR.msg_engineering = msg_engineering
|
||||
BR.msg_security = msg_security
|
||||
BR.msg_deathsquad = msg_deathsquad
|
||||
BR.msg_syndicate = msg_syndicate
|
||||
BR.msg_service = msg_service
|
||||
BR.msg_cargo = msg_cargo
|
||||
BR.feedback = feedback
|
||||
BR.messages = messages
|
||||
BR.messages_admin = messages_admin
|
||||
if(blackbox != BR)
|
||||
blackbox = BR
|
||||
return ..()
|
||||
|
||||
/obj/machinery/blackbox_recorder/proc/find_feedback_datum(variable)
|
||||
for (var/datum/feedback_variable/FV in feedback)
|
||||
if (FV.get_variable() == variable)
|
||||
return FV
|
||||
var/datum/feedback_variable/FV = new(variable)
|
||||
feedback += FV
|
||||
return FV
|
||||
|
||||
/obj/machinery/blackbox_recorder/proc/get_round_feedback()
|
||||
return feedback
|
||||
|
||||
/obj/machinery/blackbox_recorder/proc/round_end_data_gathering()
|
||||
|
||||
var/pda_msg_amt = 0
|
||||
var/rc_msg_amt = 0
|
||||
|
||||
for (var/obj/machinery/message_server/MS in message_servers)
|
||||
if (MS.pda_msgs.len > pda_msg_amt)
|
||||
pda_msg_amt = MS.pda_msgs.len
|
||||
if (MS.rc_msgs.len > rc_msg_amt)
|
||||
rc_msg_amt = MS.rc_msgs.len
|
||||
|
||||
feedback_set_details("radio_usage","")
|
||||
|
||||
feedback_add_details("radio_usage","COM-[msg_common.len]")
|
||||
feedback_add_details("radio_usage","SCI-[msg_science.len]")
|
||||
feedback_add_details("radio_usage","HEA-[msg_command.len]")
|
||||
feedback_add_details("radio_usage","MED-[msg_medical.len]")
|
||||
feedback_add_details("radio_usage","ENG-[msg_engineering.len]")
|
||||
feedback_add_details("radio_usage","SEC-[msg_security.len]")
|
||||
feedback_add_details("radio_usage","DTH-[msg_deathsquad.len]")
|
||||
feedback_add_details("radio_usage","SYN-[msg_syndicate.len]")
|
||||
feedback_add_details("radio_usage","SRV-[msg_service.len]")
|
||||
feedback_add_details("radio_usage","CAR-[msg_cargo.len]")
|
||||
feedback_add_details("radio_usage","OTH-[messages.len]")
|
||||
feedback_add_details("radio_usage","PDA-[pda_msg_amt]")
|
||||
feedback_add_details("radio_usage","RC-[rc_msg_amt]")
|
||||
|
||||
|
||||
feedback_set_details("round_end","[time2text(world.realtime)]") //This one MUST be the last one that gets set.
|
||||
|
||||
|
||||
//This proc is only to be called at round end.
|
||||
/obj/machinery/blackbox_recorder/proc/save_all_data_to_sql()
|
||||
if (!feedback) return
|
||||
|
||||
round_end_data_gathering() //round_end time logging and some other data processing
|
||||
establish_db_connection()
|
||||
if (!dbcon.IsConnected()) return
|
||||
var/round_id
|
||||
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT MAX(round_id) AS round_id FROM [format_table_name("feedback")]")
|
||||
query.Execute()
|
||||
while (query.NextRow())
|
||||
round_id = query.item[1]
|
||||
|
||||
if (!isnum(round_id))
|
||||
round_id = text2num(round_id)
|
||||
round_id++
|
||||
|
||||
var/sqlrowlist = ""
|
||||
|
||||
|
||||
for (var/datum/feedback_variable/FV in feedback)
|
||||
if (sqlrowlist != "")
|
||||
sqlrowlist += ", " //a comma (,) at the start of the first row to insert will trigger a SQL error
|
||||
|
||||
sqlrowlist += "(null, Now(), [round_id], \"[sanitizeSQL(FV.get_variable())]\", [FV.get_value()], \"[sanitizeSQL(FV.get_details())]\")"
|
||||
|
||||
if (sqlrowlist == "")
|
||||
return
|
||||
|
||||
var/DBQuery/query_insert = dbcon.NewQuery("INSERT DELAYED IGNORE INTO [format_table_name("feedback")] VALUES " + sqlrowlist)
|
||||
query_insert.Execute()
|
||||
|
||||
|
||||
/proc/feedback_set(variable,value)
|
||||
if (!blackbox) return
|
||||
|
||||
var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable)
|
||||
|
||||
if (!FV) return
|
||||
|
||||
FV.set_value(value)
|
||||
|
||||
/proc/feedback_inc(variable,value)
|
||||
if (!blackbox) return
|
||||
|
||||
var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable)
|
||||
|
||||
if (!FV) return
|
||||
|
||||
FV.inc(value)
|
||||
|
||||
/proc/feedback_dec(variable,value)
|
||||
if (!blackbox) return
|
||||
|
||||
var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable)
|
||||
|
||||
if (!FV) return
|
||||
|
||||
FV.dec(value)
|
||||
|
||||
/proc/feedback_set_details(variable,details)
|
||||
if (!blackbox) return
|
||||
|
||||
var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable)
|
||||
|
||||
if(!FV) return
|
||||
|
||||
FV.set_details(details)
|
||||
|
||||
/proc/feedback_add_details(variable,details)
|
||||
if (!blackbox) return
|
||||
|
||||
var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable)
|
||||
|
||||
if (!FV) return
|
||||
|
||||
FV.add_details(details)
|
||||
|
||||
Reference in New Issue
Block a user