Datum abductors refactor
This commit is contained in:
@@ -3,9 +3,7 @@
|
||||
typepath = /datum/round_event/ghost_role/abductor
|
||||
weight = 10
|
||||
max_occurrences = 1
|
||||
|
||||
min_players = 20
|
||||
|
||||
gamemode_blacklist = list("nuclear","wizard","revolution","abduction")
|
||||
|
||||
/datum/round_event/ghost_role/abductor
|
||||
@@ -17,40 +15,17 @@
|
||||
|
||||
if(candidates.len < 2)
|
||||
return NOT_ENOUGH_PLAYERS
|
||||
//Oh god why we can't have static functions
|
||||
// I feel your pain, bro
|
||||
var/number = SSticker.mode.abductor_teams + 1
|
||||
|
||||
var/datum/game_mode/abduction/temp
|
||||
var/datum/game_mode/abduction/GM
|
||||
if(SSticker.mode.config_tag == "abduction")
|
||||
temp = SSticker.mode
|
||||
GM = SSticker.mode
|
||||
else
|
||||
temp = new
|
||||
GM = new
|
||||
|
||||
var/agent_mind = pick_n_take(candidates)
|
||||
var/scientist_mind = pick_n_take(candidates)
|
||||
var/mob/living/carbon/human/agent = makeBody(pick_n_take(candidates))
|
||||
var/mob/living/carbon/human/scientist = makeBody(pick_n_take(candidates))
|
||||
|
||||
var/mob/living/carbon/human/agent = makeBody(agent_mind)
|
||||
var/mob/living/carbon/human/scientist = makeBody(scientist_mind)
|
||||
|
||||
agent_mind = agent.mind
|
||||
scientist_mind = scientist.mind
|
||||
|
||||
temp.scientists.len = number
|
||||
temp.agents.len = number
|
||||
temp.abductors.len = 2*number
|
||||
temp.team_objectives.len = number
|
||||
temp.team_names.len = number
|
||||
temp.scientists[number] = scientist_mind
|
||||
temp.agents[number] = agent_mind
|
||||
temp.abductors |= list(agent_mind,scientist_mind)
|
||||
temp.make_abductor_team(number,preset_scientist=scientist_mind,preset_agent=agent_mind)
|
||||
temp.post_setup_team(number)
|
||||
|
||||
SSticker.mode.abductor_teams++
|
||||
|
||||
if(SSticker.mode.config_tag != "abduction")
|
||||
SSticker.mode.abductors |= temp.abductors
|
||||
GM.post_setup_team(GM.make_abductor_team(agent.mind, scientist.mind))
|
||||
|
||||
spawned_mobs += list(agent, scientist)
|
||||
return SUCCESSFUL_SPAWN
|
||||
|
||||
Reference in New Issue
Block a user