mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
A couple toilet tweaks and fixes (#6983)
This commit is contained in:
@@ -95,8 +95,8 @@
|
|||||||
name = "prison toilet"
|
name = "prison toilet"
|
||||||
icon_state = "toilet2"
|
icon_state = "toilet2"
|
||||||
|
|
||||||
/obj/structure/toilet/prison/attack_hand(mob/living/user)
|
//obj/structure/toilet/prison/attack_hand(mob/living/user) //CHOMPEdit
|
||||||
return
|
// return
|
||||||
|
|
||||||
/obj/structure/toilet/prison/attackby(obj/item/I, mob/living/user)
|
/obj/structure/toilet/prison/attackby(obj/item/I, mob/living/user)
|
||||||
if(istype(I, /obj/item/weapon/grab))
|
if(istype(I, /obj/item/weapon/grab))
|
||||||
|
|||||||
@@ -463,7 +463,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|||||||
|
|
||||||
/obj/item/device/pda/Destroy()
|
/obj/item/device/pda/Destroy()
|
||||||
PDAs -= src
|
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))
|
src.id.forceMove(get_turf(src.loc))
|
||||||
else
|
else
|
||||||
QDEL_NULL(src.id)
|
QDEL_NULL(src.id)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//Flushable toilets on station levels. Flushing sends stuff directly to a trashpit landmark without stinking up the cargo office.
|
//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
|
/obj/structure/toilet
|
||||||
var/teleplumbed = FALSE
|
var/teleplumbed = FALSE
|
||||||
@@ -7,6 +7,9 @@
|
|||||||
var/exit_container
|
var/exit_container
|
||||||
var/refill_cooldown = 200
|
var/refill_cooldown = 200
|
||||||
var/refilling = FALSE
|
var/refilling = FALSE
|
||||||
|
var/no_destination = TRUE
|
||||||
|
var/max_w_class = 3 //glogged
|
||||||
|
var/total_w = 0
|
||||||
|
|
||||||
/obj/structure/toilet/Initialize()
|
/obj/structure/toilet/Initialize()
|
||||||
if(z in global.using_map.map_levels)
|
if(z in global.using_map.map_levels)
|
||||||
@@ -17,16 +20,18 @@
|
|||||||
exit_landmark = exit_container //Override landmark if container is available.
|
exit_landmark = exit_container //Override landmark if container is available.
|
||||||
if(teleplumbed && exit_landmark)
|
if(teleplumbed && exit_landmark)
|
||||||
desc = "The BS-500, a bluespace rift-rotation-based waste disposal unit for small matter. This one seems remarkably clean."
|
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 ..()
|
return ..()
|
||||||
|
|
||||||
/obj/structure/toilet/attack_hand(mob/living/user as mob)
|
/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()
|
var/list/bowl_contents = list()
|
||||||
for(var/obj/item/I in loc.contents)
|
for(var/obj/item/I in loc.contents)
|
||||||
if(istype(I) && !I.anchored)
|
if(istype(I) && !I.anchored)
|
||||||
bowl_contents += I
|
bowl_contents += I
|
||||||
for(var/mob/living/L in loc.contents)
|
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
|
bowl_contents += L
|
||||||
if(bowl_contents.len)
|
if(bowl_contents.len)
|
||||||
refilling = TRUE
|
refilling = TRUE
|
||||||
@@ -35,6 +40,7 @@
|
|||||||
playsound(src, 'sound/effects/bubbles.ogg', 50, 1)
|
playsound(src, 'sound/effects/bubbles.ogg', 50, 1)
|
||||||
playsound(src, 'sound/mecha/powerup.ogg', 30, 1)
|
playsound(src, 'sound/mecha/powerup.ogg', 30, 1)
|
||||||
var/bowl_conga = 0
|
var/bowl_conga = 0
|
||||||
|
var/list/taken_contents = list()
|
||||||
for(var/atom/movable/F in bowl_contents)
|
for(var/atom/movable/F in bowl_contents)
|
||||||
if(bowl_conga < 150)
|
if(bowl_conga < 150)
|
||||||
bowl_conga += 2
|
bowl_conga += 2
|
||||||
@@ -42,10 +48,44 @@
|
|||||||
F.SpinAnimation(5,3)
|
F.SpinAnimation(5,3)
|
||||||
spawn(15)
|
spawn(15)
|
||||||
if(F.loc == loc)
|
if(F.loc == loc)
|
||||||
|
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)
|
F.forceMove(src)
|
||||||
|
else
|
||||||
|
visible_message("The [lowertext(name)] glurks and splutters, unable to guzzle more stuff down in a single flush!")
|
||||||
|
break
|
||||||
spawn(refill_cooldown)
|
spawn(refill_cooldown)
|
||||||
for(var/atom/movable/F in bowl_contents)
|
for(var/atom/movable/F in taken_contents)
|
||||||
if(F.loc == src)
|
if(F.loc == src)
|
||||||
|
flush(F)
|
||||||
|
bowl_contents.Cut()
|
||||||
|
taken_contents.Cut()
|
||||||
|
total_w = 0
|
||||||
|
refilling = FALSE
|
||||||
|
return
|
||||||
|
if(refilling)
|
||||||
|
playsound(src, 'sound/machines/door_locked.ogg', 30, 1)
|
||||||
|
to_chat(user, "<span class='notice'>The [lowertext(name)] is still refilling its tank.</span>")
|
||||||
|
return ..()
|
||||||
|
|
||||||
|
/obj/structure/toilet/attackby(obj/item/I as obj, mob/living/user as mob)
|
||||||
|
if(refilling) //No cistern interactions until bowl contents have been dealt with.
|
||||||
|
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/list/bs_things = list()
|
||||||
var/bs_error = FALSE
|
var/bs_error = FALSE
|
||||||
for(var/item in bluespace_item_types)
|
for(var/item in bluespace_item_types)
|
||||||
@@ -61,18 +101,6 @@
|
|||||||
F.forceMove(destturf)
|
F.forceMove(destturf)
|
||||||
else
|
else
|
||||||
F.forceMove(exit_landmark)
|
F.forceMove(exit_landmark)
|
||||||
bowl_contents.Cut()
|
|
||||||
refilling = FALSE
|
|
||||||
return
|
|
||||||
if(refilling)
|
|
||||||
playsound(src, 'sound/machines/door_locked.ogg', 30, 1)
|
|
||||||
to_chat(user, "<span class='notice'>The [lowertext(name)] is still refilling its tank.</span>")
|
|
||||||
return ..()
|
|
||||||
|
|
||||||
/obj/structure/toilet/attackby(obj/item/I as obj, mob/living/user as mob)
|
|
||||||
if(refilling) //No cistern interactions until bowl contents have been dealt with.
|
|
||||||
return
|
|
||||||
return ..()
|
|
||||||
|
|
||||||
/obj/structure/toilet/attack_ai(mob/user as mob)
|
/obj/structure/toilet/attack_ai(mob/user as mob)
|
||||||
if(isrobot(user))
|
if(isrobot(user))
|
||||||
|
|||||||
Reference in New Issue
Block a user