Skip to content

Commit

Permalink
Merge pull request #281 from She-Is-Trying-To-Form-Her-First-Thought/…
Browse files Browse the repository at this point in the history
…power-use

Tweaks Much of Android Power
  • Loading branch information
carpotoxin authored Dec 17, 2024
2 parents 7ccfc19 + 05371b3 commit c2f2327
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// The starter amount for the android's core
#define ENERGY_START_AMT 5 MEGA JOULES
/// The amount at which mob energy decreases
#define ENERGY_DRAIN_AMT 5 KILO JOULES
#define ENERGY_DRAIN_AMT 2.5 KILO JOULES

/datum/species/android
name = "Android"
Expand Down Expand Up @@ -71,6 +71,8 @@
QDEL_NULL(energy_tracker)

/datum/species/android/spec_revival(mob/living/carbon/human/target)
if(core_energy < 0.5 MEGA JOULES)
core_energy += 0.5 MEGA JOULES
playsound(target.loc, 'sound/machines/chime.ogg', 50, TRUE)
target.visible_message(span_notice("[target]'s LEDs flicker to life!"), span_notice("All systems nominal. You're back online!"))

Expand All @@ -91,11 +93,6 @@
return
if(core_energy > 0)
core_energy -= ENERGY_DRAIN_AMT
// alerts
if(core_energy <= 0.75 MEGA JOULES)
if(prob(10))
target.balloon_alert_to_viewers("power low!")
playsound(target, 'sound/machines/beep/triple_beep.ogg', 50, FALSE)
// alerts end, death begins
if(core_energy <= 0)
target.death() // You can do a lot in a day.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// 1 tile down
#define UI_ENERGY_DISPLAY "WEST:6,CENTER-1:0"
#define UI_ENERGY_DISPLAY "WEST:0,CENTER-1:0"

///Maptext define for Hemophage HUDs
#define FORMAT_ANDROID_HUD_TEXT(valuecolor, value) MAPTEXT("<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='[valuecolor]'>[round((value/1000000), 0.01)]MJ</font></div>")
Expand All @@ -11,9 +11,14 @@
name = "Energy Tracker"
icon_state = "energy_display"
screen_loc = UI_ENERGY_DISPLAY
maptext_width = 48

/atom/movable/screen/android/energy/proc/update_energy_hud(core_energy)
maptext = FORMAT_ANDROID_HUD_TEXT(hud_text_color(core_energy), core_energy)
if(core_energy <= 1.5 MEGA JOULES)
icon_state = "energy_display_low"
else
icon_state = "energy_display"

/atom/movable/screen/android/energy/proc/hud_text_color(core_energy)
return core_energy > 1.5 MEGA JOULES ? "#ffffff" : "#b64b4b"
Expand Down
Binary file not shown.

0 comments on commit c2f2327

Please sign in to comment.