mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 19:17:50 +01:00
Update inflatable.dm (#31070)
Co-authored-by: Fordoxia <143041327+Fordoxia@users.noreply.github.com>
This commit is contained in:
@@ -20,23 +20,44 @@
|
||||
if(..())
|
||||
return
|
||||
|
||||
inflate(user, user)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/inflatable/interact_with_atom(atom/target, mob/living/user, list/modifiers)
|
||||
inflate(user, target)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/inflatable/proc/inflate(mob/user, atom/target)
|
||||
if(torn)
|
||||
add_fingerprint(user)
|
||||
to_chat(user, "<span class='warning'>[src] cannot be inflated anymore!</span>")
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
to_chat(user, "<span class='warning'>[src] is torn and cannot be inflated anymore!</span>")
|
||||
return
|
||||
|
||||
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
|
||||
var/turf/T = get_turf(target)
|
||||
if(iswallturf(T))
|
||||
return
|
||||
|
||||
if((locate(/obj/structure/inflatable) in T) || (locate(/obj/structure/window/full) in T))
|
||||
to_chat(user, "<span class='warning'>There's no room to deploy [src] here!</span>")
|
||||
return
|
||||
|
||||
var/obj/machinery/door/airlock = locate(/obj/machinery/door) in T
|
||||
var/obj/structure/mineral_door/mineral_door = locate(/obj/structure/mineral_door) in T
|
||||
if(mineral_door && mineral_door.density)
|
||||
to_chat(user, "<span class='warning'>You need to open [mineral_door] before you can deploy [src] there!</span>")
|
||||
return
|
||||
|
||||
if(airlock && airlock.density && !istype(airlock, /obj/machinery/door/window))
|
||||
to_chat(user, "<span class='warning'>You need to open [airlock] before you can deploy [src] there!</span>")
|
||||
return
|
||||
|
||||
playsound(loc, 'sound/items/zip.ogg', 75, 1)
|
||||
to_chat(user, "<span class='notice'>You inflate [src].</span>")
|
||||
var/obj/structure/inflatable/R = new structure_type(user.loc)
|
||||
var/obj/structure/inflatable/R = new structure_type(T)
|
||||
src.transfer_fingerprints_to(R)
|
||||
R.add_fingerprint(user)
|
||||
if(!isrobot(loc))
|
||||
qdel(src)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/inflatable/torn
|
||||
name = "torn inflatable wall"
|
||||
@@ -221,6 +242,15 @@
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/inflatable/cyborg/interact_with_atom(atom/target, mob/living/user, list/modifiers)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user