Skip to content

Commit

Permalink
[MIRROR] Mech Diagnostic Hud Fix [MDB IGNORE] (#322)
Browse files Browse the repository at this point in the history
* Mech Diagnostic Hud Fix (#79281)

---------

Co-authored-by: GPeckman <[email protected]>
  • Loading branch information
Steals-The-PRs and GPeckman authored Oct 28, 2023
1 parent b815623 commit b8262d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions code/modules/vehicles/mecha/mecha_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
if(damage_taken <= 0 || atom_integrity < 0)
return damage_taken

diag_hud_set_mechhealth()
spark_system?.start()
try_deal_internal_damage(damage_taken)
if(damage_taken >= 5 || prob(33))
Expand Down Expand Up @@ -332,6 +333,7 @@
. = ..()
if(.)
try_damage_component(., user.zone_selected)
diag_hud_set_mechhealth()

/obj/vehicle/sealed/mecha/examine(mob/user)
. = ..()
Expand Down Expand Up @@ -428,6 +430,7 @@
break
if(did_the_thing)
user.balloon_alert_to_viewers("[(atom_integrity >= max_integrity) ? "fully" : "partially"] repaired [src]")
diag_hud_set_mechhealth()
else
user.balloon_alert_to_viewers("stopped welding [src]", "interrupted the repair!")

Expand All @@ -436,6 +439,7 @@
atom_integrity = max_integrity
if(cell && charge_cell)
cell.charge = cell.maxcharge
diag_hud_set_mechcell()
if(internal_damage & MECHA_INT_FIRE)
clear_internal_damage(MECHA_INT_FIRE)
if(internal_damage & MECHA_INT_TEMP_CONTROL)
Expand All @@ -446,6 +450,7 @@
clear_internal_damage(MECHA_CABIN_AIR_BREACH)
if(internal_damage & MECHA_INT_CONTROL_LOST)
clear_internal_damage(MECHA_INT_CONTROL_LOST)
diag_hud_set_mechhealth()

/obj/vehicle/sealed/mecha/narsie_act()
emp_act(EMP_HEAVY)
Expand Down
5 changes: 4 additions & 1 deletion code/modules/vehicles/mecha/mecha_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
return cell?.charge

/obj/vehicle/sealed/mecha/proc/use_power(amount)
return (get_charge() && cell.use(amount))
var/output = get_charge() && cell.use(amount)
if (output)
diag_hud_set_mechcell()
return output

/obj/vehicle/sealed/mecha/proc/give_power(amount)
if(!isnull(get_charge()))
Expand Down

0 comments on commit b8262d7

Please sign in to comment.