mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-03 22:12:38 +00:00
Christ on a stick. SO MANY ERRORS. REEE. # Conflicts: # baystation12.dme # code/_helpers/lists.dm # code/_helpers/logging.dm # code/_helpers/text.dm # code/_onclick/click.dm # code/controllers/configuration.dm # code/controllers/master_controller.dm # code/datums/supplypacks.dm # code/game/antagonist/antagonist.dm # code/game/antagonist/antagonist_print.dm # code/game/antagonist/outsider/commando.dm # code/game/antagonist/outsider/ninja.dm # code/game/area/areas.dm # code/game/gamemodes/cult/cult_items.dm # code/game/gamemodes/game_mode.dm # code/game/jobs/access.dm # code/game/machinery/atmoalter/canister.dm # code/game/machinery/autolathe.dm # code/game/machinery/doors/airlock.dm # code/game/machinery/recharger.dm # code/game/machinery/suit_storage_unit.dm # code/game/mecha/mech_fabricator.dm # code/game/mecha/mecha.dm # code/game/objects/effects/spiders.dm # code/game/objects/items.dm # code/game/objects/items/devices/PDA/PDA.dm # code/game/objects/items/devices/flash.dm # code/game/objects/items/devices/lightreplacer.dm # code/game/objects/items/devices/paicard.dm # code/game/objects/items/devices/scanners.dm # code/game/objects/items/devices/suit_cooling.dm # code/game/objects/items/devices/uplink.dm # code/game/objects/items/robot/robot_upgrades.dm # code/game/objects/items/toys.dm # code/game/objects/items/weapons/cards_ids.dm # code/game/objects/items/weapons/handcuffs.dm # code/game/objects/items/weapons/manuals.dm # code/game/objects/items/weapons/material/kitchen.dm # code/game/objects/items/weapons/material/misc.dm # code/game/objects/items/weapons/material/swords.dm # code/game/objects/items/weapons/melee/energy.dm # code/game/objects/items/weapons/melee/misc.dm # code/game/objects/items/weapons/scrolls.dm # code/game/objects/items/weapons/storage/belt.dm # code/game/objects/items/weapons/stunbaton.dm # code/game/objects/items/weapons/tools.dm # code/game/objects/objs.dm # code/game/objects/structures/crates_lockers/closets.dm # code/game/objects/structures/crates_lockers/closets/secure/security.dm # code/game/objects/structures/janicart.dm # code/game/sound.dm # code/game/turfs/simulated.dm # code/game/verbs/ooc.dm # code/global.dm # code/modules/admin/verbs/debug.dm # code/modules/admin/verbs/modifyvariables.dm # code/modules/client/client procs.dm # code/modules/client/preferences.dm # code/modules/clothing/clothing.dm # code/modules/clothing/head/hardhat.dm # code/modules/clothing/head/helmet.dm # code/modules/clothing/head/jobs.dm # code/modules/clothing/head/misc_special.dm # code/modules/clothing/shoes/jobs.dm # code/modules/clothing/spacesuits/alien.dm # code/modules/clothing/spacesuits/captain.dm # code/modules/clothing/spacesuits/miscellaneous.dm # code/modules/clothing/spacesuits/rig/rig_pieces.dm # code/modules/clothing/spacesuits/rig/suits/alien.dm # code/modules/clothing/spacesuits/spacesuits.dm # code/modules/clothing/spacesuits/void/merc.dm # code/modules/clothing/spacesuits/void/void.dm # code/modules/clothing/suits/armor.dm # code/modules/clothing/suits/jobs.dm # code/modules/clothing/suits/storage.dm # code/modules/clothing/suits/utility.dm # code/modules/clothing/suits/wiz_robe.dm # code/modules/clothing/under/jobs/security.dm # code/modules/economy/Events.dm # code/modules/economy/Events_Mundane.dm # code/modules/economy/economy_misc.dm # code/modules/events/blob.dm # code/modules/events/event.dm # code/modules/events/event_container.dm # code/modules/events/event_manager.dm # code/modules/events/money_lotto.dm # code/modules/events/prison_break.dm # code/modules/events/spacevine.dm # code/modules/hydroponics/trays/tray.dm # code/modules/mob/dead/observer/observer.dm # code/modules/mob/emote.dm # code/modules/mob/holder.dm # code/modules/mob/language/station.dm # code/modules/mob/living/bot/cleanbot.dm # code/modules/mob/living/carbon/alien/diona/diona.dm # code/modules/mob/living/carbon/alien/diona/diona_attacks.dm # code/modules/mob/living/carbon/give.dm # code/modules/mob/living/carbon/human/emote.dm # code/modules/mob/living/carbon/human/human.dm # code/modules/mob/living/carbon/human/human_defense.dm # code/modules/mob/living/carbon/human/inventory.dm # code/modules/mob/living/carbon/human/life.dm # code/modules/mob/living/carbon/human/species/outsider/vox.dm # code/modules/mob/living/carbon/human/species/station/golem.dm # code/modules/mob/living/carbon/human/species/station/station.dm # code/modules/mob/living/carbon/human/update_icons.dm # code/modules/mob/living/carbon/metroid/metroid.dm # code/modules/mob/living/living.dm # code/modules/mob/living/living_defense.dm # code/modules/mob/living/living_defines.dm # code/modules/mob/living/silicon/ai/ai.dm # code/modules/mob/living/silicon/pai/admin.dm # code/modules/mob/living/silicon/pai/pai.dm # code/modules/mob/living/silicon/robot/drone/drone.dm # code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm # code/modules/mob/living/silicon/robot/emote.dm # code/modules/mob/living/silicon/robot/robot_items.dm # code/modules/mob/living/silicon/robot/robot_modules.dm # code/modules/mob/living/silicon/silicon.dm # code/modules/mob/living/simple_animal/bees.dm # code/modules/mob/living/simple_animal/friendly/cat.dm # code/modules/mob/living/simple_animal/friendly/corgi.dm # code/modules/mob/living/simple_animal/friendly/farm_animals.dm # code/modules/mob/living/simple_animal/friendly/mouse.dm # code/modules/mob/living/simple_animal/friendly/spiderbot.dm # code/modules/mob/living/simple_animal/hostile/hostile.dm # code/modules/mob/living/simple_animal/simple_animal.dm # code/modules/mob/logout.dm # code/modules/mob/mob.dm # code/modules/mob/mob_grab_specials.dm # code/modules/mob/mob_helpers.dm # code/modules/mob/new_player/sprite_accessories.dm # code/modules/organs/organ.dm # code/modules/organs/organ_alien.dm # code/modules/organs/organ_external.dm # code/modules/paperwork/faxmachine.dm # code/modules/projectiles/ammunition/boxes.dm # code/modules/projectiles/ammunition/bullets.dm # code/modules/projectiles/guns/energy/nuclear.dm # code/modules/projectiles/guns/energy/rifle.dm # code/modules/projectiles/guns/energy/special.dm # code/modules/projectiles/guns/projectile.dm # code/modules/projectiles/guns/projectile/automatic.dm # code/modules/projectiles/guns/projectile/pistol.dm # code/modules/projectiles/guns/projectile/revolver.dm # code/modules/projectiles/guns/projectile/shotgun.dm # code/modules/projectiles/projectile/bullets.dm # code/modules/projectiles/projectile/special.dm # code/modules/reagents/reagent_containers.dm # code/modules/reagents/reagent_containers/food/drinks.dm # code/modules/research/designs.dm # code/modules/research/destructive_analyzer.dm # code/modules/research/rdconsole.dm # code/modules/spells/artifacts.dm # code/modules/spells/spellbook.dm # code/modules/tables/tables.dm # code/world.dm # config/example/config.txt # icons/mob/items_lefthand.dmi # icons/mob/items_righthand.dmi # icons/obj/lighting.dmi
509 lines
16 KiB
Plaintext
509 lines
16 KiB
Plaintext
//todo: toothbrushes, and some sort of "toilet-filthinator" for the hos
|
|
|
|
/obj/structure/toilet
|
|
name = "toilet"
|
|
desc = "The HT-451, a torque rotation-based, waste disposal unit for small matter. This one seems remarkably clean."
|
|
icon = 'icons/obj/watercloset.dmi'
|
|
icon_state = "toilet00"
|
|
density = 0
|
|
anchored = 1
|
|
var/open = 0 //if the lid is up
|
|
var/cistern = 0 //if the cistern bit is open
|
|
var/w_items = 0 //the combined w_class of all the items in the cistern
|
|
var/mob/living/swirlie = null //the mob being given a swirlie
|
|
|
|
/obj/structure/toilet/New()
|
|
open = round(rand(0, 1))
|
|
update_icon()
|
|
|
|
/obj/structure/toilet/attack_hand(mob/living/user as mob)
|
|
if(swirlie)
|
|
usr.visible_message("<span class='danger'>[user] slams the toilet seat onto [swirlie.name]'s head!</span>", "<span class='notice'>You slam the toilet seat onto [swirlie.name]'s head!</span>", "You hear reverberating porcelain.")
|
|
swirlie.adjustBruteLoss(8)
|
|
return
|
|
|
|
if(cistern && !open)
|
|
if(!contents.len)
|
|
user << "<span class='notice'>The cistern is empty.</span>"
|
|
return
|
|
else
|
|
var/obj/item/I = pick(contents)
|
|
if(ishuman(user))
|
|
user.put_in_hands(I)
|
|
else
|
|
I.loc = get_turf(src)
|
|
user << "<span class='notice'>You find \an [I] in the cistern.</span>"
|
|
w_items -= I.w_class
|
|
return
|
|
|
|
open = !open
|
|
update_icon()
|
|
|
|
/obj/structure/toilet/update_icon()
|
|
icon_state = "toilet[open][cistern]"
|
|
|
|
/obj/structure/toilet/attackby(obj/item/I as obj, mob/living/user as mob)
|
|
if(istype(I, /obj/item/weapon/crowbar))
|
|
user << "<span class='notice'>You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"].</span>"
|
|
playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
|
|
if(do_after(user, 30))
|
|
user.visible_message("<span class='notice'>[user] [cistern ? "replaces the lid on the cistern" : "lifts the lid off the cistern"]!</span>", "<span class='notice'>You [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]!</span>", "You hear grinding porcelain.")
|
|
cistern = !cistern
|
|
update_icon()
|
|
return
|
|
|
|
if(istype(I, /obj/item/weapon/grab))
|
|
var/obj/item/weapon/grab/G = I
|
|
|
|
if(isliving(G.affecting))
|
|
var/mob/living/GM = G.affecting
|
|
|
|
if(G.state>1)
|
|
if(!GM.loc == get_turf(src))
|
|
user << "<span class='notice'>[GM.name] needs to be on the toilet.</span>"
|
|
return
|
|
if(open && !swirlie)
|
|
user.visible_message("<span class='danger'>[user] starts to give [GM.name] a swirlie!</span>", "<span class='notice'>You start to give [GM.name] a swirlie!</span>")
|
|
swirlie = GM
|
|
if(do_after(user, 30, 5, 0))
|
|
user.visible_message("<span class='danger'>[user] gives [GM.name] a swirlie!</span>", "<span class='notice'>You give [GM.name] a swirlie!</span>", "You hear a toilet flushing.")
|
|
if(!GM.internal)
|
|
GM.adjustOxyLoss(5)
|
|
swirlie = null
|
|
else
|
|
user.visible_message("<span class='danger'>[user] slams [GM.name] into the [src]!</span>", "<span class='notice'>You slam [GM.name] into the [src]!</span>")
|
|
GM.adjustBruteLoss(8)
|
|
else
|
|
user << "<span class='notice'>You need a tighter grip.</span>"
|
|
|
|
if(cistern && !istype(user,/mob/living/silicon/robot)) //STOP PUTTING YOUR MODULES IN THE TOILET.
|
|
if(I.w_class > 3)
|
|
user << "<span class='notice'>\The [I] does not fit.</span>"
|
|
return
|
|
if(w_items + I.w_class > 5)
|
|
user << "<span class='notice'>The cistern is full.</span>"
|
|
return
|
|
user.drop_item()
|
|
I.loc = src
|
|
w_items += I.w_class
|
|
user << "You carefully place \the [I] into the cistern."
|
|
return
|
|
|
|
|
|
|
|
/obj/structure/urinal
|
|
name = "urinal"
|
|
desc = "The HU-452, an experimental urinal."
|
|
icon = 'icons/obj/watercloset.dmi'
|
|
icon_state = "urinal"
|
|
density = 0
|
|
anchored = 1
|
|
|
|
/obj/structure/urinal/attackby(obj/item/I as obj, mob/user as mob)
|
|
if(istype(I, /obj/item/weapon/grab))
|
|
var/obj/item/weapon/grab/G = I
|
|
if(isliving(G.affecting))
|
|
var/mob/living/GM = G.affecting
|
|
if(G.state>1)
|
|
if(!GM.loc == get_turf(src))
|
|
user << "<span class='notice'>[GM.name] needs to be on the urinal.</span>"
|
|
return
|
|
user.visible_message("<span class='danger'>[user] slams [GM.name] into the [src]!</span>", "<span class='notice'>You slam [GM.name] into the [src]!</span>")
|
|
GM.adjustBruteLoss(8)
|
|
else
|
|
user << "<span class='notice'>You need a tighter grip.</span>"
|
|
|
|
|
|
|
|
/obj/machinery/shower
|
|
name = "shower"
|
|
desc = "The HS-451. Installed in the 2550s by the Hygiene Division."
|
|
icon = 'icons/obj/watercloset.dmi'
|
|
icon_state = "shower"
|
|
density = 0
|
|
anchored = 1
|
|
use_power = 0
|
|
var/on = 0
|
|
var/obj/effect/mist/mymist = null
|
|
var/ismist = 0 //needs a var so we can make it linger~
|
|
var/watertemp = "normal" //freezing, normal, or boiling
|
|
var/mobpresent = 0 //true if there is a mob on the shower's loc, this is to ease process()
|
|
var/is_washing = 0
|
|
var/list/temperature_settings = list("normal" = 310, "boiling" = T0C+100, "freezing" = T0C)
|
|
|
|
/obj/machinery/shower/New()
|
|
..()
|
|
create_reagents(2)
|
|
|
|
//add heat controls? when emagged, you can freeze to death in it?
|
|
|
|
/obj/effect/mist
|
|
name = "mist"
|
|
icon = 'icons/obj/watercloset.dmi'
|
|
icon_state = "mist"
|
|
layer = MOB_LAYER + 1
|
|
anchored = 1
|
|
mouse_opacity = 0
|
|
|
|
/obj/machinery/shower/attack_hand(mob/M as mob)
|
|
on = !on
|
|
update_icon()
|
|
if(on)
|
|
if (M.loc == loc)
|
|
wash(M)
|
|
process_heat(M)
|
|
for (var/atom/movable/G in src.loc)
|
|
G.clean_blood()
|
|
|
|
/obj/machinery/shower/attackby(obj/item/I as obj, mob/user as mob)
|
|
if(I.type == /obj/item/device/analyzer)
|
|
user << "<span class='notice'>The water temperature seems to be [watertemp].</span>"
|
|
if(istype(I, /obj/item/weapon/wrench))
|
|
var/newtemp = input(user, "What setting would you like to set the temperature valve to?", "Water Temperature Valve") in temperature_settings
|
|
user << "<span class='notice'>You begin to adjust the temperature valve with \the [I].</span>"
|
|
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
|
if(do_after(user, 50))
|
|
watertemp = newtemp
|
|
user.visible_message("<span class='notice'>[user] adjusts the shower with \the [I].</span>", "<span class='notice'>You adjust the shower with \the [I].</span>")
|
|
add_fingerprint(user)
|
|
|
|
/obj/machinery/shower/update_icon() //this is terribly unreadable, but basically it makes the shower mist up
|
|
overlays.Cut() //once it's been on for a while, in addition to handling the water overlay.
|
|
if(mymist)
|
|
qdel(mymist)
|
|
|
|
if(on)
|
|
overlays += image('icons/obj/watercloset.dmi', src, "water", MOB_LAYER + 1, dir)
|
|
if(temperature_settings[watertemp] < T20C)
|
|
return //no mist for cold water
|
|
if(!ismist)
|
|
spawn(50)
|
|
if(src && on)
|
|
ismist = 1
|
|
mymist = PoolOrNew(/obj/effect/mist,loc)
|
|
else
|
|
ismist = 1
|
|
mymist = PoolOrNew(/obj/effect/mist,loc)
|
|
else if(ismist)
|
|
ismist = 1
|
|
mymist = PoolOrNew(/obj/effect/mist,loc)
|
|
spawn(250)
|
|
if(src && !on)
|
|
qdel(mymist)
|
|
ismist = 0
|
|
|
|
/obj/machinery/shower/Crossed(atom/movable/O)
|
|
..()
|
|
wash(O)
|
|
if(ismob(O))
|
|
mobpresent += 1
|
|
process_heat(O)
|
|
|
|
/obj/machinery/shower/Uncrossed(atom/movable/O)
|
|
if(ismob(O))
|
|
mobpresent -= 1
|
|
..()
|
|
|
|
//Yes, showers are super powerful as far as washing goes.
|
|
/obj/machinery/shower/proc/wash(atom/movable/O as obj|mob)
|
|
if(!on) return
|
|
|
|
if(isliving(O))
|
|
var/mob/living/L = O
|
|
L.ExtinguishMob()
|
|
L.fire_stacks = -20 //Douse ourselves with water to avoid fire more easily
|
|
|
|
if(iscarbon(O))
|
|
var/mob/living/carbon/M = O
|
|
if(M.r_hand)
|
|
M.r_hand.clean_blood()
|
|
if(M.l_hand)
|
|
M.l_hand.clean_blood()
|
|
if(M.back)
|
|
if(M.back.clean_blood())
|
|
M.update_inv_back(0)
|
|
|
|
//flush away reagents on the skin
|
|
if(M.touching)
|
|
var/remove_amount = M.touching.maximum_volume * M.reagent_permeability() //take off your suit first
|
|
M.touching.remove_any(remove_amount)
|
|
|
|
if(ishuman(M))
|
|
var/mob/living/carbon/human/H = M
|
|
var/washgloves = 1
|
|
var/washshoes = 1
|
|
var/washmask = 1
|
|
var/washears = 1
|
|
var/washglasses = 1
|
|
|
|
if(H.wear_suit)
|
|
washgloves = !(H.wear_suit.flags_inv & HIDEGLOVES)
|
|
washshoes = !(H.wear_suit.flags_inv & HIDESHOES)
|
|
|
|
if(H.head)
|
|
washmask = !(H.head.flags_inv & HIDEMASK)
|
|
washglasses = !(H.head.flags_inv & HIDEEYES)
|
|
washears = !(H.head.flags_inv & HIDEEARS)
|
|
|
|
if(H.wear_mask)
|
|
if (washears)
|
|
washears = !(H.wear_mask.flags_inv & HIDEEARS)
|
|
if (washglasses)
|
|
washglasses = !(H.wear_mask.flags_inv & HIDEEYES)
|
|
|
|
if(H.head)
|
|
if(H.head.clean_blood())
|
|
H.update_inv_head(0)
|
|
if(H.wear_suit)
|
|
if(H.wear_suit.clean_blood())
|
|
H.update_inv_wear_suit(0)
|
|
else if(H.w_uniform)
|
|
if(H.w_uniform.clean_blood())
|
|
H.update_inv_w_uniform(0)
|
|
if(H.gloves && washgloves)
|
|
if(H.gloves.clean_blood())
|
|
H.update_inv_gloves(0)
|
|
if(H.shoes && washshoes)
|
|
if(H.shoes.clean_blood())
|
|
H.update_inv_shoes(0)
|
|
if(H.wear_mask && washmask)
|
|
if(H.wear_mask.clean_blood())
|
|
H.update_inv_wear_mask(0)
|
|
if(H.glasses && washglasses)
|
|
if(H.glasses.clean_blood())
|
|
H.update_inv_glasses(0)
|
|
if(H.l_ear && washears)
|
|
if(H.l_ear.clean_blood())
|
|
H.update_inv_ears(0)
|
|
if(H.r_ear && washears)
|
|
if(H.r_ear.clean_blood())
|
|
H.update_inv_ears(0)
|
|
if(H.belt)
|
|
if(H.belt.clean_blood())
|
|
H.update_inv_belt(0)
|
|
H.clean_blood(washshoes)
|
|
else
|
|
if(M.wear_mask) //if the mob is not human, it cleans the mask without asking for bitflags
|
|
if(M.wear_mask.clean_blood())
|
|
M.update_inv_wear_mask(0)
|
|
M.clean_blood()
|
|
else
|
|
O.clean_blood()
|
|
|
|
if(isturf(loc))
|
|
var/turf/tile = loc
|
|
loc.clean_blood()
|
|
for(var/obj/effect/E in tile)
|
|
if(istype(E,/obj/effect/rune) || istype(E,/obj/effect/decal/cleanable) || istype(E,/obj/effect/overlay))
|
|
qdel(E)
|
|
|
|
/obj/machinery/shower/process()
|
|
if(!on) return
|
|
wash_floor()
|
|
if(!mobpresent) return
|
|
for(var/mob/living/L in loc)
|
|
process_heat(L)
|
|
|
|
/obj/machinery/shower/proc/wash_floor()
|
|
if(!ismist && is_washing)
|
|
return
|
|
is_washing = 1
|
|
var/turf/T = get_turf(src)
|
|
reagents.add_reagent("water", 2)
|
|
T.clean(src)
|
|
spawn(100)
|
|
is_washing = 0
|
|
|
|
/obj/machinery/shower/proc/process_heat(mob/living/M)
|
|
if(!on || !istype(M)) return
|
|
|
|
var/temperature = temperature_settings[watertemp]
|
|
var/temp_adj = between(BODYTEMP_COOLING_MAX, temperature - M.bodytemperature, BODYTEMP_HEATING_MAX)
|
|
M.bodytemperature += temp_adj
|
|
|
|
if(ishuman(M))
|
|
var/mob/living/carbon/human/H = M
|
|
if(temperature >= H.species.heat_level_1)
|
|
H << "<span class='danger'>The water is searing hot!</span>"
|
|
else if(temperature <= H.species.cold_level_1)
|
|
H << "<span class='warning'>The water is freezing cold!</span>"
|
|
|
|
/obj/item/weapon/bikehorn/rubberducky
|
|
name = "rubber ducky"
|
|
desc = "Rubber ducky you're so fine, you make bathtime lots of fuuun. Rubber ducky I'm awfully fooooond of yooooouuuu~" //thanks doohl
|
|
icon = 'icons/obj/watercloset.dmi'
|
|
icon_state = "rubberducky"
|
|
item_state = "rubberducky"
|
|
|
|
|
|
|
|
/obj/structure/sink
|
|
name = "sink"
|
|
icon = 'icons/obj/watercloset.dmi'
|
|
icon_state = "sink"
|
|
desc = "A sink used for washing one's hands and face."
|
|
anchored = 1
|
|
var/busy = 0 //Something's being washed at the moment
|
|
|
|
/obj/structure/sink/attack_hand(mob/user as mob)
|
|
if (ishuman(user))
|
|
var/mob/living/carbon/human/H = user
|
|
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
|
|
if (user.hand)
|
|
temp = H.organs_by_name["l_hand"]
|
|
if(temp && !temp.is_usable())
|
|
user << "<span class='notice'>You try to move your [temp.name], but cannot!</span>"
|
|
return
|
|
|
|
if(isrobot(user) || isAI(user))
|
|
return
|
|
|
|
if(!Adjacent(user))
|
|
return
|
|
|
|
if(busy)
|
|
user << "<span class='warning'>Someone's already washing here.</span>"
|
|
return
|
|
|
|
usr << "<span class='notice'>You start washing your hands.</span>"
|
|
|
|
busy = 1
|
|
sleep(40)
|
|
busy = 0
|
|
|
|
if(!Adjacent(user)) return //Person has moved away from the sink
|
|
|
|
user.clean_blood()
|
|
if(ishuman(user))
|
|
user:update_inv_gloves()
|
|
for(var/mob/V in viewers(src, null))
|
|
V.show_message("<span class='notice'>[user] washes their hands using \the [src].</span>")
|
|
|
|
|
|
/obj/structure/sink/attackby(obj/item/O as obj, mob/user as mob)
|
|
if(busy)
|
|
user << "<span class='warning'>Someone's already washing here.</span>"
|
|
return
|
|
|
|
// Filling/emptying open reagent containers
|
|
var/obj/item/weapon/reagent_containers/RG = O
|
|
if (istype(RG) && RG.is_open_container())
|
|
var/atype = alert(usr, "Do you want to fill or empty \the [RG] at \the [src]?", "Fill or Empty", "Fill", "Empty", "Cancel")
|
|
|
|
if(!usr.Adjacent(src)) return
|
|
if(RG.loc != usr || (usr.l_hand != RG && usr.r_hand != RG)) return
|
|
if(busy)
|
|
usr << "<span class='warning'>Someone's already using \the [src].</span>"
|
|
return
|
|
|
|
switch(atype)
|
|
if ("Fill")
|
|
if(RG.reagents.total_volume >= RG.volume)
|
|
usr << "<span class='warning'>\The [RG] is already full.</span>"
|
|
return
|
|
|
|
RG.reagents.add_reagent("water", min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
|
|
oviewers(3, usr) << "<span class='notice'>[usr] fills \the [RG] using \the [src].</span>"
|
|
usr << "<span class='notice'>You fill \the [RG] using \the [src].</span>"
|
|
if ("Empty")
|
|
if(!RG.reagents.total_volume)
|
|
usr << "<span class='warning'>\The [RG] is already empty.</span>"
|
|
return
|
|
|
|
RG.reagents.clear_reagents()
|
|
oviewers(3, usr) << "<span class='notice'>[usr] empties \the [RG] into \the [src].</span>"
|
|
usr << "<span class='notice'>You empty \the [RG] into \the [src].</span>"
|
|
return
|
|
|
|
// Filling/empying Syringes
|
|
else if (istype(O, /obj/item/weapon/reagent_containers/syringe))
|
|
var/obj/item/weapon/reagent_containers/syringe/S = O
|
|
switch(S.mode)
|
|
if(0) // draw
|
|
if(S.reagents.total_volume >= S.volume)
|
|
usr << "<span class='warning'>\The [S] is already full.</span>"
|
|
return
|
|
|
|
var/trans = min(S.volume - S.reagents.total_volume, S.amount_per_transfer_from_this)
|
|
S.reagents.add_reagent("water", trans)
|
|
oviewers(3, usr) << "<span class='notice'>[usr] uses \the [S] to draw water from \the [src].</span>"
|
|
usr << "<span class='notice'>You draw [trans] units of water from \the [src]. \The [S] now contains [S.reagents.total_volume] units.</span>"
|
|
if(1) // inject
|
|
if(!S.reagents.total_volume)
|
|
usr << "<span class='warning'>\The [S] is already empty.</span>"
|
|
return
|
|
|
|
var/trans = min(S.amount_per_transfer_from_this, S.reagents.total_volume)
|
|
S.reagents.remove_any(trans)
|
|
oviewers(3, usr) << "<span class='notice'>[usr] empties \the [S] into \the [src].</span>"
|
|
usr << "<span class='notice'>You empty [trans] units of water into \the [src]. \The [S] now contains [S.reagents.total_volume] units.</span>"
|
|
|
|
return
|
|
|
|
else if (istype(O, /obj/item/weapon/melee/baton))
|
|
var/obj/item/weapon/melee/baton/B = O
|
|
if(B.bcell)
|
|
if(B.bcell.charge > 0 && B.status == 1)
|
|
flick("baton_active", src)
|
|
user.Stun(10)
|
|
user.stuttering = 10
|
|
user.Weaken(10)
|
|
if(isrobot(user))
|
|
var/mob/living/silicon/robot/R = user
|
|
R.cell.charge -= 20
|
|
else
|
|
B.deductcharge(B.hitcost)
|
|
user.visible_message( \
|
|
"<span class='danger'>[user] was stunned by \his wet [O]!</span>", \
|
|
"<span class='userdanger'>[user] was stunned by \his wet [O]!</span>")
|
|
return 1
|
|
// Short of a rewrite, this is necessary to stop monkeycubes being washed.
|
|
else if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/monkeycube))
|
|
return
|
|
else if(istype(O, /obj/item/weapon/mop))
|
|
O.reagents.add_reagent("water", 5)
|
|
user << "<span class='notice'>You wet \the [O] in \the [src].</span>"
|
|
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
|
return
|
|
|
|
var/turf/location = user.loc
|
|
if(!isturf(location)) return
|
|
|
|
var/obj/item/I = O
|
|
if(!I || !istype(I,/obj/item)) return
|
|
|
|
usr << "<span class='notice'>You start washing \the [I].</span>"
|
|
|
|
busy = 1
|
|
sleep(40)
|
|
busy = 0
|
|
|
|
if(user.loc != location) return //User has moved
|
|
if(!I) return //Item's been destroyed while washing
|
|
if(user.get_active_hand() != I) return //Person has switched hands or the item in their hands
|
|
|
|
O.clean_blood()
|
|
user.visible_message( \
|
|
"<span class='notice'>[user] washes \a [I] using \the [src].</span>", \
|
|
"<span class='notice'>You wash \a [I] using \the [src].</span>")
|
|
|
|
|
|
/obj/structure/sink/kitchen
|
|
name = "kitchen sink"
|
|
icon_state = "sink_alt"
|
|
|
|
|
|
/obj/structure/sink/puddle //splishy splashy ^_^
|
|
name = "puddle"
|
|
icon_state = "puddle"
|
|
|
|
/obj/structure/sink/puddle/attack_hand(mob/M as mob)
|
|
icon_state = "puddle-splash"
|
|
..()
|
|
icon_state = "puddle"
|
|
|
|
/obj/structure/sink/puddle/attackby(obj/item/O as obj, mob/user as mob)
|
|
icon_state = "puddle-splash"
|
|
..()
|
|
icon_state = "puddle"
|