From 6befeed46fb20bceaf04c0bae1134df39f86ef5c Mon Sep 17 00:00:00 2001 From: ikarrus Date: Fri, 27 Jun 2014 09:25:52 -0600 Subject: [PATCH] -Giacom's feedback -Fixed secbots being able to stun silicons -Added an attack cooldown for secbots --- code/game/machinery/bots/bots.dm | 3 +++ code/game/machinery/bots/ed209bot.dm | 20 ++++++++++++-------- code/game/machinery/bots/secbot.dm | 14 +++++++++----- code/modules/mob/living/carbon/carbon.dm | 6 +----- code/modules/mob/living/silicon/silicon.dm | 6 +++++- code/modules/mob/mob.dm | 2 ++ 6 files changed, 32 insertions(+), 19 deletions(-) diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm index 299c700808e..3548b15de45 100644 --- a/code/game/machinery/bots/bots.dm +++ b/code/game/machinery/bots/bots.dm @@ -53,6 +53,7 @@ return /obj/machinery/bot/attack_alien(var/mob/living/carbon/alien/user as mob) + user.changeNext_move(8) src.health -= rand(15,30)*brute_dam_coeff src.visible_message("\red [user] has slashed [src]!") playsound(src.loc, 'sound/weapons/slice.ogg', 25, 1, -1) @@ -63,6 +64,7 @@ /obj/machinery/bot/attack_animal(var/mob/living/simple_animal/M as mob) if(M.melee_damage_upper == 0) return + M.changeNext_move(8) src.health -= M.melee_damage_upper src.visible_message("\red [M] has [M.attacktext] [src]!") add_logs(M, src, "attacked", admin=0) @@ -91,6 +93,7 @@ Emag(user) else if(hasvar(W,"force") && hasvar(W,"damtype")) + user.changeNext_move(8) switch(W.damtype) if("fire") src.health -= W.force * fire_dam_coeff diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index 4ba0a31017d..f705b1ff3f5 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -149,7 +149,7 @@ Auto Patrol: []"}, "[src.declare_arrests ? "Yes" : "No"]", "[auto_patrol ? "On" : "Off"]" ) - var/datum/browser/popup = new(user, "autosec", "Securitron v2.6 controls") + var/datum/browser/popup = new(user, "autosec", "Securitron v2.09 controls") popup.set_content(dat) popup.open() return @@ -221,10 +221,13 @@ Auto Patrol: []"}, ..() if (!istype(W, /obj/item/weapon/screwdriver) && !istype(W, /obj/item/weapon/weldingtool) && (!src.target)) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass. if(hasvar(W,"force") && W.force)//If force is defined and non-zero - src.target = user - if(lasercolor)//To make up for the fact that lasertag bots don't hunt - src.shootAt(user) - src.mode = SECBOT_HUNT + threatlevel = user.assess_threat(src) + threatlevel += 6 + if(threatlevel > 0) + src.target = user + if(lasercolor)//To make up for the fact that lasertag bots don't hunt + src.shootAt(user) + src.mode = SECBOT_HUNT /obj/machinery/bot/ed209/Emag(mob/user as mob) ..() @@ -1014,6 +1017,7 @@ Auto Patrol: []"}, /obj/machinery/bot/ed209/proc/declare_arrest() var/area/location = get_area(src) - for(var/mob/living/carbon/human/human in world) - if((human.z == src.z) && istype(human.glasses, /obj/item/clothing/glasses/hud/security) && !human.blinded) - human << "\icon[human.glasses] [src.name] is [arrest_type ? "detaining" : "arresting"] level [threatlevel] scumbag [target] in [location]" + for(var/mob/living/carbon/human/human in mob_list) + var/turf/humanturf = get_turf(human) + if((humanturf.z == src.z) && istype(human.glasses, /obj/item/clothing/glasses/hud/security)) + human.show_message("\icon[human.glasses] [src.name] is [arrest_type ? "detaining" : "arresting"] level [threatlevel] scumbag [target] in [location]", 1) diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index bb7b9417fb6..7e4ba5222f4 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -207,8 +207,11 @@ Auto Patrol: []"}, else ..() if(!istype(W, /obj/item/weapon/screwdriver) && !istype(W, /obj/item/weapon/weldingtool) && (W.force) && (!src.target)) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass. - src.target = user - src.mode = SECBOT_HUNT + threatlevel = user.assess_threat(src) + threatlevel += 6 + if(threatlevel > 0) + src.target = user + src.mode = SECBOT_HUNT /obj/machinery/bot/secbot/Emag(mob/user as mob) ..() @@ -775,6 +778,7 @@ Auto Patrol: []"}, /obj/machinery/bot/secbot/proc/declare_arrest() var/area/location = get_area(src) - for(var/mob/living/carbon/human/human in world) - if((human.z == src.z) && istype(human.glasses, /obj/item/clothing/glasses/hud/security) && !human.blinded) - human << "\icon[human.glasses] [src.name] is [arrest_type ? "detaining" : "arresting"] level [threatlevel] scumbag [target] in [location]" + for(var/mob/living/carbon/human/human in mob_list) + var/turf/humanturf = get_turf(human) + if((humanturf.z == src.z) && istype(human.glasses, /obj/item/clothing/glasses/hud/security)) + human.show_message("\icon[human.glasses] [src.name] is [arrest_type ? "detaining" : "arresting"] level [threatlevel] scumbag [target] in [location]", 1) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index fb18d49c673..888cd01e330 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -482,8 +482,4 @@ var/const/GALOSHES_DONT_HELP = 8 loc.handle_slip(src, s_amount, w_amount, O, lube) /mob/living/carbon/fall(var/forced) - loc.handle_fall(src, forced)//it's loc so it doesn't call the mob's handle_fall which does nothing - - -/mob/living/carbon/proc/assess_threat() - return \ No newline at end of file + loc.handle_fall(src, forced)//it's loc so it doesn't call the mob's handle_fall which does nothing diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 2d36c56e227..5712d20ac89 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -306,4 +306,8 @@ // The src mob is trying to place an item on someone // But the src mob is a silicon!! Disable. /mob/living/silicon/stripPanelEquip(obj/item/what, mob/who, slot) - return 0 \ No newline at end of file + return 0 + + +/mob/living/silicon/assess_threat() //Secbots won't hunt silicon units + return -10 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index b3f3e3137ce..77b21a0098c 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -794,3 +794,5 @@ var/list/slot_equipment_priority = list( \ update_canmove() return +/mob/proc/assess_threat() //For sec bot threat assessment + return \ No newline at end of file