Screw commit history.
This commit is contained in:
@@ -6,20 +6,19 @@
|
||||
return
|
||||
if(sound_effect)
|
||||
play_attack_sound(damage_amount, damage_type, damage_flag)
|
||||
if(!(resistance_flags & INDESTRUCTIBLE) && obj_integrity > 0)
|
||||
damage_amount = run_obj_armor(damage_amount, damage_type, damage_flag, attack_dir, armour_penetration)
|
||||
if(damage_amount >= DAMAGE_PRECISION)
|
||||
. = damage_amount
|
||||
var/old_integ = obj_integrity
|
||||
obj_integrity = max(old_integ - damage_amount, 0)
|
||||
if(obj_integrity <= 0)
|
||||
var/int_fail = integrity_failure
|
||||
if(int_fail && old_integ > int_fail)
|
||||
obj_break(damage_flag)
|
||||
obj_destruction(damage_flag)
|
||||
else if(integrity_failure)
|
||||
if(obj_integrity <= integrity_failure)
|
||||
obj_break(damage_flag)
|
||||
if((resistance_flags & INDESTRUCTIBLE) || obj_integrity <= 0)
|
||||
return
|
||||
damage_amount = run_obj_armor(damage_amount, damage_type, damage_flag, attack_dir, armour_penetration)
|
||||
if(damage_amount < DAMAGE_PRECISION)
|
||||
return
|
||||
. = damage_amount
|
||||
obj_integrity = max(obj_integrity - damage_amount, 0)
|
||||
//BREAKING FIRST
|
||||
if(integrity_failure && obj_integrity <= integrity_failure * max_integrity)
|
||||
obj_break(damage_flag)
|
||||
//DESTROYING SECOND
|
||||
if(obj_integrity <= 0)
|
||||
obj_destruction(damage_flag)
|
||||
|
||||
//returns the damage value of the attack after processing the obj's various armor protections
|
||||
/obj/proc/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir, armour_penetration = 0)
|
||||
@@ -271,7 +270,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
|
||||
|
||||
//changes max_integrity while retaining current health percentage
|
||||
//returns TRUE if the obj broke, FALSE otherwise
|
||||
/obj/proc/modify_max_integrity(new_max, can_break = TRUE, damage_type = BRUTE, new_failure_integrity = null)
|
||||
/obj/proc/modify_max_integrity(new_max, can_break = TRUE, damage_type = BRUTE)
|
||||
var/current_integrity = obj_integrity
|
||||
var/current_max = max_integrity
|
||||
|
||||
@@ -282,10 +281,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
|
||||
|
||||
max_integrity = new_max
|
||||
|
||||
if(new_failure_integrity != null)
|
||||
integrity_failure = new_failure_integrity
|
||||
|
||||
if(can_break && integrity_failure && current_integrity <= integrity_failure)
|
||||
if(can_break && integrity_failure && current_integrity <= integrity_failure * max_integrity)
|
||||
obj_break(damage_type)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user