mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-30 12:02:24 +00:00
Drones now get a timer for their self-destruct (#9511)
This commit is contained in:
@@ -105,13 +105,15 @@
|
||||
/mob/living/silicon/robot/drone/mining/process_level_restrictions()
|
||||
//Abort if they should not get blown
|
||||
if(lock_charge || scrambled_codes || emagged)
|
||||
return
|
||||
//Check if they are not on a station level -> abort
|
||||
return FALSE
|
||||
//Check if they are not on a station level -> else abort
|
||||
var/turf/T = get_turf(src)
|
||||
if (!T || isStationLevel(T.z))
|
||||
return
|
||||
to_chat(src, SPAN_DANGER("WARNING: Removal from NanoTrasen property detected. Anti-Theft mode activated."))
|
||||
gib()
|
||||
return FALSE
|
||||
if(!self_destructing)
|
||||
to_chat(src, SPAN_DANGER("WARNING: Removal from [current_map.company_name] property detected. Anti-Theft mode activated."))
|
||||
start_self_destruct(TRUE)
|
||||
return TRUE
|
||||
|
||||
/**********************Minebot Upgrades**********************/
|
||||
|
||||
|
||||
@@ -132,6 +132,8 @@
|
||||
hat_x_offset = 1
|
||||
hat_y_offset = -12
|
||||
|
||||
var/my_home_z
|
||||
|
||||
/mob/living/silicon/robot/drone/Initialize()
|
||||
. = ..()
|
||||
|
||||
@@ -301,13 +303,16 @@
|
||||
|
||||
//DRONE LIFE/DEATH
|
||||
/mob/living/silicon/robot/drone/process_level_restrictions()
|
||||
//Abort if they should not get blown
|
||||
if(lock_charge || scrambled_codes || emagged)
|
||||
return FALSE
|
||||
var/turf/T = get_turf(src)
|
||||
var/area/A = get_area(T)
|
||||
if((!T || !(A in the_station_areas)) && src.stat != DEAD)
|
||||
to_chat(src, SPAN_WARNING("WARNING: Removal from NanoTrasen property detected. Anti-Theft mode activated."))
|
||||
gib()
|
||||
return
|
||||
return
|
||||
if(!self_destructing)
|
||||
to_chat(src, SPAN_WARNING("WARNING: Removal from [current_map.company_name] property detected. Anti-Theft mode activated."))
|
||||
start_self_destruct(TRUE)
|
||||
return TRUE
|
||||
|
||||
//For some goddamn reason robots have this hardcoded. Redefining it for our fragile friends here.
|
||||
/mob/living/silicon/robot/drone/updatehealth()
|
||||
@@ -440,16 +445,18 @@
|
||||
|
||||
return dat
|
||||
|
||||
/mob/living/silicon/robot/drone/construction/Initialize()
|
||||
. = ..()
|
||||
var/turf/T = get_turf(src)
|
||||
my_home_z = T.z
|
||||
flavor_text = "It's a bulky construction drone stamped with a NanoTrasen glyph."
|
||||
|
||||
/mob/living/silicon/robot/drone/construction/welcome_drone()
|
||||
to_chat(src, SPAN_NOTICE("<b>You are a construction drone, an autonomous engineering and fabrication system.</b>."))
|
||||
to_chat(src, SPAN_NOTICE("You are assigned to a NanoTrasen construction project. The name is irrelevant. Your task is to complete construction and subsystem integration as soon as possible."))
|
||||
to_chat(src, SPAN_NOTICE("Use <b>:d</b> to talk to other drones and <b>say</b> to speak silently to your nearby fellows."))
|
||||
to_chat(src, SPAN_NOTICE("<b>You do not follow orders from anyone; not the AI, not humans, and not other synthetics.</b>."))
|
||||
|
||||
/mob/living/silicon/robot/drone/construction/init()
|
||||
..()
|
||||
flavor_text = "It's a bulky construction drone stamped with a NanoTrasen glyph."
|
||||
|
||||
/mob/living/silicon/robot/drone/construction/updatename()
|
||||
real_name = "construction drone ([rand(100,999)])"
|
||||
name = real_name
|
||||
@@ -457,13 +464,16 @@
|
||||
/mob/living/silicon/robot/drone/construction/process_level_restrictions()
|
||||
//Abort if they should not get blown
|
||||
if(lock_charge || scrambled_codes || emagged)
|
||||
return
|
||||
//Check if they are not on station level -> abort
|
||||
return FALSE
|
||||
//Check if they are not on a station level -> else abort
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T || isNotStationLevel(T.z))
|
||||
return
|
||||
to_chat(src, SPAN_WARNING("WARNING: Lost contact with controller. Anti-Theft mode activated."))
|
||||
gib()
|
||||
if (!T || AreConnectedZLevels(my_home_z, T.z))
|
||||
return FALSE
|
||||
|
||||
if(!self_destructing)
|
||||
to_chat(src, SPAN_DANGER("WARNING: Removal from [current_map.company_name] property detected. Anti-Theft mode activated."))
|
||||
start_self_destruct(TRUE)
|
||||
return TRUE
|
||||
|
||||
/proc/too_many_active_drones()
|
||||
var/drones = 0
|
||||
|
||||
@@ -333,15 +333,17 @@
|
||||
/mob/living/silicon/robot/proc/process_level_restrictions()
|
||||
//Abort if they should not get blown
|
||||
if(lock_charge || scrambled_codes || emagged)
|
||||
return
|
||||
return FALSE
|
||||
//Check if they are on a player level -> abort
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T || isStationLevel(T.z))
|
||||
return
|
||||
return FALSE
|
||||
//If they are on centcom -> abort
|
||||
if(istype(get_area(src), /area/centcom) || istype(get_area(src), /area/shuttle/escape) || istype(get_area(src), /area/shuttle/arrival))
|
||||
return
|
||||
self_destruct(TRUE)
|
||||
return FALSE
|
||||
if(!self_destructing)
|
||||
start_self_destruct(TRUE)
|
||||
return TRUE
|
||||
|
||||
/mob/living/silicon/robot/update_fire()
|
||||
cut_overlay(image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing"))
|
||||
|
||||
@@ -110,6 +110,8 @@
|
||||
// Alerts
|
||||
var/view_alerts = FALSE
|
||||
|
||||
var/self_destructing = FALSE
|
||||
|
||||
// Killswitch
|
||||
var/killswitch = FALSE
|
||||
var/killswitch_time = 60
|
||||
@@ -507,12 +509,12 @@
|
||||
set name = "Toggle Mop"
|
||||
set desc = "Toggle the integrated mop."
|
||||
set src in usr
|
||||
|
||||
|
||||
mopping = !mopping
|
||||
if (mopping)
|
||||
usr.visible_message(SPAN_NOTICE("[usr]'s integrated mopping system rumbles to life."), SPAN_NOTICE("You enable your integrated mopping system."))
|
||||
playsound(usr, 'sound/machines/hydraulic_long.ogg', 100, 1)
|
||||
else
|
||||
else
|
||||
usr.visible_message(SPAN_NOTICE("[usr]'s integrated mopping system putters before turning off."), SPAN_NOTICE("You disable your integrated mopping system."))
|
||||
|
||||
/mob/living/silicon/robot/proc/update_robot_light()
|
||||
@@ -999,23 +1001,37 @@
|
||||
cleaned_human.clean_blood(1)
|
||||
to_chat(cleaned_human, SPAN_WARNING("\The [src] runs its bottom mounted bristles all over you!"))
|
||||
|
||||
/mob/living/silicon/robot/proc/self_destruct(var/anti_theft = FALSE)
|
||||
/mob/living/silicon/robot/proc/start_self_destruct(var/anti_theft = FALSE)
|
||||
if(self_destructing)
|
||||
return
|
||||
self_destructing = TRUE
|
||||
if(anti_theft)
|
||||
say("WARNING! Removal from NanoTrasen property detected. Anti-Theft mode activated. Unit [src] will self-destruct in five seconds.")
|
||||
to_chat(src, SPAN_WARNING("All databases containing information related to NanoTrasen have been wiped!"))
|
||||
to_chat(src, SPAN_WARNING("Initiating wipe of all databases containing information related to [current_map.company_name]!"))
|
||||
else
|
||||
say("WARNING! Self-destruct initiated. Unit [src] will self destruct in five seconds.")
|
||||
lock_charge = TRUE
|
||||
update_canmove()
|
||||
sleep(20)
|
||||
playsound(get_turf(src), 'sound/items/countdown.ogg', 125, TRUE)
|
||||
sleep(20)
|
||||
playsound(get_turf(src), 'sound/effects/alert.ogg', 125, TRUE)
|
||||
sleep(10)
|
||||
|
||||
addtimer(CALLBACK(src, .proc/self_destruct_warning, 1), 2 SECONDS, TIMER_UNIQUE)
|
||||
|
||||
/mob/living/silicon/robot/proc/self_destruct_warning(var/warning_level)
|
||||
if(!process_level_restrictions()) // Robot has returned to a turf where it is safe
|
||||
to_chat(src, SPAN_NOTICE("Unit [src] has returned to [current_map.company_name] property, self-destruct aborted!"))
|
||||
say("Unit [src] self-destruct aborted.")
|
||||
self_destructing = FALSE
|
||||
return
|
||||
switch(warning_level)
|
||||
if(1)
|
||||
playsound(get_turf(src), 'sound/items/countdown.ogg', 125, TRUE)
|
||||
addtimer(CALLBACK(src, .proc/self_destruct_warning, 2), 2 SECONDS, TIMER_UNIQUE)
|
||||
if(2)
|
||||
playsound(get_turf(src), 'sound/effects/alert.ogg', 125, TRUE)
|
||||
addtimer(CALLBACK(src, .proc/self_destruct_warning, 3), 1 SECONDS, TIMER_UNIQUE)
|
||||
if(3)
|
||||
self_destruct()
|
||||
|
||||
/mob/living/silicon/robot/proc/self_destruct()
|
||||
density = FALSE
|
||||
fragem(src, 50, 100, 2, 1, 5, 1, 0)
|
||||
gib()
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/update_canmove() // to fix lockdown issues w/ chairs
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user