diff --git a/baystation12.dme b/baystation12.dme index 59d973971a0..659c9e6e914 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -595,6 +595,7 @@ #include "code\game\objects\items\weapons\tanks\jetpack.dm" #include "code\game\objects\items\weapons\tanks\tank_types.dm" #include "code\game\objects\items\weapons\tanks\tanks.dm" +#include "code\game\objects\items\weapons\tanks\watertank.dm" #include "code\game\objects\random\random.dm" #include "code\game\objects\storage\coat.dm" #include "code\game\objects\structures\barsign.dm" diff --git a/code/game/objects/items/weapons/tanks/watertank.dm b/code/game/objects/items/weapons/tanks/watertank.dm new file mode 100644 index 00000000000..6cb9cc1698d --- /dev/null +++ b/code/game/objects/items/weapons/tanks/watertank.dm @@ -0,0 +1,95 @@ +/obj/item/weapon/watertank + name = "S.U.N.S.H.I.N.E. water sprayer" + desc = "A watertank backpack with nozzle to water plants." + icon = 'icons/obj/hydroponics.dmi' + icon_state = "waterbackpack" + item_state = "waterbackpack" + w_class = 4.0 + slot_flags = SLOT_BACK + slowdown = 3 + action_button_name = "Toggle Mister" + + var/obj/item/weapon/reagent_containers/glass/mister/noz + var/on = 0 + var/volume = 500 + +/obj/item/weapon/watertank/New() + ..() + create_reagents(volume) + return + +/obj/item/weapon/watertank/ui_action_click() + if (usr.get_item_by_slot(slot_back) == src) + toggle_mister() + else + usr << "The watertank needs to be on your back to use!" + return + +/obj/item/weapon/watertank/verb/toggle_mister() + set name = "Toggle Mister" + set category = "Object" + on = !on + + var/mob/living/carbon/human/user = usr + if(on) + //Detach the nozzle into the user's hands + noz = new(src) + var/list/L = list("left hand" = slot_l_hand,"right hand" = slot_r_hand) + if(!user.equip_in_one_of_slots(noz, L)) + on = 0 + user << "You need a free hand to hold the mister!" + else + //Remove from their hands and put back "into" the tank + remove_noz(user) + return + +/obj/item/weapon/watertank/equipped(mob/user, slot) + if (slot != slot_back) + remove_noz(user) + +/obj/item/weapon/watertank/proc/remove_noz(mob/user) + if (noz != null) + var/mob/living/carbon/human/M = user + M.u_equip(noz) + return + +/obj/item/weapon/watertank/Del() + if (noz) + var/M = get(noz, /mob) + remove_noz(M) + ..() + return + +// This mister item is intended as an extension of the watertank and always attached to it. +// Therefore, it's designed to be "locked" to the player's hands or extended back onto +// the watertank backpack. Allowing it to be placed elsewhere or created without a parent +// watertank object will likely lead to weird behaviour or runtimes. +/obj/item/weapon/reagent_containers/glass/mister + name = "water mister" + desc = "A mister nozzle attached to a water tank." + icon = 'icons/obj/hydroponics.dmi' + icon_state = "mister" + item_state = "mister" + w_class = 4.0 + amount_per_transfer_from_this = 50 + possible_transfer_amounts = list(25,50,100) + volume = 500 + can_be_placed_into = list() + + var/obj/item/weapon/watertank/tank + +/obj/item/weapon/reagent_containers/glass/mister/New(parent_tank) + ..() + if (!parent_tank || !istype(parent_tank, /obj/item/weapon/watertank)) //To avoid weird issues from admin spawns + var/mob/living/carbon/human/M = usr + M.u_equip(src) + Del() + else + tank = parent_tank + reagents = tank.reagents //This mister is really just a proxy for the tank's reagents + return + +/obj/item/weapon/reagent_containers/glass/mister/dropped(mob/user as mob) + user << "The mister snaps back onto the watertank!" + tank.on = 0 + Del() diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 3424bdb562d..bab4ae72ea3 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -32,6 +32,10 @@ if(shock_stage >= 10) tally += 3 + if(back) + tally += back.slowdown + + if(FAT in src.mutations) tally += 1.5 if (bodytemperature < 283.222) diff --git a/icons/mob/back.dmi b/icons/mob/back.dmi index a98124d9748..bafd942a69d 100644 Binary files a/icons/mob/back.dmi and b/icons/mob/back.dmi differ diff --git a/icons/mob/items_lefthand.dmi b/icons/mob/items_lefthand.dmi index 69cae71faf4..e5ca483dcfe 100644 Binary files a/icons/mob/items_lefthand.dmi and b/icons/mob/items_lefthand.dmi differ diff --git a/icons/mob/items_righthand.dmi b/icons/mob/items_righthand.dmi index 8ae6796a46c..2068729366b 100644 Binary files a/icons/mob/items_righthand.dmi and b/icons/mob/items_righthand.dmi differ diff --git a/icons/obj/hydroponics.dmi b/icons/obj/hydroponics.dmi index 08ed0d2eaca..d6c6fb7e3e0 100644 Binary files a/icons/obj/hydroponics.dmi and b/icons/obj/hydroponics.dmi differ