Skip to content

Commit

Permalink
[POWER FIX #2] Synth mechcharger recharging, Crank cell, MCR discharg…
Browse files Browse the repository at this point in the history
…e (#27489)

* More power stuff

* Update stomach_ethereal.dm
  • Loading branch information
Majkl-J authored Apr 28, 2024
1 parent b2f41db commit 81c965c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Essentially, power cells that malfunction if not used in an MCR, and should only
*/

/// The amount of cell charge drained during a drain failure.
#define MICROFUSION_CELL_DRAIN_FAILURE 500
#define MICROFUSION_CELL_DRAIN_FAILURE STANDARD_CELL_CHARGE * 0.5
/// The heavy EMP range for when a cell suffers an EMP failure.
#define MICROFUSION_CELL_EMP_HEAVY_FAILURE 2
/// The light EMP range for when a cell suffers an EMP failure.
Expand Down
4 changes: 2 additions & 2 deletions modular_skyrat/modules/new_cells/code/power_cell.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
icon = 'modular_skyrat/modules/new_cells/icons/power.dmi'
icon_state = "crankcell"
/// how much each crank will give the cell charge
var/crank_amount = 100
var/crank_amount = STANDARD_CELL_CHARGE * 0.1
/// how fast it takes to crank to get the crank_amount
var/crank_speed = 1 SECONDS
/// how much gets discharged every process
var/discharge_amount = 10
var/discharge_amount = STANDARD_CELL_CHARGE * 0.01
charge_light_type = "old"

/obj/item/stock_parts/cell/crank/examine(mob/user)
Expand Down
8 changes: 5 additions & 3 deletions modular_skyrat/modules/synths/code/bodyparts/stomach.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@
UnregisterSignal(stomach_owner, COMSIG_PROCESS_BORGCHARGER_OCCUPANT)

///Handles charging the synth from borg chargers
/obj/item/organ/internal/stomach/synth/proc/on_borg_charge(datum/source, amount)
/obj/item/organ/internal/stomach/synth/proc/on_borg_charge(datum/source, datum/callback/charge_cell, seconds_per_tick)
SIGNAL_HANDLER

if(owner.nutrition >= NUTRITION_LEVEL_ALMOST_FULL)
return

amount /= 50 // Lowers the charging amount so it isn't instant
owner.nutrition = min((owner.nutrition + amount), NUTRITION_LEVEL_ALMOST_FULL) // Makes sure we don't make the synth too full, which would apply the overweight slowdown
// I am NOT rewriting this to fit with TG's standard. I have like 70 bugfixes waiting. Feel free to give synths actual cells if I don't i the future
// ~Waterpig

owner.nutrition = min(owner.nutrition + (40 / seconds_per_tick), NUTRITION_LEVEL_ALMOST_FULL) // Makes sure we don't make the synth too full, which would apply the overweight slowdown

0 comments on commit 81c965c

Please sign in to comment.