diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 9d9d8428860..6b6f4f34240 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -280,7 +280,7 @@ text_dehack_fail = "You fail to reset [name]." /mob/living/simple_animal/bot/attack_ai(mob/user as mob) - attack_hand(user) + show_controls(user) /mob/living/simple_animal/bot/proc/speak(message,channel) //Pass a message to have the bot say() it. Pass a frequency to say it on the radio. if((!on) || (!message)) @@ -709,13 +709,12 @@ Pass a positive integer as an argument to override a bot's default speed. //No ..() to prevent strip panel showing up - Todo: make that saner if(topic_denied(usr)) usr << "[src]'s interface is not responding!" - href_list = list() - return + return 1 add_fingerprint(usr) if(href_list["close"])// HUE HUE if(usr in users) users.Remove(usr) - return + return 1 if((href_list["power"]) && (bot_core.allowed(usr) || !locked)) if (on) turn_off() @@ -761,12 +760,11 @@ Pass a positive integer as an argument to override a bot's default speed. /mob/living/simple_animal/bot/proc/topic_denied(mob/user) //Access check proc for bot topics! Remember to place in a bot's individual Topic if desired. // 0 for access, 1 for denied. if(emagged == 2) //An emagged bot cannot be controlled by humans, silicons can if one hacked it. - if(hacked) //Manually emagged by a human - access denied to all. + if(!hacked) //Manually emagged by a human - access denied to all. return 1 else if(!issilicon(user)) //Bot is hacked, so only silicons are allowed access. return 1 - else - return 0 + return 0 /mob/living/simple_animal/bot/proc/hack(mob/user) var/hack diff --git a/code/modules/mob/living/simple_animal/bot/cleanbot.dm b/code/modules/mob/living/simple_animal/bot/cleanbot.dm index cb99f07ed06..39a2336d9fd 100644 --- a/code/modules/mob/living/simple_animal/bot/cleanbot.dm +++ b/code/modules/mob/living/simple_animal/bot/cleanbot.dm @@ -231,7 +231,8 @@ text("[on ? "On" : "Off"]")) return dat /mob/living/simple_animal/bot/cleanbot/Topic(href, href_list) - ..() + if(..()) + return 1 switch(href_list["operation"]) if("blood") blood =!blood diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index 0151cf2e58b..75639bb205f 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -130,7 +130,8 @@ Auto Patrol[]"}, return else if((lasercolor == "r") && (istype(H.wear_suit, /obj/item/clothing/suit/bluetag))) return - ..() + if(..()) + return 1 switch(href_list["operation"]) if ("idcheck") @@ -149,19 +150,27 @@ Auto Patrol[]"}, declare_arrests = !declare_arrests update_controls() +/mob/living/simple_animal/bot/ed209/proc/retaliate(mob/living/carbon/human/H) + threatlevel = H.assess_threat(src) + threatlevel += 6 + if(threatlevel >= 4) + target = H + mode = BOT_HUNT + +/mob/living/simple_animal/bot/ed209/attack_hand(mob/living/carbon/human/H) + if(H.a_intent == "harm") + retaliate(H) + return ..() + /mob/living/simple_animal/bot/ed209/attackby(obj/item/weapon/W, mob/user, params) ..() if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent != "harm") // Any intent but harm will heal, so we shouldn't get angry. return if (!istype(W, /obj/item/weapon/screwdriver) && (!target)) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass. if(W.force && W.damtype != STAMINA)//If force is non-zero and damage type isn't stamina. - threatlevel = user.assess_threat(src) - threatlevel += 6 - if(threatlevel >= 4) - target = user - if(lasercolor)//To make up for the fact that lasertag bots don't hunt - shootAt(user) - mode = BOT_HUNT + retaliate(user) + if(lasercolor)//To make up for the fact that lasertag bots don't hunt + shootAt(user) /mob/living/simple_animal/bot/ed209/Emag(mob/user) ..() @@ -178,11 +187,7 @@ Auto Patrol[]"}, if(istype(Proj ,/obj/item/projectile/beam)||istype(Proj,/obj/item/projectile/bullet)) if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE)) if (!Proj.nodamage && Proj.damage < src.health) - threatlevel = Proj.firer.assess_threat(src) - threatlevel += 6 - if(threatlevel >= 4) - target = Proj.firer - mode = BOT_HUNT + retaliate(Proj.firer) ..() /mob/living/simple_animal/bot/ed209/handle_automated_action() @@ -522,10 +527,7 @@ Auto Patrol[]"}, /mob/living/simple_animal/bot/ed209/RangedAttack(atom/A) if(!on) return - if(ismob(A)) - shootAt(A) - else - ..() + shootAt(A) /mob/living/simple_animal/bot/ed209/proc/stun_attack(mob/living/carbon/C) playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1) diff --git a/code/modules/mob/living/simple_animal/bot/floorbot.dm b/code/modules/mob/living/simple_animal/bot/floorbot.dm index 25d8436e2e3..823579b3b96 100644 --- a/code/modules/mob/living/simple_animal/bot/floorbot.dm +++ b/code/modules/mob/living/simple_animal/bot/floorbot.dm @@ -118,7 +118,9 @@ user << "[src] buzzes and beeps." /mob/living/simple_animal/bot/floorbot/Topic(href, href_list) - ..() + if(..()) + return 1 + switch(href_list["operation"]) if("replace") replacetiles = !replacetiles diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index c38a3279817..a4e76f5ed73 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -157,7 +157,8 @@ return dat /mob/living/simple_animal/bot/medbot/Topic(href, href_list) - ..() + if(..()) + return 1 if(href_list["adj_threshold"]) var/adjust_num = text2num(href_list["adj_threshold"]) diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 71dc09c7e40..833dae0eacb 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -106,8 +106,8 @@ Auto Patrol: []"}, return dat /mob/living/simple_animal/bot/secbot/Topic(href, href_list) - - ..() + if(..()) + return 1 switch(href_list["operation"]) if("idcheck") @@ -126,16 +126,24 @@ Auto Patrol: []"}, declare_arrests = !declare_arrests update_controls() +/mob/living/simple_animal/bot/secbot/proc/retaliate(mob/living/carbon/human/H) + threatlevel = H.assess_threat(src) + threatlevel += 6 + if(threatlevel >= 4) + target = H + mode = BOT_HUNT + +/mob/living/simple_animal/bot/secbot/attack_hand(mob/living/carbon/human/H) + if(H.a_intent == "harm") + retaliate(H) + return ..() + /mob/living/simple_animal/bot/secbot/attackby(obj/item/weapon/W, mob/user, params) ..() if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent != "harm") // Any intent but harm will heal, so we shouldn't get angry. return if(!istype(W, /obj/item/weapon/screwdriver) && (W.force) && (!target) && (W.damtype != STAMINA) ) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass. - threatlevel = user.assess_threat(src) - threatlevel += 6 - if(threatlevel >= 4) - target = user - mode = BOT_HUNT + retaliate(user) /mob/living/simple_animal/bot/secbot/Emag(mob/user) ..() @@ -152,11 +160,7 @@ Auto Patrol: []"}, if(istype(Proj ,/obj/item/projectile/beam)||istype(Proj,/obj/item/projectile/bullet)) if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE)) if (!Proj.nodamage && Proj.damage < src.health) - threatlevel = Proj.firer.assess_threat(src) - threatlevel += 6 - if(threatlevel >= 4) - target = Proj.firer - mode = BOT_HUNT + retaliate(Proj.firer) ..()