forked from Baystation12/Baystation12
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Порт фич для интегральных плат с Инфинити (#2655)
Co-authored-by: Builder13 <[email protected]> Co-authored-by: UEDCommander <[email protected]>
- Loading branch information
1 parent
aa66448
commit 8d963c2
Showing
9 changed files
with
515 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
|
||
#### Список PRов: | ||
|
||
- https://github.com/SierraBay/SierraBay12/pull/2655 | ||
<!-- | ||
Ссылки на PRы, связанные с модом: | ||
- Создание | ||
- Большие изменения | ||
--> | ||
|
||
<!-- Название мода. Не важно на русском или на английском. --> | ||
## Integrated circuits | ||
|
||
ID мода: INTEGRATED_CIRCUITS | ||
<!-- | ||
Название модпака прописными буквами, СОЕДИНЁННЫМИ_ПОДЧЁРКИВАНИЕМ, | ||
которое ты будешь использовать для обозначения файлов. | ||
--> | ||
|
||
### Описание мода | ||
|
||
Добавляет несколько новых плат, вносит дополнительный функционал в плату контроля ИИ, упрощает вставку и доставание предметов из интегральных плат для расширения функционала и удобства. | ||
<!-- | ||
Что он делает, что добавляет: что, куда, зачем и почему - всё здесь. | ||
А также любая полезная информация. | ||
--> | ||
|
||
### Изменения *кор кода* | ||
|
||
- Отсутствуют | ||
<!-- | ||
Если вы редактировали какие-либо процедуры или переменные в кор коде, | ||
они должны быть указаны здесь. | ||
Нужно указать и файл, и процедуры/переменные. | ||
Изменений нет - напиши "Отсутствуют" | ||
--> | ||
|
||
### Оверрайды | ||
|
||
- Отсутствуют | ||
<!-- | ||
Если ты добавлял новый модульный оверрайд, его нужно указать здесь. | ||
Здесь указываются оверрайды в твоём моде и папке `_master_files` | ||
Изменений нет - напиши "Отсутствуют" | ||
--> | ||
|
||
### Дефайны | ||
|
||
- Отсутствуют | ||
<!-- | ||
Если требовалось добавить какие-либо дефайны, укажи файлы, | ||
в которые ты их добавил, а также перечисли имена. | ||
И то же самое, если ты используешь дефайны, определённые другим модом. | ||
Не используешь - напиши "Отсутствуют" | ||
--> | ||
|
||
### Используемые файлы, не содержащиеся в модпаке | ||
|
||
- Отсутствуют | ||
<!-- | ||
Будь то немодульный файл или модульный файл, который не содержится в папке, | ||
принадлежащей этому конкретному моду, он должен быть упомянут здесь. | ||
Хорошими примерами являются иконки или звуки, которые используются одновременно | ||
несколькими модулями, или что-либо подобное. | ||
--> | ||
|
||
### Авторы: | ||
|
||
Builder13 | ||
<!-- | ||
Здесь находится твой никнейм | ||
Если работал совместно - никнеймы тех, кто помогал. | ||
В случае порта чего-либо должна быть ссылка на источник. | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/singleton/modpack/integrated_circuits | ||
name = "Integrated circuits" | ||
desc = "Изменения, связанные с интегральными платами." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef MODPACK_INTCIRCUITS | ||
#define MODPACK_INTCIRCUITS | ||
|
||
#include "_integrated_circuits.dm" | ||
#include "code/assemblies.dm" | ||
#include "code/integrated_circuit.dm" | ||
#include "code/pai.dm" | ||
#include "code/input.dm" | ||
#include "code/manipulation.dm" | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/obj/item/device/electronic_assembly | ||
var/magnetized = 0 | ||
|
||
/obj/item/device/electronic_assembly/attack_hand(mob/user) | ||
if(magnetized && istype(src.loc, /turf/simulated/floor)) | ||
attack_self(user) | ||
return | ||
..() | ||
|
||
/obj/item/device/electronic_assembly/proc/loading(obj/item/I, mob/living/user) | ||
var/list/icomponents = list() | ||
var/list/ircomponents = list() | ||
if(istype(I, /obj/item/gun/energy)) | ||
for (var/obj/item/integrated_circuit/manipulation/weapon_firing/P in assembly_components) | ||
if(!P.installed_gun) | ||
icomponents+=P.displayed_name | ||
ircomponents+=P | ||
else if(istype(I, /obj/item/grenade)) | ||
for (var/obj/item/integrated_circuit/manipulation/grenade/P in assembly_components) | ||
if(!P.attached_grenade) | ||
icomponents+=P.displayed_name | ||
ircomponents+=P | ||
else | ||
var/obj/item/card = I | ||
var/mob/living/L = locate(/mob/living) in card.contents | ||
if(L && L.key) | ||
for (var/obj/item/integrated_circuit/manipulation/ai/P in assembly_components) | ||
if(!P.controlling) | ||
icomponents+=P.displayed_name | ||
ircomponents+=P | ||
var/component_choice = input("Please choose a component to insert the [I].","[src]") as null|anything in icomponents | ||
if(component_choice) | ||
var/obj/item/integrated_circuit/circuit = ircomponents[icomponents.Find(component_choice)] | ||
if(in_range(user, circuit) && get_dist(I, user) < 1) | ||
circuit.use_tool(I, user) | ||
|
||
/obj/item/device/electronic_assembly/use_tool(obj/item/I, mob/user, list/click_params) | ||
if(is_type_in_list(I, list(/obj/item/gun/energy, /obj/item/grenade, /obj/item/aicard, /obj/item/device/paicard, /obj/item/device/mmi, /obj/item/organ/internal/posibrain)) && opened) | ||
loading(I,user) | ||
return TRUE | ||
..() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
/obj/item/integrated_circuit/input/examiner | ||
outputs = list( | ||
"name" = IC_PINTYPE_STRING, | ||
"description" = IC_PINTYPE_STRING, | ||
"X" = IC_PINTYPE_NUMBER, | ||
"Y" = IC_PINTYPE_NUMBER, | ||
"distance" = IC_PINTYPE_NUMBER, | ||
"max reagents" = IC_PINTYPE_NUMBER, | ||
"amount of reagents" = IC_PINTYPE_NUMBER, | ||
"density" = IC_PINTYPE_BOOLEAN, | ||
"opacity" = IC_PINTYPE_BOOLEAN, | ||
"occupied turf" = IC_PINTYPE_REF, | ||
"object direction" = IC_PINTYPE_DIR | ||
) | ||
|
||
/obj/item/integrated_circuit/input/examiner/do_work() | ||
var/atom/H = get_pin_data_as_type(IC_INPUT, 1, /atom) | ||
var/turf/T = get_turf(src) | ||
|
||
if(!istype(H) || !(H in view(T))) | ||
activate_pin(3) | ||
else | ||
set_pin_data(IC_OUTPUT, 1, H.name) | ||
set_pin_data(IC_OUTPUT, 2, H.desc) | ||
set_pin_data(IC_OUTPUT, 3, H.x-T.x) | ||
set_pin_data(IC_OUTPUT, 4, H.y-T.y) | ||
set_pin_data(IC_OUTPUT, 5, sqrt((H.x-T.x)*(H.x-T.x)+ (H.y-T.y)*(H.y-T.y))) | ||
var/mr = 0 | ||
var/tr = 0 | ||
if(H.reagents) | ||
mr = H.reagents.maximum_volume | ||
tr = H.reagents.total_volume | ||
set_pin_data(IC_OUTPUT, 6, mr) | ||
set_pin_data(IC_OUTPUT, 7, tr) | ||
set_pin_data(IC_OUTPUT, 8, H.density) | ||
set_pin_data(IC_OUTPUT, 9, H.opacity) | ||
set_pin_data(IC_OUTPUT, 10, get_turf(H)) | ||
set_pin_data(IC_OUTPUT, 11, H.dir) | ||
push_data() | ||
activate_pin(2) | ||
|
||
/obj/item/integrated_circuit/input/list_pick | ||
name = "list pick" | ||
desc = "A touch screen with all the data you need to pick." | ||
icon_state = "screen" | ||
complexity = 3 | ||
inputs = list("List" = IC_PINTYPE_LIST) | ||
outputs = list("Picked element" = IC_PINTYPE_ANY) | ||
activators = list("on pressed" = IC_PINTYPE_PULSE_OUT, "on picked" = IC_PINTYPE_PULSE_OUT) | ||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH | ||
power_draw_per_use = 5 | ||
|
||
/obj/item/integrated_circuit/input/list_pick/get_topic_data(mob/user) | ||
return list("Press" = "list_pick=1") | ||
|
||
/obj/item/integrated_circuit/input/list_pick/OnICTopic(href_list, user) | ||
if(href_list["list_pick"]) | ||
activate_pin(1) | ||
var/list/input_list = get_pin_data(IC_INPUT, 1) | ||
if(length(input_list)) | ||
var/pick_element = input("Choose an element.") as null|anything in input_list | ||
if(pick_element) | ||
if(get_dist(src, user) <= 1) | ||
set_pin_data(IC_OUTPUT, 1, pick_element) | ||
push_data() | ||
activate_pin(2) | ||
else | ||
to_chat(user, "<span class='notice'>You are not close enough for that!</span>") | ||
else | ||
to_chat(user, "<span class='notice'>There is no list to pick from!</span>") | ||
return IC_TOPIC_REFRESH | ||
|
||
/obj/item/integrated_circuit/input/image_comparse | ||
name = "image comparsion scanner" | ||
desc = "A circuit with miniature camera attached to it." | ||
extended_desc = "On pulsing 'store' activator, circuit would remember the selected target, \ | ||
on 'check' it will compare stored object with the selected target, trying to include into comparsion every detail on them.\ | ||
When both objects are almost completely identical, both outputs will be ones. \ | ||
(matching form - type check, match of details - icon_state check)." | ||
icon_state = "video_camera" | ||
complexity = 5 | ||
inputs = list( | ||
"target" = IC_PINTYPE_REF | ||
) | ||
outputs = list( | ||
"stored object" = IC_PINTYPE_STRING, | ||
"matching form" = IC_PINTYPE_BOOLEAN, | ||
"match of details" = IC_PINTYPE_BOOLEAN | ||
) | ||
activators = list( | ||
"store" = IC_PINTYPE_PULSE_IN, | ||
"check" = IC_PINTYPE_PULSE_IN, | ||
"on checked" = IC_PINTYPE_PULSE_OUT, | ||
"on failure" = IC_PINTYPE_PULSE_OUT | ||
) | ||
spawn_flags = IC_SPAWN_RESEARCH | ||
power_draw_per_use = 80 | ||
var/obj_type | ||
var/state | ||
|
||
/obj/item/integrated_circuit/input/image_comparse/do_work(ord) | ||
switch(ord) | ||
if(1) | ||
var/atom/object = get_pin_data_as_type(IC_INPUT, 1, /atom) | ||
if(object) | ||
obj_type = object.type | ||
state = object.icon_state | ||
set_pin_data(IC_OUTPUT, 1, object.name) | ||
push_data() | ||
else | ||
var/atom/H = get_pin_data_as_type(IC_INPUT, 1, /atom) | ||
var/turf/T = get_turf(src) | ||
|
||
if(!istype(H) || !(H in view(T))) | ||
activate_pin(4) | ||
else | ||
if(!H || !obj_type) | ||
return | ||
|
||
if(H.type == obj_type) | ||
set_pin_data(IC_OUTPUT, 2, 1) | ||
|
||
if(H.icon_state == state) | ||
set_pin_data(IC_OUTPUT, 3, 1) | ||
else | ||
set_pin_data(IC_OUTPUT, 3, 0) | ||
|
||
else | ||
set_pin_data(IC_OUTPUT, 2, 0) | ||
set_pin_data(IC_OUTPUT, 3, 0) | ||
|
||
push_data() | ||
activate_pin(3) |
Oops, something went wrong.