mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 20:17:15 +01:00
Finally got things working from vote to roundstart to join to death.
This commit is contained in:
@@ -69,7 +69,9 @@
|
||||
id.registered_name = player.real_name
|
||||
|
||||
/datum/antagonist/proc/random_spawn()
|
||||
return attempt_spawn(null,null,(flags & (ANTAG_OVERRIDE_MOB|ANTAG_OVERRIDE_JOB)))
|
||||
create_global_objectives()
|
||||
attempt_spawn(flags & (ANTAG_OVERRIDE_MOB|ANTAG_OVERRIDE_JOB))
|
||||
finalize()
|
||||
|
||||
/datum/antagonist/proc/create_id(var/assignment, var/mob/living/carbon/human/player)
|
||||
|
||||
|
||||
@@ -27,15 +27,3 @@
|
||||
if(antag_type == id || antag_type == role_text)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/antagonist/proc/get_candidates(var/ghosts_only)
|
||||
|
||||
candidates = list() // Clear.
|
||||
candidates = ticker.mode.get_players_for_role(role_type, id)
|
||||
|
||||
// Prune restricted jobs and status.
|
||||
for(var/datum/mind/player in candidates)
|
||||
if((ghosts_only && !istype(player.current, /mob/dead)) || (player.assigned_role in restricted_jobs))
|
||||
candidates -= player
|
||||
|
||||
return candidates
|
||||
@@ -12,7 +12,7 @@
|
||||
place_mob(player.current)
|
||||
return
|
||||
|
||||
/datum/antagonist/proc/update_cur_max(var/lower_count, var/upper_count)
|
||||
/datum/antagonist/proc/update_cur_max()
|
||||
|
||||
candidates = list()
|
||||
var/main_type
|
||||
@@ -26,16 +26,15 @@
|
||||
if(ticker.mode.antag_scaling_coeff)
|
||||
cur_max = Clamp((ticker.mode.num_players()/ticker.mode.antag_scaling_coeff), 1, cur_max)
|
||||
|
||||
/datum/antagonist/proc/attempt_spawn(var/lower_count, var/upper_count, var/ghosts_only)
|
||||
/datum/antagonist/proc/attempt_spawn(var/ghosts_only)
|
||||
|
||||
world << "Attempting to spawn."
|
||||
// Get the raw list of potential players.
|
||||
update_cur_max(lower_count, upper_count)
|
||||
update_cur_max()
|
||||
candidates = get_candidates(ghosts_only)
|
||||
|
||||
// Update our boundaries.
|
||||
if(!candidates.len)
|
||||
world << "No candidates."
|
||||
world << "Somehow there are no antagonist candidates."
|
||||
return 0
|
||||
|
||||
//Grab candidates randomly until we have enough.
|
||||
@@ -47,7 +46,6 @@
|
||||
if(flags & ANTAG_OVERRIDE_JOB)
|
||||
player.assigned_role = "MODE"
|
||||
candidates -= player
|
||||
world << "Done."
|
||||
return 1
|
||||
|
||||
/datum/antagonist/proc/place_mob(var/mob/living/mob)
|
||||
@@ -75,4 +73,14 @@
|
||||
update_icons_removed(player)
|
||||
BITSET(player.current.hud_updateflag, SPECIALROLE_HUD)
|
||||
return 1
|
||||
return 0
|
||||
return 0
|
||||
|
||||
/datum/antagonist/proc/get_candidates(var/ghosts_only)
|
||||
|
||||
candidates = list() // Clear.
|
||||
candidates = ticker.mode.get_players_for_role(role_type, id)
|
||||
// Prune restricted jobs and status.
|
||||
for(var/datum/mind/player in candidates)
|
||||
if((ghosts_only && !istype(player.current, /mob/dead)) || (player.assigned_role in restricted_jobs))
|
||||
candidates -= player
|
||||
return candidates
|
||||
@@ -1,9 +1,13 @@
|
||||
// Notes towards a monkey mode to reduce snowflakes for downstream. Will not compile.
|
||||
|
||||
/datum/antagonist/monkey
|
||||
role_text = "Rabid Monkey"
|
||||
role_text_plural = "Rabid Monkeys"
|
||||
mob_type = /mob/living/carbon/monkey
|
||||
id = MODE_MONKEY
|
||||
flags = ANTAG_OVERRIDE_JOB | ANTAG_OVERRIDE_MOB
|
||||
|
||||
// Notes towards a monkey mode to reduce snowflakes for downstream. Will not compile.
|
||||
/datum/antagonist/monkey/apply(var/datum/mind/player)
|
||||
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
if(istype(D, /datum/disease/jungle_fever))
|
||||
|
||||
@@ -258,6 +258,14 @@ var/global/list/additional_antag_types = list()
|
||||
return 1
|
||||
else
|
||||
return 1
|
||||
|
||||
// Attempt to mark folks down as ready to go. Don't finalize until post setup.
|
||||
var/datum/antagonist/main_antags = antag_templates[1]
|
||||
var/list/candidates = main_antags.get_candidates()
|
||||
if(candidates.len >= required_enemies)
|
||||
for(var/datum/antagonist/antag in antag_templates)
|
||||
antag.attempt_spawn()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/game_mode/proc/refresh_event_modifiers()
|
||||
@@ -286,7 +294,6 @@ var/global/list/additional_antag_types = list()
|
||||
|
||||
if(antag_templates && antag_templates.len)
|
||||
for(var/datum/antagonist/antag in antag_templates)
|
||||
antag.attempt_spawn(required_enemies)
|
||||
antag.finalize()
|
||||
|
||||
if(emergency_shuttle && auto_recall_shuttle)
|
||||
|
||||
@@ -52,4 +52,4 @@ var/const/commandos_possible = 6 //if more Commandos are needed in the future
|
||||
usr << "Looks like someone beat you to it."
|
||||
return
|
||||
|
||||
team.attempt_spawn(1,commandos_possible)
|
||||
team.attempt_spawn(1)
|
||||
|
||||
Reference in New Issue
Block a user