diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm index 4bc7101f4b3..3af08489784 100644 --- a/code/modules/mob/living/simple_animal/bot/construction.dm +++ b/code/modules/mob/living/simple_animal/bot/construction.dm @@ -24,11 +24,19 @@ return created_name = t -/obj/item/bot_assembly/proc/can_finish_build(obj/item/I, mob/user) +/** + * Checks if the user can finish constructing a bot with a given item. + * + * Arguments: + * * I - Item to be used + * * user - Mob doing the construction + * * drop_item - Whether or no the item should be dropped; defaults to 1. Should be set to 0 if the item is a tool, stack, or otherwise doesn't need to be dropped. If not set to 0, item must be deleted afterwards. + */ +/obj/item/bot_assembly/proc/can_finish_build(obj/item/I, mob/user, drop_item = 1) if(istype(loc, /obj/item/storage/backpack)) to_chat(user, "You must take [src] out of [loc] first!") return FALSE - if(!I || !user || !user.temporarilyRemoveItemFromInventory(I)) + if(!I || !user || (drop_item && !user.temporarilyRemoveItemFromInventory(I))) return FALSE return TRUE @@ -455,8 +463,7 @@ /obj/item/bot_assembly/hygienebot name = "incomplete hygienebot assembly" desc = "Clear out the swamp once and for all" - icon = 'icons/obj/watercloset.dmi' - icon_state = "drone" + icon_state = "hygienebot" created_name = "Hygienebot" /obj/item/bot_assembly/hygienebot/attackby(obj/item/I, mob/user, params) @@ -465,13 +472,20 @@ if(ASSEMBLY_FIRST_STEP) if(I.tool_behaviour == TOOL_WELDER) if(I.use_tool(src, user, 0, volume=40)) - add_overlay("hs_hole") to_chat(user, "You weld a water hole in [src]!") build_step++ return if(ASSEMBLY_SECOND_STEP) - if(!can_finish_build(I, user)) + if(isprox(I)) + if(!user.temporarilyRemoveItemFromInventory(I)) + return + build_step++ + to_chat(user, "You add [I] to [src].") + qdel(I) + + if(ASSEMBLY_THIRD_STEP) + if(!can_finish_build(I, user, 0)) return if(istype(I, /obj/item/stack/ducts)) var/obj/item/stack/ducts/D = I @@ -479,14 +493,8 @@ to_chat(user, "You need one fluid duct to finish [src]") return to_chat(user, "You start to pipe up [src]...") - if(do_after(user, 40, target = src)) - if(D.get_amount() >= 1) - D.use(1) - to_chat(user, "You pipe up [src].") - build_step++ - else - return - var/mob/living/simple_animal/bot/hygienebot/H = new(drop_location()) - H.name = created_name - qdel(src) - return TRUE + if(do_after(user, 40, target = src) && D.use(1)) + to_chat(user, "You pipe up [src].") + var/mob/living/simple_animal/bot/hygienebot/H = new(drop_location()) + H.name = created_name + qdel(src) diff --git a/code/modules/mob/living/simple_animal/bot/hygienebot.dm b/code/modules/mob/living/simple_animal/bot/hygienebot.dm index d1ff292e94d..f345bf7309e 100644 --- a/code/modules/mob/living/simple_animal/bot/hygienebot.dm +++ b/code/modules/mob/living/simple_animal/bot/hygienebot.dm @@ -2,8 +2,8 @@ /mob/living/simple_animal/bot/hygienebot name = "\improper Hygienebot" desc = "A flying cleaning robot, he'll chase down people who can't shower properly!" - icon = 'icons/obj/watercloset.dmi' - icon_state = "drone" + icon = 'icons/mob/aibots.dmi' + icon_state = "hygienebot" density = FALSE anchored = FALSE health = 100 @@ -59,20 +59,20 @@ /mob/living/simple_animal/bot/hygienebot/update_icon_state() . = ..() if(on) - icon_state = "drone-on" + icon_state = "hygienebot-on" else - icon_state = "drone" + icon_state = "hygienebot" /mob/living/simple_animal/bot/hygienebot/update_overlays() . = ..() if(on) - var/mutable_appearance/fire_overlay = mutable_appearance(icon,"flame") + var/mutable_appearance/fire_overlay = mutable_appearance(icon, "hygienebot-flame") . +=fire_overlay if(washing) - var/mutable_appearance/water_overlay = mutable_appearance(icon, emagged ? "dronefire" : "dronewater") + var/mutable_appearance/water_overlay = mutable_appearance(icon, emagged ? "hygienebot-fire" : "hygienebot-water") . += water_overlay @@ -87,12 +87,6 @@ walk_to(src,0) last_found = world.time -/mob/living/simple_animal/bot/hygienebot/Moved() - . = ..() - if(washing && isturf(loc) && !emagged) - var/turf/open/OT = loc - OT.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = 5 SECONDS) - /mob/living/simple_animal/bot/hygienebot/handle_automated_action() if(!..()) return @@ -113,36 +107,37 @@ mode = BOT_START_PATROL // switch to patrol mode if(BOT_HUNT) // hunting for stinkman - // if can't reach stinkman for long enough, don't give up, try harder. if(emagged) //lol fuck em up - currentspeed = 8 + currentspeed = 3.5 start_washing() mad = TRUE else switch(frustration) if(0 to 4) currentspeed = 5 - stop_washing() mad = FALSE - if(4 to INFINITY) + if(5 to INFINITY) currentspeed = 2.5 - start_washing() mad = TRUE - if(target) + if(target && !check_purity(target)) if(target.loc == loc && isturf(target.loc)) //LADIES AND GENTLEMAN WE GOTEM PREPARE TO DUMP start_washing() if(mad) - speak("Well about fucking time you degenerate", "Fucking finally", "Thank god, you finally stopped") + speak("Well about fucking time you degenerate.", "Fucking finally.", "Thank god, you finally stopped.") playsound(loc, 'sound/effects/hygienebot_angry.ogg', 60, 1) mad = FALSE mode = BOT_SHOWERSTANCE else - var/turf/olddist = get_dist(src, target) + stop_washing() + var/olddist = get_dist(src, target) + if(olddist > 20 || frustration > 100) // Focus on something else + back_to_idle() + return walk_to(src, target,0, currentspeed) - if(mad && prob(60)) + if(mad && prob(min(frustration * 2, 60))) playsound(loc, 'sound/effects/hygienebot_angry.ogg', 60, 1) - speak(pick("Get back here you foul smelling fucker.", "If you don't get back here right now I'm going to give you a fucking vasectomy.", "STOP RUNNING OR I WILL CUT YOUR ARTERIES!", "Just fucking let me clean you you arsehole!", "STOP. RUNNING.", "Either you stop running or I will fucking drag you out of an airlock.", "I just want to fucking clean you you troglodyte.", "If you don't come back here I'll put a green cloud around you cunt.")) - if((get_dist(src, target)) >= (olddist)) + speak(pick("Get back here you foul smelling fucker.", "STOP RUNNING OR I WILL CUT YOUR ARTERIES!", "Just fucking let me clean you you arsehole!", "STOP. RUNNING.", "Either you stop running or I will fucking drag you out of an airlock.", "I just want to fucking clean you you troglodyte.", "If you don't come back here I'll put a green cloud around you cunt.")) + if((get_dist(src, target)) >= olddist) frustration++ else frustration = 0 @@ -157,7 +152,7 @@ return if(!target) last_found = world.time - if(target.loc != loc && !isturf(target.loc)) + if(target.loc != loc || !isturf(target.loc)) back_to_hunt() if(BOT_START_PATROL) diff --git a/icons/mob/aibots.dmi b/icons/mob/aibots.dmi index c493402b8ec..23e7baeec36 100644 Binary files a/icons/mob/aibots.dmi and b/icons/mob/aibots.dmi differ diff --git a/icons/obj/watercloset.dmi b/icons/obj/watercloset.dmi index 3678135e259..eecb1b90637 100644 Binary files a/icons/obj/watercloset.dmi and b/icons/obj/watercloset.dmi differ