mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 13:30:42 +01:00
Ports baystation armor system (#2954)
Ports Baystation12/Baystation12#12658 Changing how the calculation of armor works , instead of just being a check if it is protected fully, half or nothing. Making armor more reliable and less rng dependant. Also, uranium meteors will irradiate nearby people when they explode.
This commit is contained in:
@@ -1,36 +1,36 @@
|
||||
|
||||
/*
|
||||
apply_damage(a,b,c)
|
||||
args
|
||||
a:damage - How much damage to take
|
||||
b:damage_type - What type of damage to take, brute, burn
|
||||
c:def_zone - Where to take the damage if its brute or burn
|
||||
apply_damage() args
|
||||
damage - How much damage to take
|
||||
damage_type - What type of damage to take, brute, burn
|
||||
def_zone - Where to take the damage if its brute or burn
|
||||
Returns
|
||||
standard 0 if fail
|
||||
*/
|
||||
|
||||
/mob/living/proc/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/used_weapon = null, var/sharp = 0, var/edge = 0)
|
||||
if(!damage || (blocked >= 2)) return 0
|
||||
if(!damage || (blocked >= 100)) return 0
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
adjustBruteLoss(damage/(blocked+1))
|
||||
adjustBruteLoss(damage * BLOCKED_MULT(blocked))
|
||||
if(BURN)
|
||||
if(COLD_RESISTANCE in mutations) damage = 0
|
||||
adjustFireLoss(damage/(blocked+1))
|
||||
adjustFireLoss(damage * BLOCKED_MULT(blocked))
|
||||
if(TOX)
|
||||
adjustToxLoss(damage/(blocked+1))
|
||||
adjustToxLoss(damage * BLOCKED_MULT(blocked))
|
||||
if(OXY)
|
||||
adjustOxyLoss(damage/(blocked+1))
|
||||
adjustOxyLoss(damage * BLOCKED_MULT(blocked))
|
||||
if(CLONE)
|
||||
adjustCloneLoss(damage/(blocked+1))
|
||||
adjustCloneLoss(damage * BLOCKED_MULT(blocked))
|
||||
if(HALLOSS)
|
||||
adjustHalLoss(damage/(blocked+1))
|
||||
adjustHalLoss(damage * BLOCKED_MULT(blocked))
|
||||
flash_weak_pain()
|
||||
updatehealth()
|
||||
return 1
|
||||
|
||||
|
||||
/mob/living/proc/apply_damages(var/brute = 0, var/burn = 0, var/tox = 0, var/oxy = 0, var/clone = 0, var/halloss = 0, var/def_zone = null, var/blocked = 0)
|
||||
if(blocked >= 2) return 0
|
||||
if(blocked >= 100) return 0
|
||||
if(brute) apply_damage(brute, BRUTE, def_zone, blocked)
|
||||
if(burn) apply_damage(burn, BURN, def_zone, blocked)
|
||||
if(tox) apply_damage(tox, TOX, def_zone, blocked)
|
||||
@@ -41,29 +41,29 @@
|
||||
|
||||
|
||||
|
||||
/mob/living/proc/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0, var/check_protection = 1)
|
||||
if(!effect || (blocked >= 2)) return 0
|
||||
/mob/living/proc/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0)
|
||||
if(!effect || (blocked >= 100)) return 0
|
||||
switch(effecttype)
|
||||
if(STUN)
|
||||
Stun(effect/(blocked+1))
|
||||
Stun(effect * BLOCKED_MULT(blocked))
|
||||
if(WEAKEN)
|
||||
Weaken(effect/(blocked+1))
|
||||
Weaken(effect * BLOCKED_MULT(blocked))
|
||||
if(PARALYZE)
|
||||
Paralyse(effect/(blocked+1))
|
||||
Paralyse(effect * BLOCKED_MULT(blocked))
|
||||
if(AGONY)
|
||||
adjustHalLoss(effect) //Changed this to use the wrapper function, it shouldn't directly alter the value
|
||||
adjustHalLoss(effect * BLOCKED_MULT(blocked)) //Changed this to use the wrapper function, it shouldn't directly alter the value
|
||||
if(IRRADIATE)
|
||||
var/rad_protection = check_protection ? getarmor(null, "rad")/100 : 0
|
||||
apply_radiation(max((1-rad_protection)*effect/(blocked+1),0))//Rads auto check armor
|
||||
var/rad_protection = blocked ? getarmor(null, "rad")/100 : 0
|
||||
apply_radiation(max((1-rad_protection) * BLOCKED_MULT(blocked),0))//Rads auto check armor
|
||||
if(STUTTER)
|
||||
if(status_flags & CANSTUN) // stun is usually associated with stutter
|
||||
stuttering = max(stuttering,(effect/(blocked+1)))
|
||||
stuttering = max(stuttering, effect * BLOCKED_MULT(blocked))
|
||||
if(EYE_BLUR)
|
||||
eye_blurry = max(eye_blurry,(effect/(blocked+1)))
|
||||
eye_blurry = max(eye_blurry, effect * BLOCKED_MULT(blocked))
|
||||
if(DROWSY)
|
||||
drowsyness = max(drowsyness,(effect/(blocked+1)))
|
||||
drowsyness = max(drowsyness, effect * BLOCKED_MULT(blocked))
|
||||
if(INCINERATE)
|
||||
adjust_fire_stacks(effect/(blocked+1))
|
||||
adjust_fire_stacks(effect * BLOCKED_MULT(blocked))
|
||||
IgniteMob()
|
||||
updatehealth()
|
||||
return 1
|
||||
@@ -86,4 +86,4 @@
|
||||
/mob/living/proc/apply_radiation(var/rads)
|
||||
total_radiation += rads
|
||||
if (total_radiation < 0)
|
||||
total_radiation = 0
|
||||
total_radiation = 0
|
||||
|
||||
Reference in New Issue
Block a user