sanity checking for AI damage

This commit is contained in:
Birdtalon
2017-08-15 18:27:17 +01:00
parent e3c98f79c4
commit 808c35a7ab
+13 -4
View File
@@ -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, "<span class='warning'>Your shock has no effect on [src]!</span>")
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("<span class='danger'><B>[M]</B> [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)