Merge pull request #2935 from Citadel-Station-13/upstream-merge-30893

[MIRROR] Datum abductors refactor
This commit is contained in:
LetterJay
2017-09-27 16:31:53 -04:00
committed by GitHub
14 changed files with 196 additions and 310 deletions
+6 -31
View File
@@ -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
@@ -2,12 +2,10 @@
name = "Abductor"
id = "abductor"
say_mod = "gibbers"
sexes = 0
sexes = FALSE
species_traits = list(NOBLOOD,NOBREATH,VIRUSIMMUNE,NOGUNS,NOHUNGER)
mutanttongue = /obj/item/organ/tongue/abductor
var/scientist = 0 // vars to not pollute spieces list with castes
var/team = 1
var/scientist = FALSE // vars to not pollute spieces list with castes
/datum/species/abductor/copy_properties_from(datum/species/abductor/old_species)
scientist = old_species.scientist
team = old_species.team
+3 -4
View File
@@ -85,10 +85,9 @@
var/obj/item/organ/tongue/T = H.getorganslot("tongue")
if(!T || T.type != type)
continue
else if(H.dna && H.dna.species.id == "abductor" && user.dna && user.dna.species.id == "abductor")
var/datum/species/abductor/Ayy = user.dna.species
var/datum/species/abductor/Byy = H.dna.species
if(Ayy.team != Byy.team)
if(H.dna && H.dna.species.id == "abductor" && user.dna && user.dna.species.id == "abductor")
var/datum/antagonist/abductor/A = user.mind.has_antag_datum(ANTAG_DATUM_ABDUCTOR)
if(!A || !(H.mind in A.team.members))
continue
to_chat(H, rendered)
for(var/mob/M in GLOB.dead_mob_list)