<commit_before>//This should hold all the vampire related powers


/mob/proc/vampire_power(required_blood=0, max_stat=0)

	if(!src.mind)		return 0
	if(!ishuman(src))
		src << "<span class='warning'>You are in too weak of a form to do this!</span>"
		return 0

	var/datum/vampire/vampire = src.mind.vampire

	if(!vampire)
		msg_scopes("[src] has vampire verbs but isn't a vampire.")
		world.log << "[src] has vampire verbs but isn't a vampire."
		return 0

	var/fullpower = (VAMP_FULL in vampire.powers)

	if(src.stat > max_stat)
		src << "<span class='warning'>You are incapacitated.</span>"
		return 0

	if(vampire.nullified)
		if(!fullpower)
			src << "<span class='warning'>Something is blocking your powers!</span>"
			return 0
	if(vampire.bloodusable < required_blood)
		src << "<span class='warning'>You require at least [required_blood] units of usable blood to do that!</span>"
		return 0
	//chapel check
	if(istype(loc.loc, /area/chapel))
		if(!fullpower)
			src << "<span class='warning'>Your powers are useless on this holy ground.</span>"
			return 0
	return 1

/mob/proc/vampire_affected(datum/mind/M)
	//Other vampires aren't affected
	if(mind && mind.vampire) return 0
	//Chaplains are resistant to vampire powers
	if(mind && mind.assigned_role == "Chaplain")
		return 0
	if(mind && mind.current.isipc())//Not sure if this should be here but we can easily override.
		return 0
	//Vampires who have reached their full potential can affect nearly everything
	if(M && M.vampire && (VAMP_FULL in M.vampire.powers))
		return 1 // This doesn't really need to be here because of well the line below it.
	return 1

/mob/proc/vampire_can_reach(mob/M as mob, active_range = 1)
	if(M.loc == src.loc) return 1 //target and source are in the same thing
	if(!isturf(src.loc) || !isturf(M.loc)) return 0 //One is inside, the other is outside something.
	if(Adjacent(M))//if(AStar(src.loc, M.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, active_range)) //If a path exists, good!
		return 1
	return 0

/mob/proc/vampire_active(required_blood=0, max_stat=0, active_range=1)
	var/pass = vampire_power(required_blood, max_stat)
	if(!pass)								return
	var/datum/vampire/vampire = mind.vampire
	if(!vampire) return
	var/list/victims = list()
	for(var/mob/living/carbon/C in view(active_range))
		if(C==src) continue
		victims += C
	var/mob/living/carbon/T = input(src, "Victim?") as null|anything in victims

	if(!T) return
	if(!(T in view(active_range))) return
	if(!vampire_can_reach(T, active_range)) return
	if(!vampire_power(required_blood, max_stat)) return
	return T

/client/vampire/proc/vampire_rejuvinate()
	set category = "Abilities"
	set name = "Rejuvinate "
	set desc= "Flush your system with spare blood to remove any incapacitating effects"
	var/datum/mind/M = usr.mind
	if(!M) return
	if(M.current.vampire_power(0, 1))
		M.current.weakened = 0
		M.current.stunned = 0
		M.current.paralysis = 0
		//M.vampire.bloodusable -= 10
		M.current << "\blue You flush your system with clean blood and remove any incapacitating effects."
		spawn(1)
			if(M.vampire.bloodtotal >= 200)
				for(var/i = 0; i < 5; i++)
					M.current.adjustBruteLoss(-2)
					M.current.adjustOxyLoss(-5)
					M.current.adjustToxLoss(-2)
					M.current.adjustFireLoss(-2)
					sleep(35)
		M.current.verbs -= /client/vampire/proc/vampire_rejuvinate
		spawn(200)
			M.current.verbs += /client/vampire/proc/vampire_rejuvinate

/client/vampire/proc/vampire_hypnotise()
	set category = "Abilities"
	set name = "Hypnotise" // (20)
	set desc= "A piercing stare that incapacitates your victim for a good length of time."
	var/datum/mind/M = usr.mind
	if(!M) return

	var/mob/living/carbon/C = M.current.vampire_active(0, 0, 1) //(20, 0, 1)

	if(!C) return
	if(C==usr)
		M.current << "\red You can't do that to yourself"
		return

	var/vampgender
	if(M.current.gender == "male")
		vampgender = "he"
	else
		vampgender = "she"

	M.current.visible_message("<span class='warning'>[M]'s eyes flash briefly as [vampgender] stares into [C.name]'s eyes</span>")
