mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 21:12:24 +01:00
**_- bugfix: "Fixes all rubber bullets dealing damage twice."_** Rubber bullets were dealing their pain damage twice, while checking if they should shake your screen or not. _**- bugfix: "Fixes all attacks that dealt pain damage checking siemens coefficient. This makes everything but hardsuits and voidsuits stronger against rubber bullets. Insulated gloves are also no longer immune to rubber bullets."**_ Hardsuits has siemens 0.1, meaning they took 10% damage from all stuns. Now rubber bullets check their melee armor. Hardsuits are now weaker, or the same against stuns. Regular armor all has siemens 0.5, they took a flat 50% reduction. Security armour is slightly weaker to rubbers, ablative and ballistic are much weaker. Combat armour is roughly the same, or slightly better. Riot armour is a lot better. Voidsuits all had better siemens than armour, all voidsuits are now weaker against stuns. Finally, all jumpsuits had 0.75 siemens, but no (or nearly no) armor. Combined with the fix of them hitting twice this means that rubber bullets previously dealt 50% more damage against people in jumpsuits than they do now. **_- bugfix: "Fixes pain failing to make your blurt out whatever you were typing. Now getting shot will cause you to say whatever was in the typing window when you were hit and close the window immediately, allowing you to move."_** No more getting stuck in the typing window when you're getting sprayed down by an STS! _**- bugfix: "Fixes all attacks that had manually set armour checks, previously they ignored the armour they were meant to check and decided what armour affected them based only on their damage type."**_ Weapons that were set to specifically target armour types, such as explosive projectiles (rockets, etc) were instead defaulting to the damage type they dealt. So a rocket to the head was checking your melee armour, not your bomb armour. --------- Signed-off-by: FenodyreeAv <fenodyree.av@gmail.com>
160 lines
4.5 KiB
Plaintext
160 lines
4.5 KiB
Plaintext
|
|
/*
|
|
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(damage = 0, damagetype = DAMAGE_BRUTE, def_zone, used_weapon, damage_flags = 0, armor_pen, silent = FALSE, check_armor = null)
|
|
SHOULD_NOT_SLEEP(TRUE)
|
|
|
|
if(!damage)
|
|
return FALSE
|
|
|
|
var/list/after_armor = modify_damage_by_armor(def_zone, damage, damagetype, damage_flags, src, armor_pen, silent, check_armor)
|
|
damage = after_armor[1]
|
|
damagetype = after_armor[2]
|
|
damage_flags = after_armor[3] // args modifications in case of parent calls
|
|
if(!damage)
|
|
return FALSE
|
|
|
|
switch(damagetype)
|
|
if(DAMAGE_BRUTE)
|
|
adjustBruteLoss(damage)
|
|
if(DAMAGE_BURN)
|
|
if((mutations & COLD_RESISTANCE))
|
|
damage = 0
|
|
adjustFireLoss(damage)
|
|
if(DAMAGE_TOXIN)
|
|
adjustToxLoss(damage)
|
|
if(DAMAGE_OXY)
|
|
adjustOxyLoss(damage)
|
|
if(DAMAGE_CLONE)
|
|
adjustCloneLoss(damage)
|
|
if(DAMAGE_PAIN)
|
|
adjustHalLoss(damage)
|
|
if(DAMAGE_RADIATION)
|
|
apply_radiation(damage)
|
|
|
|
updatehealth()
|
|
return TRUE
|
|
|
|
/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, var/damage_flags = 0)
|
|
if(brute) apply_damage(brute, DAMAGE_BRUTE, def_zone, GLOB.blocked)
|
|
if(burn) apply_damage(burn, DAMAGE_BURN, def_zone, GLOB.blocked)
|
|
if(tox) apply_damage(tox, DAMAGE_TOXIN, def_zone, GLOB.blocked)
|
|
if(oxy) apply_damage(oxy, DAMAGE_OXY, def_zone, GLOB.blocked)
|
|
if(clone) apply_damage(clone, DAMAGE_CLONE, def_zone, GLOB.blocked)
|
|
if(halloss) apply_damage(halloss, DAMAGE_PAIN, def_zone, GLOB.blocked)
|
|
return TRUE
|
|
|
|
/**
|
|
* Apply an effect to the mob
|
|
*
|
|
* * effect - The amount of effect to apply, a number
|
|
* * effect_type - An effect eg. `STUN`, `WEAKEN`; see `code\__DEFINES\damage_organs.dm` for relative defines
|
|
* * blocked - The **percentage** of effect that was blocked, eg. by armor, a number
|
|
*
|
|
* Returns `TRUE` if the effect was applied, `FALSE` otherwise
|
|
*/
|
|
/mob/living/proc/apply_effect(effect = 0, effect_type = STUN, blocked = 0)
|
|
SHOULD_NOT_SLEEP(TRUE)
|
|
|
|
//Check that noone fucked up the vars
|
|
if(!isnum(effect))
|
|
stack_trace("Passed a wrong value in the proc for the effect var, it must be a number!")
|
|
return FALSE
|
|
|
|
if(!isnum(blocked))
|
|
stack_trace("Passed a wrong value in the proc for the blocked var, it must be a number!")
|
|
blocked = 0
|
|
|
|
if(!istext(effect_type))
|
|
stack_trace("Passed a wrong value in the proc for the effect_type var, it must be an effect!")
|
|
return FALSE
|
|
|
|
//If the armor blocked it all, no effect is to be applied
|
|
if(blocked >= 100)
|
|
return FALSE
|
|
|
|
//Apply the effect based on type, accounting for the blocked percentage
|
|
switch(effect_type)
|
|
|
|
if(STUN)
|
|
Stun(effect * BLOCKED_MULT(blocked))
|
|
|
|
if(WEAKEN)
|
|
Weaken(effect * BLOCKED_MULT(blocked))
|
|
|
|
if(PARALYZE)
|
|
Paralyse(effect * BLOCKED_MULT(blocked))
|
|
|
|
if(DAMAGE_PAIN)
|
|
adjustHalLoss(effect * BLOCKED_MULT(blocked)) //Changed this to use the wrapper function, it shouldn't directly alter the value
|
|
|
|
if(STUTTER)
|
|
if(status_flags & CANSTUN) // stun is usually associated with stutter
|
|
stuttering = max(stuttering, effect * BLOCKED_MULT(blocked))
|
|
|
|
if(EYE_BLUR)
|
|
eye_blurry = max(eye_blurry, effect * BLOCKED_MULT(blocked))
|
|
|
|
if(DROWSY)
|
|
drowsiness = max(drowsiness, effect * BLOCKED_MULT(blocked))
|
|
|
|
if(INCINERATE)
|
|
IgniteMob(effect * BLOCKED_MULT(blocked))
|
|
|
|
//Update health for the mob
|
|
updatehealth()
|
|
|
|
return TRUE
|
|
|
|
/**
|
|
* Convenience proc to apply effects to a mob
|
|
*
|
|
* * blocked - The **percentage** of effects that was blocked, eg. by armor, a number
|
|
*
|
|
* Returns `TRUE` if the effects were not completely blocked, `FALSE` otherwise
|
|
*/
|
|
/mob/living/proc/apply_effects(stun = 0, weaken = 0, paralyze = 0, irradiate = 0, stutter = 0, eyeblur = 0, drowsy = 0, agony = 0, incinerate = 0, blocked = 0)
|
|
SHOULD_NOT_SLEEP(TRUE)
|
|
|
|
if(blocked >= 100)
|
|
return FALSE
|
|
|
|
if(stun)
|
|
apply_effect(stun, STUN, blocked)
|
|
|
|
if(weaken)
|
|
apply_effect(weaken, WEAKEN, blocked)
|
|
|
|
if(paralyze)
|
|
apply_effect(paralyze, PARALYZE, blocked)
|
|
|
|
if(stutter)
|
|
apply_effect(stutter, STUTTER, blocked)
|
|
|
|
if(eyeblur)
|
|
apply_effect(eyeblur, EYE_BLUR, blocked)
|
|
|
|
if(drowsy)
|
|
apply_effect(drowsy, DROWSY, blocked)
|
|
|
|
if(agony)
|
|
apply_effect(agony, DAMAGE_PAIN, blocked)
|
|
|
|
if(incinerate)
|
|
apply_effect(incinerate, INCINERATE, blocked)
|
|
|
|
return TRUE
|
|
|
|
// overridden by human
|
|
/mob/living/proc/apply_radiation(var/rads)
|
|
total_radiation += rads
|
|
if (total_radiation < 0)
|
|
total_radiation = 0
|