anchor.diff:  	var/image/halbody
   	var/obj/halitem
   	var/hal_screwyhud = SCREWYHUD_NONE
  -	var/handling_hal = 0
  +	var/next_hallucination = 0
  +
  +GLOBAL_LIST_INIT(hallucinations_minor, list(
  +	/datum/hallucination/sounds,
  +	/datum/hallucination/bolts,
  +	/datum/hallucination/whispers,
  +	/datum/hallucination/message,
  +	/datum/hallucination/hudscrew))
  +
  +GLOBAL_LIST_INIT(hallucinations_medium, list(
  +	/datum/hallucination/fake_alert,
  +	/datum/hallucination/items,
  +	/datum/hallucination/items_other,
  +	/datum/hallucination/dangerflash,
  +	/datum/hallucination/bolts,
  +	/datum/hallucination/fake_flood,
  +	/datum/hallucination/husks,
  +	/datum/hallucination/battle,
  +	/datum/hallucination/fire,
  +	/datum/hallucination/self_delusion))
  +
  +GLOBAL_LIST_INIT(hallucinations_major, list(
  +	/datum/hallucination/fakeattacker,
  +	/datum/hallucination/death,
  +	/datum/hallucination/xeno_attack,
  +	/datum/hallucination/singularity_scare,
  +	/datum/hallucination/delusion,
  +	/datum/hallucination/oh_yeah))
   
   /mob/living/carbon/proc/handle_hallucinations()
  -	if(handling_hal)
  +	if(world.time < next_hallucination)
   		return
   
  -	//Least obvious
  -	var/list/minor = list("sounds"=25,"bolts_minor"=5,"whispers"=15,"message"=10,"hudscrew"=15)
  -	//Something's wrong here
  -	var/list/medium = list("fake_alert"=15,"items"=10,"items_other"=10,"dangerflash"=10,"bolts"=5,"flood"=5,"husks"=10,"battle"=15,"self_delusion"=10)
  -	//AAAAH
  -	var/list/major = list("fake"=20,"death"=10,"xeno"=10,"singulo"=10,"borer"=10,"delusion"=20,"koolaid"=10)
  -
  -	handling_hal = 1
  -	while(hallucination > 20)
  -		sleep(rand(200,500)/(hallucination/25))
  -		if(prob(20))
  -			continue
  -		var/list/current = list()
  -		switch(rand(100))
  -			if(1 to 50)
  -				current = minor
  -			if(51 to 85)
  -				current = medium
  -			if(86 to 100)
  -				current = major
  -
  -		var/halpick = pickweight(current)
  -
  -		hallucinate(halpick)
  -	handling_hal = 0
  +	if(hallucination)
  +		var/list/current = GLOB.hallucinations_minor
  +		if(prob(25) && hallucination > 100)
  +			current = GLOB.hallucinations_medium
  +		else if(prob(10) && hallucination > 200)
  +			current = GLOB.hallucinations_major
  +		var/halpick = pick(current)
  +		new halpick(src, FALSE)
  +
  +/mob/living/carbon/proc/set_screwyhud(hud_type)
  +	hal_screwyhud = hud_type
  +	update_health_hud()
  +
  +/datum/hallucination
  +	var/mob/living/carbon/target
  +	var/cost = 5 //affects the amount of hallucination reduced, and cooldown until the next hallucination
  +	var/feedback_details //extra info for investigate
  +
  +/datum/hallucination/New(mob/living/carbon/T, forced = TRUE)
  +	set waitfor = 0
  +	target = T
  +	if(!forced)
  +		target.hallucination = max(0, target.hallucination - cost)
  +		target.next_hallucination = world.time + (rand(cost * 0.5, cost * 3) * 10)
  +
  +/datum/hallucination/proc/wake_and_restore()
  +	target.set_screwyhud(SCREWYHUD_NONE)
  +	target.SetSleeping(0)
  +
  +/datum/hallucination/Destroy()
  +	target.investigate_log("was afflicted with a hallucination of type [type]. [feedback_details]", INVESTIGATE_HALLUCINATIONS)
  +	return ..()
   
   /obj/effect/hallucination
   	invisibility = INVISIBILITY_OBSERVER
   	var/mob/living/carbon/target = null
  -
  -/obj/effect/hallucination/proc/wake_and_restore()
  -	target.hal_screwyhud = SCREWYHUD_NONE
  -	target.SetSleeping(0)
   
   /obj/effect/hallucination/simple
   	var/image_icon = 'icons/mob/alien.dmi'
  
positive.code: 
  /datum/hallucination/whispers/New(mob/living/carbon/T, forced = TRUE)
  	..()
  	var/speak_messages = list("[pick("I'm watching you...","I know what you're doing","What are you hiding?","I saw that")]",\
  	"[pick("","Hey, ","Hi ","Hello ","Wait, ","It's ")][target.first_name()]!",\
  	"[pick("Get out","Go away","Fuck off","OUT!")]",\
  	"[pick("Kchck-Chkck? Kchchck!","EEEeeeeEEEE","#@*&","H-hhhhh...")]",\
  	"[pick("Did you hear that?","Did you see that?","What was that?")]",\
  	"[pick("Hail Ratvar","Hail Nar'Sie","Viva!","[generate_code_phrase()]","Are you mr. [pick(GLOB.possible_changeling_IDs)]?")]",\
  	"[pick("Why?","What?","Wait, what?","Wait","Hold on","Uh...")]",\
  	"Give me that!",\
  	"HELP[pick(""," ME"," HIM"," HER"," THEM")]!!",\
  	"RUN!!",\
  	"I'm infected, [pick("stay away","don't get close","be careful","help me","kill me")]")
  
  	var/radio_messages = list("Set [target.first_name()] to arrest!",\
  	"[pick("Captain","Hos","Cmo","Rd","Ce","Hop","Janitor","AI","Viro","Qm","[target.first_name()]")] is [pick("rogue","cult","clockcult","a revhead","a gang leader","a traitor","a ling","dead")]!",\
  	"Help!",\
  	"[pick("Cult", "Wizard", "Blob", "Ling", "Ops", "Swarmers", "Revenant", "Traitor", "Harm", "I hear flashing", "Help")] in [pick(GLOB.teleportlocs)][prob(50)?"!":"!!"]",\
  	"Where's [target.first_name()]?"\
  	,"[pick("C","Ai, c","Someone c","Rec")]all the shuttle!"\
  	,"AI [pick("rogue", "is dead")]!!")
  
negative.code: 
  /obj/effect/hallucination/simple/clown/scary
  	image_state = "scary_clown"
  
  /obj/effect/hallucination/simple/bubblegum
  	name = "Bubblegum"
  