mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-16 01:23:41 +01:00
Fix alien observer picking
This commit is contained in:
@@ -250,7 +250,7 @@
|
||||
|
||||
if(new_slime.client)
|
||||
if(babies.len)
|
||||
var/list/candidates = get_slime_candidates()
|
||||
var/list/candidates = get_candidates(BE_SLIME)
|
||||
if(candidates.len)
|
||||
var/mob/dead/observer/picked = pick(candidates)
|
||||
var/mob/living/carbon/slime/S = pick(babies)
|
||||
|
||||
+9
-72
@@ -311,81 +311,18 @@ proc/isInSight(var/atom/A, var/atom/B)
|
||||
return M
|
||||
return null
|
||||
|
||||
// Will return a list of active candidates. It increases the buffer 5 times until it finds a candidate which is active within the buffer.
|
||||
/proc/get_active_candidates(var/buffer = 1)
|
||||
|
||||
var/list/candidates = list() //List of candidate KEYS to assume control of the new larva ~Carn
|
||||
var/i = 0
|
||||
while(candidates.len <= 0 && i < 5)
|
||||
for(var/mob/G in respawnable_list)
|
||||
if(((G.client.inactivity/10)/60) <= buffer + i) // the most active players are more likely to become an alien
|
||||
/proc/get_candidates(be_special_flag=0, afk_bracket=3000)
|
||||
var/list/candidates = list()
|
||||
// Keep looping until we find a non-afk candidate within the time bracket (we limit the bracket to 10 minutes (6000))
|
||||
while(!candidates.len && afk_bracket < 6000)
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
if(G.client != null)
|
||||
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
|
||||
candidates += G.key
|
||||
i++
|
||||
if(!G.client.is_afk(afk_bracket) && (G.client.prefs.be_special & be_special_flag))
|
||||
candidates += G.client
|
||||
afk_bracket += 600 // Add a minute to the bracket, for every attempt
|
||||
return candidates
|
||||
|
||||
// Same as above but for alien candidates.
|
||||
|
||||
/proc/get_alien_candidates()
|
||||
|
||||
var/list/candidates = list() //List of candidate KEYS to assume control of the new larva ~Carn
|
||||
var/i = 0
|
||||
while(candidates.len <= 0 && i < 5)
|
||||
for(var/mob/G in respawnable_list)
|
||||
if( G.client && G.client.prefs.be_special & BE_ALIEN)
|
||||
if(((G.client.inactivity/10)/60) <= ALIEN_SELECT_AFK_BUFFER + i) // the most active players are more likely to become an alien
|
||||
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
|
||||
candidates += G.key
|
||||
i++
|
||||
return candidates
|
||||
|
||||
/proc/get_blob_candidates()
|
||||
|
||||
var/list/candidates = list() //List of candidate KEYS to assume control of the new blob core ~Carn
|
||||
var/i = 0
|
||||
while(candidates.len <= 0 && i < 5)
|
||||
for(var/mob/G in respawnable_list)
|
||||
if( G.client && G.client.prefs.be_special & BE_BLOB)
|
||||
if(((G.client.inactivity/10)/60) <= ALIEN_SELECT_AFK_BUFFER + i) // the most active players are more likely to become an alien
|
||||
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
|
||||
candidates += G.key
|
||||
i++
|
||||
return candidates
|
||||
|
||||
/proc/get_vox_candidates()
|
||||
|
||||
var/list/candidates = list() //List of candidate KEYS to assume control of the new blob core ~Carn
|
||||
var/i = 0
|
||||
while(candidates.len <= 0 && i < 5)
|
||||
for(var/mob/G in respawnable_list)
|
||||
if( G.client && G.client.prefs.be_special & BE_RAIDER)
|
||||
if(((G.client.inactivity/10)/60) <= ALIEN_SELECT_AFK_BUFFER + i) // the most active players are more likely to become an alien
|
||||
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
|
||||
candidates += G.key
|
||||
i++
|
||||
return candidates
|
||||
|
||||
/proc/get_slime_candidates()
|
||||
|
||||
var/list/candidates = list() //List of candidate KEYS to assume control of the new larva ~Carn
|
||||
var/i = 0
|
||||
while(candidates.len <= 0 && i < 5)
|
||||
for(var/mob/G in respawnable_list)
|
||||
if( G.client && G.client.prefs.be_special & BE_SLIME)
|
||||
if(((G.client.inactivity/10)/60) <= ALIEN_SELECT_AFK_BUFFER + i) // the most active players are more likely to become a slime
|
||||
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
|
||||
candidates += G.key
|
||||
i++
|
||||
return candidates
|
||||
|
||||
proc/get_candidates(be_special_flag=0)
|
||||
. = list()
|
||||
for(var/mob/G in respawnable_list)
|
||||
if(G)
|
||||
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
|
||||
if(!G.client.is_afk() && (G.client.prefs.be_special & be_special_flag))
|
||||
. += G.client
|
||||
|
||||
/proc/ScreenText(obj/O, maptext="", screen_loc="CENTER-7,CENTER-7", maptext_height=480, maptext_width=480)
|
||||
if(!isobj(O)) O = new /obj/screen/text()
|
||||
O.maptext = maptext
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology
|
||||
vents += temp_vent
|
||||
|
||||
var/list/candidates = get_alien_candidates()
|
||||
var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET)
|
||||
|
||||
if(prob(40)) spawncount++ //sometimes, have two larvae spawn instead of one
|
||||
while((spawncount >= 1) && vents.len && candidates.len)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
if(temp_vent.network.normal_members.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology
|
||||
vents += temp_vent
|
||||
|
||||
var/list/candidates = get_alien_candidates()
|
||||
var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET)
|
||||
|
||||
while(spawncount > 0 && vents.len && candidates.len)
|
||||
var/obj/vent = pick(vents)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
if(temp_vent.network.normal_members.len > 50)
|
||||
vents += temp_vent
|
||||
|
||||
var/list/candidates = get_alien_candidates()
|
||||
var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET)
|
||||
while(spawncount > 0 && vents.len && candidates.len)
|
||||
var/obj/vent = pick_n_take(vents)
|
||||
var/client/C = pick_n_take(candidates)
|
||||
|
||||
Reference in New Issue
Block a user