Skip to content

Commit

Permalink
fix and icons for charging
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeguyManperson committed Feb 6, 2024
1 parent 0c4d4f5 commit a160b44
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions code/modules/power/gravitygenerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -437,16 +437,17 @@
if(charging)
if(!active_power_usage || surplus() >= active_power_usage)
add_load(active_power_usage)
charge = min(charge+1, 10)
if(charge >= 10)
charge = min(charge+1, 5)
update_appearance()
if(charge >= 5)
set_state(TRUE)
else
if(charge)
charge--
return
set_state(FALSE)

/obj/machinery/power/ship_gravity/proc/set_state(var/toggle)
/obj/machinery/power/ship_gravity/proc/set_state(toggle)
if(toggle == active)
return
if(toggle)
Expand All @@ -464,9 +465,12 @@
if(panel_open)
return
icon_state = "[base_icon_state]"
if(charging)
if(active)
icon_state += "_a"
return
if(charging)
icon_state += "_[charge]"
return

/obj/machinery/power/ship_gravity/examine(mob/user)
. = ..()
Expand All @@ -478,7 +482,7 @@
if(!charging && !charge)
. += span_info("Its status display is currently turned off.")
else
. += span_info("Its status display reads: Current charge at <b>[charge*10]%</b>.")
. += span_info("Its status display reads: Current charge at <b>[charge*20]%</b>.")

/obj/machinery/power/ship_gravity/screwdriver_act(mob/living/user, obj/item/I)
..()
Expand Down
Binary file modified icons/obj/machines/gravity_generator.dmi
Binary file not shown.

0 comments on commit a160b44

Please sign in to comment.