Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: New keys for departments #705

Merged
merged 23 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bfdb840
ключеки
Kar4es Nov 15, 2023
e58ca33
забыл добавить
Kar4es Nov 15, 2023
ea6668b
коромбочка и другая переменная
Kar4es Nov 15, 2023
5b027b6
добавил коробку к ГП
Kar4es Nov 15, 2023
4dd0e5e
описание ключам
Kar4es Nov 15, 2023
6f82dc6
ключеки
Kar4es Nov 15, 2023
28c6a7f
забыл добавить
Kar4es Nov 15, 2023
522e0e3
коромбочка и другая переменная
Kar4es Nov 15, 2023
f7a1bd8
добавил коробку к ГП
Kar4es Nov 15, 2023
2e8c5e8
описание ключам
Kar4es Nov 15, 2023
ecca187
Merge branch 'vacant-office' of https://github.com/Kar4es/Paradise-SS…
Kar4es Nov 16, 2023
cbcd11e
фиксим штуки исправляем штуки
Kar4es Nov 16, 2023
3831d58
починил доступ у ключика, мало ли
Kar4es Nov 16, 2023
2e646ee
пофиксил THE
Kar4es Nov 17, 2023
c7e2123
убрал вакантный. Эйлонг - ты наше будущее
Kar4es Nov 17, 2023
45922da
ммм
Kar4es Nov 17, 2023
fd8d89e
я хуево знаю русский
Kar4es Nov 17, 2023
96dae2b
лишняя переменная
Kar4es Nov 17, 2023
17dade6
опять поправил доступы...
Kar4es Nov 17, 2023
a4ea149
убрал пробелы
Kar4es Nov 17, 2023
b907504
чиню фон
Kar4es Nov 18, 2023
31d28cf
странные дела
Kar4es Nov 18, 2023
1bf108d
Merge branch 'master' into vacant-office
Kar4es Nov 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions modular_ss220/objects/code/key.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#define ACCESS_VACANT_STORE 401
Kar4es marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/door_remote/key
icon = 'modular_ss220/objects/icons/key.dmi'
icon_state = "key"
/// Ты уже используешь ключ?
var/busy = FALSE
/// Предотвращение спама открытия/закрытия шлюза.
var/cooldown = 0
Kar4es marked this conversation as resolved.
Show resolved Hide resolved
/// Как быстро происходит открытие шлюза.
var/hack_speed = 5 SECONDS
Kar4es marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/door_remote/key/afterattack(obj/machinery/door/airlock/D, mob/user)
if(!istype(D))
Kar4es marked this conversation as resolved.
Show resolved Hide resolved
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved

if(HAS_TRAIT(D, TRAIT_CMAGGED))
to_chat(user, "<span class='danger'>[src] не хочет вставлятся в [D] airlock's access panel, тут повсюду слизь!</span>")
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved

if(D.is_special)
to_chat(user, "<span class='danger'>[src] не может поместится в [D] airlock's access panel!</span>")
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved

if(!D.arePowerSystemsOn())
to_chat(user, "<span class='danger'>The [D] airlock без питания!</span>")
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved

if(busy)
to_chat(user, "<span class='warning'>Ты уже используешь [src] на [D] airlock's access panel!</span>")
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved

playsound(src, 'sound/items/keyring_unlock.ogg', 50)
D.add_fingerprint(user)

busy = TRUE
if(!do_after(user, hack_speed, target = D, progress = 5))
busy = FALSE
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved
busy = FALSE

if(!D.check_access(ID))
to_chat(user, "<span class='danger'>[src] похоже не подходит к [D] airlock's access panel!</span>")
Kar4es marked this conversation as resolved.
Show resolved Hide resolved
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved

if(!D.density)
D.close()
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved
D.open()

/obj/item/door_remote/key/engineer
name = "ключ от инженерного отдела"
icon_state = "eng"
additional_access = list (ACCESS_ENGINE)

/obj/item/door_remote/key/medical
name = "ключ от медицинского отдела"
icon_state = "med"
additional_access = list (ACCESS_MEDICAL)

/obj/item/door_remote/key/supply
name = "ключ от отдела снабжения"
icon_state = "supply"
additional_access = list (ACCESS_CARGO, ACCESS_MINING)

/obj/item/door_remote/key/rnd
name = "ключ от отдела исследований"
icon_state = "rnd"
additional_access = list (ACCESS_RESEARCH)

/obj/item/door_remote/key/sec
name = "ключ от отдела службы безопасности"
icon_state = "sec"
additional_access = list (ACCESS_SECURITY)

/obj/item/door_remote/key/service
name = "ключ от отдела сервиса"
icon_state = "service"
additional_access = list (ACCESS_KITCHEN, ACCESS_BAR, ACCESS_HYDROPONICS, ACCESS_JANITOR)

/obj/item/door_remote/key/command
name = "ключ командования"
icon_state = "com"
additional_access = list(ACCESS_HEADS)

/obj/item/door_remote/key/vacant
name = "Ключ от свободного офиса"
desc = "Выкидной ключ темно-синего цвета."
icon_state = "closed"
/// Ключ готов к использованию?
var/ready = FALSE
additional_access = list (ACCESS_VACANT_STORE)

/obj/item/door_remote/key/vacant/attack_self(mob/user)
if(cooldown > world.time)
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved
if(!ready)
to_chat(user, "<span class='warning'>Ты вытаскиваешь ключ!</span>")
flick("opens", src)
icon_state = "open"
ready = TRUE
cooldown = world.time + 2 SECONDS
else
to_chat(user, "<span class='warning'>Ты складываешь ключ!</span>")
flick("closes", src)
icon_state = "closed"
ready = FALSE
cooldown = world.time + 2 SECONDS

/obj/item/door_remote/key/vacant/afterattack(obj/machinery/door/airlock/D, mob/user)
if(!ready)
to_chat(user, "<span class='danger'>Сперва нужно вытащить ключ!</span>")
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved
. = ..()
Binary file added modular_ss220/objects/icons/key.dmi
Binary file not shown.
Loading