Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced Mop can now make its own water #21903

Merged
merged 2 commits into from
Dec 4, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 31 additions & 1 deletion code/game/objects/items/weapons/mop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
return

/obj/item/weapon/mop/advanced
desc = "The most advanced tool in a custodian's arsenal. Just think of all the viscera you will clean up with this!"
desc = "The most advanced tool in a custodian's arsenal, complete with a condenser for self-wetting! Just think of all the viscera you will clean up with this!"
name = "advanced mop"
mopcap = 10
icon_state = "advmop"
Expand All @@ -78,3 +78,33 @@
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

/obj/item/weapon/mop/advanced/New()
..()
START_PROCESSING(SSobj, src)

/obj/item/weapon/mop/advanced/attack_self(mob/user)
refill_enabled = !refill_enabled
if(refill_enabled)
START_PROCESSING(SSobj, src)
else
STOP_PROCESSING(SSobj,src)
user << "<span class='notice'>You turn [refill_enabled ? "on" : "off"] the condenser.</span>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it look better being: "You turn the condenser [on : off]." ? Maybe it's just me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change it a little, but not exactly that, it seems weird.

playsound(user, 'sound/machines/click.ogg', 30, 1)

/obj/item/weapon/mop/advanced/process()

if(reagents.total_volume < mopcap)
reagents.add_reagent(refill_reagent, refill_rate)

/obj/item/weapon/mop/advanced/examine(mob/user)
..()
user << "<span class='notice'>The condenser switch is set to <b>[refill_enabled ? "ON" : "off"]</b>.</span>"

/obj/item/weapon/mop/advanced/Destroy()
if(refill_enabled)
STOP_PROCESSING(SSobj, src)
..()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty sure you need return ..() for Destroy()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any other things I should know before I commit?

Copy link
Contributor

@lzimann lzimann Dec 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

none that i've noticed