mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-22 08:01:06 +00:00
Janitor slot and janicart tweaks (#612)
Adds an extra janitor slot and some mapping work to support it, reworks the janicart a fair bit. changes: rscadd: "Increased number of janitor slots to two." rscadd: "Janitorial carts can now be constructed with metal sheets, and deconstructed with a wrench, welder or plasmacutter if empty." tweak: "Janicarts now come without a bucket. Click and drag a mop bucket onto a cart to mount it, and you can unmount it from the janicart interface." tweak: "Placing a mop into a janicart, and pouring containers into the bucket, is now done with alt-click. A leftclick will now always wet the mop, and throw objects into the trashbag, respectively." rscadd: "Janicarts can now be climbed over like tables - Click and drag your sprite onto it." tweak: "Custodial closet's Spraycleaner, cleaning grenades, and spare lights, are now inside the janitorial locker instead of on table/floor." tweak: "Added an extra janitorial locker in the custodial closet." bugfix: "Fixed the Captain's deluxe soap being unuseable for cleaning" tweak: "Soap can now clean more tiles when wetted" tweak: "Soap and rags can now be wetted in buckets, mopbuckets, watertanks and janicarts"
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
icon_state = "soapdeluxe"
|
||||
|
||||
/obj/item/weapon/soap/deluxe/New()
|
||||
..()
|
||||
desc = "A deluxe Waffle Co. brand bar of soap. Smells of [pick("lavender", "vanilla", "strawberry", "chocolate" ,"space")]."
|
||||
|
||||
/obj/item/weapon/soap/syndie
|
||||
|
||||
@@ -184,8 +184,8 @@
|
||||
department = "Civilian"
|
||||
department_flag = CIVILIAN
|
||||
faction = "Station"
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
total_positions = 2
|
||||
spawn_positions = 2
|
||||
supervisors = "the head of personnel"
|
||||
selection_color = "#dddddd"
|
||||
access = list(access_janitor, access_maint_tunnels, access_engine, access_research, access_sec_doors, access_medical)
|
||||
|
||||
@@ -17,11 +17,12 @@
|
||||
*/
|
||||
/obj/item/weapon/soap/New()
|
||||
..()
|
||||
create_reagents(5)
|
||||
create_reagents(10)
|
||||
wet()
|
||||
|
||||
|
||||
/obj/item/weapon/soap/proc/wet()
|
||||
reagents.add_reagent("cleaner", 5)
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
reagents.add_reagent("cleaner", 10)
|
||||
|
||||
/obj/item/weapon/soap/Crossed(AM as mob|obj)
|
||||
if (istype(AM, /mob/living))
|
||||
@@ -38,12 +39,20 @@
|
||||
user << "<span class='notice'>You scrub \the [target.name] out.</span>"
|
||||
qdel(target)
|
||||
else if(istype(target,/turf))
|
||||
user << "<span class='notice'>You scrub \the [target.name] clean.</span>"
|
||||
var/turf/T = target
|
||||
T.clean(src, user)
|
||||
else if(istype(target,/obj/structure/sink))
|
||||
user << "You start scrubbing the [target.name]"
|
||||
if (do_after(user, 30, needhand = 0))
|
||||
user << "<span class='notice'>You scrub \the [target.name] clean.</span>"
|
||||
var/turf/T = target
|
||||
T.clean(src, user)
|
||||
else if(istype(target,/obj/structure/sink) || istype(target,/obj/structure/sink))
|
||||
user << "<span class='notice'>You wet \the [src] in the sink.</span>"
|
||||
wet()
|
||||
else if (istype(target, /obj/structure/mopbucket) || istype(target, /obj/item/weapon/reagent_containers/glass) || istype(target, /obj/structure/reagent_dispensers/watertank))
|
||||
if (target.reagents && target.reagents.total_volume)
|
||||
user << "<span class='notice'>You wet \the [src] in the [target].</span>"
|
||||
wet()
|
||||
else
|
||||
user << "\The [target] is empty!"
|
||||
else
|
||||
user << "<span class='notice'>You clean \the [target.name].</span>"
|
||||
target.clean_blood()
|
||||
|
||||
@@ -458,6 +458,16 @@
|
||||
max_w_class = max(I.w_class, max_w_class)
|
||||
max_storage_space += I.get_storage_cost()
|
||||
|
||||
//Useful for spilling the contents of containers all over the floor
|
||||
/obj/item/weapon/storage/proc/spill()
|
||||
if (istype(loc, /turf))//If its not on the floor this might cause issues
|
||||
var/turf/T = get_turf(src)
|
||||
for (var/obj/O in contents)
|
||||
contents.Remove(O)
|
||||
O.forceMove(T)
|
||||
O.tumble(2)
|
||||
|
||||
|
||||
//Returns the storage depth of an atom. This is the number of storage items the atom is contained in before reaching toplevel (the area).
|
||||
//Returns -1 if the atom was not found on container.
|
||||
/atom/proc/storage_depth(atom/container)
|
||||
|
||||
@@ -155,3 +155,15 @@
|
||||
tesla_zap(src, 5, power_bounced)
|
||||
spawn(10)
|
||||
being_shocked = 0
|
||||
|
||||
|
||||
//To be called from things that spill objects on the floor.
|
||||
//Makes an object move around randomly for a couple of tiles
|
||||
/obj/proc/tumble(var/dist)
|
||||
if (dist >= 1)
|
||||
spawn()
|
||||
dist += rand(0,1)
|
||||
for(var/i = 1, i <= dist, i++)
|
||||
if(src)
|
||||
step(src, pick(NORTH,SOUTH,EAST,WEST))
|
||||
sleep(rand(2,4))
|
||||
|
||||
@@ -78,7 +78,12 @@
|
||||
new /obj/item/weapon/storage/bag/trash(src)
|
||||
new /obj/item/clothing/shoes/galoshes(src)
|
||||
new /obj/item/weapon/storage/belt/janitor(src)
|
||||
|
||||
new /obj/item/weapon/storage/box/lights/mixed(src)
|
||||
new /obj/item/weapon/grenade/chem_grenade/cleaner(src)
|
||||
new /obj/item/weapon/grenade/chem_grenade/cleaner(src)
|
||||
new /obj/item/weapon/grenade/chem_grenade/cleaner(src)
|
||||
new /obj/item/weapon/reagent_containers/spray/cleaner(src)
|
||||
|
||||
/*
|
||||
* Lawyer
|
||||
*/
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
icon_state = "cart"
|
||||
anchored = 0
|
||||
density = 1
|
||||
climbable = 1
|
||||
flags = OPENCONTAINER
|
||||
//copypaste sorry
|
||||
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
|
||||
@@ -12,74 +13,179 @@
|
||||
var/obj/item/weapon/mop/mymop = null
|
||||
var/obj/item/weapon/reagent_containers/spray/myspray = null
|
||||
var/obj/item/device/lightreplacer/myreplacer = null
|
||||
var/obj/structure/mopbucket/mybucket = null
|
||||
var/signs = 0 //maximum capacity hardcoded below
|
||||
var/has_items = 0//This is set true whenever the cart has anything loaded/mounted on it
|
||||
var/dismantled = 0//This is set true after the object has been dismantled to avoid an infintie loop
|
||||
|
||||
|
||||
/obj/structure/janitorialcart/New()
|
||||
create_reagents(100)
|
||||
///obj/structure/janitorialcart/New()
|
||||
|
||||
|
||||
/obj/structure/janitorialcart/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
user << "[src] \icon[src] contains [reagents.total_volume] unit\s of liquid!"
|
||||
if (mybucket)
|
||||
user << "[src] \icon The bucket contains [mybucket.reagents.total_volume] unit\s of liquid!"
|
||||
else
|
||||
user << "[src] \icon There is no bucket mounted on it!"
|
||||
//everything else is visible, so doesn't need to be mentioned
|
||||
|
||||
|
||||
/obj/structure/janitorialcart/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/weapon/storage/bag/trash) && !mybag)
|
||||
user.drop_item()
|
||||
mybag = I
|
||||
I.loc = src
|
||||
/obj/structure/janitorialcart/MouseDrop_T(atom/movable/O as mob|obj, mob/living/user as mob)
|
||||
if (istype(O, /obj/structure/mopbucket) && !mybucket)
|
||||
O.loc = src
|
||||
mybucket = O
|
||||
user << "You mount the [O] on the janicart."
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
user << "<span class='notice'>You put [I] into [src].</span>"
|
||||
else
|
||||
..()
|
||||
|
||||
else if(istype(I, /obj/item/weapon/mop))
|
||||
if(I.reagents.total_volume < I.reagents.maximum_volume) //if it's not completely soaked we assume they want to wet it, otherwise store it
|
||||
if(reagents.total_volume < 1)
|
||||
user << "[src] is out of water!</span>"
|
||||
else
|
||||
reagents.trans_to_obj(I, 5) //
|
||||
user << "<span class='notice'>You wet [I] in [src].</span>"
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
return
|
||||
//New Altclick functionality!
|
||||
//Altclick the cart with a mop to stow the mop away
|
||||
//Altclick the cart with a reagent container to pour things into the bucket without putting the bottle in trash
|
||||
/obj/structure/janitorialcart/AltClick()
|
||||
var/obj/I = usr.get_active_hand()
|
||||
if(istype(I, /obj/item/weapon/mop))
|
||||
if(!mymop)
|
||||
user.drop_item()
|
||||
usr.drop_item()
|
||||
mymop = I
|
||||
I.loc = src
|
||||
I.forceMove(src)
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
user << "<span class='notice'>You put [I] into [src].</span>"
|
||||
usr << "<span class='notice'>You put [I] into [src].</span>"
|
||||
else
|
||||
usr << "<span class='notice'>The cart already has a mop attached</span>"
|
||||
return
|
||||
else if(istype(I, /obj/item/weapon/reagent_containers) && mybucket)
|
||||
var/obj/item/weapon/reagent_containers/C = I
|
||||
C.afterattack(mybucket, usr, 1)
|
||||
|
||||
/obj/structure/janitorialcart/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/weapon/mop) || istype(I, /obj/item/weapon/reagent_containers/glass/rag) || istype(I, /obj/item/weapon/soap))
|
||||
if (mybucket)
|
||||
if(I.reagents.total_volume < I.reagents.maximum_volume)
|
||||
if(mybucket.reagents.total_volume < 1)
|
||||
user << "<span class='notice'>[mybucket] is empty!</span>"
|
||||
else
|
||||
mybucket.reagents.trans_to_obj(I, 5) //
|
||||
user << "<span class='notice'>You wet [I] in [mybucket].</span>"
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
else
|
||||
user << "<span class='notice'>[I] can't absorb anymore liquid!</span>"
|
||||
else
|
||||
user << "<span class='notice'>There is no bucket mounted here to dip [I] into!</span>"
|
||||
return 1
|
||||
|
||||
else if(istype(I, /obj/item/weapon/reagent_containers/spray) && !myspray)
|
||||
user.drop_item()
|
||||
myspray = I
|
||||
I.loc = src
|
||||
I.forceMove(src)
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
user << "<span class='notice'>You put [I] into [src].</span>"
|
||||
return 1
|
||||
|
||||
else if(istype(I, /obj/item/device/lightreplacer) && !myreplacer)
|
||||
user.drop_item()
|
||||
myreplacer = I
|
||||
I.loc = src
|
||||
I.forceMove(src)
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
user << "<span class='notice'>You put [I] into [src].</span>"
|
||||
return 1
|
||||
|
||||
else if(istype(I, /obj/item/weapon/storage/bag/trash) && !mybag)
|
||||
user.drop_item()
|
||||
mybag = I
|
||||
I.forceMove(src)
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
user << "<span class='notice'>You put [I] into [src].</span>"
|
||||
return 1
|
||||
|
||||
else if(istype(I, /obj/item/weapon/caution))
|
||||
if(signs < 4)
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
I.forceMove(src)
|
||||
signs++
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
user << "<span class='notice'>You put [I] into [src].</span>"
|
||||
else
|
||||
user << "<span class='notice'>[src] can't hold any more signs.</span>"
|
||||
return 1
|
||||
|
||||
else if(mybag)
|
||||
mybag.attackby(I, user)
|
||||
return mybag.attackby(I, user)
|
||||
//This return will prevent afterattack from executing if the object goes into the trashbag,
|
||||
//This prevents dumb stuff like splashing the cart with the contents of a container, after putting said container into trash
|
||||
|
||||
else if (!has_items && (istype(I, /obj/item/weapon/wrench) || istype(I, /obj/item/weapon/weldingtool) || istype(I, /obj/item/weapon/pickaxe/plasmacutter)))
|
||||
dismantle(user)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/structure/janitorialcart/proc/dismantle(var/mob/user = null)
|
||||
if (!dismantled)
|
||||
if (has_items)
|
||||
spill()
|
||||
|
||||
if (user)
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user.visible_message("[user] starts taking apart the [src]", "You start disasembling the [src]")
|
||||
if (!do_after(user, 30, needhand = 0))
|
||||
return
|
||||
|
||||
new /obj/item/stack/material/steel(src.loc, 15)
|
||||
dismantled = 1
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/janitorialcart/ex_act(severity)
|
||||
spill(100 / severity)
|
||||
..()
|
||||
|
||||
//This is called if the cart is caught in an explosion, or destroyed by weapon fire
|
||||
/obj/structure/janitorialcart/proc/spill(var/chance = 100)
|
||||
var/turf/dropspot = get_turf(src)
|
||||
if (mymop && prob(chance))
|
||||
mymop.forceMove(dropspot)
|
||||
mymop.tumble(2)
|
||||
mymop = null
|
||||
|
||||
if (myspray && prob(chance))
|
||||
myspray.forceMove(dropspot)
|
||||
myspray.tumble(3)
|
||||
myspray = null
|
||||
|
||||
if (myreplacer && prob(chance))
|
||||
myreplacer.forceMove(dropspot)
|
||||
myreplacer.tumble(3)
|
||||
myreplacer = null
|
||||
|
||||
if (mybucket && prob(chance*0.5))//bucket is heavier, harder to knock off
|
||||
mybucket.forceMove(dropspot)
|
||||
mybucket.tumble(1)
|
||||
mybucket = null
|
||||
|
||||
if (signs)
|
||||
for (var/obj/item/weapon/caution/Sign in src)
|
||||
if (prob(min((chance*2),100)))
|
||||
signs--
|
||||
Sign.forceMove(dropspot)
|
||||
Sign.tumble(3)
|
||||
if (signs < 0)//safety for something that shouldn't happen
|
||||
signs = 0
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if (mybag && prob(min((chance*2),100)))//Bag is flimsy
|
||||
mybag.forceMove(dropspot)
|
||||
mybag.tumble(1)
|
||||
mybag.spill()//trashbag spills its contents too
|
||||
mybag = null
|
||||
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
/obj/structure/janitorialcart/attack_hand(mob/user)
|
||||
@@ -90,6 +196,7 @@
|
||||
var/data[0]
|
||||
data["name"] = capitalize(name)
|
||||
data["bag"] = mybag ? capitalize(mybag.name) : null
|
||||
data["bucket"] = mybucket ? capitalize(mybucket.name) : null
|
||||
data["mop"] = mymop ? capitalize(mymop.name) : null
|
||||
data["spray"] = myspray ? capitalize(myspray.name) : null
|
||||
data["replacer"] = myreplacer ? capitalize(myreplacer.name) : null
|
||||
@@ -107,7 +214,7 @@
|
||||
if(!isliving(usr))
|
||||
return
|
||||
var/mob/living/user = usr
|
||||
|
||||
|
||||
if(href_list["take"])
|
||||
switch(href_list["take"])
|
||||
if("garbage")
|
||||
@@ -140,6 +247,11 @@
|
||||
else
|
||||
warning("[src] signs ([signs]) didn't match contents")
|
||||
signs = 0
|
||||
if("bucket")
|
||||
if(mybucket)
|
||||
mybucket.forceMove(get_turf(user))
|
||||
user << "<span class='notice'>You unmount [mybucket] from [src].</span>"
|
||||
mybucket = null
|
||||
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
@@ -147,16 +259,25 @@
|
||||
|
||||
/obj/structure/janitorialcart/update_icon()
|
||||
overlays = null
|
||||
has_items = 0
|
||||
if(mybucket)
|
||||
overlays += "cart_bucket"
|
||||
has_items = 1
|
||||
if(mybag)
|
||||
overlays += "cart_garbage"
|
||||
has_items = 1
|
||||
if(mymop)
|
||||
overlays += "cart_mop"
|
||||
has_items = 1
|
||||
if(myspray)
|
||||
overlays += "cart_spray"
|
||||
has_items = 1
|
||||
if(myreplacer)
|
||||
overlays += "cart_replacer"
|
||||
has_items = 1
|
||||
if(signs)
|
||||
overlays += "cart_sign[signs]"
|
||||
has_items = 1
|
||||
|
||||
|
||||
//old style retardo-cart
|
||||
|
||||
@@ -132,12 +132,13 @@
|
||||
if(!proximity)
|
||||
return
|
||||
|
||||
if(istype(A, /obj/structure/reagent_dispensers))
|
||||
if(istype(A, /obj/structure/reagent_dispensers) || istype(A, /obj/structure/mopbucket) || istype(A, /obj/item/weapon/reagent_containers/glass))
|
||||
if(!reagents.get_free_space())
|
||||
user << "<span class='warning'>\The [src] is already soaked.</span>"
|
||||
return
|
||||
|
||||
if(A.reagents && A.reagents.trans_to_obj(src, reagents.maximum_volume))
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
user.visible_message("<span class='notice'>\The [user] soaks [src] using [A].</span>", "<span class='notice'>You soak [src] using [A].</span>")
|
||||
update_name()
|
||||
return
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
))
|
||||
|
||||
recipes += new/datum/stack_recipe("table frame", /obj/structure/table, 1, time = 10, one_per_turf = 1, on_floor = 1)
|
||||
recipes += new/datum/stack_recipe("custodial cart", /obj/structure/janitorialcart, 15, time = 120, one_per_turf = 1, on_floor = 1)
|
||||
recipes += new/datum/stack_recipe("rack", /obj/structure/table/rack, 1, time = 5, one_per_turf = 1, on_floor = 1)
|
||||
recipes += new/datum/stack_recipe("closet", /obj/structure/closet, 2, time = 15, one_per_turf = 1, on_floor = 1)
|
||||
recipes += new/datum/stack_recipe("canister", /obj/machinery/portable_atmospherics/canister, 10, time = 15, one_per_turf = 1, on_floor = 1)
|
||||
|
||||
Reference in New Issue
Block a user