moves obj_integrity and associated procs to the atom level (#61183)

This commit is contained in:
Kylerace
2021-09-06 04:07:26 -07:00
committed by GitHub
parent ed8be87105
commit d9ee5e7297
122 changed files with 503 additions and 436 deletions

View File

@@ -234,9 +234,9 @@
/obj/item/modular_computer/examine(mob/user)
. = ..()
if(obj_integrity <= integrity_failure * max_integrity)
if(atom_integrity <= integrity_failure * max_integrity)
. += span_danger("It is heavily damaged!")
else if(obj_integrity < max_integrity)
else if(atom_integrity < max_integrity)
. += span_warning("It is damaged.")
. += get_modular_computer_parts_examine(user)
@@ -252,7 +252,7 @@
if(enabled)
. += active_program?.program_icon_state || icon_state_menu
if(obj_integrity <= integrity_failure * max_integrity)
if(atom_integrity <= integrity_failure * max_integrity)
. += "bsod"
. += "broken"
@@ -266,7 +266,7 @@
/obj/item/modular_computer/proc/turn_on(mob/user)
var/issynth = issilicon(user) // Robots and AIs get different activation messages.
if(obj_integrity <= integrity_failure * max_integrity)
if(atom_integrity <= integrity_failure * max_integrity)
if(issynth)
to_chat(user, span_warning("You send an activation signal to \the [src], but it responds with an error code. It must be damaged."))
else
@@ -302,7 +302,7 @@
last_power_usage = 0
return
if(obj_integrity <= integrity_failure * max_integrity)
if(atom_integrity <= integrity_failure * max_integrity)
shutdown_computer()
return
@@ -536,7 +536,7 @@
return
if(W.tool_behaviour == TOOL_WELDER)
if(obj_integrity == max_integrity)
if(atom_integrity == max_integrity)
to_chat(user, span_warning("\The [src] does not require repairs."))
return
@@ -545,7 +545,7 @@
to_chat(user, span_notice("You begin repairing damage to \the [src]..."))
if(W.use_tool(src, user, 20, volume=50, amount=1))
obj_integrity = max_integrity
atom_integrity = max_integrity
to_chat(user, span_notice("You repair \the [src]."))
return

View File

@@ -1,6 +1,6 @@
/obj/item/modular_computer/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
. = ..()
var/component_probability = min(50, max(damage_amount*0.1, 1 - obj_integrity/max_integrity))
var/component_probability = min(50, max(damage_amount*0.1, 1 - atom_integrity/max_integrity))
switch(damage_flag)
if(BULLET)
component_probability = damage_amount * 0.5