From 44aca352cf6d07bf58e9dc302a647fc3237548d6 Mon Sep 17 00:00:00 2001 From: Birdtalon Date: Mon, 14 Aug 2017 11:37:27 +0100 Subject: [PATCH 1/3] prevents swarmers from attacking the AI --- code/modules/mob/living/silicon/ai/ai.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 84f731d3669..503e1a6fcb4 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -697,6 +697,9 @@ var/list/ai_verbs_default = list( return /mob/living/silicon/ai/attack_animal(mob/living/simple_animal/M) + if(istype(M, /mob/living/simple_animal/hostile/swarmer)) //Swarmers shouldn't be killing the AI + to_chat(M, "Your shock has no effect on [src]!") + return if(M.melee_damage_upper == 0) M.custom_emote(1, "[M.friendly] [src]") else @@ -1259,4 +1262,4 @@ var/list/ai_verbs_default = list( to_chat(src, "Unable to locate an airlock near [target].") else - to_chat(src, "Target is not on or near any active cameras on the station.") \ No newline at end of file + to_chat(src, "Target is not on or near any active cameras on the station.") From e3c98f79c4413e70a43325f9c15ebc5876db91a6 Mon Sep 17 00:00:00 2001 From: Birdtalon Date: Mon, 14 Aug 2017 11:40:46 +0100 Subject: [PATCH 2/3] remove trailing newline --- code/modules/mob/living/silicon/ai/ai.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 503e1a6fcb4..32befa33c9a 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -1262,4 +1262,4 @@ var/list/ai_verbs_default = list( to_chat(src, "Unable to locate an airlock near [target].") else - to_chat(src, "Target is not on or near any active cameras on the station.") + to_chat(src, "Target is not on or near any active cameras on the station.") \ No newline at end of file From 808c35a7abeff614d61a39a9e4ce7edcdf26438e Mon Sep 17 00:00:00 2001 From: Birdtalon Date: Tue, 15 Aug 2017 18:27:17 +0100 Subject: [PATCH 3/3] sanity checking for AI damage --- code/modules/mob/living/silicon/ai/ai.dm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 32befa33c9a..d3354672ac9 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -697,9 +697,6 @@ var/list/ai_verbs_default = list( return /mob/living/silicon/ai/attack_animal(mob/living/simple_animal/M) - if(istype(M, /mob/living/simple_animal/hostile/swarmer)) //Swarmers shouldn't be killing the AI - to_chat(M, "Your shock has no effect on [src]!") - return if(M.melee_damage_upper == 0) M.custom_emote(1, "[M.friendly] [src]") else @@ -709,7 +706,19 @@ var/list/ai_verbs_default = list( visible_message("[M] [M.attacktext] [src]!") add_logs(M, src, "attacked", admin=0, print_attack_log = 0) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) - adjustBruteLoss(damage) + switch(M.melee_damage_type) + if(BRUTE) + adjustBruteLoss(damage) + if(BURN) + adjustFireLoss(damage) + if(TOX) + adjustToxLoss(damage) + if(OXY) + adjustOxyLoss(damage) + if(CLONE) + adjustCloneLoss(damage) + if(STAMINA) + adjustStaminaLoss(damage) updatehealth() /mob/living/silicon/ai/reset_perspective(atom/A)