mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Merge pull request #1992 from yogstation13/upstream-merge-39223
[MIRROR] Turning circuits literate
This commit is contained in:
29
code/modules/integrated_electronics/subtypes/text.dm
Normal file
29
code/modules/integrated_electronics/subtypes/text.dm
Normal file
@@ -0,0 +1,29 @@
|
||||
/obj/item/integrated_circuit/text
|
||||
name = "text thingy"
|
||||
desc = "Does text-processing related things."
|
||||
category_text = "Text"
|
||||
complexity = 1
|
||||
|
||||
// - Text Replacer - //
|
||||
/obj/item/integrated_circuit/text/text_replacer
|
||||
name = "find-replace circuit"
|
||||
desc = "Replaces all of one bit of text with another"
|
||||
extended_desc = "Takes a string(haystack) and puts out the string while having a certain word(needle) replaced with another."
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
inputs = list(
|
||||
"haystack" = IC_PINTYPE_STRING,
|
||||
"needle" = IC_PINTYPE_STRING,
|
||||
"replacement" = IC_PINTYPE_STRING
|
||||
)
|
||||
activators = list(
|
||||
"replace" = IC_PINTYPE_PULSE_IN,
|
||||
"on replaced" = IC_PINTYPE_PULSE_OUT
|
||||
)
|
||||
outputs = list(
|
||||
"replaced string" = IC_PINTYPE_STRING
|
||||
)
|
||||
|
||||
/obj/item/integrated_circuit/text/text_replacer/do_work()
|
||||
set_pin_data(IC_OUTPUT, 1,replacetext(get_pin_data(IC_INPUT, 1), get_pin_data(IC_INPUT, 2), get_pin_data(IC_INPUT, 3)))
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
Reference in New Issue
Block a user