Only malf AI can hack doors with cut ai wires, flash emps cameras (#21610)

* Only malf AI can hack doors with cut ai wires, flash emp

* weaker emp = less time

* Apply suggestions from code review

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: JimKil3 <47290811+JimKil3@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: JimKil3 <47290811+JimKil3@users.noreply.github.com>

* FLASH. AH AH

---------

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: JimKil3 <47290811+JimKil3@users.noreply.github.com>
This commit is contained in:
Qwertytoforty
2023-08-12 13:43:05 -04:00
committed by GitHub
parent 121603c825
commit 7907e1dc38
3 changed files with 28 additions and 9 deletions
+1 -1
View File
@@ -98,7 +98,7 @@
network = list()
stat |= EMPED
turn_off(null, FALSE, TRUE)
addtimer(CALLBACK(src, PROC_REF(reactivate_after_emp)), 90 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE)
addtimer(CALLBACK(src, PROC_REF(reactivate_after_emp)), (90 / severity) SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE)
..()
/obj/machinery/camera/proc/reactivate_after_emp()
+8 -8
View File
@@ -212,8 +212,8 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
/obj/machinery/door/airlock/proc/canAIControl()
return ((aiControlDisabled != AICONTROLDISABLED_ON) && (!isAllPowerLoss()))
/obj/machinery/door/airlock/proc/canAIHack()
return ((aiControlDisabled == AICONTROLDISABLED_ON) && (!hackProof) && (!isAllPowerLoss()))
/obj/machinery/door/airlock/proc/canAIHack(mob/living/user)
return ((aiControlDisabled == AICONTROLDISABLED_ON) && (!hackProof) && (!isAllPowerLoss()) && user.mind?.special_role)
/obj/machinery/door/airlock/proc/arePowerSystemsOn()
if(stat & (NOPOWER|BROKEN))
@@ -716,7 +716,7 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
if(!aiHacking)
aiHacking = TRUE
to_chat(user, "Airlock AI control has been blocked. Beginning fault-detection.")
sleep(50)
sleep(3 SECONDS)
if(canAIControl())
to_chat(user, "Alert cancelled. Airlock control has been restored without our assistance.")
aiHacking = FALSE
@@ -726,9 +726,9 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
aiHacking = FALSE
return
to_chat(user, "Fault confirmed: airlock control wire disabled or cut.")
sleep(20)
sleep(2 SECONDS)
to_chat(user, "Attempting to hack into airlock. This may take some time.")
sleep(200)
sleep(15 SECONDS)
if(canAIControl())
to_chat(user, "Alert cancelled. Airlock control has been restored without our assistance.")
aiHacking = FALSE
@@ -738,7 +738,7 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
aiHacking = FALSE
return
to_chat(user, "Upload access confirmed. Loading control program into airlock software.")
sleep(170)
sleep(5 SECONDS)
if(canAIControl())
to_chat(user, "Alert cancelled. Airlock control has been restored without our assistance.")
aiHacking = FALSE
@@ -748,11 +748,11 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
aiHacking = FALSE
return
to_chat(user, "Transfer complete. Forcing airlock to execute program.")
sleep(50)
sleep(5 SECONDS)
//disable blocked control
aiControlDisabled = AICONTROLDISABLED_BYPASS
to_chat(user, "Receiving control information from airlock.")
sleep(10)
sleep(1 SECONDS)
//bring up airlock dialog
aiHacking = FALSE
if(user)
+19
View File
@@ -137,6 +137,20 @@
return 1
user.visible_message("<span class='disarm'>[user] fails to blind [M] with [src]!</span>", "<span class='warning'>You fail to blind [M] with [src]!</span>")
/obj/item/flash/afterattack(atom/target, mob/living/user, proximity, params)
if(!proximity)
return
if(!istype(target, /obj/machinery/camera))
return
if(!try_use_flash(user))
return
var/obj/machinery/camera/C = target
C.emp_act(EMP_HEAVY)
to_chat(user,"<span class='notice'>You hit the lens of [C] with [src], temporarily disabling the camera!</span>")
log_admin("[key_name(user)] EMPd a camera with a flash")
user.create_attack_log("[key_name(user)] EMPd a camera with a flash")
add_attack_logs(user, C, "EMPd with [src]", ATKLOG_ALL)
/obj/item/flash/attack_self(mob/living/carbon/user, flag = 0, emp = 0)
if(!try_use_flash(user))
@@ -144,6 +158,11 @@
user.visible_message("<span class='disarm'>[user]'s [name] emits a blinding light!</span>", "<span class='danger'>Your [name] emits a blinding light!</span>")
for(var/mob/living/carbon/M in oviewers(3, null))
flash_carbon(M, user, 6 SECONDS, 0)
for(var/obj/machinery/camera/C in view(3, user))
C.emp_act(EMP_LIGHT)
log_admin("[key_name(user)] EMPd a camera with a flash")
user.create_attack_log("[key_name(user)] EMPd a camera with a flash")
add_attack_logs(user, C, "EMPd with [src]", ATKLOG_ALL)
/obj/item/flash/emp_act(severity)