Major Lavaland Update

This commit is contained in:
Fox McCloud
2019-08-10 22:36:55 -04:00
parent afe7997569
commit ee0447dad6
23 changed files with 548 additions and 348 deletions
+29 -1
View File
@@ -44,6 +44,22 @@
if(BRAIN)
return adjustBrainLoss(damage)
/mob/living/proc/get_damage_amount(damagetype = BRUTE)
switch(damagetype)
if(BRUTE)
return getBruteLoss()
if(BURN)
return getFireLoss()
if(TOX)
return getToxLoss()
if(OXY)
return getOxyLoss()
if(CLONE)
return getCloneLoss()
if(STAMINA)
return getStaminaLoss()
/mob/living/proc/apply_damages(var/brute = 0, var/burn = 0, var/tox = 0, var/oxy = 0, var/clone = 0, var/def_zone = null, var/blocked = 0, var/stamina = 0)
if(blocked >= 100) return 0
if(brute) apply_damage(brute, BRUTE, def_zone, blocked)
@@ -309,4 +325,16 @@
updatehealth("take overall damage")
/mob/living/proc/has_organic_damage()
return (maxHealth - health)
return (maxHealth - health)
//heal up to amount damage, in a given order
/mob/living/proc/heal_ordered_damage(amount, list/damage_types)
. = amount //we'll return the amount of damage healed
for(var/i in damage_types)
var/amount_to_heal = min(amount, get_damage_amount(i)) //heal only up to the amount of damage we have
if(amount_to_heal)
apply_damage_type(-amount_to_heal, i)
amount -= amount_to_heal //remove what we healed from our current amount
if(!amount)
break
. -= amount //if there's leftover healing, remove it from what we return
@@ -309,14 +309,18 @@
else
M.Goto(src,M.move_to_delay,M.minimum_distance)
/mob/living/simple_animal/hostile/proc/OpenFire(atom/A)
/mob/living/simple_animal/hostile/proc/CheckFriendlyFire(atom/A)
if(check_friendly_fire)
for(var/turf/T in getline(src,A)) // Not 100% reliable but this is faster than simulating actual trajectory
for(var/mob/living/L in T)
if(L == src || L == A)
continue
if(faction_check(L) && !attack_same)
return
if(faction_check_mob(L) && !attack_same)
return TRUE
/mob/living/simple_animal/hostile/proc/OpenFire(atom/A)
if(CheckFriendlyFire(A))
return
visible_message("<span class='danger'><b>[src]</b> [ranged_message] at [A]!</span>")
if(rapid)