mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-02-06 22:39:04 +00:00
* Merge pull request #54048 from nicbn/tank-frames Adds tank holders * Adds tank holders Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
32 lines
1001 B
Plaintext
32 lines
1001 B
Plaintext
/// Tank holder item - Added to an object which can be added to a tank holder.
|
|
/datum/component/container_item/tank_holder
|
|
var/tank_holder_icon_state
|
|
var/make_density
|
|
|
|
/datum/component/container_item/tank_holder/Initialize(state, density = TRUE)
|
|
if(!isitem(parent))
|
|
return COMPONENT_INCOMPATIBLE
|
|
|
|
tank_holder_icon_state = state
|
|
make_density = density
|
|
return ..()
|
|
|
|
/datum/component/container_item/tank_holder/try_attach(datum/source, obj/structure/tank_holder/container, mob/user)
|
|
if(!container || !istype(container))
|
|
return FALSE
|
|
var/obj/item/I = parent
|
|
if(container.contents.len)
|
|
if(user)
|
|
to_chat(user, "<span class='warning'>There's already something in [container].</span>")
|
|
return TRUE
|
|
if(user)
|
|
if(!user.transferItemToLoc(I, container))
|
|
return TRUE
|
|
to_chat(user, "<span class='notice'>You put [I] into [container].</span>")
|
|
else
|
|
I.forceMove(container)
|
|
container.tank = I
|
|
container.density = make_density
|
|
container.icon_state = tank_holder_icon_state
|
|
return TRUE
|