mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 20:37:34 +01:00
Tweaks.
Re-uses the too_many_active_drones() proc as originally intended. Makes the private_valid_special_roles list global, no need to let each individual player initialize the list.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
var/list/private_valid_special_roles
|
||||
|
||||
/datum/category_item/player_setup_item/antagonism/candidacy
|
||||
name = "Candidacy"
|
||||
sort_order = 2
|
||||
var/list/private_valid_special_roles
|
||||
|
||||
/datum/category_item/player_setup_item/antagonism/candidacy/load_character(var/savefile/S)
|
||||
S["be_special"] >> pref.be_special_role
|
||||
|
||||
@@ -48,6 +48,12 @@ var/list/ghost_traps
|
||||
|
||||
// Print a message to all ghosts with the right prefs/lack of bans.
|
||||
/datum/ghosttrap/proc/request_player(var/mob/target, var/request_string, var/request_timeout)
|
||||
if(request_timeout)
|
||||
request_timeouts[target] = world.time + request_timeout
|
||||
target.destruction.register(src, /datum/ghosttrap/proc/target_destroyed)
|
||||
else
|
||||
request_timeouts -= target
|
||||
|
||||
for(var/mob/dead/observer/O in player_list)
|
||||
if(!O.MayRespawn())
|
||||
continue
|
||||
@@ -58,12 +64,6 @@ var/list/ghost_traps
|
||||
if(pref_check && !(pref_check in O.client.prefs.be_special_role))
|
||||
continue
|
||||
if(O.client)
|
||||
if(request_timeout)
|
||||
request_timeouts[target] = world.time + request_timeout
|
||||
target.destruction.register(src, /datum/ghosttrap/proc/target_destroyed)
|
||||
else
|
||||
request_timeouts -= target
|
||||
|
||||
O << "[request_string] <a href='?src=\ref[src];candidate=\ref[O];target=\ref[target]'>(Occupy)</a> ([ghost_follow_link(target, O)])"
|
||||
|
||||
/datum/ghosttrap/proc/target_destroyed(var/destroyed_target)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
if(!host || !istype(host)) return
|
||||
|
||||
var/datum/ghosttrap/plant/P = get_ghost_trap("living plant")
|
||||
P.request_player(host, "Someone is harvesting [display_name].")
|
||||
P.request_player(host, "Someone is harvesting \a [display_name].")
|
||||
|
||||
spawn(75)
|
||||
if(!host.ckey && !host.client)
|
||||
|
||||
@@ -815,7 +815,7 @@ default behaviour is:
|
||||
ear_deaf = deaf
|
||||
|
||||
/mob/proc/can_be_possessed_by(var/mob/dead/observer/possessor)
|
||||
return istype(possessor) && possessor.client && possessor.ckey
|
||||
return istype(possessor) && possessor.client
|
||||
|
||||
/mob/living/can_be_possessed_by(var/mob/dead/observer/possessor)
|
||||
if(!..())
|
||||
|
||||
@@ -65,6 +65,9 @@ var/list/mob_hat_cache = list()
|
||||
if(!config.allow_drone_spawn)
|
||||
src << "<span class='danger'>Playing as drones is not currently permitted.</span>"
|
||||
return 0
|
||||
if(too_many_active_drones())
|
||||
src << "<span class='danger'>The maximum number of active drones has been reached..</span>"
|
||||
return 0
|
||||
if(jobban_isbanned(possessor,"Cyborg"))
|
||||
usr << "<span class='danger'>You are banned from playing synthetics and cannot spawn as a drone.</span>"
|
||||
return 0
|
||||
@@ -299,7 +302,7 @@ var/list/mob_hat_cache = list()
|
||||
//Reboot procs.
|
||||
|
||||
/mob/living/silicon/robot/drone/proc/request_player()
|
||||
if(active_drones() >= config.max_maint_drones)
|
||||
if(too_many_active_drones())
|
||||
return
|
||||
var/datum/ghosttrap/G = get_ghost_trap("maintenance drone")
|
||||
G.request_player(src, "Someone is attempting to reboot a maintenance drone.", 30 SECONDS)
|
||||
@@ -342,9 +345,9 @@ var/list/mob_hat_cache = list()
|
||||
real_name = "construction drone ([rand(100,999)])"
|
||||
name = real_name
|
||||
|
||||
/proc/active_drones()
|
||||
/proc/too_many_active_drones()
|
||||
var/drones = 0
|
||||
for(var/mob/living/silicon/robot/drone/D in mob_list)
|
||||
if(D.key && D.client)
|
||||
drones++
|
||||
return drones
|
||||
return drones >= config.max_maint_drones
|
||||
|
||||
Reference in New Issue
Block a user