mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 03:25:49 +01:00
Migrates obj/item/inflatable and obj/structure/inflatable to the new attack chain. (#30253)
* creation * Update inflatable.dm
This commit is contained in:
@@ -1,20 +1,47 @@
|
||||
// MARK: Wall
|
||||
/obj/item/inflatable
|
||||
name = "inflatable wall"
|
||||
desc = "A folded membrane which rapidly expands into a large cubical shape on activation."
|
||||
icon = 'icons/obj/inflatable.dmi'
|
||||
icon_state = "folded_wall"
|
||||
var/structure_type = /obj/structure/inflatable
|
||||
var/torn = FALSE
|
||||
new_attack_chain = TRUE
|
||||
|
||||
/obj/item/inflatable/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'><b>Use this item in hand</b> to create an inflatable wall.</span>"
|
||||
if(!torn)
|
||||
. += "<span class='notice'><b>Use this item in hand</b> to create an inflatable wall.</span>"
|
||||
else
|
||||
. += "<span class='warning'>[src] is torn and cannot hold air anymore. It's completely useless now.</span>"
|
||||
|
||||
|
||||
/obj/item/inflatable/activate_self(mob/user)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(torn)
|
||||
add_fingerprint(user)
|
||||
to_chat(user, "<span class='warning'>[src] cannot be inflated anymore!</span>")
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(locate(/obj/structure/inflatable) in get_turf(user))
|
||||
to_chat(user, "<span class='warning'>There's already an inflatable structure here!</span>")
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/inflatable/attack_self__legacy__attackchain(mob/user)
|
||||
playsound(loc, 'sound/items/zip.ogg', 75, 1)
|
||||
to_chat(user, "<span class='notice'>You inflate [src].</span>")
|
||||
var/obj/structure/inflatable/R = new /obj/structure/inflatable(user.loc)
|
||||
var/obj/structure/inflatable/R = new structure_type(user.loc)
|
||||
src.transfer_fingerprints_to(R)
|
||||
R.add_fingerprint(user)
|
||||
qdel(src)
|
||||
if(!isrobot(loc))
|
||||
qdel(src)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/inflatable/torn
|
||||
name = "torn inflatable wall"
|
||||
icon_state = "folded_wall_torn"
|
||||
torn = TRUE
|
||||
|
||||
/obj/structure/inflatable
|
||||
name = "inflatable wall"
|
||||
@@ -26,6 +53,7 @@
|
||||
icon_state = "wall"
|
||||
var/torn = /obj/item/inflatable/torn
|
||||
var/intact = /obj/item/inflatable
|
||||
new_attack_chain = TRUE
|
||||
|
||||
/obj/structure/inflatable/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -49,18 +77,21 @@
|
||||
/obj/structure/inflatable/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/structure/inflatable/attackby__legacy__attackchain(obj/item/I, mob/living/user, params)
|
||||
if(I.sharp || is_type_in_typecache(I, GLOB.pointed_types))
|
||||
user.do_attack_animation(src, used_item = I)
|
||||
deconstruct(FALSE)
|
||||
return FALSE
|
||||
return ..()
|
||||
/obj/structure/inflatable/item_interaction(mob/living/user, obj/item/used, list/modifiers)
|
||||
if(!used.sharp && !is_type_in_typecache(used, GLOB.pointed_types))
|
||||
return ..()
|
||||
|
||||
user.do_attack_animation(src, used_item = used)
|
||||
deconstruct(FALSE)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/structure/inflatable/AltClick()
|
||||
if(usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
if(!Adjacent(usr))
|
||||
return
|
||||
|
||||
deconstruct(TRUE)
|
||||
|
||||
/obj/structure/inflatable/deconstruct(disassembled = TRUE)
|
||||
@@ -79,19 +110,17 @@
|
||||
transfer_fingerprints_to(R)
|
||||
qdel(src)
|
||||
|
||||
|
||||
// MARK: Door
|
||||
/obj/item/inflatable/door
|
||||
name = "inflatable door"
|
||||
desc = "A folded membrane which rapidly expands into a simple door on activation."
|
||||
desc = "A folded membrane which rapidly expands into a simple airtight door on activation."
|
||||
icon_state = "folded_door"
|
||||
structure_type = /obj/structure/inflatable/door
|
||||
|
||||
/obj/item/inflatable/door/attack_self__legacy__attackchain(mob/user)
|
||||
playsound(loc, 'sound/items/zip.ogg', 75, 1)
|
||||
to_chat(user, "<span class='notice'>You inflate [src].</span>")
|
||||
var/obj/structure/inflatable/door/R = new /obj/structure/inflatable/door(user.loc)
|
||||
src.transfer_fingerprints_to(R)
|
||||
R.add_fingerprint(user)
|
||||
qdel(src)
|
||||
/obj/item/inflatable/door/torn
|
||||
name = "torn inflatable door"
|
||||
icon_state = "folded_door_torn"
|
||||
torn = TRUE
|
||||
|
||||
/// Based on mineral door code
|
||||
/obj/structure/inflatable/door
|
||||
@@ -103,12 +132,16 @@
|
||||
var/state_open = FALSE
|
||||
var/is_operating = FALSE
|
||||
|
||||
/obj/structure/inflatable/door/attack_ai(mob/user as mob) //those aren't machinery, they're just big fucking slabs of a mineral
|
||||
if(is_ai(user)) //so the AI can't open it
|
||||
/obj/structure/inflatable/door/attack_ai(mob/user as mob)
|
||||
if(is_ai(user)) // The AI can't open it.
|
||||
return
|
||||
else if(isrobot(user)) //but cyborgs can
|
||||
if(get_dist(user,src) <= 1) //not remotely though
|
||||
return try_to_operate(user)
|
||||
|
||||
if(isrobot(user) && Adjacent(user)) // Cyborgs can, but not remotely.
|
||||
return try_to_operate(user)
|
||||
|
||||
/obj/structure/inflatable/door/attack_ghost(mob/user)
|
||||
if(user.can_advanced_admin_interact())
|
||||
operate()
|
||||
|
||||
/obj/structure/inflatable/door/attack_hand(mob/user as mob)
|
||||
return try_to_operate(user)
|
||||
@@ -124,17 +157,24 @@
|
||||
/obj/structure/inflatable/door/proc/try_to_operate(atom/user)
|
||||
if(is_operating)
|
||||
return
|
||||
|
||||
if(ismecha(user))
|
||||
operate()
|
||||
return
|
||||
|
||||
if(ismob(user))
|
||||
var/mob/M = user
|
||||
if(M.client)
|
||||
if(iscarbon(M))
|
||||
var/mob/living/carbon/C = M
|
||||
if(!C.handcuffed)
|
||||
operate()
|
||||
else
|
||||
operate()
|
||||
else if(ismecha(user))
|
||||
operate()
|
||||
if(!M.client)
|
||||
operate()
|
||||
return
|
||||
|
||||
if(!iscarbon(M))
|
||||
operate()
|
||||
return
|
||||
|
||||
var/mob/living/carbon/C = M
|
||||
if(!C.handcuffed)
|
||||
operate()
|
||||
|
||||
/obj/structure/inflatable/door/proc/operate()
|
||||
is_operating = TRUE
|
||||
@@ -156,24 +196,44 @@
|
||||
else
|
||||
icon_state = "door_closed"
|
||||
|
||||
/obj/item/inflatable/torn
|
||||
name = "torn inflatable wall"
|
||||
desc = "A folded membrane which rapidly expands into a large cubical shape on activation. It is too torn to be usable."
|
||||
icon_state = "folded_wall_torn"
|
||||
// MARK: Robot Module
|
||||
/obj/item/inflatable/cyborg
|
||||
var/power_cost = 400
|
||||
/// How long it takes to inflate.
|
||||
var/delay = 1 SECONDS
|
||||
|
||||
/obj/item/inflatable/torn/attack_self__legacy__attackchain(mob/user)
|
||||
to_chat(user, "<span class='warning'>The inflatable wall is too torn to be inflated!</span>")
|
||||
add_fingerprint(user)
|
||||
/obj/item/inflatable/cyborg/door
|
||||
name = "inflatable door"
|
||||
desc = "A folded membrane which rapidly expands into a simple door on activation."
|
||||
icon_state = "folded_door"
|
||||
power_cost = 600
|
||||
structure_type = /obj/structure/inflatable/door
|
||||
|
||||
/obj/item/inflatable/door/torn
|
||||
name = "torn inflatable door"
|
||||
desc = "A folded membrane which rapidly expands into a simple door on activation. It is too torn to be usable."
|
||||
icon_state = "folded_door_torn"
|
||||
/obj/item/inflatable/cyborg/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>As a synthetic, you will synthesise these directly from your cell's energy reserves.</span>"
|
||||
|
||||
/obj/item/inflatable/door/torn/attack_self__legacy__attackchain(mob/user)
|
||||
to_chat(user, "<span class='warning'>The inflatable door is too torn to be inflated!</span>")
|
||||
add_fingerprint(user)
|
||||
/obj/item/inflatable/cyborg/activate_self(mob/user)
|
||||
if(!do_after(user, delay, FALSE, user))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(!useResource(user))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/inflatable/cyborg/proc/useResource(mob/user)
|
||||
if(!isrobot(user))
|
||||
return FALSE
|
||||
|
||||
var/mob/living/silicon/robot/R = user
|
||||
if(R.cell.charge < power_cost)
|
||||
to_chat(user, "<span class='warning'>Not enough power!</span>")
|
||||
return FALSE
|
||||
|
||||
return R.cell.use(power_cost)
|
||||
|
||||
// MARK: Briefcase
|
||||
/obj/item/storage/briefcase/inflatable
|
||||
name = "inflatable barrier box"
|
||||
desc = "Contains inflatable walls and doors."
|
||||
|
||||
Reference in New Issue
Block a user