Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Fixing cell power usage (Part 2) #2599

Merged
merged 2 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/game/objects/items/robot/items/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
check_amount()
if(iscyborg(user))
var/mob/living/silicon/robot/robot_user = user
if(!robot_user.cell.use(12))
if(!robot_user.cell.use(12 KILO JOULES))
to_chat(user, span_warning("Not enough power."))
return AFTERATTACK_PROCESSED_ITEM
switch(mode)
Expand Down
12 changes: 6 additions & 6 deletions code/game/objects/items/robot/robot_upgrades.dm
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
/// Minimum time between repairs in seconds
var/repair_cooldown = 4
var/on = FALSE
var/powercost = 10
var/energy_cost = 10 KILO JOULES
var/datum/action/toggle_action

/obj/item/borg/upgrade/selfrepair/action(mob/living/silicon/robot/R, user = usr)
Expand Down Expand Up @@ -355,24 +355,24 @@
deactivate_sr()
return

if(cyborg.cell.charge < powercost * 2)
if(cyborg.cell.charge < energy_cost * 2)
to_chat(cyborg, span_alert("Self-repair module deactivated. Please recharge."))
deactivate_sr()
return

if(cyborg.health < cyborg.maxHealth)
if(cyborg.health < 0)
repair_amount = -2.5
powercost = 30
energy_cost = 30 KILO JOULES
else
repair_amount = -1
powercost = 10
energy_cost = 10 KILO JOULES
cyborg.adjustBruteLoss(repair_amount)
cyborg.adjustFireLoss(repair_amount)
cyborg.updatehealth()
cyborg.cell.use(powercost)
cyborg.cell.use(energy_cost)
else
cyborg.cell.use(5)
cyborg.cell.use(5 KILO JOULES)
next_repair = world.time + repair_cooldown * 10 // Multiply by 10 since world.time is in deciseconds

if(TIMER_COOLDOWN_FINISHED(src, COOLDOWN_BORG_SELF_REPAIR))
Expand Down
3 changes: 2 additions & 1 deletion code/modules/projectiles/guns/energy/special.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@
usesound = list('sound/items/welder.ogg', 'sound/items/welder2.ogg')
tool_behaviour = TOOL_WELDER
toolspeed = 0.7 //plasmacutters can be used as welders, and are faster than standard welders
var/charge_weld = 25 //amount of charge used up to start action (multiplied by amount) and per progress_flash_divisor ticks of welding
/// amount of charge used up to start action (multiplied by amount) and per progress_flash_divisor ticks of welding
var/charge_weld = 25 KILO JOULES

/obj/item/gun/energy/plasmacutter/Initialize(mapload)
AddElement(/datum/element/update_icon_blocker)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/reagents/reagent_containers/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
if(on && (!cell || cell.charge <= 0)) //Check if we ran out of power
change_power_status(FALSE)
return FALSE
cell.use(5 * seconds_per_tick) //Basic cell goes for like 200 seconds, bluespace for 8000
cell.use(5 KILO WATTS * seconds_per_tick) //Basic cell goes for like 200 seconds, bluespace for 8000
if(!reagents.total_volume)
return FALSE
var/max_temp = min(500 + (500 * (0.2 * cell.rating)), 1000) // 373 to 1000
Expand Down
Loading