From 80b41bf51af1f429cc0cfbbf4134e7b02868d5da Mon Sep 17 00:00:00 2001
From: BlueWildrose <57083662+BlueWildrose@users.noreply.github.com>
Date: Fri, 15 Dec 2023 12:12:50 -0700
Subject: [PATCH] A few fixes for bots (#6205)
---
.../ai/aI_holder_subtypes/slime_xenobio_ai.dm | 2 +-
code/modules/mob/living/bot/SLed209bot.dm | 9 +-------
code/modules/mob/living/bot/cleanbot.dm | 6 +++---
code/modules/mob/living/bot/floorbot.dm | 11 ++++++----
code/modules/mob/living/bot/secbot.dm | 21 ++++++++++---------
5 files changed, 23 insertions(+), 26 deletions(-)
diff --git a/code/modules/ai/aI_holder_subtypes/slime_xenobio_ai.dm b/code/modules/ai/aI_holder_subtypes/slime_xenobio_ai.dm
index 4aa8cc484559..61468dcf960f 100644
--- a/code/modules/ai/aI_holder_subtypes/slime_xenobio_ai.dm
+++ b/code/modules/ai/aI_holder_subtypes/slime_xenobio_ai.dm
@@ -136,7 +136,7 @@
return
rabid = TRUE
my_slime.update_mood()
- my_slime.visible_message(SPAN_DANGER("\The [src] enrages!"))
+ my_slime.visible_message(SPAN_DANGER("\The [my_slime] enrages!"))
// Called to relax from being rabid (when blue slime core was used).
/datum/ai_holder/simple_mob/xenobio_slime/proc/relax()
diff --git a/code/modules/mob/living/bot/SLed209bot.dm b/code/modules/mob/living/bot/SLed209bot.dm
index f4adefa06005..c5d53d9a73ae 100644
--- a/code/modules/mob/living/bot/SLed209bot.dm
+++ b/code/modules/mob/living/bot/SLed209bot.dm
@@ -30,7 +30,7 @@
xeno_harm_strength = 9
req_one_access = list(ACCESS_SCIENCE_MAIN, ACCESS_SCIENCE_ROBOTICS)
botcard_access = list(ACCESS_SCIENCE_MAIN, ACCESS_SCIENCE_ROBOTICS, ACCESS_SCIENCE_XENOBIO, ACCESS_SCIENCE_XENOARCH, ACCESS_SCIENCE_FABRICATION, ACCESS_SCIENCE_TOXINS, ACCESS_ENGINEERING_MAINT)
- var/xeno_stun_strength = 6
+ xeno_stun_strength = 6
/mob/living/bot/secbot/ed209/slime/update_icons()
if(on && busy)
@@ -56,13 +56,6 @@
P.old_style_target(A)
P.fire()
-/mob/living/bot/secbot/ed209/slime/UnarmedAttack(var/mob/living/L, var/proximity)
- ..()
-
- if(istype(L, /mob/living/simple_mob/slime/xenobio))
- var/mob/living/simple_mob/slime/xenobio/S = L
- S.slimebatoned(src, xeno_stun_strength)
-
// Assembly
/obj/item/secbot_assembly/ed209_assembly/slime
diff --git a/code/modules/mob/living/bot/cleanbot.dm b/code/modules/mob/living/bot/cleanbot.dm
index 167655f73e2a..ff5233c93df0 100644
--- a/code/modules/mob/living/bot/cleanbot.dm
+++ b/code/modules/mob/living/bot/cleanbot.dm
@@ -107,11 +107,11 @@
update_icons()
var/cleantime = istype(D, /obj/effect/debris/cleanable/dirt) ? 10 : 50
if(do_after(src, cleantime))
- if(istype(loc, /turf/simulated))
- var/turf/simulated/f = loc
- f.dirt = FALSE
if(!D)
return
+ if(istype(get_turf(D), /turf/simulated))
+ var/turf/simulated/f = get_turf(D)
+ f.dirt = 0
qdel(D)
if(D == target)
target = null
diff --git a/code/modules/mob/living/bot/floorbot.dm b/code/modules/mob/living/bot/floorbot.dm
index 88c81906939b..5774345a8e81 100644
--- a/code/modules/mob/living/bot/floorbot.dm
+++ b/code/modules/mob/living/bot/floorbot.dm
@@ -74,7 +74,7 @@
data["amount"] = amount
- data["possible_bmode"] = list("NORTH", "EAST", "SOUTH", "WEST")
+ data["possible_bmode"] = list("OFF","NORTH", "EAST", "SOUTH", "WEST")
data["improvefloors"] = null
data["eattiles"] = null
@@ -85,7 +85,7 @@
data["improvefloors"] = improvefloors
data["eattiles"] = eattiles
data["maketiles"] = maketiles
- data["bmode"] = dir2text(targetdirection)
+ data["bmode"] = targetdirection ? dir2text(targetdirection) : "OFF"
return data
@@ -132,7 +132,10 @@
. = TRUE
if("bridgemode")
- targetdirection = text2dir(params["dir"])
+ if(params["dir"] != "OFF")
+ targetdirection = text2dir(params["dir"])
+ else
+ targetdirection = null
. = TRUE
/mob/living/bot/floorbot/handleRegular()
@@ -429,7 +432,7 @@
switch(build_step)
if(ASSEMBLY_FIRST_STEP)
if(isprox(W))
- if(!user.attempt_insert_item_for_installation(W, src))
+ if(!user.attempt_consume_item_for_construction(W))
return
to_chat(user, SPAN_NOTICE("You add the proximity sensor to [src]."))
name = "incomplete floorbot assembly"
diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm
index 6a2c2cd4dd92..e2957d985c8f 100644
--- a/code/modules/mob/living/bot/secbot.dm
+++ b/code/modules/mob/living/bot/secbot.dm
@@ -42,6 +42,7 @@
var/can_next_insult = 0 // Uses world.time
var/stun_strength = 60 // For humans.
var/xeno_harm_strength = 15 // How hard to hit simple_mobs.
+ var/xeno_stun_strength = 3 // How hard to slimebatoned()'d naughty slimes. Normal securitrons aren't all that good at it but can do it.
var/baton_glow = "#FF6A00"
var/used_weapon = /obj/item/melee/baton //Weapon used by the bot
@@ -104,7 +105,7 @@
req_one_access = list(ACCESS_SCIENCE_MAIN, ACCESS_SCIENCE_ROBOTICS)
botcard_access = list(ACCESS_SCIENCE_MAIN, ACCESS_SCIENCE_ROBOTICS, ACCESS_SCIENCE_XENOBIO, ACCESS_SCIENCE_XENOARCH, ACCESS_SCIENCE_FABRICATION, ACCESS_SCIENCE_TOXINS, ACCESS_ENGINEERING_MAINT)
used_weapon = /obj/item/melee/baton/slime
- var/xeno_stun_strength = 5 // How hard to slimebatoned()'d naughty slimes. 5 works out to 2 discipline and 5 weaken.
+ xeno_stun_strength = 5 // 5 works out to 2 discipline and 5 weaken.
/datum/category_item/catalogue/technology/bot/secbot/slime/slimesky
name = "Bot - Doctor Slimesky"
@@ -360,7 +361,7 @@
var/mob/living/carbon/human/H = M
var/cuff = TRUE
- if(!H.lying || H.handcuffed || arrest_type)
+ if(CHECK_MOBILITY(H, MOBILITY_CAN_MOVE | MOBILITY_CAN_USE) || H.handcuffed || arrest_type)
cuff = FALSE
if(!cuff)
H.stun_effect_act(0, stun_strength, null)
@@ -390,6 +391,13 @@
busy = FALSE
else if(istype(M, /mob/living))
var/mob/living/L = M
+ if(istype(L, /mob/living/simple_mob/slime/xenobio))
+ var/mob/living/simple_mob/slime/xenobio/S = L
+ var/datum/ai_holder/simple_mob/xenobio_slime/sai = S.ai_holder
+ if(!S.is_justified_to_discipline() && !sai?.rabid) //will kill angry slimes.
+ attacked = FALSE //quit abusing the damn slimes. I don't care if they're hurting you.
+ return
+ S.slimebatoned(src, xeno_stun_strength)
L.adjustBruteLoss(xeno_harm_strength)
do_attack_animation(M)
playsound(loc, "swing_hit", 50, 1, -1)
@@ -401,13 +409,6 @@
visible_message("\The [M] was beaten by \the [src] with a stun baton!")
insult(L)
-/mob/living/bot/secbot/slime/UnarmedAttack(var/mob/living/L, var/proximity)
- ..()
-
- if(istype(L, /mob/living/simple_mob/slime/xenobio))
- var/mob/living/simple_mob/slime/xenobio/S = L
- S.slimebatoned(src, xeno_stun_strength)
-
/mob/living/bot/secbot/explode()
visible_message("[src] blows apart!")
var/turf/Tsec = get_turf(src)
@@ -435,7 +436,7 @@
return "unidentified lifeform"
/mob/living/bot/secbot/proc/check_threat(var/mob/living/M)
- if(!M || !istype(M) || M.stat == DEAD || src == M)
+ if(!M || !istype(M) || M.stat == DEAD || src == M || (isslime(M) && M.incapacitated()))
threat = 0
else if(emagged && !M.incapacitated()) //check incapacitated so emagged secbots don't keep attacking the same target forever