mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 19:17:50 +01:00
Merge pull request #4918 from Chakirski/EMP-Binary
Adds disable_component() to Cyborgs - EMPs Disable Binary
This commit is contained in:
@@ -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.
|
||||
@@ -121,7 +122,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, duration)
|
||||
var/datum/robot_component/D = get_component(module_name)
|
||||
D.component_disabled++
|
||||
spawn(duration)
|
||||
D.component_disabled--
|
||||
|
||||
// Returns component by it's string name
|
||||
/mob/living/silicon/robot/proc/get_component(var/component_name)
|
||||
|
||||
@@ -1470,3 +1470,11 @@ var/list/robot_verbs_default = list(
|
||||
status_flags &= ~CANPUSH
|
||||
|
||||
notify_ai(2)
|
||||
|
||||
/mob/living/silicon/robot/emp_act(severity)
|
||||
..()
|
||||
switch(severity)
|
||||
if(1)
|
||||
disable_component("comms", 160)
|
||||
if(2)
|
||||
disable_component("comms", 60)
|
||||
|
||||
Reference in New Issue
Block a user