mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Constructable Phazon, constructable display case
This commit is contained in:
@@ -1,23 +1,84 @@
|
||||
/obj/structure/displaycase_frame
|
||||
name = "display case frame"
|
||||
icon = 'icons/obj/stock_parts.dmi'
|
||||
icon_state="box_glass"
|
||||
var/obj/item/weapon/airlock_electronics/circuit = null
|
||||
var/state=0
|
||||
|
||||
/obj/structure/displaycase_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
var/pstate=state
|
||||
var/turf/T=get_turf(src)
|
||||
switch(state)
|
||||
if(0)
|
||||
if(istype(W, /obj/item/weapon/airlock_electronics) && W:icon_state != "door_electronics_smoked")
|
||||
user.drop_item()
|
||||
circuit = W
|
||||
circuit.loc = src
|
||||
state++
|
||||
playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(istype(W, /obj/item/weapon/crowbar))
|
||||
new /obj/machinery/constructable_frame/machine_frame(T)
|
||||
new /obj/item/stack/sheet/glass(T)
|
||||
del(src)
|
||||
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1)
|
||||
return
|
||||
|
||||
if(1)
|
||||
if(isscrewdriver(W))
|
||||
var/obj/structure/displaycase/C=new(T)
|
||||
if(circuit.one_access)
|
||||
C.req_access = null
|
||||
C.req_one_access = circuit.conf_access
|
||||
else
|
||||
C.req_access = circuit.conf_access
|
||||
C.req_one_access = null
|
||||
playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
del(src)
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/crowbar))
|
||||
circuit.loc=T
|
||||
circuit=null
|
||||
state--
|
||||
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1)
|
||||
if(pstate!=state)
|
||||
pstate=state
|
||||
update_icon()
|
||||
|
||||
/obj/structure/displaycase_frame/update_icon()
|
||||
switch(state)
|
||||
if(1)
|
||||
icon_state="box_glass_circuit"
|
||||
else
|
||||
icon_state="box_glass"
|
||||
|
||||
/obj/structure/displaycase
|
||||
name = "Display Case"
|
||||
name = "display case"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "glassbox20"
|
||||
desc = "A display case for prized possessions. It taunts you to kick it."
|
||||
density = 1
|
||||
anchored = 1
|
||||
unacidable = 1//Dissolving the case would also delete the gun.
|
||||
unacidable = 1//Dissolving the case would also delete the contents.
|
||||
var/health = 30
|
||||
var/obj/item/occupant = null
|
||||
var/destroyed = 0
|
||||
var/locked = 0
|
||||
var/ue=null
|
||||
var/image/occupant_overlay=null
|
||||
var/ue = null
|
||||
var/image/occupant_overlay = null
|
||||
var/obj/item/weapon/airlock_electronics/circuit
|
||||
|
||||
/obj/structure/displaycase/captains_laser
|
||||
name = "captain's display case"
|
||||
desc = "A display case for the captain's antique laser gun. It taunts you to kick it."
|
||||
|
||||
/obj/structure/displaycase/captains_laser/New()
|
||||
occupant=new /obj/item/weapon/gun/energy/laser/captain(src)
|
||||
locked=1
|
||||
req_access=list(access_captain)
|
||||
req_access = list(access_captain)
|
||||
occupant = new /obj/item/weapon/gun/energy/laser/captain(src)
|
||||
locked = 1
|
||||
update_icon()
|
||||
|
||||
/obj/structure/proc/getPrint(mob/user as mob)
|
||||
return md5(user:dna:uni_identity)
|
||||
|
||||
/obj/structure/displaycase/examine()
|
||||
..()
|
||||
@@ -28,8 +89,9 @@
|
||||
usr << "Nothing."
|
||||
|
||||
/obj/structure/displaycase/proc/dump()
|
||||
occupant.loc=get_turf(src)
|
||||
occupant=null
|
||||
if(occupant)
|
||||
occupant.loc=get_turf(src)
|
||||
occupant=null
|
||||
occupant_overlay=null
|
||||
|
||||
/obj/structure/displaycase/ex_act(severity)
|
||||
@@ -38,7 +100,7 @@
|
||||
getFromPool(/obj/item/weapon/shard, loc)
|
||||
if (occupant)
|
||||
dump()
|
||||
qdel(src)
|
||||
del(src)
|
||||
if (2)
|
||||
if (prob(50))
|
||||
src.health -= 15
|
||||
@@ -78,7 +140,7 @@
|
||||
playsound(get_turf(src), "shatter", 70, 1)
|
||||
update_icon()
|
||||
else
|
||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
playsound(get_turf(src), 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
return
|
||||
|
||||
/obj/structure/displaycase/update_icon()
|
||||
@@ -93,8 +155,6 @@
|
||||
occupant_overlay = image(occupant_icon)
|
||||
occupant_overlay.pixel_x=8
|
||||
occupant_overlay.pixel_y=8
|
||||
//occupant_overlay.Shift(NORTH, 8)
|
||||
//occupant_overlay.Shift(EAST, 8)
|
||||
if(locked)
|
||||
occupant_overlay.alpha=128//ChangeOpacity(0.5)
|
||||
//underlays += occupant_overlay
|
||||
@@ -115,6 +175,32 @@
|
||||
user << "\icon[src] \blue You close \the [src] and swipe your card, locking it."
|
||||
update_icon()
|
||||
return
|
||||
if(istype(W,/obj/item/weapon/crowbar) && (!locked || destroyed))
|
||||
user.visible_message("[user.name] pries \the [src] apart.", \
|
||||
"You pry \the [src] apart.", \
|
||||
"You hear something pop.")
|
||||
var/turf/T=get_turf(src)
|
||||
playsound(T, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
dump()
|
||||
var/obj/item/weapon/airlock_electronics/C = circuit
|
||||
if(!C)
|
||||
C=new (src)
|
||||
C.one_access=!(req_access && req_access.len>0)
|
||||
if(!C.one_access)
|
||||
C.conf_access=req_access
|
||||
else
|
||||
C.conf_access=req_one_access
|
||||
if(!destroyed)
|
||||
var/obj/structure/displaycase_frame/F=new(T)
|
||||
F.state=1
|
||||
F.circuit=C
|
||||
F.circuit.loc=F
|
||||
F.update_icon()
|
||||
else
|
||||
C.loc=T
|
||||
circuit=null
|
||||
new /obj/machinery/constructable_frame/machine_frame(T)
|
||||
del(src)
|
||||
if(user.a_intent == "harm")
|
||||
src.health -= W.force
|
||||
src.healthcheck()
|
||||
@@ -133,9 +219,6 @@
|
||||
/obj/structure/displaycase/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/structure/displaycase/proc/getPrint(mob/user as mob)
|
||||
return md5(user:dna:uni_identity)
|
||||
|
||||
/obj/structure/displaycase/attack_hand(mob/user as mob)
|
||||
if (destroyed)
|
||||
if(occupant)
|
||||
@@ -160,8 +243,8 @@
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
user << "\blue Your press your thumb against the fingerprint scanner, and deactivate the hover field built into the case."
|
||||
if(occupant)
|
||||
user << "\blue Your press your thumb against the fingerprint scanner, and deactivate the hover field built into the case."
|
||||
dump()
|
||||
update_icon()
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user