mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-31 07:58:22 +01:00
Refactors how armor works. It's now less of a dice roll, but still retains some randomness. This makes weaker armor worth using, and stronger armor not godlike.
Also fixes a bug with the auto shotgun causing runtimes.
This commit is contained in:
@@ -9,28 +9,34 @@
|
||||
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(Debug2)
|
||||
world.log << "## DEBUG: apply_damage() was called on [src], with [damage] damage, and an armor value of [blocked]."
|
||||
if(!damage || (blocked >= 100))
|
||||
return 0
|
||||
blocked = (100-blocked)/100
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
adjustBruteLoss(damage/(blocked+1))
|
||||
adjustBruteLoss(damage * blocked)
|
||||
if(BURN)
|
||||
if(COLD_RESISTANCE in mutations) damage = 0
|
||||
adjustFireLoss(damage/(blocked+1))
|
||||
if(COLD_RESISTANCE in mutations)
|
||||
damage = 0
|
||||
adjustFireLoss(damage * blocked)
|
||||
if(TOX)
|
||||
adjustToxLoss(damage/(blocked+1))
|
||||
adjustToxLoss(damage * blocked)
|
||||
if(OXY)
|
||||
adjustOxyLoss(damage/(blocked+1))
|
||||
adjustOxyLoss(damage * blocked)
|
||||
if(CLONE)
|
||||
adjustCloneLoss(damage/(blocked+1))
|
||||
adjustCloneLoss(damage * blocked)
|
||||
if(HALLOSS)
|
||||
adjustHalLoss(damage/(blocked+1))
|
||||
adjustHalLoss(damage * 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)
|
||||
@@ -42,32 +48,43 @@
|
||||
|
||||
|
||||
/mob/living/proc/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0, var/check_protection = 1)
|
||||
if(!effect || (blocked >= 2)) return 0
|
||||
if(Debug2)
|
||||
world.log << "## DEBUG: apply_effect() was called. The type of effect is [effecttype]. Blocked by [blocked]."
|
||||
if(!effect || (blocked >= 100))
|
||||
return 0
|
||||
blocked = (100-blocked)/100
|
||||
|
||||
switch(effecttype)
|
||||
if(STUN)
|
||||
Stun(effect/(blocked+1))
|
||||
Stun(effect * blocked)
|
||||
if(WEAKEN)
|
||||
Weaken(effect/(blocked+1))
|
||||
Weaken(effect * blocked)
|
||||
if(PARALYZE)
|
||||
Paralyse(effect/(blocked+1))
|
||||
Paralyse(effect * blocked)
|
||||
if(AGONY)
|
||||
halloss += effect // Useful for objects that cause "subdual" damage. PAIN!
|
||||
halloss += max((effect * blocked), 0) // Useful for objects that cause "subdual" damage. PAIN!
|
||||
if(IRRADIATE)
|
||||
/*
|
||||
var/rad_protection = check_protection ? getarmor(null, "rad")/100 : 0
|
||||
radiation += max((1-rad_protection)*effect/(blocked+1),0)//Rads auto check armor
|
||||
*/
|
||||
var/rad_protection = getarmor(null, "rad")
|
||||
rad_protection = (100-rad_protection)/100
|
||||
radiation += max((effect * rad_protection), 0)
|
||||
if(STUTTER)
|
||||
if(status_flags & CANSTUN) // stun is usually associated with stutter
|
||||
stuttering = max(stuttering,(effect/(blocked+1)))
|
||||
stuttering = max(stuttering,(effect * blocked))
|
||||
if(EYE_BLUR)
|
||||
eye_blurry = max(eye_blurry,(effect/(blocked+1)))
|
||||
eye_blurry = max(eye_blurry,(effect * blocked))
|
||||
if(DROWSY)
|
||||
drowsyness = max(drowsyness,(effect/(blocked+1)))
|
||||
drowsyness = max(drowsyness,(effect * blocked))
|
||||
updatehealth()
|
||||
return 1
|
||||
|
||||
|
||||
/mob/living/proc/apply_effects(var/stun = 0, var/weaken = 0, var/paralyze = 0, var/irradiate = 0, var/stutter = 0, var/eyeblur = 0, var/drowsy = 0, var/agony = 0, var/blocked = 0)
|
||||
if(blocked >= 2) return 0
|
||||
if(blocked >= 100)
|
||||
return 0
|
||||
if(stun) apply_effect(stun, STUN, blocked)
|
||||
if(weaken) apply_effect(weaken, WEAKEN, blocked)
|
||||
if(paralyze) apply_effect(paralyze, PARALYZE, blocked)
|
||||
|
||||
Reference in New Issue
Block a user