mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-25 00:51:55 +00:00
moves obj_integrity and associated procs to the atom level (#61183)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user