Merge pull request #15182 from ChangelingRain/complexanimals

Simple animal force threshold no longer converts damage to brute
This commit is contained in:
tkdrg
2016-02-05 01:03:21 -03:00
3 changed files with 16 additions and 18 deletions
@@ -274,13 +274,13 @@
/mob/living/simple_animal/attack_animal(mob/living/simple_animal/M)
if(..())
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
attack_threshold_check(damage,M.melee_damage_type)
apply_damage(damage, M.melee_damage_type, threshold_check = 1, threshold_message = 1)
return 1
/mob/living/simple_animal/bullet_act(obj/item/projectile/Proj)
if(!Proj)
return
apply_damage(Proj.damage, Proj.damage_type)
apply_damage(Proj.damage, Proj.damage_type, threshold_message = 1)
Proj.on_hit(src)
return 0
@@ -330,7 +330,7 @@
M.do_attack_animation(src)
visible_message("<span class='danger'>[M] [response_harm] [src]!</span>")
playsound(loc, "punch", 25, 1, -1)
attack_threshold_check(harm_intent_damage)
apply_damage(harm_intent_damage, threshold_check = 1, threshold_message = 1)
add_logs(M, src, "attacked")
updatehealth()
return 1
@@ -339,7 +339,7 @@
if(..()) //successful monkey bite.
if(stat != DEAD)
var/damage = rand(1, 3)
attack_threshold_check(damage)
apply_damage(damage, threshold_check = 1, threshold_message = 1)
return 1
if (M.a_intent == "help")
if (health > 0)
@@ -360,7 +360,7 @@
visible_message("<span class='danger'>[M] has slashed at [src]!</span>", \
"<span class='userdanger'>[M] has slashed at [src]!</span>")
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
attack_threshold_check(damage)
apply_damage(damage, threshold_check = 1, threshold_message = 1)
add_logs(M, src, "attacked")
return 1
@@ -369,7 +369,7 @@
var/damage = rand(5, 10)
if(stat != DEAD)
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
attack_threshold_check(damage)
apply_damage(damage, threshold_check = 1, threshold_message = 1)
return 1
/mob/living/simple_animal/attack_slime(mob/living/simple_animal/slime/M)
@@ -377,15 +377,16 @@
var/damage = rand(15, 25)
if(M.is_adult)
damage = rand(20, 35)
attack_threshold_check(damage)
apply_damage(damage, threshold_check = 1, threshold_message = 1)
return 1
/mob/living/simple_animal/proc/attack_threshold_check(damage, damagetype = BRUTE)
if(damage <= force_threshold || !damage_coeff[damagetype])
visible_message("<span class='warning'>[src] looks unharmed.</span>")
/mob/living/simple_animal/apply_damage(damage = 0, damagetype = BRUTE, threshold_check = 0, threshold_message = 0)
if(!damage_coeff[damagetype] || threshold_check && damage <= force_threshold)
if(threshold_message)
visible_message("<span class='warning'>[src] looks unharmed.</span>")
return 0
else
adjustBruteLoss(damage)
updatehealth()
return ..()
/mob/living/simple_animal/attackby(obj/item/O, mob/living/user, params) //Marker -Agouri