mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
Merge pull request #3421 from GunHog/AI_Lockdown
Gives Malfuncting AIs the Hostile Lockdown ability!
This commit is contained in:
@@ -53,6 +53,80 @@
|
||||
turret.shot_delay = 20
|
||||
src << "<span class='notice'>Turrets upgraded.</span>"
|
||||
|
||||
/datum/AI_Module/large/lockdown
|
||||
module_name = "Hostile Station Lockdown"
|
||||
mod_pick_name = "lockdown"
|
||||
description = "Take control of the airlock, blast door and fire control networks, locking them down. Caution! This command also electrifies all airlocks."
|
||||
cost = 20
|
||||
one_time = 1
|
||||
|
||||
power_type = /mob/living/silicon/ai/proc/lockdown
|
||||
|
||||
/mob/living/silicon/ai/proc/lockdown()
|
||||
set category = "Malfunction"
|
||||
set name = "Initiate Hostile Lockdown"
|
||||
|
||||
if(src.stat == 2)
|
||||
src <<"You cannot begin a lockdown because you are dead!"
|
||||
return
|
||||
|
||||
if(malf_cooldown)
|
||||
return
|
||||
|
||||
var/obj/machinery/door/airlock/AL
|
||||
for(var/obj/machinery/door/D in portals)
|
||||
spawn()
|
||||
if(istype(D, /obj/machinery/door/airlock))
|
||||
AL = D
|
||||
if(AL.canAIControl() && !AL.stat) //Must be powered and have working AI wire.
|
||||
AL.locked = 0 //For airlocks that were bolted open.
|
||||
AL.safe = 0 //DOOR CRUSH
|
||||
AL.close()
|
||||
AL.locked = 1 //Bolt it!
|
||||
AL.lights = 0 //Stealth bolt for a classic AI door trap.
|
||||
AL.secondsElectrified = -1 //Shock it!
|
||||
else if(!D.stat) //So that only powered doors are closed.
|
||||
D.close() //Close ALL the doors!
|
||||
|
||||
var/obj/machinery/computer/communications/C = locate() in machines
|
||||
if(C)
|
||||
C.post_status("alert", "lockdown")
|
||||
|
||||
src.verbs += /mob/living/silicon/ai/proc/disablelockdown
|
||||
src << "<span class = 'warning'>Lockdown Initiated.</span>"
|
||||
malf_cooldown = 1
|
||||
spawn(30)
|
||||
malf_cooldown = 0
|
||||
|
||||
/mob/living/silicon/ai/proc/disablelockdown()
|
||||
set category = "Malfunction"
|
||||
set name = "Disable Lockdown"
|
||||
|
||||
if(src.stat == 2)
|
||||
src <<"You cannot disable lockdown because you are dead!"
|
||||
return
|
||||
if(malf_cooldown)
|
||||
return
|
||||
|
||||
var/obj/machinery/door/airlock/AL
|
||||
for(var/obj/machinery/door/D in portals)
|
||||
spawn()
|
||||
if(istype(D, /obj/machinery/door/airlock))
|
||||
AL = D
|
||||
if(AL.canAIControl() && !AL.stat) //Must be powered and have working AI wire.
|
||||
AL.locked = 0
|
||||
AL.secondsElectrified = 0
|
||||
AL.open()
|
||||
AL.safe = 1
|
||||
AL.lights = 1 //Essentially reset the airlock to normal.
|
||||
else if(!D.stat) //Opens only powered doors.
|
||||
D.open() //Open everything!
|
||||
|
||||
src << "<span class = 'notice'>Lockdown Lifted.</span>"
|
||||
malf_cooldown = 1
|
||||
spawn(30)
|
||||
malf_cooldown = 0
|
||||
|
||||
/datum/AI_Module/large/disable_rcd
|
||||
module_name = "RCD disable"
|
||||
mod_pick_name = "rcd"
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
explosion_resistance = 0
|
||||
update_freelook_sight()
|
||||
air_update_turf(1)
|
||||
portals += src
|
||||
return
|
||||
|
||||
|
||||
@@ -34,6 +35,7 @@
|
||||
density = 0
|
||||
air_update_turf(1)
|
||||
update_freelook_sight()
|
||||
portals -= src
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ var/list/ai_list = list()
|
||||
|
||||
var/control_disabled = 0 // Set to 1 to stop AI from interacting via Click()
|
||||
var/malfhacking = 0 // More or less a copy of the above var, so that malf AIs can hack and still get new cyborgs -- NeoFite
|
||||
var/malf_cooldown = 0 //Cooldown var for malf modules
|
||||
|
||||
var/obj/machinery/power/apc/malfhack = null
|
||||
var/explosive = 0 //does the AI explode when it dies?
|
||||
|
||||
Reference in New Issue
Block a user