diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index 6ab559732b4..dfc78987eb3 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -66,11 +66,42 @@ turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh) icon = 'icons/effects/fire.dmi' icon_state = "1" - l_color = "#ED9200" + l_color = "#010000" layer = TURF_LAYER var/firelevel = 10000 //Calculated by gas_mixture.calculate_firelevel() +/obj/fire/proc/GenColor(var/datum/gas_mixture/ac) + var/temperature = ac.temperature + //All temperatures are in Kelvin for the color assignment + if(temperature > 9000) + //rainbow, wtf? + l_color = pick("#0092ED", "#EDEDED", "#ED9200", "#ED00ED", "#0000ED", "#010000", "#00EDED", "#EDED00", "#ED0000") + else if(temperature >= 7150) + //dark blue + l_color = "#0000ED" + else if(temperature >= 5300) + //blue + l_color = "#0092ED" + else if(temperature >= 1800) + //cyan + l_color = "#00EDED" + else if(temperature >= 1500) + //white + l_color = "#EDEDED" + else if(temperature >= 1300) + //yellow + l_color = "#EDED00" + else if(temperature >= 1100) + //orange + l_color = "#ED9200" + else if(temperature >= 75) + //red + l_color = "#ED0000" + else + //black fire, go atmos! + l_color = "#010000" + /obj/fire/process() . = 1 @@ -114,10 +145,10 @@ turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh) icon_state = "3" SetLuminosity(7) else if(firelevel > 2.5) - icon_state = "2" + icon_state = "3" SetLuminosity(5) else - icon_state = "1" + icon_state = "3" SetLuminosity(3) //im not sure how to implement a version that works for every creature so for now monkeys are firesafe @@ -130,6 +161,9 @@ turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh) // Burn the turf, too. S.fire_act(air_contents, air_contents.temperature, air_contents.return_volume()) + //Update color of the fire + src.GenColor(air_contents) + //spread for(var/direction in cardinal) var/turf/simulated/enemy_tile = get_step(S, direction) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index a692639d802..a47f261f9c1 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -167,8 +167,6 @@ // The old system would loop through lists for a total of 5000 per function call, in an empty server. // This new system will loop at around 1000 in an empty server. -// SCREW THAT SHIT, we're not recursing. - /proc/get_mobs_in_view(var/R, var/atom/source) // Returns a list of mobs in range of R from source. Used in radio and say code. @@ -180,48 +178,40 @@ var/list/range = hear(R, T) - for(var/mob/M in range) - hear += M + for(var/atom/A in range) + if(ismob(A)) + var/mob/M = A + if(M.client) + hear += M + //world.log << "Start = [M] - [get_turf(M)] - ([M.x], [M.y], [M.z])" + else if(istype(A, /obj/item/device/radio)) + hear += A - var/list/objects = list() + if(isobj(A) || ismob(A)) + hear |= recursive_mob_check(A, hear, 3, 1, 0, 1) - for(var/obj/O in range) //Get a list of objects in hearing range. We'll check to see if any clients have their "eye" set to the object - objects += O - - for(var/client/C in clients) - if(!istype(C) || !C.eye || istype(C.eye, /mob/aiEye)) - continue //I have no idea when this client check would be needed, but if this runtimes people won't hear anything - //So kinda paranoid about runtime avoidance. - if(istype(C.eye, /obj/machinery/camera)) - continue //No microphones in cameras. - - if(C.mob in hear) - continue - - var/list/hear_and_objects = (hear|objects) //Combined these lists here instead of doing the combine 3 more times. - - if(C.eye in hear_and_objects) - hear += C.mob - - else if(C.mob && C.mob.loc in hear_and_objects) - hear += C.mob - else if(C.mob && C.mob.loc.loc in hear_and_objects) - hear += C.mob - else if(C.mob && C.mob.loc.loc.loc in hear_and_objects) - hear += C.mob return hear /proc/get_mobs_in_radio_ranges(var/list/obj/item/device/radio/radios) - //set background = 1 + set background = 1 . = list() // Returns a list of mobs who can hear any of the radios given in @radios var/list/speaker_coverage = list() - for(var/i = 1; i <= radios.len; i++) - var/obj/item/device/radio/R = radios[i] + for(var/obj/item/device/radio/R in radios) if(R) + //Cyborg checks. Receiving message uses a bit of cyborg's charge. + var/obj/item/device/radio/borg/BR = R + if(istype(BR) && BR.myborg) + var/mob/living/silicon/robot/borg = BR.myborg + var/datum/robot_component/CO = borg.get_component("radio") + if(!CO) + continue //No radio component (Shouldn't happen) + if(!borg.is_component_functioning("radio") || !borg.use_power(CO.energy_consumption)) + continue //No power. + var/turf/speaker = get_turf(R) if(speaker) for(var/turf/T in hear(R.canhear_range,speaker)) @@ -239,6 +229,7 @@ . |= M // Since we're already looping through mobs, why bother using |= ? This only slows things down. return . + #define SIGN(X) ((X<0)?-1:1) proc diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index 515f1788f66..441e48139c8 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -28,6 +28,7 @@ var/global/list/airlocks = list() //list of all airlocks //Languages/species/whitelist. var/global/list/all_species[0] var/global/list/all_languages[0] +var/global/list/language_keys[0] // Table of say codes for all languages var/global/list/all_nations[0] var/global/list/whitelisted_species = list() @@ -114,6 +115,13 @@ var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Al var/datum/language/L = new T all_languages[L.name] = L + for (var/language_name in all_languages) + var/datum/language/L = all_languages[language_name] + if(!(L.flags & NONGLOBAL)) + language_keys[":[lowertext(L.key)]"] = L + language_keys[".[lowertext(L.key)]"] = L + language_keys["#[lowertext(L.key)]"] = L + var/rkey = 0 paths = typesof(/datum/species)-/datum/species for(var/T in paths) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index a790124c152..81ed859a7e5 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -49,15 +49,19 @@ proc/random_facial_hair_style(gender, species = "Human") return f_style -proc/random_name(gender, speciesName = "Human") - var/datum/species/S = all_species[speciesName] - if(S) - return S.makeName(gender) - else - if(gender==FEMALE) +proc/random_name(gender, species = "Human") + + var/datum/species/current_species + if(species) + current_species = all_species[species] + + if(!current_species || current_species.name == "Human") + if(gender==FEMALE) return capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names)) - else - return capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) + else + return capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) + else + return current_species.get_random_name(gender) proc/random_skin_tone() switch(pick(60;"caucasian", 15;"afroamerican", 10;"african", 10;"latino", 5;"albino")) @@ -128,6 +132,8 @@ Proc for attack log creation, because really why not proc/add_logs(mob/target, mob/user, what_done, var/object=null, var/addition=null) var/list/ignore=list("shaked","CPRed","grabbed","punched") + if(!user) + return if(ismob(user)) user.attack_log += text("\[[time_stamp()]\] Has [what_done] [target.name][ismob(target) ? "([target.ckey])" : ""][object ? " with [object]" : " "][addition]") if(ismob(target)) diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index cb2fad75ddb..c6cd633398b 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -34,12 +34,9 @@ return t //Removes a few problematic characters -/proc/sanitize_simple(var/t,var/list/repl_chars = list("\n"="#","\t"="#","�"="�")) +/proc/sanitize_simple(var/t,var/list/repl_chars = list("\n"="#","\t"="#")) for(var/char in repl_chars) - var/index = findtext(t, char) - while(index) - t = copytext(t, 1, index) + repl_chars[char] + copytext(t, index+1) - index = findtext(t, char) + replacetext(t, char, repl_chars[char]) return t /proc/readd_quotes(var/t) @@ -341,4 +338,5 @@ proc/checkhtml(var/t) return sanitize(input) /proc/trim_strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN) - return trim(strip_html_properly(input, max_length)) + return trim(strip_html_properly(input, max_length)) + \ No newline at end of file diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index a0da39a2976..fb2f17d46a9 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -65,6 +65,8 @@ if(stat || paralysis || stunned || weakened) return + face_atom(A) + if(next_move > world.time) // in the year 2000... return diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index d8b5617d2a1..210140bdf9f 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -64,10 +64,11 @@ // Now you can click through portals, wormholes, gateways, and teleporters while observing. -Sayu /obj/machinery/teleport/hub/attack_ghost(mob/user as mob) - var/atom/l = loc - var/obj/machinery/computer/teleporter/com = locate(/obj/machinery/computer/teleporter, locate(l.x - 2, l.y, l.z)) - if(com && com.locked) - user.loc = get_turf(com.locked) + var/obj/machinery/teleport/station/S = power_station + if(S) + var/obj/machinery/computer/teleporter/com = S.teleporter_console + if(com && com.target) + user.loc = get_turf(com.target) /obj/effect/portal/attack_ghost(mob/user as mob) if(target) diff --git a/code/controllers/communications.dm b/code/controllers/communications.dm index b3a5a9f58d1..6fc3faab894 100644 --- a/code/controllers/communications.dm +++ b/code/controllers/communications.dm @@ -40,7 +40,7 @@ obj/proc/receive_signal(datum/signal/signal, var/receive_method as num, var/receive_param) Handler from received signals. By default does nothing. Define your own for your object. - Avoid of sending signals directly from this proc, use spawn(-1). Do not use sleep() here please. + Avoid of sending signals directly from this proc, use spawn(-1). DO NOT use sleep() here or call procs that sleep please. If you must, use spawn() parameters: signal - see description below. Extract all needed data from the signal before doing sleep(), spawn() or return! receive_method - may be TRANSMISSION_WIRE or TRANSMISSION_RADIO. @@ -61,33 +61,6 @@ */ -/* the radio controller is a confusing piece of shit and didnt work - so i made radios not use the radio controller. -*/ -var/list/all_radios = list() - -/proc/add_radio(var/obj/item/radio, freq) - if(!freq || !radio) - return - if(!all_radios["[freq]"]) - all_radios["[freq]"] = list(radio) - return freq - - all_radios["[freq]"] |= radio - return freq - -/proc/remove_radio(var/obj/item/radio, freq) - if(!freq || !radio) - return - if(!all_radios["[freq]"]) - return - - all_radios["[freq]"] -= radio - -/proc/remove_radio_all(var/obj/item/radio) - for(var/freq in all_radios) - all_radios["[freq]"] -= radio - /* Frequency range: 1200 to 1600 Radiochat range: 1441 to 1489 (most devices refuse to be tune to other frequency, even during mapmaking) @@ -99,10 +72,10 @@ Radio: 1355 - Medical 1357 - Engineering 1359 - Security -1441 - death squad +1341 - death squad 1443 - Confession Intercom 1347 - Cargo techs -1349 - Service +1349 - Service people Devices: 1451 - tracking implant @@ -112,7 +85,7 @@ On the map: 1311 for prison shuttle console (in fact, it is not used) 1435 for status displays 1437 for atmospherics/fire alerts -1439 for engine components +1438 for engine components 1439 for air pumps, air scrubbers, atmo control 1441 for atmospherics - supply tanks 1443 for atmospherics - distribution loop/mixed air tank @@ -124,30 +97,14 @@ On the map: 1455 for AI access */ -var/list/radiochannels = list( - "Common" = 1459, - "Science" = 1351, - "Command" = 1353, - "Medical" = 1355, - "Engineering" = 1357, - "Security" = 1359, - "Response Team" = 1443, - "Deathsquad" = 1441, - "Syndicate" = 1213, - "Supply" = 1347, - "Service" = 1349, - "AI Private" = 1447 -) -//depenging helpers -var/list/DEPT_FREQS = list(1351, 1355, 1357, 1359, 1213, 1443, 1441, 1347, 1349) - -// central command channels, i.e deathsquid & response teams -var/list/CENT_FREQS = list(1441, 1443) - -var/const/COMM_FREQ = 1353 //command, colored gold in chat window +var/const/COMM_FREQ = 1353 var/const/SYND_FREQ = 1213 +var/const/ERT_FREQ = 1345 +var/const/DTH_FREQ = 1341 +var/const/AI_FREQ = 1447 // department channels +var/const/PUB_FREQ = 1459 var/const/SEC_FREQ = 1359 var/const/ENG_FREQ = 1357 var/const/SCI_FREQ = 1351 @@ -155,25 +112,85 @@ var/const/MED_FREQ = 1355 var/const/SUP_FREQ = 1347 var/const/SRV_FREQ = 1349 -// other channels -var/const/AIPRIV_FREQ = 1447 +var/list/radiochannels = list( + "Common" = PUB_FREQ, + "Science" = SCI_FREQ, + "Command" = COMM_FREQ, + "Medical" = MED_FREQ, + "Engineering" = ENG_FREQ, + "Security" = SEC_FREQ, + "Response Team" = ERT_FREQ, + "Special Ops" = DTH_FREQ, + "Syndicate" = SYND_FREQ, + "Supply" = SUP_FREQ, + "Service" = SRV_FREQ, + "AI Private" = AI_FREQ +) + +// central command channels, i.e deathsquid & response teams +var/list/CENT_FREQS = list(ERT_FREQ, DTH_FREQ) + +// Antag channels, i.e. Syndicate +var/list/ANTAG_FREQS = list(SYND_FREQ) + +//depenging helpers +var/list/DEPT_FREQS = list(SCI_FREQ, MED_FREQ, ENG_FREQ, SEC_FREQ, SUP_FREQ, SRV_FREQ, ERT_FREQ, SYND_FREQ, DTH_FREQ) #define TRANSMISSION_WIRE 0 #define TRANSMISSION_RADIO 1 +/proc/frequency_span_class(var/frequency) + // Antags! + if (frequency in ANTAG_FREQS) + return "syndradio" + // centcomm channels (deathsquid and ert) + else if(frequency in CENT_FREQS) + return "centradio" + // command channel + else if(frequency == COMM_FREQ) + return "comradio" + // AI private channel + else if(frequency == AI_FREQ) + return "airadio" + // department radio formatting (poorly optimized, ugh) + else if(frequency == SEC_FREQ) + return "secradio" + else if (frequency == ENG_FREQ) + return "engradio" + else if(frequency == SCI_FREQ) + return "sciradio" + else if(frequency == MED_FREQ) + return "medradio" + else if(frequency == SUP_FREQ) // cargo + return "supradio" + else if(frequency == SRV_FREQ) // service + return "srvradio" + // If all else fails and it's a dept_freq, color me purple! + else if(frequency in DEPT_FREQS) + return "deptradio" + + return "radio" + /* filters */ -var/const/RADIO_TO_AIRALARM = "1" -var/const/RADIO_FROM_AIRALARM = "2" -var/const/RADIO_CHAT = "3" -var/const/RADIO_ATMOSIA = "4" -var/const/RADIO_NAVBEACONS = "5" -var/const/RADIO_AIRLOCK = "6" -var/const/RADIO_SECBOT = "7" -var/const/RADIO_MULEBOT = "8" -var/const/RADIO_MAGNETS = "9" +//When devices register with the radio controller, they might register under a certain filter. +//Other devices can then choose to send signals to only those devices that belong to a particular filter. +//This is done for performance, so we don't send signals to lots of machines unnecessarily. + +//This filter is special because devices belonging to default also recieve signals sent to any other filter. +var/const/RADIO_DEFAULT = "radio_default" + +var/const/RADIO_TO_AIRALARM = "radio_airalarm" //air alarms +var/const/RADIO_FROM_AIRALARM = "radio_airalarm_rcvr" //devices interested in recieving signals from air alarms +var/const/RADIO_CHAT = "radio_telecoms" +var/const/RADIO_ATMOSIA = "radio_atmos" +var/const/RADIO_NAVBEACONS = "radio_navbeacon" +var/const/RADIO_AIRLOCK = "radio_airlock" +var/const/RADIO_SECBOT = "radio_secbot" +var/const/RADIO_MULEBOT = "radio_mulebot" var/const/RADIO_CLEANBOT = "10" var/const/RADIO_FLOORBOT = "11" var/const/RADIO_MEDBOT = "12" +var/const/RADIO_MAGNETS = "radio_magnet" var/global/datum/controller/radio/radio_controller @@ -181,164 +198,138 @@ var/global/datum/controller/radio/radio_controller radio_controller = new /datum/controller/radio() return 1 -datum/controller/radio +//callback used by objects to react to incoming radio signals +/obj/proc/receive_signal(datum/signal/signal, receive_method, receive_param) + return null + +//The global radio controller +/datum/controller/radio var/list/datum/radio_frequency/frequencies = list() - proc/add_object(obj/device as obj, var/new_frequency as num, var/filter = null as text|null) - var/f_text = num2text(new_frequency) - var/datum/radio_frequency/frequency = frequencies[f_text] +/datum/controller/radio/proc/add_object(obj/device as obj, var/new_frequency as num, var/filter = null as text|null) + var/f_text = num2text(new_frequency) + var/datum/radio_frequency/frequency = frequencies[f_text] - if(!frequency) - frequency = new - frequency.frequency = new_frequency - frequencies[f_text] = frequency + if(!frequency) + frequency = new + frequency.frequency = new_frequency + frequencies[f_text] = frequency - frequency.add_listener(device, filter) - return frequency + frequency.add_listener(device, filter) + return frequency - proc/remove_object(obj/device, old_frequency) - var/f_text = num2text(old_frequency) - var/datum/radio_frequency/frequency = frequencies[f_text] +/datum/controller/radio/proc/remove_object(obj/device, old_frequency) + var/f_text = num2text(old_frequency) + var/datum/radio_frequency/frequency = frequencies[f_text] - if(frequency) - frequency.remove_listener(device) + if(frequency) + frequency.remove_listener(device) - if(frequency.devices.len == 0) - del(frequency) - frequencies -= f_text + if(frequency.devices.len == 0) + del(frequency) + frequencies -= f_text - return 1 + return 1 - proc/return_frequency(var/new_frequency as num) - var/f_text = num2text(new_frequency) - var/datum/radio_frequency/frequency = frequencies[f_text] +/datum/controller/radio/proc/return_frequency(var/new_frequency as num) + var/f_text = num2text(new_frequency) + var/datum/radio_frequency/frequency = frequencies[f_text] - if(!frequency) - frequency = new - frequency.frequency = new_frequency - frequencies[f_text] = frequency + if(!frequency) + frequency = new + frequency.frequency = new_frequency + frequencies[f_text] = frequency - return frequency + return frequency -datum/radio_frequency +/datum/radio_frequency var/frequency as num var/list/list/obj/devices = list() - proc - post_signal(obj/source as obj|null, datum/signal/signal, var/filter = null as text|null, var/range = null as num|null) - //log_admin("DEBUG \[[world.timeofday]\]: post_signal {source=\"[source]\", [signal.debug_print()], filter=[filter]}") -// var/N_f=0 -// var/N_nf=0 -// var/Nt=0 - var/turf/start_point - if(range) - start_point = get_turf(source) - if(!start_point) - del(signal) - return 0 - if (filter) //here goes some copypasta. It is for optimisation. -rastaf0 - for(var/obj/device in devices[filter]) - if(device == source) - continue - if(range) - var/turf/end_point = get_turf(device) - if(!end_point) - continue - //if(max(abs(start_point.x-end_point.x), abs(start_point.y-end_point.y)) <= range) - if(start_point.z!=end_point.z || get_dist(start_point, end_point) > range) - continue - device.receive_signal(signal, TRANSMISSION_RADIO, frequency) - for(var/obj/device in devices["_default"]) - if(device == source) - continue - if(range) - var/turf/end_point = get_turf(device) - if(!end_point) - continue - //if(max(abs(start_point.x-end_point.x), abs(start_point.y-end_point.y)) <= range) - if(start_point.z!=end_point.z || get_dist(start_point, end_point) > range) - continue - device.receive_signal(signal, TRANSMISSION_RADIO, frequency) -// N_f++ - else - for (var/next_filter in devices) -// var/list/obj/DDD = devices[next_filter] -// Nt+=DDD.len - for(var/obj/device in devices[next_filter]) - if(device == source) - continue - if(range) - var/turf/end_point = get_turf(device) - if(!end_point) - continue - //if(max(abs(start_point.x-end_point.x), abs(start_point.y-end_point.y)) <= range) - if(start_point.z!=end_point.z || get_dist(start_point, end_point) > range) - continue - device.receive_signal(signal, TRANSMISSION_RADIO, frequency) -// N_nf++ +/datum/radio_frequency/proc/post_signal(obj/source as obj|null, datum/signal/signal, var/filter = null as text|null, var/range = null as num|null) + var/turf/start_point + if(range) + start_point = get_turf(source) + if(!start_point) + del(signal) + return 0 + if (filter) + send_to_filter(source, signal, filter, start_point, range) + send_to_filter(source, signal, RADIO_DEFAULT, start_point, range) + else + //Broadcast the signal to everyone! + for (var/next_filter in devices) + send_to_filter(source, signal, next_filter, start_point, range) -// log_admin("DEBUG: post_signal(source=[source] ([source.x], [source.y], [source.z]),filter=[filter]) frequency=[frequency], N_f=[N_f], N_nf=[N_nf]") +//Sends a signal to all machines belonging to a given filter. Should be called by post_signal() +/datum/radio_frequency/proc/send_to_filter(obj/source, datum/signal/signal, var/filter, var/turf/start_point = null, var/range = null) + if (range && !start_point) + return + for(var/obj/device in devices[filter]) + if(device == source) + continue + if(range) + var/turf/end_point = get_turf(device) + if(!end_point) + continue + if(start_point.z!=end_point.z || get_dist(start_point, end_point) > range) + continue -// del(signal) + device.receive_signal(signal, TRANSMISSION_RADIO, frequency) - add_listener(obj/device as obj, var/filter as text|null) - if (!filter) - filter = "_default" - //log_admin("add_listener(device=[device],filter=[filter]) frequency=[frequency]") - var/list/obj/devices_line = devices[filter] - if (!devices_line) - devices_line = new - devices[filter] = devices_line - devices_line+=device +/datum/radio_frequency/proc/add_listener(obj/device as obj, var/filter as text|null) + if (!filter) + filter = RADIO_DEFAULT + //log_admin("add_listener(device=[device],filter=[filter]) frequency=[frequency]") + var/list/obj/devices_line = devices[filter] + if (!devices_line) + devices_line = new + devices[filter] = devices_line + devices_line+=device // var/list/obj/devices_line___ = devices[filter_str] // var/l = devices_line___.len - //log_admin("DEBUG: devices_line.len=[devices_line.len]") - //log_admin("DEBUG: devices(filter_str).len=[l]") + //log_admin("DEBUG: devices_line.len=[devices_line.len]") + //log_admin("DEBUG: devices(filter_str).len=[l]") - remove_listener(obj/device) - for (var/devices_filter in devices) - var/list/devices_line = devices[devices_filter] - devices_line-=device - while (null in devices_line) - devices_line -= null - if (devices_line.len==0) - devices -= devices_filter - del(devices_line) +/datum/radio_frequency/proc/remove_listener(obj/device) + for (var/devices_filter in devices) + var/list/devices_line = devices[devices_filter] + devices_line-=device + while (null in devices_line) + devices_line -= null + if (devices_line.len==0) + devices -= devices_filter + del(devices_line) - -obj/proc - receive_signal(datum/signal/signal, receive_method, receive_param) - return null - -datum/signal +/datum/signal var/obj/source - var/transmission_method = 0 + var/transmission_method = 0 //unused at the moment //0 = wire //1 = radio transmission //2 = subspace transmission - var/data = list() + var/list/data = list() var/encryption var/frequency = 0 - proc/copy_from(datum/signal/model) - source = model.source - transmission_method = model.transmission_method - data = model.data - encryption = model.encryption - frequency = model.frequency +/datum/signal/proc/copy_from(datum/signal/model) + source = model.source + transmission_method = model.transmission_method + data = model.data + encryption = model.encryption + frequency = model.frequency - proc/debug_print() - if (source) - . = "signal = {source = '[source]' ([source:x],[source:y],[source:z])\n" - else - . = "signal = {source = '[source]' ()\n" - for (var/i in data) - . += "data\[\"[i]\"\] = \"[data[i]]\"\n" - if(islist(data[i])) - var/list/L = data[i] - for(var/t in L) - . += "data\[\"[i]\"\] list has: [t]" +/datum/signal/proc/debug_print() + if (source) + . = "signal = {source = '[source]' ([source:x],[source:y],[source:z])\n" + else + . = "signal = {source = '[source]' ()\n" + for (var/i in data) + . += "data\[\"[i]\"\] = \"[data[i]]\"\n" + if(islist(data[i])) + var/list/L = data[i] + for(var/t in L) + . += "data\[\"[i]\"\] list has: [t]" diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 160137a2e5b..062a650c9ba 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -138,7 +138,7 @@ var/list/station_levels = list(1) // Defines which Z-levels the station exists on. var/list/admin_levels= list(2) // Defines which Z-levels which are for admin functionality, for example including such areas as Central Command and the Syndicate Shuttle var/list/contact_levels = list(1, 5) // Defines which Z-levels which, for example, a Code Red announcement may affect - var/list/player_levels = list(1, 3, 4, 5, 6) // Defines all Z-levels a character can typically reach + var/list/player_levels = list(1, 3, 4, 5, 6, 7) // Defines all Z-levels a character can typically reach var/const/minutes_to_ticks = 60 * 10 // Event settings diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index d202f29d8f9..a7db9300c73 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -441,7 +441,7 @@ client usr << "This can only be used on instances of type /mob" return - var/new_name = copytext(sanitize(input(usr,"What would you like to name this mob?","Input a name",M.real_name) as text|null),1,MAX_NAME_LEN) + var/new_name = sanitize(copytext(input(usr,"What would you like to name this mob?","Input a name",M.real_name) as text|null,1,MAX_NAME_LEN)) if( !new_name || !M ) return message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].") diff --git a/code/datums/mind.dm b/code/datums/mind.dm index caea97b2f7d..4c63722a2ff 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -446,7 +446,7 @@ datum/mind assigned_role = new_role else if (href_list["memory_edit"]) - var/new_memo = copytext(sanitize(input("Write new memory", "Memory", memory) as null|message),1,MAX_MESSAGE_LEN) + var/new_memo = sanitize(copytext(input("Write new memory", "Memory", memory) as null|message,1,MAX_MESSAGE_LEN)) if (isnull(new_memo)) return memory = new_memo @@ -580,12 +580,24 @@ datum/mind new_objective.target_amount = target_number if("identity theft") + var/list/possible_targets = list("Free objective") + for(var/datum/mind/possible_target in ticker.minds) + if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human)) + possible_targets += possible_target.current + + var/new_target = input("Select target:", "Objective target") as null|anything in possible_targets + if (!new_target) + return + var/datum/mind/targ = new_target + if(!istype(targ)) + log_debug("Invalid target for identity theft objective, cancelling") + return new_objective = new /datum/objective/escape/escape_with_identity new_objective.owner = src - new_objective.find_target() - + new_objective.target = new_target + new_objective.explanation_text = "Escape on the shuttle or an escape pod with the identity of [targ.current.real_name], the [targ.assigned_role] while wearing their identification card." if ("custom") - var/expl = copytext(sanitize(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null),1,MAX_MESSAGE_LEN) + var/expl = sanitize(copytext(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null,1,MAX_MESSAGE_LEN)) if (!expl) return new_objective = new /datum/objective new_objective.owner = src diff --git a/code/datums/wires/airlock.dm b/code/datums/wires/airlock.dm index 3b6d009a5ff..211e82d4394 100644 --- a/code/datums/wires/airlock.dm +++ b/code/datums/wires/airlock.dm @@ -33,14 +33,16 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048 /datum/wires/airlock/GetInteractWindow() var/obj/machinery/door/airlock/A = holder + var/haspower = A.arePowerSystemsOn() . += ..() - . += text("
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]", (A.locked ? "The door bolts have fallen!" : "The door bolts look up."), - (A.lights ? "The door bolt lights are on." : "The door bolt lights are off!"), - ((A.arePowerSystemsOn() && !(A.stat & NOPOWER)) ? "The test light is on." : "The test light is off!"), - (A.aiControlDisabled==0 ? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."), - (A.safe==0 ? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."), - (A.normalspeed==0 ? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off."), - (A.emergency==0 ? "The emergency lights are off." : "The emergency lights are on.")) + . += text("
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]", + (A.locked ? "The door bolts have fallen!" : "The door bolts look up."), + ((A.lights && haspower) ? "The door bolt lights are on." : "The door bolt lights are off!"), + ((haspower) ? "The test light is on." : "The test light is off!"), + ((A.aiControlDisabled==0 && !A.emagged && haspower) ? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."), + ((A.safe==0 && haspower) ? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."), + ((A.normalspeed==0 && haspower) ? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off."), + ((A.emergency==0 && haspower) ? "The emergency lights are off." : "The emergency lights are on.")) /datum/wires/airlock/UpdateCut(var/index, var/mended) @@ -125,7 +127,7 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048 switch(index) if(AIRLOCK_WIRE_IDSCAN) //Sending a pulse through this disables emergency access and flashes the red light on the door (if the door has power). - if((A.arePowerSystemsOn()) && (!(A.stat & NOPOWER))) + if((A.arePowerSystemsOn()) && A.density) A.door_animate("deny") if(A.emergency) A.emergency = 0 diff --git a/code/datums/wires/radio.dm b/code/datums/wires/radio.dm index a8171270008..9da8890ac32 100644 --- a/code/datums/wires/radio.dm +++ b/code/datums/wires/radio.dm @@ -21,11 +21,24 @@ var/const/WIRE_TRANSMIT = 4 var/obj/item/device/radio/R = holder switch(index) if(WIRE_SIGNAL) - R.listening = !R.listening - R.broadcasting = R.listening + R.listening = !R.listening && !IsIndexCut(WIRE_RECEIVE) + R.broadcasting = R.listening && !IsIndexCut(WIRE_TRANSMIT) if(WIRE_RECEIVE) - R.listening = !R.listening + R.listening = !R.listening && !IsIndexCut(WIRE_SIGNAL) if(WIRE_TRANSMIT) - R.broadcasting = !R.broadcasting \ No newline at end of file + R.broadcasting = !R.broadcasting && !IsIndexCut(WIRE_SIGNAL) + +/datum/wires/radio/UpdateCut(var/index, var/mended) + var/obj/item/device/radio/R = holder + switch(index) + if(WIRE_SIGNAL) + R.listening = mended && !IsIndexCut(WIRE_RECEIVE) + R.broadcasting = mended && !IsIndexCut(WIRE_TRANSMIT) + + if(WIRE_RECEIVE) + R.listening = mended && !IsIndexCut(WIRE_SIGNAL) + + if(WIRE_TRANSMIT) + R.broadcasting = mended && !IsIndexCut(WIRE_SIGNAL) diff --git a/code/defines/procs/radio.dm b/code/defines/procs/radio.dm new file mode 100644 index 00000000000..1e0e045928b --- /dev/null +++ b/code/defines/procs/radio.dm @@ -0,0 +1,81 @@ +#define TELECOMMS_RECEPTION_NONE 0 +#define TELECOMMS_RECEPTION_SENDER 1 +#define TELECOMMS_RECEPTION_RECEIVER 2 +#define TELECOMMS_RECEPTION_BOTH 3 + +/proc/get_frequency_name(var/display_freq) + var/freq_text + + // the name of the channel + if(display_freq in ANTAG_FREQS) + freq_text = "#unkn" + else + for(var/channel in radiochannels) + if(radiochannels[channel] == display_freq) + freq_text = channel + break + + // --- If the frequency has not been assigned a name, just use the frequency as the name --- + if(!freq_text) + freq_text = format_frequency(display_freq) + + return freq_text + +/datum/reception + var/obj/machinery/message_server/message_server = null + var/telecomms_reception = TELECOMMS_RECEPTION_NONE + var/message = "" + +/datum/receptions + var/obj/machinery/message_server/message_server = null + var/sender_reception = TELECOMMS_RECEPTION_NONE + var/list/receiver_reception = new + +/proc/get_message_server() + if(message_servers) + for (var/obj/machinery/message_server/MS in message_servers) + if(MS.active) + return MS + return null + +/proc/check_signal(var/datum/signal/signal) + return signal && signal.data["done"] + +/proc/get_sender_reception(var/atom/sender, var/datum/signal/signal) + return check_signal(signal) ? TELECOMMS_RECEPTION_SENDER : TELECOMMS_RECEPTION_NONE + +/proc/get_receiver_reception(var/receiver, var/datum/signal/signal) + if(receiver && check_signal(signal)) + var/turf/pos = get_turf(receiver) + if(pos && (pos.z in signal.data["level"])) + return TELECOMMS_RECEPTION_RECEIVER + return TELECOMMS_RECEPTION_NONE + +/proc/get_reception(var/atom/sender, var/receiver, var/message = "", var/do_sleep = 1) + var/datum/reception/reception = new + + // check if telecomms I/O route 1459 is stable + reception.message_server = get_message_server() + + var/datum/signal/signal = sender.telecomms_process(do_sleep) // Be aware that this proc calls sleep, to simulate transmition delays + reception.telecomms_reception |= get_sender_reception(sender, signal) + reception.telecomms_reception |= get_receiver_reception(receiver, signal) + reception.message = signal && signal.data["compression"] > 0 ? Gibberish(message, signal.data["compression"] + 50) : message + + return reception + +/proc/get_receptions(var/atom/sender, var/list/atom/receivers, var/do_sleep = 1) + var/datum/receptions/receptions = new + receptions.message_server = get_message_server() + + var/datum/signal/signal + if(sender) + signal = sender.telecomms_process(do_sleep) + receptions.sender_reception = get_sender_reception(sender, signal) + + for(var/atom/receiver in receivers) + if(!signal) + signal = receiver.telecomms_process() + receptions.receiver_reception[receiver] = get_receiver_reception(receiver, signal) + + return receptions diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index 43c52ec018c..7d5547f3c45 100644 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -2268,6 +2268,7 @@ area/security/podbay /area/awaycontent name = "space" + report_alerts = 0 /area/awaycontent/a1 icon_state = "awaycontent1" diff --git a/code/game/dna/dna2_domutcheck.dm b/code/game/dna/dna2_domutcheck.dm index 6f0e3412f19..545e65b691d 100644 --- a/code/game/dna/dna2_domutcheck.dm +++ b/code/game/dna/dna2_domutcheck.dm @@ -5,6 +5,7 @@ // flags: See below, bitfield. #define MUTCHK_FORCED 1 /proc/domutcheck(var/mob/living/M, var/connected=null, var/flags=0) + for(var/datum/dna/gene/gene in dna_genes) if(!M || !M.dna) return @@ -75,6 +76,14 @@ var/gene_active = (gene.flags & GENE_ALWAYS_ACTIVATE) if(!gene_active) gene_active = M.dna.GetSEState(gene.block) + + var/defaultgenes // Do not mutate inherent species abilities + if(ishuman(M)) + var/mob/living/carbon/human/H = M + defaultgenes = H.species.default_genes + + if((gene in defaultgenes) && gene_active) + return // Prior state var/gene_prior_status = (gene.type in M.active_genes) diff --git a/code/game/dna/genes/goon_disabilities.dm b/code/game/dna/genes/goon_disabilities.dm index 5de6a0c35c3..1214919a441 100644 --- a/code/game/dna/genes/goon_disabilities.dm +++ b/code/game/dna/genes/goon_disabilities.dm @@ -335,7 +335,7 @@ if(L) usr.attack_log += text("\[[time_stamp()]\] [usr.real_name] ([usr.ckey]) cast the spell [name] on [L.real_name] ([L.ckey]).") - msg_admin_attack("[usr.real_name] ([usr.ckey]) has cast the spell [name] on [L.real_name] ([L.ckey]) (JMP)") + msg_admin_attack("[usr.real_name] ([usr.ckey]) has cast the spell [name] on [L.real_name] ([L.ckey]) (JMP)") L.adjust_fire_stacks(0.5) L.visible_message("\red [L.name] suddenly bursts into flames!") diff --git a/code/game/dna/genes/goon_powers.dm b/code/game/dna/genes/goon_powers.dm index 5ded91894bf..00a7879906f 100644 --- a/code/game/dna/genes/goon_powers.dm +++ b/code/game/dna/genes/goon_powers.dm @@ -162,12 +162,12 @@ H.visible_message("\red [usr] sprays a cloud of fine ice crystals, engulfing [H]!", "[usr] sprays a cloud of fine ice crystals over your [H.head]'s visor.") log_admin("[ckey(usr.key)] has used cryokinesis on [ckey(C.key)], internals yes, suit yes") - msg_admin_attack("[usr.real_name] ([usr.ckey]) has cast cryokinesis on [C.real_name] ([C.ckey]), (JMP)") + msg_admin_attack("[usr.real_name] ([usr.ckey]) has cast cryokinesis on [C.real_name] ([C.ckey]), (JMP)") else H.visible_message("\red [usr] sprays a cloud of fine ice crystals engulfing, [H]!", "[usr] sprays a cloud of fine ice crystals cover your [H.head]'s visor and make it into your air vents!.") log_admin("[usr.real_name] ([ckey(usr.key)]) has used cryokinesis on [C.real_name] ([ckey(C.key)]), ()") - msg_admin_attack("[usr.real_name] ([usr.ckey]) has cast cryokinesis on [C.real_name] ([C.ckey]), (JMP)") + msg_admin_attack("[usr.real_name] ([usr.ckey]) has cast cryokinesis on [C.real_name] ([C.ckey]), (JMP)") H.bodytemperature = max(0, H.bodytemperature - 50) H.adjustFireLoss(5) if(!handle_suit) @@ -177,7 +177,7 @@ C.visible_message("\red [usr] sprays a cloud of fine ice crystals, engulfing [C]!") log_admin("[ckey(usr.key)] has used cryokinesis on [ckey(C.key)], internals no, suit no") - msg_admin_attack("[usr.real_name] ([usr.ckey]) has cast cryokinesis on [C.real_name] ([C.ckey]), (JMP)") + msg_admin_attack("[usr.real_name] ([usr.ckey]) has cast cryokinesis on [C.real_name] ([C.ckey]), (JMP)") //playsound(usr.loc, 'bamf.ogg', 50, 0) diff --git a/code/game/gamemodes/blob/overmind.dm b/code/game/gamemodes/blob/overmind.dm index 8316c570f9a..5f3b1bf796e 100644 --- a/code/game/gamemodes/blob/overmind.dm +++ b/code/game/gamemodes/blob/overmind.dm @@ -65,7 +65,7 @@ /mob/camera/blob/proc/blob_talk(message) log_say("[key_name(src)] : [message]") - message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) + message = trim(sanitize(copytext(message, 1, MAX_MESSAGE_LEN))) if (!message) return diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 76d198d796f..3a0ebf2d928 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -120,9 +120,9 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon" var/datum/objective/escape/escape_with_identity/identity_theft = new identity_theft.owner = changeling identity_theft.target = kill_objective.target + identity_theft.target_real_name = kill_objective.target.current.real_name //Whoops, forgot this. if(identity_theft.target && identity_theft.target.current) - var/target_real_name = identity_theft.target.current.real_name - identity_theft.explanation_text = "Escape on the shuttle or an escape pod with the identity of [target_real_name], the [identity_theft.target.assigned_role] while wearing their identification card." + identity_theft.explanation_text = "Escape on the shuttle or an escape pod with the identity of [identity_theft.target_real_name], the [identity_theft.target.assigned_role] while wearing their identification card." else identity_theft.explanation_text = "Free objective" changeling.objectives += identity_theft @@ -310,13 +310,4 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon" user << "We already have this DNA in storage!" return 1 - -//More snowflake stuff, but for languages. -/datum/changeling/proc/changeling_update_languages(var/updated_languages, var/mob/living/carbon/user) - if(!istype(user) || !user) - return - user.languages = list() - for(var/language in updated_languages) - user.languages += language - - return \ No newline at end of file + diff --git a/code/game/gamemodes/changeling/evolution_menu.dm b/code/game/gamemodes/changeling/evolution_menu.dm index 370a65d42a0..32ab8473d66 100644 --- a/code/game/gamemodes/changeling/evolution_menu.dm +++ b/code/game/gamemodes/changeling/evolution_menu.dm @@ -360,10 +360,11 @@ var/list/sting_paths sting_paths = init_subtypes(/obj/effect/proc_holder/changeling) if(mind.changeling.purchasedpowers) remove_changeling_powers(1) + + add_language("Changeling") for(var/language in languages) - if(!(language in mind.changeling.absorbed_languages)) - mind.changeling.absorbed_languages += language + mind.changeling.absorbed_languages |= language // purchase free powers. for(var/obj/effect/proc_holder/changeling/path in sting_paths) @@ -376,6 +377,17 @@ var/list/sting_paths var/mob/living/carbon/C = src //only carbons have dna now, so we have to typecaste mind.changeling.absorbed_dna |= C.dna return 1 + +//Used to dump the languages from the changeling datum into the actual mob. +/mob/proc/changeling_update_languages(var/updated_languages) + + for(var/datum/language/L in updated_languages) + add_language("L.name") + + //This isn't strictly necessary but just to be safe... + add_language("Changeling") + + return /datum/changeling/proc/reset() chosen_sting = null diff --git a/code/game/gamemodes/changeling/powers/absorb.dm b/code/game/gamemodes/changeling/powers/absorb.dm index 6acb6e5a66d..115a5ae59d2 100644 --- a/code/game/gamemodes/changeling/powers/absorb.dm +++ b/code/game/gamemodes/changeling/powers/absorb.dm @@ -94,7 +94,7 @@ for(var/language in T.languages) if(!(language in absorbed_languages)) absorbed_languages += language - changeling_update_languages(absorbed_languages, user) + user.changeling_update_languages(absorbed_languages) absorbedcount++ store_dna(new_dna, user) diff --git a/code/game/gamemodes/changeling/powers/humanform.dm b/code/game/gamemodes/changeling/powers/humanform.dm index 81828120875..42e0bb3dad1 100644 --- a/code/game/gamemodes/changeling/powers/humanform.dm +++ b/code/game/gamemodes/changeling/powers/humanform.dm @@ -65,7 +65,7 @@ I.implanted = O user.mind.transfer_to(O) - O.mind.changeling.changeling_update_languages(changeling.absorbed_languages) + O.changeling_update_languages(changeling.absorbed_languages) O.mind.changeling.purchasedpowers -= src //O.mind.changeling.purchasedpowers += new /obj/effect/proc_holder/changeling/lesserform(null) feedback_add_details("changeling_powers","LFT") diff --git a/code/game/gamemodes/changeling/powers/lesserform.dm b/code/game/gamemodes/changeling/powers/lesserform.dm index f8ebed5798e..a769ee47bd0 100644 --- a/code/game/gamemodes/changeling/powers/lesserform.dm +++ b/code/game/gamemodes/changeling/powers/lesserform.dm @@ -60,7 +60,7 @@ C.mind.transfer_to(O) O.mind.changeling.purchasedpowers += new /obj/effect/proc_holder/changeling/humanform(null) - O.mind.changeling.changeling_update_languages(changeling.absorbed_languages) + O.changeling_update_languages(changeling.absorbed_languages) feedback_add_details("changeling_powers","LF") qdel(C) diff --git a/code/game/gamemodes/changeling/powers/transform.dm b/code/game/gamemodes/changeling/powers/transform.dm index b6a9cf0af30..f1ff51a42a2 100644 --- a/code/game/gamemodes/changeling/powers/transform.dm +++ b/code/game/gamemodes/changeling/powers/transform.dm @@ -21,6 +21,8 @@ user.set_species() user.UpdateAppearance() domutcheck(user, null) + + user.changeling_update_languages(changeling.absorbed_languages) feedback_add_details("changeling_powers","TR") return 1 diff --git a/code/game/gamemodes/events/ninja_equipment.dm b/code/game/gamemodes/events/ninja_equipment.dm index 9ed459ef8ce..a02fc5042e7 100644 --- a/code/game/gamemodes/events/ninja_equipment.dm +++ b/code/game/gamemodes/events/ninja_equipment.dm @@ -564,7 +564,7 @@ ________________________________________________________________________________ if("Message") var/obj/item/device/pda/P = locate(href_list["target"]) var/t = input(U, "Please enter untraceable message.") as text - t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) + t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN)) if(!t||U.stat||U.wear_suit!=src||!s_initialized)//Wow, another one of these. Man... display_to << browse(null, "window=spideros") return @@ -1351,21 +1351,21 @@ ________________________________________________________________________________ var/chance = rand(1,100) switch(chance) if(1 to 70)//High chance of a regular name. - voice = "[rand(0,1)==1?pick(first_names_female):pick(first_names_male)] [pick(last_names)]" + changer.voice = "[rand(0,1)==1?pick(first_names_female):pick(first_names_male)] [pick(last_names)]" if(71 to 80)//Smaller chance of a clown name. - voice = "[pick(clown_names)]" + changer.voice = "[pick(clown_names)]" if(81 to 90)//Small chance of a wizard name. - voice = "[pick(wizard_first)] [pick(wizard_second)]" + changer.voice = "[pick(wizard_first)] [pick(wizard_second)]" if(91 to 100)//Small chance of an existing crew name. var/names[] = new() for(var/mob/living/carbon/human/M in player_list) if(M==U||!M.client||!M.real_name) continue names.Add(M.real_name) - voice = !names.len ? "Cuban Pete" : pick(names) - U << "You are now mimicking [voice]." + changer.voice = !names.len ? "Cuban Pete" : pick(names) + U << "You are now mimicking [changer.voice]." else - U << "The voice synthesizer is [voice!="Unknown"?"now":"already"] deactivated." - voice = "Unknown" + U << "The voice synthesizer is [changer.voice!="Unknown"?"now":"already"] deactivated." + changer.voice = "Unknown" return /obj/item/clothing/mask/gas/voice/space_ninja/proc/switchm() @@ -1408,7 +1408,7 @@ ________________________________________________________________________________ if(3) mode = "Meson Scanner" usr << "[mode] is active."//Leaving usr here since it may be on the floor or on a person. - usr << "Voice mimicking algorithm is set [!vchange?"inactive":"active"]." + usr << "Voice mimicking algorithm is set [!changer.active?"inactive":"active"]." /* diff --git a/code/game/gamemodes/events/space_ninja.dm b/code/game/gamemodes/events/space_ninja.dm index 9a17a188ec0..1792e573a5b 100644 --- a/code/game/gamemodes/events/space_ninja.dm +++ b/code/game/gamemodes/events/space_ninja.dm @@ -480,7 +480,7 @@ As such, it's hard-coded for now. No reason for it not to be, really. var/mission if(alert("Would you the Ninja to have a random or preset mission?",,"Random","Preset")=="Preset") while(!mission) - mission = copytext(sanitize(input(src, "Please specify which mission the space ninja shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN) + mission = sanitize(copytext(input(src, "Please specify which mission the space ninja shall undertake.", "Specify Mission", ""),1,MAX_MESSAGE_LEN)) if(!mission) if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes") return diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index de7bc051054..de5d25bd9d1 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -132,6 +132,7 @@ proc/issyndicate(mob/living/M as mob) synd_mind.current.loc = synd_spawn[spawnpos] forge_syndicate_objectives(synd_mind) + create_syndicate(synd_mind) greet_syndicate(synd_mind) equip_syndicate(synd_mind.current) @@ -162,7 +163,38 @@ proc/issyndicate(mob/living/M as mob) spawn (rand(waittime_l, waittime_h)) send_intercept() return ..() + +/datum/game_mode/proc/create_syndicate(var/datum/mind/synd_mind) // So we don't have inferior species as ops - randomize a human + var/mob/living/carbon/human/M = synd_mind.current + M.set_species("Human",1) + M.dna.ready_dna(M) // Quadriplegic Nuke Ops won't be participating in the paralympics + var/hair_c = pick("#8B4513","#000000","#FF4500","#FFD700") // Brown, black, red, blonde + var/eye_c = pick("#000000","#8B4513","1E90FF") // Black, brown, blue + var/skin_tone = pick(35, 60, 75, 90, 105, 120, 135, 150) // Caucasian - black + var/hair_style = "Bald" + var/facial_hair_style = "Shaved" + if(M.gender == MALE) + hair_style = pick(hair_styles_male_list) + facial_hair_style = pick(facial_hair_styles_list) + else + hair_style = pick(hair_styles_female_list) + if(prob(5)) + facial_hair_style = pick(facial_hair_styles_list) + + M.r_facial = hex2num(copytext(hair_c, 2, 4)) + M.g_facial = hex2num(copytext(hair_c, 4, 6)) + M.b_facial = hex2num(copytext(hair_c, 6, 8)) + M.r_hair = hex2num(copytext(hair_c, 2, 4)) + M.g_hair = hex2num(copytext(hair_c, 4, 6)) + M.b_hair = hex2num(copytext(hair_c, 6, 8)) + M.r_eyes = hex2num(copytext(eye_c, 2, 4)) + M.g_eyes = hex2num(copytext(eye_c, 4, 6)) + M.b_eyes = hex2num(copytext(eye_c, 6, 8)) + M.s_tone = skin_tone + 35 + M.s_tone = -M.s_tone + 35 + M.h_style = hair_style + M.f_style = facial_hair_style /datum/game_mode/proc/prepare_syndicate_leader(var/datum/mind/synd_mind, var/nuke_code) var/leader_title = pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord") @@ -409,7 +441,7 @@ proc/issyndicate(mob/living/M as mob) /proc/nukelastname(var/mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea. Also praise Urist for copypasta ho. var/randomname = pick(last_names) - var/newname = copytext(sanitize(input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change",randomname)),1,MAX_NAME_LEN) + var/newname = sanitize(copytext(input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change",randomname),1,MAX_NAME_LEN)) if (!newname) newname = randomname diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 330949c3caf..8d4686148b1 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -23,10 +23,6 @@ var/bomb_set var/timing_wire var/removal_stage = 0 // 0 is no removal, 1 is covers removed, 2 is covers open, 3 is sealant open, 4 is unwrenched, 5 is removed from bolts. var/lastentered - var/data[0] - var/uiwidth - var/uiheight - var/uititle use_power = 0 unacidable = 1 @@ -84,7 +80,7 @@ var/bomb_set if (istype(O, /obj/item/device/multitool) || istype(O, /obj/item/weapon/wirecutters)) ui_interact(user) - + if (src.extended) if (istype(O, /obj/item/weapon/disk/nuclear)) usr.drop_item() @@ -186,8 +182,12 @@ var/bomb_set obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob) ui_interact(user) - + /obj/machinery/nuclearbomb/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + var/data[0] + var/uiwidth + var/uiheight + var/uititle if(!src.opened) data["hacking"] = 0 data["auth"] = src.auth @@ -197,12 +197,12 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob) else data["authstatus"] = "Auth. S2" else - if (src.timing) + if (src.timing) data["authstatus"] = "Set" else data["authstatus"] = "Auth. S1" - data["safe"] = src.safety ? "Safe" : "Engaged" - data["time"] = src.timeleft + data["safe"] = src.safety ? "Safe" : "Engaged" + data["time"] = src.timeleft data["timer"] = src.timing data["safety"] = src.safety data["anchored"] = src.anchored @@ -217,7 +217,7 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob) uititle = "Nuke Control Panel" else data["hacking"] = 1 - var/list/tempwires[0] + var/list/tempwires[0] for(var/wire in src.wires) tempwires.Add(list(list("name" = wire, "cut" = src.wires[wire]))) data["wires"] = tempwires @@ -227,10 +227,10 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob) uiwidth = 420 uiheight = 440 uititle = "Nuclear Bomb Defusion" - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if (!ui) ui = new(user, src, ui_key, "nuclear_bomb.tmpl", uititle, uiwidth, uiheight) - ui.set_initial_data(data) + ui.set_initial_data(data) ui.open() /obj/machinery/nuclearbomb/verb/make_deployable() @@ -337,8 +337,8 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob) if (src.timing == -1.0) return if (src.safety) - usr << "\red The safety is still on." - nanomanager.update_uis(src) + usr << "\red The safety is still on." + nanomanager.update_uis(src) return src.timing = !( src.timing ) if (src.timing) @@ -426,7 +426,7 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob) if(ticker.mode.name == "nuclear emergency") ticker.mode:nukes_left -- else if(off_station == 1) - world << "A nuclear device was set off, but the explosion was out of reach of the station!" + world << "A nuclear device was set off, but the explosion was out of reach of the station!" else if(off_station == 2) world << "A nuclear device was set off, but the device was not on the station!" else diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index be2ac536afb..d79a7f8b6ae 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -619,7 +619,7 @@ datum/objective/steal var/tmp_obj = new O.typepath var/custom_name = tmp_obj:name del(tmp_obj) - O.name = copytext(sanitize(input("Enter target name:", "Objective target", custom_name) as text|null),1,MAX_NAME_LEN) + O.name = sanitize(copytext(input("Enter target name:", "Objective target", custom_name) as text|null,1,MAX_NAME_LEN)) if (!O.name) return steal_target = O explanation_text = "Steal [O.name]." @@ -727,10 +727,14 @@ datum/objective/absorb var/n_p = 1 //autowin if (ticker.current_state == GAME_STATE_SETTING_UP) for(var/mob/new_player/P in player_list) - if(P.client && P.ready && P.mind!=owner) + if(P.client && P.ready && P.mind != owner) + if(P.client.prefs && (P.client.prefs.species == "Vox" || P.client.prefs.species == "Slime People" || P.client.prefs.species == "Machine")) // Special check for species that can't be absorbed. No better solution. + continue n_p ++ else if (ticker.current_state == GAME_STATE_PLAYING) for(var/mob/living/carbon/human/P in player_list) + if((P.species.flags & IS_SYNTHETIC) || (P.species.flags & NO_SCAN)) + continue if(P.client && !(P.mind in ticker.mode.changelings) && P.mind!=owner) n_p ++ target_amount = min(target_amount, n_p) @@ -745,12 +749,14 @@ datum/objective/absorb return 0 datum/objective/destroy + var/target_real_name find_target() var/list/possible_targets = active_ais(1) var/mob/living/silicon/ai/target_ai = pick(possible_targets) target = target_ai.mind if(target && target.current) - explanation_text = "Destroy [target.current.real_name], the experimental AI." + target_real_name = target.current.real_name + explanation_text = "Destroy [target_real_name], the AI." else explanation_text = "Free Objective" return target diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index 96b1a3d7920..f32258c13db 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -134,22 +134,6 @@ //testing("DNA2: [numsToAssign.len] blocks are unused: [english_list(numsToAssign)]") -// Run AFTER genetics setup and AFTER species setup. -/proc/setup_species() - // SPECIES GENETICS FUN - for(var/name in all_species) - // I hate BYOND. Can't just call while it's in the list. - var/datum/species/species = all_species[name] - if(species.default_block_names.len>0) - testing("Setting up genetics for [species.name] (needs [english_list(species.default_block_names)])") - species.default_blocks.Cut() - for(var/block=1;block 1)) - return - if (!(multiplier in list(1,10,25,max_multiplier))) //"enough materials ?" is checked further down - return - ///////////////// - - var/coeff = (is_stack ? 1 : 2 ** prod_coeff) //stacks are unaffected by production coefficient - var/metal_cost = being_built.materials["$metal"] - var/glass_cost = being_built.materials["$glass"] - - var/power = max(2000, (metal_cost+glass_cost)*multiplier/5) - - if((m_amount >= metal_cost*multiplier/coeff) && (g_amount >= glass_cost*multiplier/coeff)) - busy = 1 - use_power(power) - icon_state = "autolathe" - flick("autolathe_n",src) - spawn(32/coeff) - use_power(power) - if(is_stack) - m_amount -= metal_cost*multiplier - g_amount -= glass_cost*multiplier - var/obj/item/stack/S = new being_built.build_path(T) - S.amount = multiplier - else - m_amount -= metal_cost/coeff - g_amount -= glass_cost/coeff - var/obj/item/new_item = new being_built.build_path(T) - new_item.m_amt /= coeff - new_item.g_amt /= coeff - if(m_amount < 0) - m_amount = 0 - if(g_amount < 0) - g_amount = 0 - busy = 0 - src.updateUsrDialog() - - if(href_list["search"]) - matching_designs.Cut() - - for(var/datum/design/D in files.known_designs) - if(findtext(D.name,href_list["to_search"])) - matching_designs.Add(D) - - else - usr << "The autolathe is busy. Please wait for completion of previous operation." - if(href_list["menu"]) screen = text2num(href_list["menu"]) diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm index 8cf8c77c66c..e676f69c130 100644 --- a/code/game/machinery/bots/bots.dm +++ b/code/game/machinery/bots/bots.dm @@ -29,7 +29,6 @@ var/remote_disabled = 0 //If enabled, the AI cannot *Remotely* control a bot. It can still control it through cameras. var/mob/living/silicon/ai/calling_ai //Links a bot to the AI calling it. var/obj/item/device/radio/Radio //The bot's radio, for speaking to people. - var/radio_frequency //The bot's default radio speaking freqency. Recommended to be on a department frequency. var/radio_name = "Common" //var/emagged = 0 //Urist: Moving that var to the general /bot tree as it's used by most bots var/auto_patrol = 0// set to make bot automatically patrol @@ -339,11 +338,9 @@ /obj/machinery/bot/attack_ai(mob/user as mob) attack_hand(user) -/obj/machinery/bot/proc/speak(var/message, freq, var/freqname = null) //Pass a message to have the bot say() it. Pass a frequency to say it on the radio. +/obj/machinery/bot/proc/speak(var/message, var/freqname = null) //Pass a message to have the bot say() it. Pass a frequency to say it on the radio. if((!on) || (!message)) return - if(freq) - Radio.set_frequency(radio_frequency) if(freqname) Radio.autosay(message, src.name, freqname, list(src.z)) else @@ -654,7 +651,7 @@ obj/machinery/bot/proc/start_patrol() botcard.access = user_access + prev_access //Adds the user's access, if any. mode = BOT_SUMMON calc_summon_path() - speak("Responding.", radio_frequency, radio_name) + speak("Responding.", radio_name) return // receive response from beacon @@ -741,7 +738,7 @@ obj/machinery/bot/proc/bot_summon() check_bot_access() path = AStar(loc, summon_target, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance_cardinal, 0, 150, id=botcard, exclude=avoid) if(!path || tries >= 5) //Cannot reach target. Give up and announce the issue. - speak("Summon command failed, destination unreachable.", radio_frequency, radio_name) + speak("Summon command failed, destination unreachable.", radio_name) bot_reset() /obj/machinery/bot/proc/summon_step() diff --git a/code/game/machinery/bots/cleanbot.dm b/code/game/machinery/bots/cleanbot.dm index e30bfa45283..a77235dad26 100644 --- a/code/game/machinery/bots/cleanbot.dm +++ b/code/game/machinery/bots/cleanbot.dm @@ -38,7 +38,6 @@ var/failed_steps var/next_dest var/next_dest_loc - radio_frequency = SRV_FREQ //Service radio_name = "Service" bot_type = CLEAN_BOT bot_type_name = "Cleanbot" diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index 703b0b7dd82..bffd8a07032 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -33,7 +33,6 @@ var/arrest_type = 0 //If true, don't handcuff var/projectile = /obj/item/projectile/energy/electrode //Holder for projectile type var/shoot_sound = 'sound/weapons/Taser.ogg' - radio_frequency = SEC_FREQ radio_name = "Security" bot_type = SEC_BOT bot_type_name = "ED-209" @@ -269,7 +268,7 @@ Auto Patrol[]"}, if(declare_arrests) var/area/location = get_area(src) - speak("[arrest_type ? "Detaining" : "Arresting"] level [threatlevel] scumbag [target] in [location].",radio_frequency, radio_name) + speak("[arrest_type ? "Detaining" : "Arresting"] level [threatlevel] scumbag [target] in [location].", radio_name) target.visible_message("[target] has been stunned by [src]!",\ "[target] has been stunned by [src]!") diff --git a/code/game/machinery/bots/farmbot.dm b/code/game/machinery/bots/farmbot.dm index 3c13b04ff96..d5eff718549 100644 --- a/code/game/machinery/bots/farmbot.dm +++ b/code/game/machinery/bots/farmbot.dm @@ -585,7 +585,7 @@ else if(istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text - t = copytext(sanitize(t), 1, MAX_NAME_LEN) + t = sanitize(copytext(t), 1, MAX_NAME_LEN) if (!t) return if (!in_range(src, usr) && src.loc != usr) diff --git a/code/game/machinery/bots/floorbot.dm b/code/game/machinery/bots/floorbot.dm index 3752796f90f..e9a8c67093f 100644 --- a/code/game/machinery/bots/floorbot.dm +++ b/code/game/machinery/bots/floorbot.dm @@ -49,7 +49,6 @@ var/oldloc = null req_one_access = list(access_construction, access_robotics) var/targetdirection - radio_frequency = ENG_FREQ //Engineering channel radio_name = "Engineering" bot_type = FLOOR_BOT bot_type_name = "Floorbot" @@ -318,7 +317,7 @@ /obj/machinery/bot/floorbot/proc/nag() //Annoy everyone on the channel to refill us! if(!nagged) var/area/location = get_area(src) - speak("Requesting refill at [location]!", radio_frequency, radio_name) + speak("Requesting refill at [location]!", radio_name) nagged = 1 /obj/machinery/bot/floorbot/proc/is_hull_breach(var/turf/t) //Ignore space tiles not considered part of a structure, also ignores shuttle docking areas. diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index 084514ecd85..aa0dd6c94ab 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -30,7 +30,6 @@ var/declare_crit = 1 //If active, the bot will transmit a critical patient alert to MedHUD users. var/declare_cooldown = 0 //Prevents spam of critical patient alerts. var/stationary_mode = 0 //If enabled, the Medibot will not move automatically. - radio_frequency = MED_FREQ //Medical frequency radio_name = "Medical" //Setting which reagents to use to treat what by default. By id. var/treatment_brute = "tricordrazine" @@ -533,7 +532,7 @@ if((skin == "bezerk")) return var/area/location = get_area(src) - speak("Medical emergency! [crit_patient ? "[crit_patient]" : "A patient"] is in critical condition at [location]!",radio_frequency, radio_name) + speak("Medical emergency! [crit_patient ? "[crit_patient]" : "A patient"] is in critical condition at [location]!", radio_name) declare_cooldown = 1 spawn(200) //Twenty seconds declare_cooldown = 0 diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index 19ef2058f43..bbab6f7d9e7 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -238,7 +238,7 @@ var/global/mulebot_count = 0 //user << browse("M.U.L.E. Mk. III [suffix ? "([suffix])" : ""][dat]", "window=mulebot;size=350x500") //onclose(user, "mulebot") - var/datum/browser/popup = new(user, "mulebot", "M.U.L.E. Mk. V [suffix ? "([suffix])" : ""]", 350, 535) + var/datum/browser/popup = new(user, "mulebot", "M.U.L.E. Mk. V [suffix ? "([suffix])" : ""]", 350, 620) popup.set_content(dat) popup.set_title_image(user.browse_rsc_icon(icon, icon_state)) popup.open() @@ -313,6 +313,8 @@ var/global/mulebot_count = 0 updateDialog() if("destination") + if(!delivery_beacons.len) + post_signal(beacon_freq, "findbeacon", "delivery") refresh=0 var/new_dest = input("Select M.U.L.E. Destination", "Mulebot [suffix ? "([suffix])" : ""]", destination) as null|anything in delivery_beacons refresh=1 @@ -322,7 +324,7 @@ var/global/mulebot_count = 0 if("setid") refresh=0 - var/new_id = copytext(sanitize(input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null),1,MAX_NAME_LEN) + var/new_id = sanitize(copytext(input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null,1,MAX_NAME_LEN)) refresh=1 if(new_id) suffix = new_id @@ -683,7 +685,6 @@ var/global/mulebot_count = 0 // called when bot reaches current target /obj/machinery/bot/mulebot/proc/at_target() if(!reached_target) - radio_frequency = SUP_FREQ //Supply channel radio_name = "Supply" Radio.config(list("[radio_name]" = 0)) visible_message("[src] makes a chiming sound!", "You hear a chime.") @@ -696,12 +697,11 @@ var/global/mulebot_count = 0 calling_ai << "\icon[src] [src] wirelessly plays a chiming sound!" playsound(calling_ai, 'sound/machines/chime.ogg',40, 0) calling_ai = null - radio_frequency = AIPRIV_FREQ //Report on AI Private instead if the AI is controlling us. radio_name = "AI Private" Radio.config(list("[radio_name]" = 0)) if(load) // if loaded, unload at target - speak("Destination [destination] reached. Unloading [load].", radio_frequency, radio_name) + speak("Destination [destination] reached. Unloading [load].", radio_name) unload(loaddir) else // not loaded @@ -717,7 +717,7 @@ var/global/mulebot_count = 0 if(AM) load(AM) if(report_delivery) - speak("Now loading [load] at [get_area(src)].", radio_frequency, radio_name) + speak("Now loading [load] at [get_area(src)].", radio_name) // whatever happened, check to see if we return home if(auto_return && destination != home_destination) diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index d7d9d24a774..2b70de39797 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -25,7 +25,6 @@ var/arrest_type = 0 //If true, don't handcuff var/harmbaton = 0 var/base_icon = "secbot" - radio_frequency = SEC_FREQ //Security channel radio_name = "Security" bot_type = SEC_BOT bot_type_name = "Secbot" @@ -50,7 +49,6 @@ /obj/machinery/bot/secbot/pingsky name = "Officer Pingsky" desc = "It's Officer Pingsky! Delegated to satellite guard duty for harbouring anti-human sentiment." - radio_frequency = AIPRIV_FREQ radio_name = "AI Private" /obj/machinery/bot/secbot/ofitser @@ -256,7 +254,7 @@ Auto Patrol: []"}, if(declare_arrests) var/area/location = get_area(src) - speak("[arrest_type ? "Detaining" : "Arresting"] level [threatlevel] scumbag [target] in [location].",radio_frequency, radio_name) + speak("[arrest_type ? "Detaining" : "Arresting"] level [threatlevel] scumbag [target] in [location].", radio_name) target.visible_message("[target] has been [harmbaton ? "beaten" : "stunned"] by [src]!",\ "[target] has been [harmbaton ? "beaten" : "stunned"] by [src]!") diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index 1d60db31a3c..dd7c175ce4d 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -4,7 +4,7 @@ /mob/living/silicon/ai/proc/InvalidTurf(turf/T as turf) if(!T) return 1 - if((T.z in config.station_levels)) + if((T.z in config.admin_levels)) return 1 if(T.z > 6) return 1 diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 6298f0d7d89..87552942026 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -198,7 +198,7 @@ if (is_authenticated() && modify) var/t1 = href_list["assign_target"] if(t1 == "Custom") - var/temp_t = copytext(sanitize(input("Enter a custom job assignment.","Assignment")),1,MAX_MESSAGE_LEN) + var/temp_t = sanitize(copytext(input("Enter a custom job assignment.","Assignment"),1,MAX_MESSAGE_LEN)) //let custom jobs function as an impromptu alt title, mainly for sechuds if(temp_t && modify) modify.assignment = temp_t diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 916b99e05c9..879e6b8f150 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -422,7 +422,7 @@ //Enter message if("Message") custommessage = input(usr, "Please enter your message.") as text|null - custommessage = copytext(sanitize(custommessage), 1, MAX_MESSAGE_LEN) + custommessage = sanitize(copytext(custommessage, 1, MAX_MESSAGE_LEN)) //Send message if("Send") diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index 8340838f6e2..7b4b37665b0 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -129,7 +129,7 @@ usr << "Unauthorized Access." else if(href_list["warn"]) - var/warning = copytext(sanitize(input(usr,"Message:","Enter your message here!","")),1,MAX_MESSAGE_LEN) + var/warning = sanitize(copytext(input(usr,"Message:","Enter your message here!",""),1,MAX_MESSAGE_LEN)) if(!warning) return var/obj/item/weapon/implant/I = locate(href_list["warn"]) if((I)&&(I.imp_in)) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 19980597308..daa81985978 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -358,7 +358,7 @@ About the new airlock wires panel: return ((src.aiControlDisabled==1) && (!hackProof) && (!src.isAllPowerLoss())); /obj/machinery/door/airlock/proc/arePowerSystemsOn() - if (stat & NOPOWER) + if (stat & (NOPOWER|BROKEN)) return 0 return (src.secondsMainPowerLost==0 || src.secondsBackupPowerLost==0) @@ -473,7 +473,8 @@ About the new airlock wires panel: if("spark") flick("door_spark", src) if("deny") - flick("door_deny", src) + if(density && src.arePowerSystemsOn()) + flick("door_deny", src) return /obj/machinery/door/airlock/attack_ai(mob/user as mob) @@ -1028,19 +1029,19 @@ About the new airlock wires panel: if(density) if(beingcrowbarred == 0) //being fireaxe'd var/obj/item/weapon/twohanded/fireaxe/F = C - if(F:wielded) + if(F.wielded) spawn(0) open(1) else - user << "\red You need to be wielding the Fire axe to do that." + user << "\red You need to be wielding \the [C] to do that." else spawn(0) open(1) else if(beingcrowbarred == 0) var/obj/item/weapon/twohanded/fireaxe/F = C - if(F:wielded) + if(F.wielded) spawn(0) close(1) else - user << "\red You need to be wielding the Fire axe to do that." + user << "\red You need to be wielding \the [C] to do that." else spawn(0) close(1) else diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm index 498d7449a36..ad9d9910365 100644 --- a/code/game/machinery/doors/airlock_control.dm +++ b/code/game/machinery/doors/airlock_control.dm @@ -8,11 +8,6 @@ obj/machinery/door/airlock var/datum/radio_frequency/radio_connection var/cur_command = null //the command the door is currently attempting to complete -obj/machinery/door/airlock/proc/can_radio() - if(!arePowerSystemsOn()) - return 0 - return 1 - obj/machinery/door/airlock/process() ..() if (arePowerSystemsOn()) @@ -21,14 +16,13 @@ obj/machinery/door/airlock/process() obj/machinery/door/airlock/receive_signal(datum/signal/signal) if (!arePowerSystemsOn()) return //no power - if (!can_radio()) return //no radio - if(!signal || signal.encryption) return if(id_tag != signal.data["tag"] || !signal.data["command"]) return cur_command = signal.data["command"] - execute_current_command() + spawn() + execute_current_command() obj/machinery/door/airlock/proc/execute_current_command() if(operating) @@ -94,7 +88,7 @@ obj/machinery/door/airlock/proc/command_completed(var/command) return 1 //Unknown command. Just assume it's completed. -obj/machinery/door/airlock/proc/send_status() +obj/machinery/door/airlock/proc/send_status(var/bumped = 0) if(radio_connection) var/datum/signal/signal = new signal.transmission_method = 1 //radio signal @@ -103,6 +97,9 @@ obj/machinery/door/airlock/proc/send_status() signal.data["door_status"] = density?("closed"):("open") signal.data["lock_status"] = locked?("locked"):("unlocked") + + if (bumped) + signal.data["bumped_with_access"] = 1 radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK) @@ -122,17 +119,7 @@ obj/machinery/door/airlock/Bumped(atom/AM) if(istype(AM, /obj/mecha)) var/obj/mecha/mecha = AM if(density && radio_connection && mecha.occupant && (src.allowed(mecha.occupant) || src.check_access_list(mecha.operation_req_access))) - var/datum/signal/signal = new - signal.transmission_method = 1 //radio signal - signal.data["tag"] = id_tag - signal.data["timestamp"] = world.time - - signal.data["door_status"] = density?("closed"):("open") - signal.data["lock_status"] = locked?("locked"):("unlocked") - - signal.data["bumped_with_access"] = 1 - - radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK) + send_status(1) return obj/machinery/door/airlock/proc/set_frequency(new_frequency) @@ -258,6 +245,12 @@ obj/machinery/access_button/update_icon() else icon_state = "access_button_off" +obj/machinery/access_button/attackby(obj/item/I as obj, mob/user as mob) + //Swiping ID on the access button + if (istype(I, /obj/item/weapon/card/id) || istype(I, /obj/item/device/pda)) + attack_hand(user) + return + ..() obj/machinery/access_button/attack_hand(mob/user) add_fingerprint(usr) @@ -296,4 +289,4 @@ obj/machinery/access_button/airlock_interior obj/machinery/access_button/airlock_exterior frequency = 1379 - command = "cycle_exterior" + command = "cycle_exterior" \ No newline at end of file diff --git a/code/game/machinery/embedded_controller/airlock_program.dm b/code/game/machinery/embedded_controller/airlock_program.dm index 90a2ca57206..24c49f9fa55 100644 --- a/code/game/machinery/embedded_controller/airlock_program.dm +++ b/code/game/machinery/embedded_controller/airlock_program.dm @@ -265,7 +265,7 @@ var/datum/signal/signal = new signal.data["tag"] = tag signal.data["command"] = command - post_signal(signal) + post_signal(signal, RADIO_AIRLOCK) /datum/computer/file/embedded_program/airlock/proc/signalPump(var/tag, var/power, var/direction, var/pressure) var/datum/signal/signal = new diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm index a9a8b40ed58..ec411753803 100644 --- a/code/game/machinery/embedded_controller/embedded_controller_base.dm +++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm @@ -3,6 +3,9 @@ name = "Embedded Controller" anchored = 1 + + use_power = 1 + idle_power_usage = 10 var/on = 1 @@ -43,8 +46,10 @@ density = 0 var/id_tag + //var/radio_power_use = 50 //power used to xmit signals var/frequency = 1379 + var/radio_filter = null var/datum/radio_frequency/radio_connection unacidable = 1 @@ -60,14 +65,15 @@ else icon_state = "airlock_control_off" -/obj/machinery/embedded_controller/radio/post_signal(datum/signal/signal) +/obj/machinery/embedded_controller/radio/post_signal(datum/signal/signal, var/filter = null) signal.transmission_method = TRANSMISSION_RADIO if(radio_connection) - return radio_connection.post_signal(src, signal) + //use_power(radio_power_use) //neat idea, but causes way too much lag. + return radio_connection.post_signal(src, signal, filter) else del(signal) /obj/machinery/embedded_controller/radio/proc/set_frequency(new_frequency) radio_controller.remove_object(src, frequency) frequency = new_frequency - radio_connection = radio_controller.add_object(src, frequency) \ No newline at end of file + radio_connection = radio_controller.add_object(src, frequency, radio_filter) \ No newline at end of file diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 265145b4a04..a04ed3f2053 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -81,13 +81,20 @@ var/const/HOLOPAD_MODE = 0 /*This is the proc for special two-way communication between AI and holopad/people talking near holopad. For the other part of the code, check silicon say.dm. Particularly robot talk.*/ -/obj/machinery/hologram/holopad/hear_talk(mob/living/M, text, verb) +/obj/machinery/hologram/holopad/hear_talk(mob/living/M, text, verb, datum/language/speaking) if(M&&hologram&&master)//Master is mostly a safety in case lag hits or something. - if(!master.say_understands(M))//The AI will be able to understand most mobs talking through the holopad. - text = stars(text) + if(!master.say_understands(M, speaking))//The AI will be able to understand most mobs talking through the holopad. + if(speaking) + text = speaking.scramble(text) + else + text = stars(text) var/name_used = M.GetVoice() //This communication is imperfect because the holopad "filters" voices and is only designed to connect to the master only. - var/rendered = "Holopad received, [name_used] [verb], \"[text]\"" + var/rendered + if(speaking) + rendered = "Holopad received, [name_used] [speaking.format_message(text, verb)]" + else + rendered = "Holopad received, [name_used] [verb], \"[text]\"" master.show_message(rendered, 2) return diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index a2dd432d991..8569ede3fd7 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -323,7 +323,7 @@ if(speed <= 0) speed = 1 if("setpath") - var/newpath = copytext(sanitize(input(usr, "Please define a new path!",,path) as text|null),1,MAX_MESSAGE_LEN) + var/newpath = sanitize(copytext(input(usr, "Please define a new path!",,path) as text|null,1,MAX_MESSAGE_LEN)) if(newpath && newpath != "") moving = 0 // stop moving path = newpath diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 59bf0f2ea17..414c6c365b1 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -193,7 +193,7 @@ Transponder Codes: