mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-28 22:47:59 +01:00
Mop, Mop Bucket, and Janicart Refactor (#28049)
* Update mop.dm * This... Is a bucket * Dear god... * Update janicart.dm * There's more * No! * Finished? * newline * Update janicart.dm * Update mop.dm * Update mop.dm * Update mop.dm
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#define MOP_SOUND_CD 2 SECONDS // How many seconds before the mopping sound triggers again
|
||||
|
||||
/obj/item/mop
|
||||
desc = "The world of janitalia wouldn't be complete without a mop."
|
||||
name = "mop"
|
||||
desc = "The world of janitalia wouldn't be complete without a mop."
|
||||
icon = 'icons/obj/janitor.dmi'
|
||||
icon_state = "mop"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi'
|
||||
@@ -14,6 +14,7 @@
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
attack_verb = list("mopped", "bashed", "bludgeoned", "whacked")
|
||||
resistance_flags = FLAMMABLE
|
||||
new_attack_chain = TRUE
|
||||
var/mopcap = 6
|
||||
var/mopspeed = 30
|
||||
/// The cooldown between each mopping sound effect
|
||||
@@ -28,41 +29,55 @@
|
||||
GLOB.janitorial_equipment -= src
|
||||
return ..()
|
||||
|
||||
/obj/item/mop/proc/wet_mop(obj/O, mob/user)
|
||||
/obj/item/mop/proc/wet_mop(obj/O, mob/user, robot_mop)
|
||||
if(O.reagents.total_volume < 1)
|
||||
to_chat(user, "<span class='notice'>[O] is empty!</span>")
|
||||
to_chat(user, "<span class='warning'>[O] is empty!</span>")
|
||||
if(robot_mop)
|
||||
return
|
||||
|
||||
if(istype(O, /obj/structure/mopbucket))
|
||||
var/obj/structure/mopbucket/mopbucket = O
|
||||
mopbucket.mopbucket_insert(user, O)
|
||||
if(!mopbucket.stored_mop)
|
||||
mopbucket.stored_mop = src
|
||||
mopbucket.put_in_cart(user, src)
|
||||
return
|
||||
|
||||
if(istype(O, /obj/structure/janitorialcart))
|
||||
var/obj/structure/janitorialcart/janicart = O
|
||||
if(!janicart.mymop)
|
||||
janicart.mymop = src
|
||||
var/obj/structure/janitorialcart/janicart = O
|
||||
if(!janicart.my_mop)
|
||||
janicart.my_mop = src
|
||||
janicart.put_in_cart(user, src)
|
||||
return
|
||||
return
|
||||
|
||||
O.reagents.trans_to(src, 6)
|
||||
to_chat(user, "<span class='notice'>You wet [src] in [O].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, TRUE)
|
||||
|
||||
/obj/item/mop/afterattack__legacy__attackchain(atom/A, mob/user, proximity)
|
||||
if(!proximity)
|
||||
return
|
||||
if(istype(A, /obj/item/reagent_containers/glass/bucket) || istype(A, /obj/structure/janitorialcart) || istype(A, /obj/structure/mopbucket))
|
||||
return
|
||||
/obj/item/mop/interact_with_atom(atom/target, mob/living/user, list/modifiers)
|
||||
// Use the mop as a weapon.
|
||||
if(user.a_intent != INTENT_HELP)
|
||||
return ..()
|
||||
|
||||
if(istype(target, /obj/item/reagent_containers/glass/bucket/))
|
||||
return ..()
|
||||
|
||||
if(istype(target, /obj/structure/janitorialcart/) || istype(target, /obj/structure/mopbucket))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(reagents.total_volume < 1)
|
||||
to_chat(user, "<span class='warning'>Your mop is dry!</span>")
|
||||
return
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(world.time > mop_sound_cooldown)
|
||||
playsound(loc, pick('sound/weapons/mopping1.ogg', 'sound/weapons/mopping2.ogg'), 30, TRUE, -1)
|
||||
mop_sound_cooldown = world.time + MOP_SOUND_CD
|
||||
A.cleaning_act(user, src, mopspeed, text_verb = "mop", text_description = ".")
|
||||
target.cleaning_act(user, src, mopspeed, text_verb = "mop", text_description = ".")
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/mop/can_clean()
|
||||
. = FALSE
|
||||
if(reagents.has_reagent("water", 1) || reagents.has_reagent("cleaner", 1) || reagents.has_reagent("holywater", 1))
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
|
||||
/obj/item/mop/post_clean(atom/target, mob/user)
|
||||
var/turf/T = get_turf(target)
|
||||
@@ -70,21 +85,15 @@
|
||||
reagents.reaction(T, REAGENT_TOUCH, 10) //10 is the multiplier for the reaction effect. probably needed to wet the floor properly.
|
||||
reagents.remove_any(1) //reaction() doesn't use up the reagents
|
||||
|
||||
/obj/effect/attackby__legacy__attackchain(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/mop) || istype(I, /obj/item/soap))
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/mop/wash(mob/user, atom/source)
|
||||
reagents.add_reagent("water", 5)
|
||||
to_chat(user, "<span class='notice'>You wet [src] in [source].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/item/mop/advanced
|
||||
desc = "The most advanced tool in a custodian's arsenal. Just think of all the viscera you will clean up with this!"
|
||||
name = "advanced mop"
|
||||
desc = "The most advanced tool in a custodian's arsenal. Just think of all the viscera you will clean up with this!"
|
||||
mopcap = 10
|
||||
icon_state = "advmop"
|
||||
origin_tech = "materials=3;engineering=3"
|
||||
@@ -92,15 +101,21 @@
|
||||
throwforce = 8
|
||||
throw_range = 4
|
||||
mopspeed = 20
|
||||
var/refill_enabled = TRUE //Self-refill toggle for when a janitor decides to mop with something other than water.
|
||||
var/refill_rate = 1 //Rate per process() tick mop refills itself
|
||||
var/refill_reagent = "water" //Determins what reagent to use for refilling, just in case someone wanted to make a HOLY MOP OF PURGING
|
||||
/// Self-refill toggle for when a janitor decides to mop with something other than water.
|
||||
var/refill_enabled = TRUE
|
||||
/// Rate per process() tick mop refills itself
|
||||
var/refill_rate = 1
|
||||
/// Determins what reagent to use for refilling, just in case someone wanted to make a HOLY MOP OF PURGING
|
||||
var/refill_reagent = "water"
|
||||
|
||||
/obj/item/mop/advanced/New()
|
||||
..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/item/mop/advanced/attack_self__legacy__attackchain(mob/user)
|
||||
/obj/item/mop/advanced/activate_self(mob/user)
|
||||
if(..())
|
||||
return
|
||||
|
||||
refill_enabled = !refill_enabled
|
||||
if(refill_enabled)
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
@@ -952,7 +952,7 @@
|
||||
for(var/obj/item/garbage in current_item_loc.contents)
|
||||
if(garbage.anchored)
|
||||
continue
|
||||
var/obj/item/storage/bag/trash/bag = jani_vehicle?.mybag || jani_cart?.mybag
|
||||
var/obj/item/storage/bag/trash/bag = jani_vehicle?.mybag || jani_cart?.my_bag
|
||||
var/obj/trashed_into
|
||||
if(bag?.can_be_inserted(garbage, TRUE))
|
||||
bag.handle_item_insertion(garbage, user, TRUE)
|
||||
|
||||
Reference in New Issue
Block a user