mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Fix armor penetration increasing negative object's and mob silicon's armor (#30105)
* fix * no src allowed
This commit is contained in:
@@ -25,13 +25,12 @@
|
||||
return 0
|
||||
if(damage_type != BRUTE && damage_type != BURN)
|
||||
return 0
|
||||
var/armor_protection = 0
|
||||
var/armor_protection
|
||||
if(damage_flag)
|
||||
armor_protection = armor.getRating(damage_flag)
|
||||
if(armor_protection) //Only apply weak-against-armor/hollowpoint effects if there actually IS armor.
|
||||
armor_protection = clamp((armor_protection * ((100 - armor_penetration_percentage) / 100)) - armor_penetration_flat, min(armor_protection, 0), 100)
|
||||
var/damage_multiplier = (100 - armor_protection) / 100
|
||||
return round(damage_amount * damage_multiplier, DAMAGE_PRECISION)
|
||||
if(armor_protection > 0) //Only apply weak-against-armor/hollowpoint effects if there actually IS armor.
|
||||
armor_protection = clamp(armor_protection * (100 - armor_penetration_percentage) / 100 - armor_penetration_flat, 0, 100)
|
||||
return round(damage_amount * (100 - armor_protection) / 100, DAMAGE_PRECISION)
|
||||
|
||||
/// returns the amount of damage required to destroy this object in a single hit.
|
||||
/obj/proc/calculate_oneshot_damage(damage_type, damage_flag = 0, attack_dir, armor_penetration_flat = 0, armor_penetration_percentage = 0)
|
||||
@@ -42,11 +41,11 @@
|
||||
if(damage_type != BRUTE && damage_type != BURN)
|
||||
return INFINITY
|
||||
|
||||
var/armor_protection = 0
|
||||
var/armor_protection
|
||||
if(damage_flag)
|
||||
armor_protection = armor.getRating(damage_flag)
|
||||
if(armor_protection) // Only apply weak-against-armor/hollowpoint effects if there actually IS armor.
|
||||
armor_protection = clamp((armor_protection * ((100 - armor_penetration_percentage) / 100)) - armor_penetration_flat, min(armor_protection, 0), 100)
|
||||
if(armor_protection > 0) // Only apply weak-against-armor/hollowpoint effects if there actually IS armor.
|
||||
armor_protection = clamp(armor_protection * (100 - armor_penetration_percentage) / 100 - armor_penetration_flat, 0, 100)
|
||||
|
||||
var/damage_multiplier = (100 - armor_protection) / 100
|
||||
if(damage_multiplier <= 0)
|
||||
|
||||
Reference in New Issue
Block a user