Skip to content
Merged
Changes from all commits
Commits
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
44 changes: 32 additions & 12 deletions code/game/objects/structures/inflatable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@

health = 50
var/deflated = FALSE
var/icon_suffix = ""
var/obj/item/inflatable/origin = /obj/item/inflatable
var/obj/structure/inflatable/poped_type = /obj/structure/inflatable/popped

/obj/structure/inflatable/bullet_act(obj/projectile/Proj)
health -= Proj.damage
Expand Down Expand Up @@ -113,21 +116,21 @@
playsound(loc, 'sound/machines/hiss.ogg', 25, 1)
if(violent)
visible_message("[src] rapidly deflates!")
flick("wall_popping", src)
flick("wall_popping[icon_suffix]", src)
sleep(10)
deconstruct(FALSE)
else
visible_message("[src] slowly deflates.")
flick("wall_deflating", src)
flick("wall_deflating[icon_suffix]", src)
spawn(50)
deconstruct(TRUE)


/obj/structure/inflatable/deconstruct(disassembled = TRUE)
if(!disassembled)
new /obj/structure/inflatable/popped(loc)
new poped_type(loc)
else
var/obj/item/inflatable/R = new /obj/item/inflatable(loc)
var/obj/item/inflatable/R = new origin(loc)
src.transfer_fingerprints_to(R)
return ..()

Expand Down Expand Up @@ -176,6 +179,7 @@

var/open = FALSE
var/isSwitchingStates = FALSE
poped_type = /obj/structure/inflatable/popped/door

/obj/structure/inflatable/door/attack_remote(mob/user as mob) //those aren't machinery, they're just big fucking slabs of a mineral
if(isRemoteControlling(user)) //so the AI can't open it
Expand Down Expand Up @@ -208,7 +212,7 @@
/obj/structure/inflatable/door/proc/open()
isSwitchingStates = TRUE
//playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 25, 1)
flick("door_opening",src)
flick("door_opening[icon_suffix]",src)
addtimer(CALLBACK(src, PROC_REF(finish_open)), 1 SECONDS, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_NO_HASH_WAIT)

/obj/structure/inflatable/door/proc/finish_open()
Expand All @@ -223,7 +227,7 @@
/obj/structure/inflatable/door/proc/close()
isSwitchingStates = TRUE
//playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 25, 1)
flick("door_closing",src)
flick("door_closing[icon_suffix]",src)
addtimer(CALLBACK(src, PROC_REF(finish_close)), 1 SECONDS, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_NO_HASH_WAIT)

/obj/structure/inflatable/door/proc/finish_close()
Expand All @@ -237,27 +241,27 @@

/obj/structure/inflatable/door/update_icon()
if(open)
icon_state = "door_open"
icon_state = "door_open[icon_suffix]"
else
icon_state = "door_closed"
icon_state = "door_closed[icon_suffix]"

/obj/structure/inflatable/door/deflate(violent=0)
set waitfor = 0
playsound(loc, 'sound/machines/hiss.ogg', 25, 1)
if(violent)
visible_message("[src] rapidly deflates!")
flick("door_popping",src)
flick("door_popping[icon_suffix]",src)
sleep(10)
new /obj/structure/inflatable/popped/door(loc)
new poped_type(loc)
//var/obj/item/inflatable/door/torn/R = new /obj/item/inflatable/door/torn(loc)
//src.transfer_fingerprints_to(R)
qdel(src)
else
//to_chat(user, SPAN_NOTICE("You slowly deflate the inflatable wall."))
visible_message("[src] slowly deflates.")
flick("door_deflating", src)
flick("door_deflating[icon_suffix]", src)
spawn(50)
var/obj/item/inflatable/door/R = new /obj/item/inflatable/door(loc)
var/obj/item/inflatable/R = new origin(loc)
src.transfer_fingerprints_to(R)
qdel(src)

Expand Down Expand Up @@ -290,13 +294,19 @@

/obj/structure/inflatable/black
icon_state = "wall_black"
icon_suffix = "_black"
origin = /obj/item/inflatable/black
poped_type = /obj/structure/inflatable/popped/black

/obj/item/inflatable/black
icon_state = "folded_wall_black"
inflatable_type = /obj/structure/inflatable/black

/obj/structure/inflatable/orange
icon_state = "wall_orange"
icon_suffix = "_orange"
origin = /obj/item/inflatable/orange
poped_type = /obj/structure/inflatable/popped/orange

/obj/item/inflatable/orange
icon_state = "folded_wall_orange"
Expand All @@ -306,13 +316,19 @@

/obj/structure/inflatable/door/black
icon_state = "door_closed_black"
icon_suffix = "_black"
origin = /obj/item/inflatable/door/black
poped_type = /obj/structure/inflatable/popped/door/black

/obj/item/inflatable/door/black
icon_state = "folded_door_black"
inflatable_type = /obj/structure/inflatable/door/black

/obj/structure/inflatable/door/orange
icon_state = "door_closed_orange"
icon_suffix = "_orange"
origin = /obj/item/inflatable/door/orange
poped_type = /obj/structure/inflatable/popped/door/orange

/obj/item/inflatable/door/orange
icon_state = "folded_door_orange"
Expand All @@ -322,12 +338,16 @@

/obj/structure/inflatable/popped/door/black
icon_state = "door_popped_black"
icon_suffix = "_black"

/obj/structure/inflatable/popped/door/orange
icon_state = "door_popped_orange"
icon_suffix = "_orange"

/obj/structure/inflatable/popped/black
icon_state = "wall_popped_black"
icon_suffix = "_black"

/obj/structure/inflatable/popped/orange
icon_state = "wall_popped_orange"
icon_suffix = "_orange"
Loading