[BORG UPDATE] Cyborg engineer inflatable walls tool (#24017)

* cyborg engineer inflatable walls

* Apply suggestions from code review

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/objects/items/robot/items/inflatable_tool.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

---------

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
PhantornRU
2024-03-10 17:45:41 +00:00
committed by GitHub
co-authored by Henri215 Burzah
parent 5670f95cf9
commit e727727f69
4 changed files with 48 additions and 2 deletions
@@ -0,0 +1,44 @@
/obj/item/inflatable/cyborg
name = "inflatable wall"
desc = "A folded membrane which rapidly expands into a large cubical shape on activation."
var/power_use = 400
var/structure_type = /obj/structure/inflatable
/// How long it takes to inflate
var/delay = 1 SECONDS
/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_use = 600
structure_type = /obj/structure/inflatable/door
/obj/item/inflatable/cyborg/examine(mob/user)
. = ..()
. += "<span class='notice'>As a synthetic, you can restore them at a <b>cyborg recharger</b>.</span>"
/obj/item/inflatable/cyborg/attack_self(mob/user)
if(locate(/obj/structure/inflatable) in get_turf(user))
to_chat(user, "<span class='warning'>There's already an inflatable structure!</span>")
return FALSE
if(!do_after(user, delay, FALSE, user))
return FALSE
if(!useResource(user))
return FALSE
playsound(loc, 'sound/items/zip.ogg', 75, TRUE)
to_chat(user, "<span class='notice'>You inflate [src].</span>")
var/obj/structure/inflatable/R = new structure_type(user.loc)
transfer_fingerprints_to(R)
R.add_fingerprint(user)
/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_use)
to_chat(user, "<span class='warning'>Not enough power!</span>")
return FALSE
return R.cell.use(power_use)
@@ -148,7 +148,6 @@
flick("door_closing",src)
sleep(10)
density = !density
opacity = !opacity
state_open = !state_open
update_icon(UPDATE_ICON_STATE)
is_operating = FALSE