//	M.current.remove_vampire_blood(20) Moved to remove if it works only.
	if(M.current.vampire_power(0, 0)) //if(M.current.vampire_power(20, 0))
		M.current.verbs -= /client/vampire/proc/vampire_hypnotise
		spawn(1200)
			M.current.verbs += /client/vampire/proc/vampire_hypnotise
		if(do_mob(M.current, C, 50))
			if(C.mind && C.mind.vampire)
				M.current << "\red Your piercing gaze fails to knock out [C.name]."
				C << "\blue [M.current]'s feeble gaze is ineffective."
				return
			else
				M.current << "\red Your piercing gaze knocks out [C.name]."
				C << "\red You find yourself unable to move and barely able to speak"
				C.Weaken(20)
				C.Stun(20)
				C.stuttering = 20
//				M.current.remove_vampire_blood(20)
		else
			M.current << "\red You broke your gaze."
			return

/client/vampire/proc/vampire_disease()
	set category = "Abilities"
	set name = "Diseased Touch (200)"
	set desc = "Touches your victim with infected blood giving them the Shutdown Syndrome which quickly shutsdown their major organs resulting in a quick painful death."
	var/datum/mind/M = usr.mind
	if(!M) return

	var/mob/living/carbon/C = M.current.vampire_active(200, 0, 1)
	if(!C) return
	if(C==usr)
		M.current << "\red You can't do that to yourself"
		return
	if(C.isipc())
		M.current << "\red You can't to that to a machine"
		return
	if(!M.current.vampire_can_reach(C, 1))
		M.current << "\red <b>You cannot touch [C.name] from where you are standing!"
		return
	M.current << "\red You stealthily infect [C.name] with your diseased touch."
	/*var/t_him = "it"
	if (src.gender == MALE)
		t_him = "him"
	else if (src.gender == FEMALE)
		t_him = "her"
	M.current.visible_message("\blue [M] shakes [src] trying to wake [t_him] up!" )
	playsound(get_turf(src), 'sound/weapons/thudswoosh.ogg', 50, 1, -1)*/
	C.help_shake_act(M.current) // i use da colon
	if(!C.vampire_affected(M))
		M.current << "\red They seem to be unaffected."
		return
	var/datum/disease2/disease/shutdown = new /datum/disease2/disease
	var/datum/disease2/effectholder/holder = new /datum/disease2/effectholder
	var/datum/disease2/effect/organs/vampire/O = new /datum/disease2/effect/organs/vampire
	holder.effect += O
	holder.chance = 10
	shutdown.infectionchance = 100
	shutdown.antigen |= text2num(pick(ANTIGENS))
	shutdown.antigen |= text2num(pick(ANTIGENS))
	shutdown.spreadtype = "None"
	shutdown.uniqueID = rand(0,10000)
	shutdown.effects += holder
	shutdown.speed = 1
	shutdown.stage = 2
	shutdown.clicks = 185
	msg_admin_attack("[usr.name] ([usr.ckey]) gave [C.name] ([C.ckey]) the shutdown disease - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[C.x];Y=[C.y];Z=[C.z]'>JMP</a>")
	usr.attack_log += text("\[[time_stamp()]\] <font color='red'>Gave [C.name] ([C.ckey]) the shutdown disease</font>")
	C.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been given the shutdown disease by [usr.name] ([usr.ckey])</font>")
	infect_virus2(C,shutdown,0)
	M.current.remove_vampire_blood(200)
	M.current.verbs -= /client/vampire/proc/vampire_disease
	spawn(1800) M.current.verbs += /client/vampire/proc/vampire_disease

/client/vampire/proc/vampire_glare()
	set category = "Abilities"
	set name = "Glare"
	set desc= "A scary glare that incapacitates people for a short while around you."
	var/datum/mind/M = usr.mind
	if(!M) return
	if(M.current.vampire_power(0, 1))
		M.current.visible_message("\red <b>[M.current]'s eyes emit a blinding flash!")
		//M.vampire.bloodusable -= 10
		M.current.verbs -= /client/vampire/proc/vampire_glare
		spawn(800)
			M.current.verbs += /client/vampire/proc/vampire_glare
		if(istype(M.current:glasses, /obj/item/clothing/glasses/sunglasses/blindfold))
			M.current << "<span class='warning'>You're blindfolded!</span>"
			return
		for(var/mob/living/carbon/C in view(1))
			if(!C.vampire_affected(M))
				if(!C.isipc())
					continue
			if(!M.current.vampire_can_reach(C, 1)) continue<commit_msg>Can't use powers without eyes<commit_after>//This should hold all the vampire related powers


