diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index 03fe0d53b2..280c4aaf59 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -121,12 +121,10 @@ Topic("aiDisable=4", list("aiDisable"="4"), 1) /obj/machinery/power/apc/AICtrlClick() // turns off/on APCs. - Topic("breaker=1", list("breaker"="1"), 1) // 0 meaning window (consistency! wait...) + Topic("breaker=1", list("breaker"="1"), 1) // 1 meaning no window (consistency!) /obj/machinery/turretid/AICtrlClick() //turns off/on Turrets - if(!ailock) - src.enabled = !src.enabled - src.updateTurrets() + Topic("toggleOn", list("toggleOn"="1", 1)) // 1 meaning no window (consistency!) /atom/proc/AIAltClick(var/atom/A) AltClick(A) @@ -141,9 +139,7 @@ return /obj/machinery/turretid/AIAltClick() //toggles lethal on turrets - if(!ailock) - src.lethal = !src.lethal - src.updateTurrets() + Topic("toggleLethal", list("toggleLethal"="1", 1)) // 1 meaning no window (consistency!) /atom/proc/AIMiddleClick() return diff --git a/code/datums/wires/apc.dm b/code/datums/wires/apc.dm index 7e48809af9..2b8d853350 100644 --- a/code/datums/wires/apc.dm +++ b/code/datums/wires/apc.dm @@ -2,10 +2,10 @@ holder_type = /obj/machinery/power/apc wire_count = 4 -var/const/APC_WIRE_IDSCAN = 1 -var/const/APC_WIRE_MAIN_POWER1 = 2 -var/const/APC_WIRE_MAIN_POWER2 = 4 -var/const/APC_WIRE_AI_CONTROL = 8 +#define APC_WIRE_IDSCAN 1 +#define APC_WIRE_MAIN_POWER1 2 +#define APC_WIRE_MAIN_POWER2 4 +#define APC_WIRE_AI_CONTROL 8 /datum/wires/apc/GetInteractWindow() var/obj/machinery/power/apc/A = holder diff --git a/code/defines/procs/radio.dm b/code/defines/procs/radio.dm index 0846502ede..62c8170489 100644 --- a/code/defines/procs/radio.dm +++ b/code/defines/procs/radio.dm @@ -55,7 +55,6 @@ var/datum/reception/reception = new // check if telecomms I/O route 1459 is stable - //var/telecomms_intact = telecomms_process(P.owner, owner, t) reception.message_server = get_message_server() var/datum/signal/signal = sender.telecomms_process() // Be aware that this proc calls sleep, to simulate transmition delays diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index f542ff6994..acfa9c2328 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1032,8 +1032,8 @@ About the new airlock wires panel: else if(src.locked) usr << "The door bolts are already dropped." else - src.lock() - usr << "The door bolts have been dropped." + if(src.lock()) + usr << "The door bolts have been dropped." if(5) //un-electrify door if(src.isWireCut(AIRLOCK_WIRE_ELECTRIFY)) @@ -1372,12 +1372,13 @@ About the new airlock wires panel: return /obj/machinery/door/airlock/proc/lock(var/forced=0) - if (operating || src.locked) return + if (operating || src.locked) return 0 src.locked = 1 for(var/mob/M in range(1,src)) M.show_message("You hear a click from the bottom of the door.", 2) update_icon() + return 1 /obj/machinery/door/airlock/proc/unlock(var/forced=0) if (operating || !src.locked) return diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm index 5bc531e571..e21af65ee7 100644 --- a/code/game/machinery/telecomms/broadcaster.dm +++ b/code/game/machinery/telecomms/broadcaster.dm @@ -452,6 +452,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept for (var/mob/R in heard_gibberish) R.hear_radio(message, verbage, speaking, part_a, part_b, M, 1) + return 1 /proc/Broadcast_SimpleMessage(var/source, var/frequency, var/text, var/data, var/mob/M, var/compression, var/level) diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm index 6c1b6acd11..65e0dab0c9 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -111,9 +111,18 @@ popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) popup.open() -/obj/machinery/turretid/Topic(href, href_list) - if(..()) - return +/obj/machinery/turretid/Topic(href, href_list, var/nowindow = 0) + if(!nowindow && ..()) + return 0 + + if(inoperable()) + return 0 + + if(ailock) + usr << "There seems to be a firewall preventing you from accessing this device." + return 0 + + add_fingerprint(usr) if (src.locked) if (!istype(usr, /mob/living/silicon)) usr << "Control panel is locked!" @@ -124,7 +133,14 @@ else if (href_list["toggleLethal"]) src.lethal = !src.lethal src.updateTurrets() - src.attack_hand(usr) + + if(!nowindow) + updateDialog() + +/obj/machinery/turretid/updateDialog() + if (stat & (BROKEN|MAINT)) + return + ..() /obj/machinery/turretid/proc/updateTurrets() if(control_area) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 0985f87a32..814b304496 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -221,27 +221,27 @@ // If a channel isn't specified, send to common. if(!message_mode || message_mode == "headset") return radio_connection - + // Otherwise, if a channel is specified, look for it. if(channels) if (message_mode == "department") // Department radio shortcut message_mode = channels[1] - + if (channels[message_mode]) // only broadcast if the channel is set on return secure_radio_connections[message_mode] - + // If we were to send to a channel we don't have, drop it. return null /obj/item/device/radio/talk_into(mob/living/M as mob, message, channel, var/verb = "says", var/datum/language/speaking = null) - if(!on) return // the device has to be on + if(!on) return 0 // the device has to be on // Fix for permacell radios, but kinda eh about actually fixing them. - if(!M || !message) return + if(!M || !message) return 0 // Uncommenting this. To the above comment: // The permacell radios aren't suppose to be able to transmit, this isn't a bug and this "fix" is just making radio wires useless. -Giacom if(!(src.wires & WIRE_TRANSMIT)) // The device has to have all its wires and shit intact - return + return 0 M.last_target_click = world.time @@ -259,9 +259,9 @@ //#### Grab the connection datum ####// var/datum/radio_frequency/connection = handle_message_mode(M, message, channel) if (!istype(connection)) - return + return 0 if (!connection) - return + return 0 var/turf/position = get_turf(src) @@ -280,7 +280,8 @@ // --- Human: use their actual job --- if (ishuman(M)) - jobname = M:get_assignment() + var/mob/living/carbon/human/H = M + jobname = H.get_assignment() // --- Carbon Nonhuman --- else if (iscarbon(M)) // Nonhuman carbon mob @@ -363,7 +364,7 @@ R.receive_signal(signal) // Receiving code can be located in Telecommunications.dm - return + return signal.data["done"] && position.z in signal.data["level"] /* ###### Intercoms and station-bounced radios ###### */ @@ -416,15 +417,15 @@ if(signal.data["done"] && position.z in signal.data["level"]) // we're done here. - return + return 1 // Oh my god; the comms are down or something because the signal hasn't been broadcasted yet in our level. // Send a mundane broadcast with limited targets: //THIS IS TEMPORARY. YEAH RIGHT - if(!connection) return //~Carn + if(!connection) return 0 //~Carn - Broadcast_Message(connection, M, voicemask, pick(M.speak_emote), + return Broadcast_Message(connection, M, voicemask, pick(M.speak_emote), src, message, displayname, jobname, real_name, M.voice_name, filter_type, signal.data["compression"], list(position.z), connection.frequency,verb,speaking) @@ -536,7 +537,7 @@ canhear_range = 3 /obj/item/device/radio/borg/talk_into() - ..() + . = ..() if (isrobot(src.loc)) var/mob/living/silicon/robot/R = src.loc var/datum/robot_component/C = R.components["radio"] diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index ba8613dcbb..064dd24089 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -88,8 +88,7 @@ proc/get_radio_key_from_channel(var/channel) src.custom_emote(1, "[pick(speaking.signlang_verb)].") if (speaking.flags & SIGNLANG) - say_signlang(message, pick(speaking.signlang_verb), speaking) - return 1 + return say_signlang(message, pick(speaking.signlang_verb), speaking) //make sure the air can transmit speech var/datum/gas_mixture/environment = T.return_air() @@ -154,6 +153,7 @@ proc/get_radio_key_from_channel(var/channel) /mob/living/proc/say_signlang(var/message, var/verb="gestures", var/datum/language/language) for (var/mob/O in viewers(src, null)) O.hear_signlang(message, verb, language, src) + return 1 /obj/effect/speech_bubble var/mob/parent diff --git a/code/modules/mob/living/silicon/laws.dm b/code/modules/mob/living/silicon/laws.dm index 0094d932d7..212fc14096 100644 --- a/code/modules/mob/living/silicon/laws.dm +++ b/code/modules/mob/living/silicon/laws.dm @@ -39,48 +39,49 @@ else prefix = get_radio_key_from_channel(lawchannel == "Holopad" ? "department" : lawchannel) + " " - if(src.say("[prefix]Current Active Laws:") != 1) - return + var/can_state = statelaw("[prefix]Current Active Laws:") //src.laws_sanity_check() //src.laws.show_laws(world) - var/number = 1 - sleep(10) - - if (src.laws.zeroth) + if (can_state && src.laws.zeroth) if (src.lawcheck[1] == "Yes") //This line and the similar lines below make sure you don't state a law unless you want to. --NeoFite - src.say("[prefix]0. [src.laws.zeroth]") - sleep(10) + can_state = statelaw("[prefix]0. [src.laws.zeroth]") - for (var/index = 1, index <= src.laws.ion.len, index++) + for (var/index = 1, can_state && index <= src.laws.ion.len, index++) var/law = src.laws.ion[index] var/num = ionnum() if (length(law) > 0) if (src.ioncheck[index] == "Yes") - src.say("[prefix][num]. [law]") - sleep(10) + can_state = statelaw("[prefix][num]. [law]") - for (var/index = 1, index <= src.laws.inherent.len, index++) + var/number = 1 + for (var/index = 1, can_state && index <= src.laws.inherent.len, index++) var/law = src.laws.inherent[index] - if (length(law) > 0) if (src.lawcheck[index+1] == "Yes") - src.say("[prefix][number]. [law]") - sleep(10) + can_state = statelaw("[prefix][number]. [law]") number++ - for (var/index = 1, index <= src.laws.supplied.len, index++) + for (var/index = 1, can_state && index <= src.laws.supplied.len, index++) var/law = src.laws.supplied[index] - if (length(law) > 0) if(src.lawcheck.len >= number+1) if (src.lawcheck[number+1] == "Yes") - src.say("[prefix][number]. [law]") - sleep(10) + can_state = statelaw("[prefix][number]. [law]") number++ + if(!can_state) + src << "Unable to state laws. Communication method unavailable." + stating_laws = 0 +/mob/living/silicon/proc/statelaw(var/law) + if(src.say(law)) + sleep(10) + return 1 + + return 0 + /mob/living/silicon/proc/checklaws() //Gives you a link-driven interface for deciding what laws the statelaws() proc will share with the crew. --NeoFite var/list = "Which laws do you want to include when stating them for the crew?

" diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index 170b1503a8..775ae5cd86 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -25,14 +25,14 @@ /mob/living/silicon/say(var/message) if (!message) - return + return 0 if (src.client) if(client.prefs.muted & MUTE_IC) src << "You cannot send IC messages (muted)." - return + return 0 if (src.client.handle_spam_prevention(message,MUTE_IC)) - return + return 0 message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) @@ -56,7 +56,7 @@ //Must be concious to speak if (stat) - return + return 0 var/verb = say_quote(message) @@ -105,13 +105,12 @@ return AI.holopad_talk(message) if(IS_ROBOT) log_say("[key_name(src)] : [message]") - R.radio.talk_into(src,message,message_mode,verb,speaking) + return R.radio.talk_into(src,message,message_mode,verb,speaking) if(IS_PAI) log_say("[key_name(src)] : [message]") - P.radio.talk_into(src,message,message_mode,verb,speaking) - return 1 - - return 1 + return P.radio.talk_into(src,message,message_mode,verb,speaking) + return 0 + if("general") switch(bot_type) if(IS_AI) @@ -120,14 +119,14 @@ return 0 else log_say("[key_name(src)] : [message]") - AI.aiRadio.talk_into(src,message,null,verb,speaking) + return AI.aiRadio.talk_into(src,message,null,verb,speaking) if(IS_ROBOT) log_say("[key_name(src)] : [message]") - R.radio.talk_into(src,message,null,verb,speaking) + return R.radio.talk_into(src,message,null,verb,speaking) if(IS_PAI) log_say("[key_name(src)] : [message]") - P.radio.talk_into(src,message,null,verb,speaking) - return 1 + return P.radio.talk_into(src,message,null,verb,speaking) + return 0 else if(message_mode) @@ -138,14 +137,14 @@ return 0 else log_say("[key_name(src)] : [message]") - AI.aiRadio.talk_into(src,message,message_mode,verb,speaking) + return AI.aiRadio.talk_into(src,message,message_mode,verb,speaking) if(IS_ROBOT) log_say("[key_name(src)] : [message]") - R.radio.talk_into(src,message,message_mode,verb,speaking) + return R.radio.talk_into(src,message,message_mode,verb,speaking) if(IS_PAI) log_say("[key_name(src)] : [message]") - P.radio.talk_into(src,message,message_mode,verb,speaking) - return 1 + return P.radio.talk_into(src,message,message_mode,verb,speaking) + return 0 return ..(message,speaking,verb) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 4814e80fde..65c5dc5edc 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1,8 +1,3 @@ -#define APC_WIRE_IDSCAN 1 -#define APC_WIRE_MAIN_POWER1 2 -#define APC_WIRE_MAIN_POWER2 3 -#define APC_WIRE_AI_CONTROL 4 - //update_state #define UPSTATE_CELL_IN 1 #define UPSTATE_OPENED1 2 @@ -821,6 +816,8 @@ return 0 if(!user.client) return 0 + if(inoperable()) + return 0 if(!user.IsAdvancedToolUser()) user << "You don't have the dexterity to use [src]!" return 0 @@ -859,13 +856,14 @@ return 0 return 1 -/obj/machinery/power/apc/Topic(href, href_list) - if(..()) +/obj/machinery/power/apc/Topic(href, href_list, var/nowindow = 0) + if(!nowindow && ..()) return 0 if(!can_use(usr, 1)) return 0 + add_fingerprint(usr) if (href_list["lock"]) coverlocked = !coverlocked