Files
Bubberstation/code/game/objects/items/rollertable_dock.dm
YesterdaysPromise fec946e9c0 /Icon/ Folder cleansing crusade part, I think 4; post-wallening clean-up. (#85823)
Hello everybuddy, your number three rated coder-failure here to clean up
some mess. This PR accomplishes some of the more major structural clean
up changes I wanted to do with /obj/ folder, but decided to wait on
until wallening gets merged, and so, time has come. Several things to
still be done, although I know these cleaning PR's are quite a load, so
will wait for this one to get done with first.

## Why It's Good For The Game
Saner spriters, better sprites, less annoyance. Also deleted a whole
load of redundancy this time around, a lot of sprites which existed
simultaniously in two places now got exit their quantum superposition.
2024-08-15 20:22:02 -07:00

54 lines
2.0 KiB
Plaintext

/obj/item/rolling_table_dock
name = "rolling table dock"
desc = "A collapsed roller table that can be ejected for service on the go. Must be collected or replaced after use."
icon = 'icons/obj/structures/smooth/rollingtable.dmi'
icon_state = "rollingtable"
var/obj/structure/table/rolling/loaded = null
/obj/item/rolling_table_dock/Initialize(mapload)
. = ..()
loaded = new(src)
/obj/structure/table/rolling/attackby(obj/item/wtable, mob/user, params)
if(!istype(wtable, /obj/item/rolling_table_dock))
return ..()
var/obj/item/rolling_table_dock/rable = wtable
var/turf/target_table = get_turf(src)
if(rable.loaded)
to_chat(user, span_warning("You already have a roller table docked!"))
return
if(locate(/mob/living) in target_table)
to_chat(user, span_warning("You can't collect the table with that much on top!"))
return
else
rable.loaded = src
forceMove(rable)
user.visible_message(span_notice("[user] collects [src]."), balloon_alert(user, "you collect the [src]."))
return TRUE
/obj/item/rolling_table_dock/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
var/turf/target_turf = get_turf(interacting_with)
if(target_turf.is_blocked_turf(TRUE) || (locate(/mob/living) in target_turf))
return NONE
if(isopenturf(interacting_with))
deploy_rolling_table(user, interacting_with)
return ITEM_INTERACT_SUCCESS
return NONE
/obj/item/rolling_table_dock/proc/deploy_rolling_table(mob/user, atom/location)
var/obj/structure/table/rolling/rable = new /obj/structure/table/rolling(location)
rable.add_fingerprint(user)
qdel(src)
/obj/item/rolling_table_dock/examine(mob/user)
. = ..()
. += "The dock is [loaded ? "loaded" : "empty"]."
/obj/item/rolling_table_dock/deploy_rolling_table(mob/user, atom/location)
if(loaded)
loaded.forceMove(location)
user.visible_message(span_notice("[user] deploys [loaded]."), balloon_alert(user, "you deploy the [loaded]."))
loaded = null
else
balloon_alert(user, "the dock is Empty!")