/mob/proc/vampire_power(required_blood=0, max_stat=0)

	if(!src.mind)		return 0
	if(!ishuman(src))
		src << "<span class='warning'>You are in too weak of a form to do this!</span>"
		return 0

	var/datum/vampire/vampire = src.mind.vampire

	if(!vampire)
		msg_scopes("[src] has vampire verbs but isn't a vampire.")
		world.log << "[src] has vampire verbs but isn't a vampire."
		return 0

	var/fullpower = (VAMP_FULL in vampire.powers)

	if(src.stat > max_stat)
		src << "<span class='warning'>You are incapacitated.</span>"
		return 0

	if(vampire.nullified)
		if(!fullpower)
			src << "<span class='warning'>Something is blocking your powers!</span>"
			return 0
	if(vampire.bloodusable < required_blood)
		src << "<span class='warning'>You require at least [required_blood] units of usable blood to do that!</span>"
		return 0
	//chapel check
	if(istype(loc.loc, /area/chapel))
		if(!fullpower)
			src << "<span class='warning'>Your powers are useless on this holy ground.</span>"
			return 0
	return 1

/mob/proc/vampire_affected(datum/mind/M)
	//Other vampires aren't affected
	if(mind && mind.vampire) return 0
	//Chaplains are resistant to vampire powers
	if(mind && mind.assigned_role == "Chaplain")
		return 0
	if(mind && mind.current.isipc())//Not sure if this should be here but we can easily override.
		return 0
	//Vampires who have reached their full potential can affect nearly everything
	if(M && M.vampire && (VAMP_FULL in M.vampire.powers))
		return 1 // This doesn't really need to be here because of well the line below it.
	return 1

/mob/proc/vampire_can_reach(mob/M as mob, active_range = 1)
	if(M.loc == src.loc) return 1 //target and source are in the same thing
	if(!isturf(src.loc) || !isturf(M.loc)) return 0 //One is inside, the other is outside something.
	if(Adjacent(M))//if(AStar(src.loc, M.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, active_range)) //If a path exists, good!
		return 1
	return 0

/mob/proc/vampire_active(required_blood=0, max_stat=0, active_range=1)
	var/pass = vampire_power(required_blood, max_stat)
	if(!pass)								return
	var/datum/vampire/vampire = mind.vampire
	if(!vampire) return
	var/list/victims = list()
	for(var/mob/living/carbon/C in view(active_range))
		if(C==src) continue
		victims += C
	var/mob/living/carbon/T = input(src, "Victim?") as null|anything in victims

	if(!T) return
	if(!(T in view(active_range))) return
	if(!vampire_can_reach(T, active_range)) return
	if(!vampire_power(required_blood, max_stat)) return
	return T

/client/vampire/proc/vampire_rejuvinate()
	set category = "Abilities"
	set name = "Rejuvinate "
	set desc= "Flush your system with spare blood to remove any incapacitating effects"
	var/datum/mind/M = usr.mind
	if(!M) return
	if(M.current.vampire_power(0, 1))
		M.current.weakened = 0
		M.current.stunned = 0
		M.current.paralysis = 0
		//M.vampire.bloodusable -= 10
		M.current << "\blue You flush your system with clean blood and remove any incapacitating effects."
		spawn(1)
			if(M.vampire.bloodtotal >= 200)
				for(var/i = 0; i < 5; i++)
					M.current.adjustBruteLoss(-2)
					M.current.adjustOxyLoss(-5)
					M.current.adjustToxLoss(-2)
					M.current.adjustFireLoss(-2)
					sleep(35)
		M.current.verbs -= /client/vampire/proc/vampire_rejuvinate
		spawn(200)
			M.current.verbs += /client/vampire/proc/vampire_rejuvinate

/client/vampire/proc/vampire_hypnotise()
	set category = "Abilities"
	set name = "Hypnotise" // (20)
	set desc= "A piercing stare that incapacitates your victim for a good length of time."
	var/datum/mind/M = usr.mind
	if(!M) return

	var/mob/living/carbon/C = M.current.vampire_active(0, 0, 1) //(20, 0, 1)

	if(!C) return
	if(C==usr)
		M.current << "\red You can't do that to yourself"
		return

	if(!M.current.has_eyes())
		M.current << "\red You don't have eyes"
		return

	var/vampgender
	if(M.current.gender == "male")
		vampgender = "he"
	else
		vampgender = "she"

	M.current.visible_message("<span class='warning'>[M]'s eyes flash briefly as [vampgender] stares into [C.name]'s eyes</span>")
