diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm
index afae458a58d..fe7d02488d6 100644
--- a/code/game/gamemodes/miniantags/revenant/revenant.dm
+++ b/code/game/gamemodes/miniantags/revenant/revenant.dm
@@ -120,10 +120,37 @@
updateallghostimages()
remove_from_all_data_huds()
- spawn(5)
- if(src.mind)
- src.mind.wipe_memory()
- src << 'sound/effects/ghost.ogg'
+ addtimer(CALLBACK(src, .proc/firstSetupAttempt), 15 SECONDS) // Give admin 15 seconds to put in a ghost (Or wait 15 seconds before giving it objectives)
+
+
+/mob/living/simple_animal/revenant/proc/firstSetupAttempt()
+ if(mind)
+ giveObjectivesandGoals()
+ giveSpells()
+ else
+ message_admins("Revenant was created but has no mind. Put a ghost inside, or a poll will be made in one minute.")
+ addtimer(CALLBACK(src, .proc/setupOrDelete), 1 MINUTES)
+
+/mob/living/simple_animal/revenant/proc/setupOrDelete()
+ if(mind)
+ giveObjectivesandGoals()
+ giveSpells()
+ else
+ var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as a revenant?", poll_time = 15 SECONDS)
+ var/mob/dead/observer/theghost = null
+ if(candidates.len)
+ theghost = pick(candidates)
+ message_admins("[key_name_admin(theghost)] has taken control of a revenant created without a mind")
+ key = theghost.key
+ giveObjectivesandGoals()
+ giveSpells()
+ else
+ message_admins("No ghost was willing to take control of a mindless revenant. Deleting...")
+ qdel(src)
+
+/mob/living/simple_animal/revenant/proc/giveObjectivesandGoals()
+ mind.wipe_memory()
+ SEND_SOUND(src, 'sound/effects/ghost.ogg')
to_chat(src, "
")
to_chat(src, "You are a revenant.")
to_chat(src, "Your formerly mundane spirit has been infused with alien energies and empowered into a revenant.")
@@ -132,32 +159,23 @@
to_chat(src, "To function, you are to drain the life essence from humans. This essence is a resource, as well as your health, and will power all of your abilities.")
to_chat(src, "You do not remember anything of your past lives, nor will you remember anything about this one after your death.")
to_chat(src, "Be sure to read the wiki page at http://nanotrasen.se/wiki/index.php/Revenant to learn more.")
-
var/datum/objective/revenant/objective = new
- objective.owner = src.mind
- src.mind.objectives += objective
+ objective.owner = mind
+ mind.objectives += objective
to_chat(src, "Objective #1: [objective.explanation_text]")
var/datum/objective/revenantFluff/objective2 = new
- objective2.owner = src.mind
- src.mind.objectives += objective2
+ objective2.owner = mind
+ mind.objectives += objective2
to_chat(src, "Objective #2: [objective2.explanation_text]")
- ticker.mode.traitors |= src.mind //Necessary for announcing
- if(!src.giveSpells())
- message_admins("Revenant was created but has no mind. Trying again in five seconds.")
- spawn(50)
- if(!src.giveSpells())
- message_admins("Revenant still has no mind. Deleting...")
- qdel(src)
+ ticker.mode.traitors |= mind //Necessary for announcing
/mob/living/simple_animal/revenant/proc/giveSpells()
- if(src.mind)
- src.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/night_vision/revenant(null))
- src.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/revenant_transmit(null))
- src.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/revenant/overload(null))
- src.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/revenant/defile(null))
- src.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/revenant/malfunction(null))
- return 1
- return 0
+ mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/night_vision/revenant(null))
+ mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/revenant_transmit(null))
+ mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/revenant/overload(null))
+ mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/revenant/defile(null))
+ mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/revenant/malfunction(null))
+ return TRUE
/mob/living/simple_animal/revenant/dust()