mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-24 13:47:33 +01:00
Merge branch 'master' of https://github.com/Yawn-Wider/YWPolarisVore into May2020UpstreamPull2-2
This commit is contained in:
@@ -172,13 +172,10 @@
|
||||
return id_card
|
||||
|
||||
/obj/item/device/electronic_assembly/examine(mob/user)
|
||||
. = ..(user, 1)
|
||||
if(.)
|
||||
. = ..()
|
||||
if(Adjacent(user))
|
||||
for(var/obj/item/integrated_circuit/IC in contents)
|
||||
IC.external_examine(user)
|
||||
// for(var/obj/item/integrated_circuit/output/screen/S in contents)
|
||||
// if(S.stuff_to_display)
|
||||
// to_chat(user, "There's a little screen labeled '[S.name]', which displays '[S.stuff_to_display]'.")
|
||||
. += IC.external_examine(user)
|
||||
if(opened)
|
||||
interact(user)
|
||||
|
||||
@@ -352,14 +349,6 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/device/electronic_assembly/on_loc_moved(oldloc)
|
||||
for(var/obj/O in contents)
|
||||
O.on_loc_moved(oldloc)
|
||||
|
||||
/obj/item/device/electronic_assembly/Moved(var/oldloc)
|
||||
for(var/obj/O in contents)
|
||||
O.on_loc_moved(oldloc)
|
||||
|
||||
/obj/item/device/electronic_assembly/proc/on_anchored()
|
||||
for(var/obj/item/integrated_circuit/IC in contents)
|
||||
IC.on_anchored()
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
..()
|
||||
|
||||
/obj/item/clothing/examine(mob/user)
|
||||
. = ..()
|
||||
if(IC)
|
||||
IC.examine(user)
|
||||
..()
|
||||
. += IC.examine(user)
|
||||
|
||||
/obj/item/clothing/CtrlShiftClick(mob/user)
|
||||
var/turf/T = get_turf(src)
|
||||
@@ -67,18 +67,6 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/clothing/Moved(oldloc)
|
||||
if(IC)
|
||||
IC.on_loc_moved(oldloc)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/clothing/on_loc_moved(oldloc)
|
||||
if(IC)
|
||||
IC.on_loc_moved(oldloc)
|
||||
else
|
||||
..()
|
||||
|
||||
// Does most of the repeatative setup.
|
||||
/obj/item/clothing/proc/setup_integrated_circuit(new_type)
|
||||
// Set up the internal circuit holder.
|
||||
|
||||
@@ -46,10 +46,10 @@
|
||||
return
|
||||
|
||||
/obj/item/device/assembly/electronic_assembly/examine(mob/user)
|
||||
.=..(user, 1)
|
||||
. = ..()
|
||||
if(EA)
|
||||
for(var/obj/item/integrated_circuit/IC in EA.contents)
|
||||
IC.external_examine(user)
|
||||
. += IC.external_examine(user)
|
||||
|
||||
/obj/item/device/assembly/electronic_assembly/verb/toggle()
|
||||
set src in usr
|
||||
|
||||
@@ -4,28 +4,29 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
*/
|
||||
|
||||
/obj/item/integrated_circuit/examine(mob/user)
|
||||
interact(user)
|
||||
external_examine(user)
|
||||
. = ..()
|
||||
. += external_examine(user)
|
||||
interact(user)
|
||||
|
||||
// This should be used when someone is examining while the case is opened.
|
||||
/obj/item/integrated_circuit/proc/internal_examine(mob/user)
|
||||
to_chat(user, "This board has [inputs.len] input pin\s, [outputs.len] output pin\s and [activators.len] activation pin\s.")
|
||||
. = list()
|
||||
. += "This board has [inputs.len] input pin\s, [outputs.len] output pin\s and [activators.len] activation pin\s."
|
||||
for(var/datum/integrated_io/I in inputs)
|
||||
if(I.linked.len)
|
||||
to_chat(user, "The '[I]' is connected to [I.get_linked_to_desc()].")
|
||||
. += "The '[I]' is connected to [I.get_linked_to_desc()]."
|
||||
for(var/datum/integrated_io/O in outputs)
|
||||
if(O.linked.len)
|
||||
to_chat(user, "The '[O]' is connected to [O.get_linked_to_desc()].")
|
||||
. += "The '[O]' is connected to [O.get_linked_to_desc()]."
|
||||
for(var/datum/integrated_io/activate/A in activators)
|
||||
if(A.linked.len)
|
||||
to_chat(user, "The '[A]' is connected to [A.get_linked_to_desc()].")
|
||||
any_examine(user)
|
||||
. += "The '[A]' is connected to [A.get_linked_to_desc()]."
|
||||
. += any_examine(user)
|
||||
interact(user)
|
||||
|
||||
// This should be used when someone is examining from an 'outside' perspective, e.g. reading a screen or LED.
|
||||
/obj/item/integrated_circuit/proc/external_examine(mob/user)
|
||||
any_examine(user)
|
||||
return any_examine(user)
|
||||
|
||||
/obj/item/integrated_circuit/proc/any_examine(mob/user)
|
||||
return
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
var/area/A = get_area(src)
|
||||
if(A)
|
||||
if(A.powered(EQUIP) && assembly.give_power(power_amount))
|
||||
A.use_power(power_amount, EQUIP)
|
||||
A.use_power_oneoff(power_amount, EQUIP)
|
||||
// give_power() handles CELLRATE on its own.
|
||||
|
||||
// Interacts with the powernet.
|
||||
|
||||
@@ -527,13 +527,15 @@
|
||||
listening_objects -= src
|
||||
return ..()
|
||||
|
||||
/obj/item/integrated_circuit/input/microphone/hear_talk(mob/living/M, msg, var/verb="says", datum/language/speaking=null)
|
||||
/obj/item/integrated_circuit/input/microphone/hear_talk(mob/M, list/message_pieces, verb)
|
||||
var/msg = multilingual_to_message(message_pieces, requires_machine_understands = TRUE)
|
||||
|
||||
var/translated = FALSE
|
||||
if(M && msg)
|
||||
if(speaking)
|
||||
if(!speaking.machine_understands)
|
||||
msg = speaking.scramble(msg)
|
||||
if(!istype(speaking, /datum/language/common))
|
||||
for(var/datum/multilingual_say_piece/S in message_pieces)
|
||||
// S.speaking && here is not redundant, it's preventing `S.speaking = null` from flagging
|
||||
// as a translation, when it is not.
|
||||
if(S.speaking && !istype(S.speaking, /datum/language/common))
|
||||
translated = TRUE
|
||||
set_pin_data(IC_OUTPUT, 1, M.GetVoice())
|
||||
set_pin_data(IC_OUTPUT, 2, msg)
|
||||
@@ -577,25 +579,41 @@
|
||||
var/datum/language/newlang = GLOB.all_languages[lang]
|
||||
my_langs |= newlang
|
||||
|
||||
/obj/item/integrated_circuit/input/microphone/sign/hear_talk(mob/living/M, msg, var/verb="says", datum/language/speaking=null)
|
||||
/obj/item/integrated_circuit/input/microphone/sign/hear_talk(mob/M, list/message_pieces, verb)
|
||||
var/msg = multilingual_to_message(message_pieces)
|
||||
|
||||
var/translated = FALSE
|
||||
if(M && msg)
|
||||
if(speaking)
|
||||
if(!((speaking.flags & NONVERBAL) || (speaking.flags & SIGNLANG)))
|
||||
translated = TRUE
|
||||
msg = speaking.scramble(msg, my_langs)
|
||||
for(var/datum/multilingual_say_piece/S in message_pieces)
|
||||
if(S.speaking)
|
||||
if(!((S.speaking.flags & NONVERBAL) || (S.speaking.flags & SIGNLANG)))
|
||||
translated = TRUE
|
||||
msg = stars(msg)
|
||||
break
|
||||
set_pin_data(IC_OUTPUT, 1, M.GetVoice())
|
||||
set_pin_data(IC_OUTPUT, 2, msg)
|
||||
|
||||
push_data()
|
||||
if(!translated)
|
||||
activate_pin(1)
|
||||
if(translated)
|
||||
else
|
||||
activate_pin(2)
|
||||
|
||||
/obj/item/integrated_circuit/input/microphone/sign/hear_signlang(text, verb, datum/language/speaking, mob/M as mob)
|
||||
hear_talk(M, text, verb, speaking)
|
||||
return
|
||||
var/translated = FALSE
|
||||
if(M && text)
|
||||
if(speaking)
|
||||
if(!((speaking.flags & NONVERBAL) || (speaking.flags & SIGNLANG)))
|
||||
translated = TRUE
|
||||
text = speaking.scramble(text, my_langs)
|
||||
set_pin_data(IC_OUTPUT, 1, M.GetVoice())
|
||||
set_pin_data(IC_OUTPUT, 2, text)
|
||||
|
||||
push_data()
|
||||
if(!translated)
|
||||
activate_pin(1)
|
||||
else
|
||||
activate_pin(2)
|
||||
|
||||
/obj/item/integrated_circuit/input/sensor
|
||||
name = "sensor"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
..()
|
||||
|
||||
/obj/item/integrated_circuit/memory/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
var/i
|
||||
for(i = 1, i <= outputs.len, i++)
|
||||
var/datum/integrated_io/O = outputs[i]
|
||||
@@ -30,7 +30,7 @@
|
||||
data = "[d]"
|
||||
else if(!isnull(O.data))
|
||||
data = O.data
|
||||
to_chat(user, "\The [src] has [data] saved to address [i].")
|
||||
. += "\The [src] has [data] saved to address [i]."
|
||||
|
||||
/obj/item/integrated_circuit/memory/do_work()
|
||||
for(var/i = 1 to inputs.len)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
stuff_to_display = null
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/any_examine(mob/user)
|
||||
to_chat(user, "There is a little screen labeled '[name]', which displays [!isnull(stuff_to_display) ? "'[stuff_to_display]'" : "nothing"].")
|
||||
return "There is a little screen labeled '[name]', which displays [!isnull(stuff_to_display) ? "'[stuff_to_display]'" : "nothing"]."
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/do_work()
|
||||
var/datum/integrated_io/I = inputs[1]
|
||||
@@ -152,6 +152,7 @@
|
||||
/obj/item/integrated_circuit/output/text_to_speech/advanced/Initialize()
|
||||
..()
|
||||
my_voice = new (src)
|
||||
mob_list -= my_voice // no life() ticks
|
||||
my_voice.name = "TTS Circuit"
|
||||
|
||||
/obj/item/integrated_circuit/output/text_to_speech/advanced/do_work()
|
||||
@@ -333,7 +334,7 @@
|
||||
else
|
||||
text_output += "\an ["\improper[initial_name]"] labeled '[name]'"
|
||||
text_output += " which is currently [get_pin_data(IC_INPUT, 1) ? "lit <font color=[led_color]>¤</font>" : "unlit."]"
|
||||
to_chat(user,jointext(text_output,null))
|
||||
return jointext(text_output,null)
|
||||
|
||||
/obj/item/integrated_circuit/output/led/red
|
||||
name = "red LED"
|
||||
@@ -413,8 +414,13 @@
|
||||
// var/datum/beam/holo_beam = null // A visual effect, to make it easy to know where a hologram is coming from.
|
||||
// It is commented out due to picking up the assembly killing the beam.
|
||||
|
||||
/obj/item/integrated_circuit/output/holographic_projector/Initialize()
|
||||
. = ..()
|
||||
GLOB.moved_event.register(src, src, .proc/on_moved)
|
||||
|
||||
/obj/item/integrated_circuit/output/holographic_projector/Destroy()
|
||||
destroy_hologram()
|
||||
GLOB.moved_event.unregister(src, src, .proc/on_moved)
|
||||
return ..()
|
||||
|
||||
/obj/item/integrated_circuit/output/holographic_projector/do_work()
|
||||
@@ -505,7 +511,7 @@
|
||||
if(hologram)
|
||||
update_hologram()
|
||||
|
||||
/obj/item/integrated_circuit/output/holographic_projector/on_loc_moved(atom/oldloc)
|
||||
/obj/item/integrated_circuit/output/holographic_projector/proc/on_moved()
|
||||
if(hologram)
|
||||
update_hologram_position()
|
||||
|
||||
|
||||
@@ -86,10 +86,10 @@
|
||||
power_draw_per_use = 4
|
||||
|
||||
/obj/item/integrated_circuit/time/clock/do_work()
|
||||
set_pin_data(IC_OUTPUT, 1, time2text(station_time_in_ticks, "hh:mm:ss") )
|
||||
set_pin_data(IC_OUTPUT, 2, text2num(time2text(station_time_in_ticks, "hh") ) )
|
||||
set_pin_data(IC_OUTPUT, 3, text2num(time2text(station_time_in_ticks, "mm") ) )
|
||||
set_pin_data(IC_OUTPUT, 4, text2num(time2text(station_time_in_ticks, "ss") ) )
|
||||
set_pin_data(IC_OUTPUT, 1, time2text(station_time_in_ds, "hh:mm:ss") )
|
||||
set_pin_data(IC_OUTPUT, 2, text2num(time2text(station_time_in_ds, "hh") ) )
|
||||
set_pin_data(IC_OUTPUT, 3, text2num(time2text(station_time_in_ds, "mm") ) )
|
||||
set_pin_data(IC_OUTPUT, 4, text2num(time2text(station_time_in_ds, "ss") ) )
|
||||
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
|
||||
Reference in New Issue
Block a user