//	M.current.remove_vampire_blood(20) Moved to remove if it works only.
	if(M.current.vampire_power(0, 0)) //if(M.current.vampire_power(20, 0))
		M.current.verbs -= /client/vampire/proc/vampire_hypnotise
		spawn(1200)
			M.current.verbs += /client/vampire/proc/vampire_hypnotise
		if(do_mob(M.current, C, 50))
			if(C.mind && C.mind.vampire)
				M.current << "\red Your piercing gaze fails to knock out [C.name]."
				C << "\blue [M.current]'s feeble gaze is ineffective."
				return
			else
				M.current << "\red Your piercing gaze knocks out [C.name]."
				C << "\red You find yourself unable to move and barely able to speak"
				C.Weaken(20)
				C.Stun(20)
				C.stuttering = 20
//				M.current.remove_vampire_blood(20)
		else
			M.current << "\red You broke your gaze."
			return

/client/vampire/proc/vampire_disease()
	set category = "Abilities"
	set name = "Diseased Touch (200)"
	set desc = "Touches your victim with infected blood giving them the Shutdown Syndrome which quickly shutsdown their major organs resulting in a quick painful death."
	var/datum/mind/M = usr.mind
	if(!M) return

	var/mob/living/carbon/C = M.current.vampire_active(200, 0, 1)
	if(!C) return
	if(C==usr)
		M.current << "\red You can't do that to yourself"
		return
	if(C.isipc())
		M.current << "\red You can't to that to a machine"
		return
	if(!M.current.vampire_can_reach(C, 1))
		M.current << "\red <b>You cannot touch [C.name] from where you are standing!"
		return
	M.current << "\red You stealthily infect [C.name] with your diseased touch."
	/*var/t_him = "it"
	if (src.gender == MALE)
		t_him = "him"
	else if (src.gender == FEMALE)
		t_him = "her"
	M.current.visible_message("\blue [M] shakes [src] trying to wake [t_him] up!" )
	playsound(get_turf(src), 'sound/weapons/thudswoosh.ogg', 50, 1, -1)*/
	C.help_shake_act(M.current) // i use da colon
	if(!C.vampire_affected(M))
		M.current << "\red They seem to be unaffected."
		return
	var/datum/disease2/disease/shutdown = new /datum/disease2/disease
	var/datum/disease2/effectholder/holder = new /datum/disease2/effectholder
	var/datum/disease2/effect/organs/vampire/O = new /datum/disease2/effect/organs/vampire
	holder.effect += O
	holder.chance = 10
	shutdown.infectionchance = 100
	shutdown.antigen |= text2num(pick(ANTIGENS))
	shutdown.antigen |= text2num(pick(ANTIGENS))
	shutdown.spreadtype = "None"
	shutdown.uniqueID = rand(0,10000)
	shutdown.effects += holder
	shutdown.speed = 1
	shutdown.stage = 2
	shutdown.clicks = 185
	msg_admin_attack("[usr.name] ([usr.ckey]) gave [C.name] ([C.ckey]) the shutdown disease - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[C.x];Y=[C.y];Z=[C.z]'>JMP</a>")
	usr.attack_log += text("\[[time_stamp()]\] <font color='red'>Gave [C.name] ([C.ckey]) the shutdown disease</font>")
	C.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been given the shutdown disease by [usr.name] ([usr.ckey])</font>")
	infect_virus2(C,shutdown,0)
	M.current.remove_vampire_blood(200)
	M.current.verbs -= /client/vampire/proc/vampire_disease
	spawn(1800) M.current.verbs += /client/vampire/proc/vampire_disease

/client/vampire/proc/vampire_glare()
	set category = "Abilities"
	set name = "Glare"
	set desc= "A scary glare that incapacitates people for a short while around you."
	var/datum/mind/M = usr.mind
	if(!M) return

	if(!M.current.has_eyes())
		M.current << "\red You don't have eyes"
		return

	if(M.current.vampire_power(0, 1))
		M.current.visible_message("\red <b>[M.current]'s eyes emit a blinding flash!")
		//M.vampire.bloodusable -= 10
		M.current.verbs -= /client/vampire/proc/vampire_glare
		spawn(800)
			M.current.verbs += /client/vampire/proc/vampire_glare
		if(istype(M.current:glasses, /obj/item/clothing/glasses/sunglasses/blindfold))
			M.current << "<span class='warning'>You're blindfolded!</span>"
			return
		for(var/mob/living/carbon/C in view(1))
			if(!C.vampire_affected(M))
				if(!C.isipc())
					continue
			if(!M.current.vampire_can_reach(C, 1)) continue
{'fraction_non_alphanumeric': 0.14458206261280887, 'fraction_numerical': 0.016306715628306465, 'mean_word_length': 4.0306825297432685, 'pattern_counts': {'":': 0, '<': 131, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5098496', 'n_tokens_mistral': 6746, 'n_tokens_neox': 6005, 'n_words': 1477}