Files
Bubberstation/code/modules/events/operative.dm
SkyratBot ec09510459 Bools and returns super-pr (#53221) (#565)
Replaces like 70-80% of 0 and such, as a side effect cleaned up a bunch of returns
Edit: Most left out ones are in mecha which should be done in mecha refactor already
Oh my look how clean it is

Co-authored-by: TiviPlus <TiviPlus>
Co-authored-by: Couls <coul422@gmail.com>

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
Co-authored-by: Couls <coul422@gmail.com>
2020-08-30 05:12:59 +02:00

40 lines
1.2 KiB
Plaintext

/datum/round_event_control/operative
name = "Lone Operative"
typepath = /datum/round_event/ghost_role/operative
weight = 0 //Admin only
max_occurrences = 1
/datum/round_event/ghost_role/operative
minimum_required = 1
role_name = "lone operative"
fakeable = FALSE
/datum/round_event/ghost_role/operative/spawn_role()
var/list/candidates = get_candidates(ROLE_OPERATIVE, null, ROLE_OPERATIVE)
if(!candidates.len)
return NOT_ENOUGH_PLAYERS
var/mob/dead/selected = pick_n_take(candidates)
var/list/spawn_locs = list()
for(var/obj/effect/landmark/carpspawn/L in GLOB.landmarks_list)
spawn_locs += L.loc
if(!spawn_locs.len)
return MAP_ERROR
var/mob/living/carbon/human/operative = new(pick(spawn_locs))
var/datum/preferences/A = new
A.copy_to(operative)
operative.dna.update_dna_identity()
var/datum/mind/Mind = new /datum/mind(selected.key)
Mind.assigned_role = "Lone Operative"
Mind.special_role = "Lone Operative"
Mind.active = TRUE
Mind.transfer_to(operative)
Mind.add_antag_datum(/datum/antagonist/nukeop/lone)
message_admins("[ADMIN_LOOKUPFLW(operative)] has been made into lone operative by an event.")
log_game("[key_name(operative)] was spawned as a lone operative by an event.")
spawned_mobs += operative
return SUCCESSFUL_SPAWN