This repository was archived by the owner on May 22, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 458
Expand file tree
/
Copy pathdevil.dm
More file actions
58 lines (47 loc) · 1.6 KB
/
devil.dm
File metadata and controls
58 lines (47 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/datum/round_event_control/devil
name = "Create Devil"
typepath = /datum/round_event/ghost_role/devil
max_occurrences = 0
/datum/round_event/ghost_role/devil
var/success_spawn = 0
role_name = "devil"
fakeable = FALSE
/datum/round_event/ghost_role/devil/kill()
if(!success_spawn && control)
control.occurrences--
return ..()
/datum/round_event/ghost_role/devil/spawn_role()
//selecting a spawn_loc
if(!SSjob.latejoin_trackers.len)
return MAP_ERROR
//selecting a candidate player
var/list/candidates = get_candidates(ROLE_DEVIL, null, ROLE_DEVIL)
if(!candidates.len)
return NOT_ENOUGH_PLAYERS
var/mob/dead/selected_candidate = pick_n_take(candidates)
var/key = selected_candidate.key
var/datum/mind/Mind = create_devil_mind(key)
Mind.active = 1
var/mob/living/carbon/human/devil = create_event_devil()
Mind.transfer_to(devil)
add_devil(devil, ascendable = FALSE)
spawned_mobs += devil
message_admins("[ADMIN_LOOKUPFLW(devil)] has been made into a devil by an event.")
log_game("[key_name(devil)] was spawned as a devil by an event.")
var/datum/job/jobdatum = SSjob.GetJob("Assistant")
devil.job = jobdatum.title
jobdatum.equip(devil)
return SUCCESSFUL_SPAWN
/proc/create_event_devil(spawn_loc)
var/mob/living/carbon/human/new_devil = new(spawn_loc)
if(!spawn_loc)
SSjob.SendToLateJoin(new_devil)
new_devil.randomize_human_appearance(~(RANDOMIZE_SPECIES))
new_devil.dna.update_dna_identity()
return new_devil
/proc/create_devil_mind(key)
var/datum/mind/Mind = new /datum/mind(key)
Mind.assigned_role = ROLE_DEVIL
Mind.special_role = ROLE_DEVIL
SSgamemode.devils |= Mind
return Mind