mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-28 02:52:28 +00:00
Fixes #4758
Fixed issue where removing the power cell would prevent certain checks on robot components. Also cleaned up /mob/living/silicon/robot/proc/use_power(), moved code related to status for better SRP. Added a line to the examine text to hint that the borg can still move without power. Sorry for all of this being in a single commit, things got screwed up with git.
This commit is contained in:
@@ -52,12 +52,11 @@
|
||||
/datum/robot_component/proc/is_powered()
|
||||
return (installed == 1) && (brute_damage + electronics_damage < max_damage) && (!energy_consumption || powered)
|
||||
|
||||
|
||||
/datum/robot_component/proc/consume_power()
|
||||
/datum/robot_component/proc/update_power_state()
|
||||
if(toggled == 0)
|
||||
powered = 0
|
||||
return
|
||||
if(owner.cell.charge >= energy_consumption)
|
||||
if(owner.cell && owner.cell.charge >= energy_consumption)
|
||||
owner.cell.use(energy_consumption)
|
||||
powered = 1
|
||||
else
|
||||
@@ -75,6 +74,10 @@
|
||||
external_type = /obj/item/robot_parts/robot_component/actuator
|
||||
max_damage = 50
|
||||
|
||||
//A fixed and much cleaner implementation of /tg/'s special snowflake code.
|
||||
/datum/robot_component/actuator/is_powered()
|
||||
return (installed == 1) && (brute_damage + electronics_damage < max_damage)
|
||||
|
||||
/datum/robot_component/cell
|
||||
name = "power cell"
|
||||
max_damage = 50
|
||||
@@ -92,7 +95,7 @@
|
||||
/datum/robot_component/binary_communication
|
||||
name = "binary communication device"
|
||||
external_type = /obj/item/robot_parts/robot_component/binary_communication_device
|
||||
energy_consumption = 0
|
||||
energy_consumption = 1
|
||||
max_damage = 30
|
||||
|
||||
/datum/robot_component/camera
|
||||
|
||||
Reference in New Issue
Block a user