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 16 commits
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
3 changes: 3 additions & 0 deletions _maps/map_files220/delta/delta.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -68202,6 +68202,9 @@
/obj/item/folder/blue,
/obj/item/pen/multi,
/obj/item/lighter/zippo/hop,
/obj/item/storage/box/keys{
pixel_x = -15
},
/turf/simulated/floor/wood/oak,
/area/station/command/office/hop)
"lEt" = (
Expand Down
1 change: 1 addition & 0 deletions modular_ss220/objects/_objects.dme
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
#include "code/posters.dm"
#include "code/tribune.dm"
#include "code/weapons.dm"
#include "code/key.dm"
111 changes: 111 additions & 0 deletions modular_ss220/objects/code/key.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@

/obj/item/door_remote/key
desc = "Обычный немного ржавый ключ."
icon = 'modular_ss220/objects/icons/key.dmi'
icon_state = "key"
/// Are you already using the key?
var/busy = FALSE
/// This prevents spamming the key.
var/cooldown = 0
Kar4es marked this conversation as resolved.
Show resolved Hide resolved
/// How fast does the key open an airlock.
var/hack_speed = 1 SECONDS

/obj/item/door_remote/key/attack_self(mob/user)
return

/obj/item/door_remote/key/afterattack(obj/machinery/door/airlock/attacked_airlock, mob/user, proximity)
if(!proximity)
return

if(!istype(attacked_airlock))
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved

if(HAS_TRAIT(attacked_airlock, TRAIT_CMAGGED))
to_chat(user, span_danger ("[src] не хочет вставлятся в панель доступа [attacked_airlock], тут повсюду слизь!"))
Kar4es marked this conversation as resolved.
Show resolved Hide resolved
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved

if(attacked_airlock.is_special)
to_chat(user, span_danger ("[src] не может поместится в панель доступа [attacked_airlock]!"))
Kar4es marked this conversation as resolved.
Show resolved Hide resolved
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved

if(!attacked_airlock.arePowerSystemsOn())
to_chat(user, span_danger ("[attacked_airlock] без питания!"))
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved

if(busy)
to_chat(user, span_warning ("Ты уже используешь [src] на панели доступа [attacked_airlock]!"))
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved

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

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

if(!attacked_airlock.check_access(ID))
to_chat(user, span_danger ("[src] похоже не подходит к панели доступа [attacked_airlock]!"))
return
Kar4es marked this conversation as resolved.
Show resolved Hide resolved

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

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

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

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

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

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

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

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

/obj/item/storage/box/keys
name = "коробка с ключами"
desc = "Коробка с ключами к отделам. Имеют неполный доступ к шлюзам."

/obj/item/storage/box/keys/populate_contents()
new /obj/item/door_remote/key/sec(src)
new /obj/item/door_remote/key/sec(src)
new /obj/item/door_remote/key/supply(src)
new /obj/item/door_remote/key/supply(src)
new /obj/item/door_remote/key/service(src)
new /obj/item/door_remote/key/service(src)
new /obj/item/door_remote/key/engineer(src)
new /obj/item/door_remote/key/engineer(src)
new /obj/item/door_remote/key/rnd(src)
new /obj/item/door_remote/key/rnd(src)
new /obj/item/door_remote/key/command(src)
new /obj/item/door_remote/key/command(src)
new /obj/item/door_remote/key/medical(src)
new /obj/item/door_remote/key/medical(src)

Binary file added modular_ss220/objects/icons/key.dmi
Binary file not shown.