mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 11:05:03 +01:00
Adds Pod Locks
Adds key and tumbler based pod locks Adds lock pod system Adds pod lock to sec pod Adds keys to sec pod in HoS and Pilot Offices
This commit is contained in:
+8994
-8995
File diff suppressed because it is too large
Load Diff
@@ -206,7 +206,8 @@
|
||||
/obj/item/clothing/shoes/magboots,
|
||||
/obj/item/areaeditor/blueprints,
|
||||
/obj/item/clothing/head/helmet/space,
|
||||
/obj/item/weapon/storage/internal
|
||||
/obj/item/weapon/storage/internal,
|
||||
/obj/item/device/spacepod_key
|
||||
)
|
||||
// These items will NOT be preserved
|
||||
var/list/do_not_preserve_items = list (
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
var/obj/item/device/spacepod_equipment/weaponry/weapon_system // weapons system
|
||||
var/obj/item/device/spacepod_equipment/misc/misc_system // misc system
|
||||
var/obj/item/device/spacepod_equipment/cargo/cargo_system // cargo system
|
||||
var/obj/item/device/spacepod_equipment/lock/lock_system // lock system
|
||||
//var/obj/item/device/spacepod_equipment/engine/engine_system // engine system
|
||||
//var/obj/item/device/spacepod_equipment/shield/shield_system // shielding system
|
||||
|
||||
@@ -186,3 +187,41 @@
|
||||
/obj/item/device/spacepod_equipment/cargo/ore/removed(var/mob/user)
|
||||
. = ..()
|
||||
unload()
|
||||
|
||||
/obj/item/device/spacepod_equipment/lock
|
||||
name = "pod lock"
|
||||
desc = "You shouldn't be seeing this"
|
||||
icon = 'icons/goonstation/pods/ship.dmi'
|
||||
icon_state = "blank"
|
||||
var/mode = 0
|
||||
var/id = null
|
||||
|
||||
// Key and Tumbler System
|
||||
/obj/item/device/spacepod_equipment/lock/keyed
|
||||
name = "\improper spacepod tumbler lock"
|
||||
desc = "A locking system to stop podjacking. This version uses a standalone key."
|
||||
icon_state = "pod_locator"
|
||||
|
||||
/obj/item/device/spacepod_equipment/lock/keyed/New()
|
||||
..()
|
||||
id = rand(1, 99999)
|
||||
|
||||
// The key
|
||||
/obj/item/device/spacepod_key
|
||||
name = "\improper spacepod key"
|
||||
desc = "A key for a spacepod lock."
|
||||
icon_state = "podkey"
|
||||
w_class = 1.0
|
||||
var/id = 0
|
||||
|
||||
// Key - Lock Interactions
|
||||
/obj/item/device/spacepod_equipment/lock/keyed/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
if(istype(I, /obj/item/device/spacepod_key))
|
||||
var/obj/item/device/spacepod_key/key = I
|
||||
if(!key.id)
|
||||
key.id = id
|
||||
to_chat(user, "<span class='notice'>You grind the blank key to fit the lock.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>This key is already ground!</span>")
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -250,9 +250,12 @@
|
||||
|
||||
/obj/spacepod/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(iscrowbar(W))
|
||||
hatch_open = !hatch_open
|
||||
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>You [hatch_open ? "open" : "close"] the maintenance hatch.</span>")
|
||||
if(!equipment_system.lock_system || allow2enter || hatch_open)
|
||||
hatch_open = !hatch_open
|
||||
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>You [hatch_open ? "open" : "close"] the maintenance hatch.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The hatch is locked shut!</span>")
|
||||
if(istype(W, /obj/item/weapon/stock_parts/cell))
|
||||
if(!hatch_open)
|
||||
to_chat(user, "\red The maintenance hatch is closed!")
|
||||
@@ -305,6 +308,25 @@
|
||||
equipment_system.cargo_system = W
|
||||
equipment_system.cargo_system.my_atom = src
|
||||
return
|
||||
if(istype(W, /obj/item/device/spacepod_equipment/lock))
|
||||
if(equipment_system.lock_system)
|
||||
to_chat(user, "<span class='notice'>The pod already has a lock system, remove it first.</span>")
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You insert \the [W] into the lock system.</span>")
|
||||
user.drop_item(W)
|
||||
W.forceMove(src)
|
||||
equipment_system.lock_system = W
|
||||
equipment_system.lock_system.my_atom = src
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/device/spacepod_key) && istype(equipment_system.lock_system, /obj/item/device/spacepod_equipment/lock/keyed))
|
||||
var/obj/item/device/spacepod_key/key = W
|
||||
if (key.id == equipment_system.lock_system.id)
|
||||
locksecondseat()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>This is the wrong key!</span>")
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
if(!hatch_open)
|
||||
@@ -340,6 +362,8 @@
|
||||
possible.Add("Misc. System")
|
||||
if(equipment_system.cargo_system)
|
||||
possible.Add("Cargo System")
|
||||
if(equipment_system.lock_system)
|
||||
possible.Add("Lock System")
|
||||
/* Not yet implemented
|
||||
if(equipment_system.engine_system)
|
||||
possible.Add("Engine System")
|
||||
@@ -379,6 +403,15 @@
|
||||
equipment_system.cargo_system = null
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need an open hand to do that.</span>")
|
||||
if("Lock System")
|
||||
SPE = equipment_system.lock_system
|
||||
if(user.put_in_any_hand_if_possible(SPE))
|
||||
to_chat(user, "<span class='notice'>You remove \the [SPE] from the equipment system.</span>")
|
||||
SPE.removed(user)
|
||||
SPE.my_atom = null
|
||||
equipment_system.lock_system = null
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need an open hand to do that.</span>")
|
||||
/*
|
||||
if("engine system")
|
||||
SPE = equipment_system.engine_system
|
||||
@@ -423,6 +456,11 @@
|
||||
equipment_system.misc_system = L
|
||||
equipment_system.misc_system.my_atom = src
|
||||
equipment_system.misc_system.enabled = 1
|
||||
var/obj/item/device/spacepod_equipment/lock/keyed/K = new /obj/item/device/spacepod_equipment/lock/keyed
|
||||
K.loc = equipment_system
|
||||
equipment_system.lock_system = K
|
||||
equipment_system.lock_system.my_atom = src
|
||||
equipment_system.lock_system.id = 100000
|
||||
return
|
||||
|
||||
/obj/spacepod/random/New()
|
||||
@@ -534,7 +572,11 @@
|
||||
moved_other_inside(M)
|
||||
|
||||
if(M == user)
|
||||
enter_pod(user)
|
||||
if(!equipment_system.lock_system || allow2enter)
|
||||
enter_pod(user)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>\The [src]'s doors are locked!</span>")
|
||||
|
||||
|
||||
if(istype(A, /obj/structure/ore_box)) // For loading ore boxes
|
||||
var/obj/structure/ore_box/O = A
|
||||
@@ -638,10 +680,6 @@
|
||||
log_debug("##SPACEPOD WARNING: OCCUPANT [occupant2] ESCAPED, TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
|
||||
occupant2 = null
|
||||
|
||||
if(!occupant && !allow2enter)
|
||||
allow2enter = 1
|
||||
log_debug("##SPACEPOD WARNING: DOORS WERE STILL LOCKED WITH NO OCCUPANT, TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
|
||||
|
||||
/obj/spacepod/verb/exit_pod()
|
||||
set name = "Exit pod"
|
||||
set category = "Spacepod"
|
||||
|
||||
@@ -181,4 +181,29 @@
|
||||
build_type = PODFAB
|
||||
materials = list(MAT_METAL=20000, MAT_GLASS=2000)
|
||||
build_path = /obj/item/device/spacepod_equipment/cargo/ore
|
||||
category = list("Pod_Parts")
|
||||
|
||||
//////////////////////////////////////////
|
||||
//////SPACEPOD LOCK ITEMS////////////////
|
||||
//////////////////////////////////////////
|
||||
/datum/design/pod_lock_keyed
|
||||
construction_time = 100
|
||||
name = "Spacepod Tumbler Lock"
|
||||
desc = "Allows for the construction of a tumbler style podlock."
|
||||
id = "podlock_keyed"
|
||||
req_tech = list("materials" = 1) //The most basic kind of locking system
|
||||
build_type = PODFAB
|
||||
materials = list(MAT_METAL=4500)
|
||||
build_path = /obj/item/device/spacepod_equipment/lock/keyed
|
||||
category = list("Pod_Parts")
|
||||
|
||||
/datum/design/pod_key
|
||||
construction_time = 100
|
||||
name = "Spacepod Tumbler Lock Key"
|
||||
desc = "Allows for the construction of a blank key for a podlock."
|
||||
id = "podkey"
|
||||
req_tech = list("materials" = 1) //The most basic kind of locking system
|
||||
build_type = PODFAB
|
||||
materials = list(MAT_METAL=500)
|
||||
build_path = /obj/item/device/spacepod_key
|
||||
category = list("Pod_Parts")
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 34 KiB |
Reference in New Issue
Block a user