Merge pull request #12094 from AnturK/mapcase

Adds support for custom showcases on the map
This commit is contained in:
Razharas
2015-10-07 22:26:43 +03:00
2 changed files with 28 additions and 5 deletions
+19 -5
View File
@@ -12,6 +12,13 @@
var/alert = 0
var/open = 0
var/obj/item/weapon/electronics/airlock/electronics
var/start_showpiece_type = null //add type for items on display
/obj/structure/displaycase/New()
..()
if(start_showpiece_type)
showpiece = new start_showpiece_type (src)
update_icon()
/obj/structure/displaycase/ex_act(severity, target)
switch(severity)
@@ -129,6 +136,17 @@
showpiece = W
user << "<span class='notice'>You put [W] on display</span>"
update_icon()
else if(istype(W, /obj/item/stack/sheet/glass) && destroyed)
var/obj/item/stack/sheet/glass/G = W
if(G.get_amount() < 2)
user << "<span class='warning'>You need two glass sheets to fix the case!</span>"
return
user << "<span class='notice'>You start fixing the [src]...</span>"
if(do_after(user, 20, target = src))
G.use(2)
destroyed = 0
health = initial(health)
update_icon()
else
user.changeNext_move(CLICK_CD_MELEE)
src.health -= W.force
@@ -205,11 +223,7 @@
/obj/structure/displaycase/captain
alert = 1
/obj/structure/displaycase/captain/New()
..()
showpiece = new /obj/item/weapon/gun/energy/laser/captain (src)
update_icon()
start_showpiece_type = /obj/item/weapon/gun/energy/laser/captain
/obj/structure/displaycase/labcage
name = "lab cage"