mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-25 13:09:11 +01:00
Folders props, and adds the laser prism, receptor, and sealed doors. (#5337)
* Re-bases props, and adds the laser prism. * Ver 1 of Puzzle Lock and Doors * Doors * Fix door hiccup I made, modify Prism
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
//A locking mechanism that pulses when hit by a projectile. The base one responds to high-power lasers.
|
||||
|
||||
/obj/structure/prop/lock
|
||||
name = "weird lock"
|
||||
desc = "An esoteric object that responds to.. something."
|
||||
icon = 'icons/obj/props/prism.dmi'
|
||||
icon_state = "lock"
|
||||
|
||||
var/enabled = 0
|
||||
var/lockID = null
|
||||
|
||||
var/list/linked_objects = list()
|
||||
|
||||
/obj/structure/prop/lock/Destroy()
|
||||
if(linked_objects.len)
|
||||
for(var/obj/O in linked_objects)
|
||||
if(istype(O, /obj/machinery/door/blast/puzzle))
|
||||
var/obj/machinery/door/blast/puzzle/P = O
|
||||
P.locks -= src
|
||||
linked_objects -= P
|
||||
..()
|
||||
|
||||
/obj/structure/prop/lock/proc/toggle_lock()
|
||||
enabled = !enabled
|
||||
|
||||
if(enabled)
|
||||
icon_state = "[initial(icon_state)]-active"
|
||||
else
|
||||
icon_state = "[initial(icon_state)]"
|
||||
|
||||
/obj/structure/prop/lock/projectile
|
||||
name = "beam lock"
|
||||
desc = "An esoteric object that responds to high intensity light."
|
||||
|
||||
var/projectile_key = /obj/item/projectile/beam
|
||||
var/timed = 0
|
||||
var/timing = 0
|
||||
var/time_limit = 1500 // In ticks. Ten is one second.
|
||||
|
||||
interaction_message = "<span class='notice'>The object remains inert to your touch.</span>"
|
||||
|
||||
/obj/structure/prop/lock/projectile/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!istype(Proj, projectile_key) || timing)
|
||||
return
|
||||
|
||||
if(istype(Proj, /obj/item/projectile/beam/heavylaser/cannon) || istype(Proj, /obj/item/projectile/beam/emitter) || (Proj.damage >= 80 && Proj.damtype == BURN))
|
||||
toggle_lock()
|
||||
visible_message("<span class='notice'>\The [src] [enabled ? "disengages" : "engages"] its locking mechanism.</span>")
|
||||
|
||||
if(timed)
|
||||
timing = 1
|
||||
spawn(time_limit)
|
||||
toggle_lock()
|
||||
Reference in New Issue
Block a user