Janitor QOL (#17594)

* Yes

* No

suggested changes

* Maybe

Suggestions + water in cart sprites

* Merge Conflict Resolve

* Suggested Changes :o)

* fixes bugs

* suggested changes round 2
This commit is contained in:
Kugamo
2022-04-22 11:39:21 +01:00
committed by GitHub
parent a0d14de10f
commit 7189ae5d65
13 changed files with 126 additions and 32 deletions
+27 -2
View File
@@ -1,6 +1,6 @@
/obj/item/holosign_creator
name = "holographic sign projector"
desc = "A handy-dandy holographic projector that displays a janitorial sign."
desc = "This shouldnt exist, if it does, tell a coder"
icon = 'icons/obj/device.dmi'
icon_state = "signmaker"
item_state = "electronic"
@@ -15,7 +15,7 @@
var/list/signs = list()
var/max_signs = 10
var/creation_time = 0 //time to create a holosign in deciseconds.
var/holosign_type = /obj/structure/holosign/wetsign
var/holosign_type = null
var/holocreator_busy = FALSE //to prevent placing multiple holo barriers at once
/obj/item/holosign_creator/afterattack(atom/target, mob/user, flag)
@@ -46,6 +46,7 @@
return
H = new holosign_type(get_turf(target), src)
to_chat(user, "<span class='notice'>You create [H] with [src].</span>")
return H
else
to_chat(user, "<span class='notice'>[src] is projecting at max capacity!</span>")
@@ -58,6 +59,30 @@
qdel(H)
to_chat(user, "<span class='notice'>You clear all active holograms.</span>")
/obj/item/holosign_creator/janitor
name = "Janitorial Holosign projector"
desc = "A handy-dandy holographic projector that displays a janitorial sign."
holosign_type = /obj/structure/holosign/wetsign
var/wet_enabled = FALSE
/obj/item/holosign_creator/janitor/AltClick(mob/user)
wet_enabled = !wet_enabled
playsound(loc, 'sound/weapons/empty.ogg', 20)
if(wet_enabled)
to_chat(user, "<span class='notice'>You enable the W.E.T. (wet evaporation timer)\nAny newly placed holographic signs will clear after the likely time it takes for a mopped tile to dry.</span>")
else
to_chat(user, "<span class='notice'>You disable the W.E.T. (wet evaporation timer)\nAny newly placed holographic signs will now stay indefinitely.</span>")
/obj/item/holosign_creator/janitor/examine(mob/user)
. = ..()
if(ishuman(user))
. += "<span class='info'>Alt Click to [wet_enabled ? "deactivate" : "activate"] its built-in wet evaporation timer.</span>"
/obj/item/holosign_creator/janitor/afterattack(atom/target, mob/user, flag)
var/obj/structure/holosign/wetsign/WS = ..()
if(WS && wet_enabled)
WS.wet_timer_start(src)
/obj/item/holosign_creator/security
name = "security holobarrier projector"
+12 -4
View File
@@ -24,6 +24,17 @@
GLOB.janitorial_equipment -= src
return ..()
/obj/item/mop/proc/wet_mop(obj/o, mob/user)
if(o.reagents.total_volume < 1)
to_chat(user, "[o] is out of water!</span>")
if(!istype(o, /obj/item/reagent_containers/glass/bucket))
janicart_insert(user, o)
return
o.reagents.trans_to(src, 5)
to_chat(user, "<span class='notice'>You wet [src] in [o].</span>")
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
/obj/item/mop/proc/clean(turf/simulated/A)
if(reagents.has_reagent("water", 1) || reagents.has_reagent("cleaner", 1) || reagents.has_reagent("holywater", 1))
A.clean_blood()
@@ -42,7 +53,7 @@
var/turf/simulated/T = get_turf(A)
if(istype(A, /obj/item/reagent_containers/glass/bucket) || istype(A, /obj/structure/janitorialcart))
if(istype(A, /obj/item/reagent_containers/glass/bucket) || istype(A, /obj/structure/janitorialcart) || istype(A, /obj/structure/mopbucket))
return
if(istype(T))
@@ -52,14 +63,12 @@
to_chat(user, "<span class='notice'>You finish mopping.</span>")
clean(T)
/obj/effect/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/mop) || istype(I, /obj/item/soap))
return
else
return ..()
/obj/item/mop/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J)
J.put_in_cart(src, user)
J.mymop=src
@@ -113,7 +122,6 @@
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/mop/advanced/cyborg
/obj/item/mop/advanced/cyborg/janicart_insert(mob/user, obj/structure/janitorialcart/J)
@@ -402,14 +402,14 @@
/obj/item/flashlight,
/obj/item/reagent_containers/spray,
/obj/item/soap,
/obj/item/holosign_creator,
/obj/item/holosign_creator/janitor,
/obj/item/melee/flyswatter,
/obj/item/storage/bag/trash
)
/obj/item/storage/belt/janitor/full/populate_contents()
new /obj/item/lightreplacer(src)
new /obj/item/holosign_creator(src)
new /obj/item/holosign_creator/janitor(src)
new /obj/item/reagent_containers/spray/cleaner(src)
new /obj/item/soap(src)
new /obj/item/grenade/chem_grenade/cleaner(src)
@@ -89,8 +89,8 @@
new /obj/item/storage/bag/trash(src)
new /obj/item/lightreplacer(src)
new /obj/item/lightreplacer(src)
new /obj/item/holosign_creator(src)
new /obj/item/holosign_creator(src)
new /obj/item/holosign_creator/janitor(src)
new /obj/item/holosign_creator/janitor(src)
new /obj/item/watertank/janitor(src)
new /obj/item/watertank/janitor(src)
new /obj/item/storage/belt/janitor(src)
+7
View File
@@ -41,6 +41,13 @@
desc = "The words flicker as if they mean nothing."
icon_state = "holosign"
/obj/structure/holosign/wetsign/proc/wet_timer_start(obj/item/holosign_creator/HS_C)
addtimer(CALLBACK(src, .proc/wet_timer_finish, HS_C), 82 SECONDS, TIMER_UNIQUE)
/obj/structure/holosign/wetsign/proc/wet_timer_finish(obj/item/holosign_creator/HS_C)
playsound(HS_C.loc, 'sound/machines/chime.ogg', 20, 1)
qdel(src)
/obj/structure/holosign/barrier
name = "holo barrier"
desc = "A short holographic barrier which can only be passed by walking."
+18 -10
View File
@@ -32,21 +32,15 @@
QDEL_NULL(myreplacer)
return ..()
/obj/structure/janitorialcart/proc/wet_mop(obj/item/mop, mob/user)
if(reagents.total_volume < 1)
to_chat(user, "[src] is out of water!</span>")
else
reagents.trans_to(mop, 5) //
to_chat(user, "<span class='notice'>You wet [mop] in [src].</span>")
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
/obj/structure/janitorialcart/proc/put_in_cart(obj/item/I, mob/user)
user.drop_item()
I.loc = src
I.forceMove(src)
updateUsrDialog()
to_chat(user, "<span class='notice'>You put [I] into [src].</span>")
return
/obj/structure/janitorialcart/on_reagent_change()
update_icon()
/obj/structure/janitorialcart/attackby(obj/item/I, mob/user, params)
var/fail_msg = "<span class='notice'>There is already one of those in [src].</span>"
@@ -55,7 +49,7 @@
if(istype(I, /obj/item/mop))
var/obj/item/mop/m=I
if(m.reagents.total_volume < m.reagents.maximum_volume)
wet_mop(m, user)
m.wet_mop(src, user)
return
if(!mymop)
m.janicart_insert(user, src)
@@ -185,3 +179,17 @@
overlays += "cart_replacer"
if(signs)
overlays += "cart_sign[signs]"
if(reagents.total_volume > 0)
var/image/reagentsImage = image(icon,src,"cart_reagents0")
reagentsImage.alpha = 150
switch((reagents.total_volume/reagents.maximum_volume)*100)
if(1 to 25)
reagentsImage.icon_state = "cart_reagents1"
if(26 to 50)
reagentsImage.icon_state = "cart_reagents2"
if(51 to 75)
reagentsImage.icon_state = "cart_reagents3"
if(76 to 100)
reagentsImage.icon_state = "cart_reagents4"
reagentsImage.icon += mix_color_from_reagents(reagents.reagent_list)
add_overlay(reagentsImage)
+49 -6
View File
@@ -5,6 +5,8 @@
icon_state = "mopbucket"
density = 1
container_type = OPENCONTAINER
face_while_pulling = FALSE
var/obj/item/mop/mymop = null
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
/obj/structure/mopbucket/Initialize(mapload)
@@ -27,11 +29,52 @@
/obj/structure/mopbucket/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/mop))
if(src.reagents.total_volume >= 2)
src.reagents.trans_to(W, 2)
to_chat(user, "<span class='notice'>You wet the mop</span>")
playsound(src.loc, 'sound/effects/slosh.ogg', 25, 1)
if(src.reagents.total_volume < 1)
to_chat(user, "<span class='notice'>Out of water!</span>")
var/obj/item/mop/m = W
if(m.reagents.total_volume < m.reagents.maximum_volume)
m.wet_mop(src, user)
return
if(!mymop)
m.janicart_insert(user, src)
return
to_chat(user, "<span class='notice'>Theres already a mop in the mopbucket.</span>")
return
return ..()
/obj/structure/mopbucket/proc/put_in_cart(obj/item/mop/I, mob/user)
user.drop_item()
I.forceMove(src)
to_chat(user, "<span class='notice'>You put [I] into [src].</span>")
return
/obj/structure/mopbucket/on_reagent_change()
update_icon()
/obj/structure/mopbucket/update_icon()
overlays.Cut()
if(mymop)
overlays += image(icon,"mopbucket_mop")
if(reagents.total_volume > 0)
var/image/reagentsImage = image(icon, src, "mopbucket_reagents0")
reagentsImage.alpha = 150
switch((reagents.total_volume/reagents.maximum_volume)*100)
if(1 to 25)
reagentsImage.icon_state = "mopbucket_reagents1"
if(26 to 50)
reagentsImage.icon_state = "mopbucket_reagents2"
if(51 to 75)
reagentsImage.icon_state = "mopbucket_reagents3"
if(76 to 100)
reagentsImage.icon_state = "mopbucket_reagents4"
reagentsImage.icon += mix_color_from_reagents(reagents.reagent_list)
add_overlay(reagentsImage)
/obj/structure/mopbucket/attack_hand(mob/living/user)
. = ..()
if(mymop)
user.put_in_hands(mymop)
to_chat(user, "<span class='notice'>You take [mymop] from [src].</span>")
mymop = null
update_icon()
return