mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
You can now move and talk through statues and mannequins (#81188) ## About The Pull Request I recently played a game where I rotated my skeleton model while rotating my own character at the same time and it being in sync gave me the realization on how cool it would be if the Coroner was able to simply control the skeleton body. I find skeleton displays very funny and I want to see more funny things happen with them, so I thought this would be a good place to start, with the benefits that it also works on mannequins and statues too so they aren't left out. Basically, while it is unanchored, if you have a statue/mannequin grabbed, it will change its direction as you do, and speak the same words you do. Your own messages can only be heard if the person is directly next to you, revealing that it was you talking through it all along. I was originally gonna add this to the simple rotation component but moved off when I decided to add talking through it, I left in the code improvements I made to the component though since it is one of the oldest components and hasn't been touched in a while. Video demonstration (before I added the person also talking, just ignore that missing) https://github.com/tgstation/tgstation/assets/53777086/27242fc3-9649-418d-95cb-b31619319e97 While fixing the Toilet bong's rotation stuff I noticed a lot of it wasn't up to proper code standards so I went over it and fixed issues I had with it. It now doesn't give text saying you found something nasty to species that still likes mice (like flypeople), and fixed its update appearance to match the codebase standard set by the introduction of ``update_appearance`` many years ago. ## Why It's Good For The Game It's a funny small idea I had and got inspired to add, it's a niche mechanic that I think fits the aesthetic I am going for with Coroner and also give a funny interaction with the human-like inanimate objects. ## Changelog 🆑 fix: Species that can eat mice don't get disgusted from seeing one in the toilet bong. add: Grabbing an unwrenched statue/mannequin/skeleton model will now move its direction as you move yours, and you can talk through it. /🆑 Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
107 lines
3.9 KiB
Plaintext
107 lines
3.9 KiB
Plaintext
/obj/structure/toiletbong
|
|
name = "toilet bong"
|
|
desc = "A repurposed toilet with re-arranged piping and an attached flamethrower. Why would anyone build this?"
|
|
icon = 'icons/obj/watercloset.dmi'
|
|
icon_state = "toiletbong"
|
|
base_icon_state = "toiletbong"
|
|
density = FALSE
|
|
anchored = TRUE
|
|
var/smokeradius = 1
|
|
var/mutable_appearance/weed_overlay
|
|
|
|
/obj/structure/toiletbong/Initialize(mapload)
|
|
. = ..()
|
|
create_storage()
|
|
AddComponent(/datum/component/simple_rotation, post_rotation = CALLBACK(src, PROC_REF(post_rotation)))
|
|
create_storage(max_total_storage = 100, max_slots = 12, canhold = /obj/item/food)
|
|
atom_storage.attack_hand_interact = FALSE
|
|
atom_storage.rustle_sound = FALSE
|
|
atom_storage.animated = FALSE
|
|
|
|
weed_overlay = mutable_appearance('icons/obj/watercloset.dmi', "[base_icon_state]_overlay")
|
|
START_PROCESSING(SSobj, src)
|
|
|
|
/obj/structure/toiletbong/update_overlays()
|
|
. = ..()
|
|
if (LAZYLEN(contents))
|
|
. += weed_overlay
|
|
|
|
/obj/structure/toiletbong/attack_hand(mob/living/carbon/user)
|
|
. = ..()
|
|
if (!anchored)
|
|
user.balloon_alert(user, "secure it first!")
|
|
return
|
|
if (!LAZYLEN(contents))
|
|
user.balloon_alert(user, "it's empty!")
|
|
return
|
|
user.visible_message(span_boldnotice("[user] takes a huge drag on the [src]."))
|
|
if (!do_after(user, 2 SECONDS, target = src))
|
|
return
|
|
var/turf/toiletbong_location = loc
|
|
toiletbong_location.hotspot_expose(1000, 5)
|
|
for (var/obj/item/item in contents)
|
|
if (item.resistance_flags & INDESTRUCTIBLE)
|
|
user.balloon_alert(user, "[item.name] is blocking the pipes!")
|
|
continue
|
|
playsound(src, 'sound/items/modsuit/flamethrower.ogg', 50)
|
|
var/datum/effect_system/fluid_spread/smoke/chem/smoke_machine/puff = new
|
|
puff.set_up(smokeradius, holder = src, location = user, carry = item.reagents, efficiency = 20)
|
|
puff.start()
|
|
if (prob(5) && !(obj_flags & EMAGGED))
|
|
if(user.get_liked_foodtypes() & GORE)
|
|
user.balloon_alert(user, "a hidden treat!")
|
|
user.visible_message(span_danger("[user] fishes a mouse out of the pipes."))
|
|
else
|
|
to_chat(user, span_userdanger("There was something disgusting in the pipes!"))
|
|
user.visible_message(span_danger("[user] spits out a mouse."))
|
|
user.adjust_disgust(50)
|
|
user.vomit(VOMIT_CATEGORY_DEFAULT)
|
|
var/mob/living/spawned_mob = new /mob/living/basic/mouse(get_turf(user))
|
|
spawned_mob.faction |= "[REF(user)]"
|
|
if(prob(50))
|
|
for(var/j in 1 to rand(1, 3))
|
|
step(spawned_mob, pick(NORTH,SOUTH,EAST,WEST))
|
|
qdel(item)
|
|
if(!(obj_flags & EMAGGED))
|
|
break
|
|
update_appearance(UPDATE_ICON)
|
|
|
|
/obj/structure/toiletbong/wrench_act(mob/living/user, obj/item/tool)
|
|
..()
|
|
default_unfasten_wrench(user, tool)
|
|
return ITEM_INTERACT_SUCCESS
|
|
|
|
///Called in the simple rotation's post_rotation callback, playing a sound cue to players.
|
|
/obj/structure/toiletbong/proc/post_rotation(mob/user, degrees)
|
|
playsound(src, 'sound/items/deconstruct.ogg', 50)
|
|
|
|
/obj/structure/toiletbong/crowbar_act(mob/living/user, obj/item/tool)
|
|
if(anchored)
|
|
return FALSE
|
|
tool.play_tool_sound(src)
|
|
to_chat(user, span_notice("You begin taking apart the [src]."))
|
|
if (!do_after(user, 10 SECONDS, target = src))
|
|
return FALSE
|
|
new /obj/item/flamethrower(get_turf(src))
|
|
new /obj/item/stack/sheet/iron(get_turf(src))
|
|
var/obj/item/tank/internals/plasma/ptank = new /obj/item/tank/internals/plasma(get_turf(src))
|
|
ptank.air_contents.gases[/datum/gas/plasma][MOLES] = (0)
|
|
qdel(src)
|
|
return TRUE
|
|
|
|
/obj/structure/toiletbong/emag_act(mob/user, obj/item/card/emag/emag_card)
|
|
if(obj_flags & EMAGGED)
|
|
return FALSE
|
|
obj_flags |= EMAGGED
|
|
smokeradius = 2
|
|
playsound(src, 'sound/effects/fish_splash.ogg', 50)
|
|
balloon_alert(user, "toilet broke")
|
|
if (emag_card)
|
|
to_chat(user, span_boldwarning("The [emag_card] falls into the toilet. You fish it back out. Looks like you broke the toilet."))
|
|
return TRUE
|
|
|
|
/obj/structure/toiletbong/attackby(obj/item/attacking_item, mob/user, params)
|
|
if(istype(attacking_item, /obj/item/card/emag))
|
|
return
|
|
return ..()
|