mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-30 07:27:57 +01:00
Added more options
This commit is contained in:
@@ -72,9 +72,7 @@
|
||||
var/assistantlimit = 0 //enables assistant limiting
|
||||
var/assistantratio = 2 //how many assistants to security members
|
||||
|
||||
// The AFK subsystem will not be activated if any of the below config values are equal or less than 0
|
||||
var/warn_afk_minimum = 0 // How long till you get a warning while being AFK
|
||||
var/auto_cryo_afk = 0 // How long till you get put into cryo when you're AFK
|
||||
// The AFK subsystem will not be activated if the below config values are equal or less than 0
|
||||
var/auto_despawn_afk = 0 // How long till you actually despawn in cryo when you're AFK (Not ssd so not automatic)
|
||||
|
||||
var/auto_cryo_ssd_mins = 0
|
||||
@@ -318,10 +316,6 @@
|
||||
if("shadowling_max_age")
|
||||
config.shadowling_max_age = text2num(value)
|
||||
|
||||
if("warn_afk_minimum")
|
||||
config.warn_afk_minimum = text2num(value)
|
||||
if("auto_cryo_afk")
|
||||
config.auto_cryo_afk = text2num(value)
|
||||
if("auto_despawn_afk")
|
||||
config.auto_despawn_afk = text2num(value)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ SUBSYSTEM_DEF(afk)
|
||||
|
||||
|
||||
/datum/controller/subsystem/afk/Initialize()
|
||||
if(config.warn_afk_minimum <= 0 || config.auto_cryo_afk <= 0 || config.auto_despawn_afk <= 0)
|
||||
if(config.auto_despawn_afk <= 0)
|
||||
flags |= SS_NO_FIRE
|
||||
|
||||
/datum/controller/subsystem/afk/fire()
|
||||
@@ -19,28 +19,29 @@ SUBSYSTEM_DEF(afk)
|
||||
continue
|
||||
|
||||
var/turf/T
|
||||
var/afk_warn_min
|
||||
// Only players and players with the AFK watch enabled
|
||||
// No dead, unconcious, restrained, people without jobs, people on other Z levels than the station or antags
|
||||
if(!H.client || !H.client.prefs.afk_watch || !H.mind || \
|
||||
if(!H.client || !(afk_warn_min = H.client.prefs.AFK_WATCH_warn_minutes) || !H.mind || \
|
||||
H.stat || H.restrained() || !H.job || H.mind.special_role || \
|
||||
!is_station_level((T = get_turf(H)).z)) // Assign the turf as last. Small optimization
|
||||
if(afk_players[H.ckey])
|
||||
toRemove += H.ckey
|
||||
continue
|
||||
|
||||
|
||||
var/mins_afk = round(H.client.inactivity / 600)
|
||||
if(mins_afk < config.warn_afk_minimum)
|
||||
if(mins_afk < afk_warn_min)
|
||||
if(afk_players[H.ckey])
|
||||
toRemove += H.ckey
|
||||
continue
|
||||
|
||||
var/afk_cryo_min = H.client.prefs.AFK_WATCH_cryo_minutes + afk_warn_min
|
||||
if(!afk_players[H.ckey])
|
||||
afk_players[H.ckey] = AFK_WARNED
|
||||
warn(H, "<span class='danger'>You are AFK for [mins_afk] minutes. You will be cryod after [config.auto_cryo_afk] total minutes and fully despawned after [config.auto_despawn_afk] total minutes. Please move or click in game if you want to avoid being despawned.</span>")
|
||||
warn(H, "<span class='danger'>You are AFK for [mins_afk] minutes. You will be cryod after [afk_cryo_min] total minutes and fully despawned after another [config.auto_despawn_afk] minutes. Please move or click in game if you want to avoid being despawned.</span>")
|
||||
else
|
||||
var/area/A = T.loc // Turfs loc is the area
|
||||
if(afk_players[H.ckey] == AFK_WARNED)
|
||||
if(mins_afk >= config.auto_cryo_afk && A.can_get_auto_cryod)
|
||||
if(mins_afk >= afk_cryo_min && A.can_get_auto_cryod)
|
||||
if(A.fast_despawn)
|
||||
toRemove += H.ckey
|
||||
warn(H, "<span class='danger'>You are have been despawned after being AFK for [mins_afk] minutes. You have been despawned instantly due to you being in a secure area.</span>")
|
||||
@@ -49,9 +50,9 @@ SUBSYSTEM_DEF(afk)
|
||||
else if(cryo_ssd(H))
|
||||
afk_players[H.ckey] = AFK_CRYOD
|
||||
msg_admins(H, mins_afk, T, "put into cryostorage")
|
||||
warn(H, "<span class='danger'>You are AFK for [mins_afk] minutes and have been moved to cryostorage. After being AFK for [config.auto_despawn_afk] total minutes you will be fully despawned. Please eject yourself (right click, eject) out of the cryostorage if you want to avoid being despawned.</span>")
|
||||
warn(H, "<span class='danger'>You are AFK for [mins_afk] minutes and have been moved to cryostorage. After being AFK for another [config.auto_despawn_afk] minutes you will be fully despawned. Please eject yourself (right click, eject) out of the cryostorage if you want to avoid being despawned.</span>")
|
||||
|
||||
else if(mins_afk >= config.auto_despawn_afk)
|
||||
else if(mins_afk >= config.auto_despawn_afk + afk_cryo_min)
|
||||
var/obj/machinery/cryopod/P = H.loc
|
||||
msg_admins(H, mins_afk, T, "forcefully despawned")
|
||||
warn(H, "<span class='danger'>You are have been despawned after being AFK for [mins_afk] minutes.</span>")
|
||||
|
||||
Reference in New Issue
Block a user