mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 07:33:34 +01:00
Major Lavaland Update
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user