Modular computer fixes (#70606)

* Moves a lot of modular computer attackbys to the cpu instead, which is what handles it all. This allows their parts to be removed and the console deconstructed/repaired once again.
This commit is contained in:
GoblinBackwards
2022-10-19 01:21:28 +01:00
committed by GitHub
parent 1c5b1e8eee
commit 89beb98495
2 changed files with 23 additions and 4 deletions

View File

@@ -312,10 +312,14 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
/obj/item/modular_computer/examine(mob/user)
. = ..()
if(atom_integrity <= integrity_failure * max_integrity)
. += span_danger("It is heavily damaged!")
else if(atom_integrity < max_integrity)
. += span_warning("It is damaged.")
var/healthpercent = round((atom_integrity/max_integrity) * 100, 1)
switch(healthpercent)
if(50 to 99)
. += span_info("It looks slightly damaged.")
if(25 to 50)
. += span_info("It appears heavily damaged.")
if(0 to 25)
. += span_warning("It's falling apart!")
if(long_ranged)
. += "It is upgraded with an experimental long-ranged network capabilities, picking up NTNet frequencies while further away."

View File

@@ -133,11 +133,26 @@
return cpu.screwdriver_act(user, tool)
return ..()
/obj/machinery/modular_computer/wrench_act(mob/user, obj/item/tool)
if(cpu)
return cpu.wrench_act(user, tool)
return ..()
/obj/machinery/modular_computer/welder_act(mob/user, obj/item/tool)
if(cpu)
return cpu.welder_act(user, tool)
return ..()
/obj/machinery/modular_computer/attackby(obj/item/W as obj, mob/living/user)
if (cpu && !user.combat_mode && !(flags_1 & NODECONSTRUCT_1))
return cpu.attackby(W, user)
return ..()
/obj/machinery/modular_computer/attacked_by(obj/item/attacking_item, mob/living/user)
if (cpu)
return cpu.attacked_by(attacking_item, user)
return ..()
// Stronger explosions cause serious damage to internal components
// Minor explosions are mostly mitigitated by casing.
/obj/machinery/modular_computer/ex_act(severity)