Skip to content

Commit

Permalink
A few fixes for bots (#6205)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueWildrose authored Dec 15, 2023
1 parent 55b4bb2 commit 80b41bf
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion code/modules/ai/aI_holder_subtypes/slime_xenobio_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
9 changes: 1 addition & 8 deletions code/modules/mob/living/bot/SLed209bot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions code/modules/mob/living/bot/cleanbot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions code/modules/mob/living/bot/floorbot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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"
Expand Down
21 changes: 11 additions & 10 deletions code/modules/mob/living/bot/secbot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -401,13 +409,6 @@
visible_message("<span class='warning'>\The [M] was beaten by \the [src] with a stun baton!</span>")
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("<span class='warning'>[src] blows apart!</span>")
var/turf/Tsec = get_turf(src)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 80b41bf

Please sign in to comment.