A couple toilet tweaks and fixes (#6983)

This commit is contained in:
Verkister
2023-09-18 18:43:20 +03:00
committed by GitHub
parent 7796ec339d
commit e2db548b9b
3 changed files with 53 additions and 25 deletions

View File

@@ -95,8 +95,8 @@
name = "prison toilet"
icon_state = "toilet2"
/obj/structure/toilet/prison/attack_hand(mob/living/user)
return
//obj/structure/toilet/prison/attack_hand(mob/living/user) //CHOMPEdit
// return
/obj/structure/toilet/prison/attackby(obj/item/I, mob/living/user)
if(istype(I, /obj/item/weapon/grab))
@@ -123,7 +123,7 @@
GM.adjustBruteLoss(5)
else
to_chat(user, "<span class='notice'>You need a tighter grip.</span>")
/obj/structure/urinal
name = "urinal"

View File

@@ -463,7 +463,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
/obj/item/device/pda/Destroy()
PDAs -= src
if (src.id && prob(100) && !delete_id) //IDs are kept in 90% of the cases //VOREStation Edit - 100% of the cases, excpet when specified otherwise
if (src.id && !delete_id && src.id.loc == src) //CHOMPEdit
src.id.forceMove(get_turf(src.loc))
else
QDEL_NULL(src.id)

View File

@@ -1,5 +1,5 @@
//Flushable toilets on station levels. Flushing sends stuff directly to a trashpit landmark without stinking up the cargo office.
//Only on-station toilets are affected and only if the trashpit landmark also exists. Otherwise toilets will stay normal.
//Only on-station toilets are linked to exit landmark or container if such exists. Otherwise stuff gets sent to shadow realm.
/obj/structure/toilet
var/teleplumbed = FALSE
@@ -7,6 +7,9 @@
var/exit_container
var/refill_cooldown = 200
var/refilling = FALSE
var/no_destination = TRUE
var/max_w_class = 3 //glogged
var/total_w = 0
/obj/structure/toilet/Initialize()
if(z in global.using_map.map_levels)
@@ -17,16 +20,18 @@
exit_landmark = exit_container //Override landmark if container is available.
if(teleplumbed && exit_landmark)
desc = "The BS-500, a bluespace rift-rotation-based waste disposal unit for small matter. This one seems remarkably clean."
no_destination = FALSE
max_w_class = 10
return ..()
/obj/structure/toilet/attack_hand(mob/living/user as mob)
if(open && teleplumbed && exit_landmark && !refilling)
if(open && !refilling && no_destination || (teleplumbed && exit_landmark))
var/list/bowl_contents = list()
for(var/obj/item/I in loc.contents)
if(istype(I) && !I.anchored)
bowl_contents += I
for(var/mob/living/L in loc.contents)
if(L.resting || L.lying && L.size_multiplier <= 0.75 && !L.buckled)
if((L.resting || L.lying) && !L.buckled)
bowl_contents += L
if(bowl_contents.len)
refilling = TRUE
@@ -35,6 +40,7 @@
playsound(src, 'sound/effects/bubbles.ogg', 50, 1)
playsound(src, 'sound/mecha/powerup.ogg', 30, 1)
var/bowl_conga = 0
var/list/taken_contents = list()
for(var/atom/movable/F in bowl_contents)
if(bowl_conga < 150)
bowl_conga += 2
@@ -42,26 +48,25 @@
F.SpinAnimation(5,3)
spawn(15)
if(F.loc == loc)
F.forceMove(src)
spawn(refill_cooldown)
for(var/atom/movable/F in bowl_contents)
if(F.loc == src)
var/list/bs_things = list()
var/bs_error = FALSE
for(var/item in bluespace_item_types)
if(istype(F, item))
bs_error = TRUE
if(isitem(F))
var/obj/item/I = F
total_w += I.w_class
if(isliving(F))
var/mob/living/L = F
total_w += L.size_multiplier * 13
if(total_w <= max_w_class)
taken_contents |= F
F.forceMove(src)
else
bs_things |= F.search_contents_for(item)
if(bs_error || LAZYLEN(bs_things))
bs_things.Cut()
bs_error = rand(1, 100)
var/list/posturfs = circlerangeturfs(exit_landmark,bs_error)
var/destturf = safepick(posturfs)
F.forceMove(destturf)
else
F.forceMove(exit_landmark)
visible_message("The [lowertext(name)] glurks and splutters, unable to guzzle more stuff down in a single flush!")
break
spawn(refill_cooldown)
for(var/atom/movable/F in taken_contents)
if(F.loc == src)
flush(F)
bowl_contents.Cut()
taken_contents.Cut()
total_w = 0
refilling = FALSE
return
if(refilling)
@@ -74,6 +79,29 @@
return
return ..()
/obj/structure/toilet/proc/flush(atom/movable/F)
if(no_destination)
for(var/atom/movable/G in F.contents)
G.forceMove(src)
flush(G)
qdel(F)
else
var/list/bs_things = list()
var/bs_error = FALSE
for(var/item in bluespace_item_types)
if(istype(F, item))
bs_error = TRUE
else
bs_things |= F.search_contents_for(item)
if(bs_error || LAZYLEN(bs_things))
bs_things.Cut()
bs_error = rand(1, 100)
var/list/posturfs = circlerangeturfs(exit_landmark,bs_error)
var/destturf = safepick(posturfs)
F.forceMove(destturf)
else
F.forceMove(exit_landmark)
/obj/structure/toilet/attack_ai(mob/user as mob)
if(isrobot(user))
if(user.client && user.client.eye == user)