mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-22 20:57:23 +01:00
Destroying a camera now also cuts wires randomly.
This commit is contained in:
@@ -278,6 +278,11 @@ var/const/POWER = 8
|
||||
var/r = rand(1, wires.len)
|
||||
CutWireIndex(r)
|
||||
|
||||
/datum/wires/proc/RandomCutAll(var/probability = 10)
|
||||
for(var/i = 1; i < MAX_FLAG && i < (1 << wire_count); i += i)
|
||||
if(prob(probability))
|
||||
CutWireIndex(i)
|
||||
|
||||
/datum/wires/proc/CutAll()
|
||||
for(var/i = 1; i < MAX_FLAG && i < (1 << wire_count); i += i)
|
||||
CutWireIndex(i)
|
||||
|
||||
@@ -226,6 +226,8 @@
|
||||
//Used when someone breaks a camera
|
||||
/obj/machinery/camera/proc/destroy()
|
||||
stat |= BROKEN
|
||||
wires.RandomCutAll()
|
||||
|
||||
kick_viewers()
|
||||
triggerCameraAlarm()
|
||||
update_icon()
|
||||
|
||||
Reference in New Issue
Block a user