EMP-Binary

This commit is contained in:
Chakirski
2016-07-07 15:05:33 -05:00
parent 3626342f8c
commit f61225f3b3
2 changed files with 16 additions and 1 deletions
@@ -9,6 +9,7 @@
var/electronics_damage = 0
var/energy_consumption = 0
var/max_damage = 30
var/component_disabled = 0
var/mob/living/silicon/robot/owner
// The actual device object that has to be installed for this.
@@ -95,6 +96,7 @@
external_type = /obj/item/robot_parts/robot_component/binary_communication_device
energy_consumption = 0
max_damage = 30
component_disabled = 0
/datum/robot_component/camera
name = "camera"
@@ -121,7 +123,13 @@
/mob/living/silicon/robot/proc/is_component_functioning(module_name)
var/datum/robot_component/C = components[module_name]
return C && C.installed == 1 && C.toggled && C.is_powered()
return C && C.installed == 1 && C.toggled && C.is_powered() && !C.component_disabled
/mob/living/silicon/robot/proc/disable_component(module_name, emp_duration)
var/datum/robot_component/D = get_component(module_name)
D.component_disabled = 1
spawn (emp_duration)
D.component_disabled = 0
// Returns component by it's string name
/mob/living/silicon/robot/proc/get_component(var/component_name)
@@ -1470,3 +1470,10 @@ var/list/robot_verbs_default = list(
status_flags &= ~CANPUSH
notify_ai(2)
/mob/living/silicon/robot/emp_act(severity)
..()
if(1)
disable_component("comms", 360)
if(2)
disable_component("comms", 60)