Fix and nerf hygienebots (#51307)

About The Pull Request

This is a three-part PR:

    Firstly, it fixes bugs for hygienebot construction. There were two present that mostly cancelled each other out: first, temporarilyRemoveItemFromInventory expects that the item passed to it will be deleted shortly after. It removes the item from mob's hands but keeps loc in the mob. Hygienebots are using a stack in their construction, so the assumption was not correct. The tubing stack appeared deleted (it was actually hidden). Second, do_after was written wrongly and would allow people to build hygienebots without consuming any tubing, if not for the first bug removing it. Their sprites were also moved to other bots.
    Secondly, I added a proximity sensor into construction. I know bots are powered by magic and coder tears, but building it out of two metal sheets, a hole, and a tube is ridiculous even for those standards. Also literally every single bot uses proximity sensors. This change will make them less spammable, because I've seen upwards of 10 being build for the funzies.
    Thirdly, I nerfed the hygienebots themselves. First, they no longer start slipping everything in their path when they're chasing someone for 5 seconds. This is stupid, no other bot is as disruptive as that, it doesn't make sense to give them slipping everything in their path as a part of normal operation. Combined with hygienebot spam, this was just shitty all-around. They still slip the tile they clean, but no more than that. Second, I made them less spammy; instead of a flat 60% chance to yell at people, it slowly increases to that number. I removed the vasectomy line (WTF?). Finally, they will now drop their target if it gets too far; previously they'd chase it forever.

Fixes #50159
#50191 - not fully fixed
Fixes #50339
Why It's Good For The Game

It requires about 0.7 brain cells and autolathe access to make slipper go brr, and there's no abundance of greyshirts in bloody shoes running around and turning station's hallways into a mass slip'n'slide.
Changelog

🆑
fix: Hygienebot construction has been fixed.
balance: Hygienebots now require a proximity sensor between welding and tubing.
balance: Hygienebots no longer slip their path while chasing someone.
balance: Hygienebots are less spammy.
/🆑
This commit is contained in:
Kelenius
2020-06-10 00:17:50 +12:00
committed by GitHub
parent 13d5925d93
commit d9ef3ebbfa
4 changed files with 44 additions and 41 deletions
@@ -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, "<span class='warning'>You must take [src] out of [loc] first!</span>")
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, "<span class='notice'>You weld a water hole in [src]!</span>")
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, "<span class='notice'>You add [I] to [src].</span>")
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, "<span class='warning'>You need one fluid duct to finish [src]</span>")
return
to_chat(user, "<span class='notice'>You start to pipe up [src]...</span>")
if(do_after(user, 40, target = src))
if(D.get_amount() >= 1)
D.use(1)
to_chat(user, "<span class='notice'>You pipe up [src].</span>")
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, "<span class='notice'>You pipe up [src].</span>")
var/mob/living/simple_animal/bot/hygienebot/H = new(drop_location())
H.name = created_name
qdel(src)
@@ -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)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 23 KiB