<commit_before>/mob/living/carbon/alien/humanoid/royal
	//Common stuffs for Praetorian and Queen
	icon = 'icons/mob/alienqueen.dmi'
	status_flags = 0
	ventcrawler = 0 //pull over that ass too fat
	unique_name = 0
	pixel_x = -16
	mob_size = MOB_SIZE_LARGE
	layer = 6
	pressure_resistance = 200 //Because big, stompy xenos should not be blown around like paper.

/mob/living/carbon/alien/humanoid/royal/queen
	name = "<NAME>"
	caste = "q"
	maxHealth = 400
	health = 400
	icon_state = "alienq"


/mob/living/carbon/alien/humanoid/royal/queen/New()
	//there should only be one queen
	for(var/mob/living/carbon/alien/humanoid/royal/queen/Q in living_mob_list)
		if(Q == src)		continue
		if(Q.stat == DEAD)	continue
		if(Q.client)
			name = "<NAME> ([rand(1, 999)])"	//if this is too cutesy feel free to change it/remove it.
			break

	real_name = src.name

	internal_organs += new /obj/item/organ/internal/alien/plasmavessel/large/queen
	internal_organs += new /obj/item/organ/internal/alien/resinspinner
	internal_organs += new /obj/item/organ/internal/alien/acid
	internal_organs += new /obj/item/organ/internal/alien/neurotoxin
	internal_organs += new /obj/item/organ/internal/alien/eggsac
	AddAbility(new/obj/effect/proc_holder/alien/royal/queen/promote())
	..()

/mob/living/carbon/alien/humanoid/royal/queen/handle_hud_icons_health()
	if (src.healths)
		if (src.stat != 2)
			switch(health)
				if(400 to INFINITY)
					src.healths.icon_state = "health0"
				if(320 to 400)
					src.healths.icon_state = "health1"
				if(240 to 320)
					src.healths.icon_state = "health2"
				if(160 to 240)
					src.healths.icon_state = "health3"
				if(80 to 160)
					src.healths.icon_state = "health4"
				if(0 to 80)
					src.healths.icon_state = "health5"
				else
					src.healths.icon_state = "health6"
		else
			src.healths.icon_state = "health7"

/mob/living/carbon/alien/humanoid/royal/queen/movement_delay()
	. = ..()
	. += 5


//Queen verbs
/obj/effect/proc_holder/alien/lay_egg
	name = "Lay Egg"
	desc = "Lay an egg to produce huggers to impregnate prey with."
	plasma_cost = 75
	check_turf = 1
	action_icon_state = "alien_egg"

/obj/effect/proc_holder/alien/lay_egg/fire(mob/living/carbon/user)
	if(locate(/obj/structure/alien/egg) in get_turf(user))
		user << "There's already an egg here."
		return 0
	user.visible_message("<span class='alertalien'>[user] has laid an egg!</span>")
	new /obj/structure/alien/egg(user.loc)
	return 1

//Button to let queen choose her praetorian.
/obj/effect/proc_holder/alien/royal/queen/promote
	name = "Create Royal Parasite"
	desc = "Produce a royal parasite to grant one of your children the honor of being your Praetorian."
	plasma_cost = 500 //Plasma cost used on promotion, not spawning the parasite.

	action_icon_state = "alien_queen_promote"



/obj/effect/proc_holder/alien/royal/queen/promote/fire(mob/living/carbon/alien/user)
	var/obj/item/queenpromote/prom
	if(alien_type_present(/mob/living/carbon/alien/humanoid/royal/praetorian/))
		user << "<span class='noticealien'>You already have a Praetorian!</span>"
		return 0
	else
		for(prom in user)
			user << "<span class='noticealien'>You discard [prom].</span>"
			qdel(prom)
			return 0

		prom = new (user.loc)
		if(!user.put_in_active_hand(prom, 1))
			user << "<span class='warning'>You must empty your hands before preparing the parasite.</span>"
			return 0
		else //Just in case telling the player only once is not enough!
			user << "<span class='noticealien'>Use the royal parasite on one of your children to promote her to Praetorian!</span>"
	return 0


/obj/item/queenpromote
	name = "\improper royal parasite"
	desc = "Inject this into one of your grown children to promote her to a Praetorian!"
	icon_state = "alien_medal"
	flags = ABSTRACT|NODROP
	icon = 'icons/mob/alien.dmi'

/obj/item/queenpromote/attack(mob/living/M, mob/living/user)
	if(!isalienadult(M) || istype(M, /mob/living/carbon/alien/humanoid/royal))
		user << "<span class='noticealien'>You may only use this with your adult, non-royal children!</span>"
		return
	if(alien_type_present(/mob/living/carbon/alien/humanoid/royal/praetorian/))
		user << "<span class='noticealien'>You already have a Praetorian!</span>"
		return

	var/mob/living/carbon/alien/humanoid/A = M
	if(A.stat == CONSCIOUS && A.mind && A.key)
		if(!A.usePlasma(500))
			user << "<span class='noticealien'>You must have 500 plasma stored to use this!</span>"
			return

		A << "<span class='noticealien'>The queen has granted you a promotion to Praetorian!</span>"
		user.visible_message("<span class='alertalien'>[A] begins to expand, twist and contort!</span>")
		var/mob/living/carbon/alien/humanoid/royal/praetorian/new_prae = new (A.loc)
		A.mind.transfer_to(new_prae)
		qdel(A)
		qdel(src)
		return
	else
		user << "<span class='warning'>This child must be alert and responsive to become a Praetorian!</span>"<commit_msg>Slight cost change for promotions<commit_after>/mob/living/carbon/alien/humanoid/royal
	//Common stuffs for Praetorian and Queen
	icon = 'icons/mob/alienqueen.dmi'
	status_flags = 0
	ventcrawler = 0 //pull over that ass too fat
	unique_name = 0
	pixel_x = -16
	mob_size = MOB_SIZE_LARGE
	layer = 6
	pressure_resistance = 200 //Because big, stompy xenos should not be blown around like paper.

/mob/living/carbon/alien/humanoid/royal/queen
	name = "<NAME>"
	caste = "q"
	maxHealth = 400
	health = 400
	icon_state = "alienq"


/mob/living/carbon/alien/humanoid/royal/queen/New()
	//there should only be one queen
	for(var/mob/living/carbon/alien/humanoid/royal/queen/Q in living_mob_list)
		if(Q == src)		continue
		if(Q.stat == DEAD)	continue
		if(Q.client)
			name = "<NAME> ([rand(1, 999)])"	//if this is too cutesy feel free to change it/remove it.
			break

	real_name = src.name

	internal_organs += new /obj/item/organ/internal/alien/plasmavessel/large/queen
	internal_organs += new /obj/item/organ/internal/alien/resinspinner
	internal_organs += new /obj/item/organ/internal/alien/acid
	internal_organs += new /obj/item/organ/internal/alien/neurotoxin
	internal_organs += new /obj/item/organ/internal/alien/eggsac
	AddAbility(new/obj/effect/proc_holder/alien/royal/queen/promote())
	..()

/mob/living/carbon/alien/humanoid/royal/queen/handle_hud_icons_health()
	if (src.healths)
		if (src.stat != 2)
			switch(health)
				if(400 to INFINITY)
					src.healths.icon_state = "health0"
				if(320 to 400)
					src.healths.icon_state = "health1"
				if(240 to 320)
					src.healths.icon_state = "health2"
				if(160 to 240)
					src.healths.icon_state = "health3"
				if(80 to 160)
					src.healths.icon_state = "health4"
				if(0 to 80)
					src.healths.icon_state = "health5"
				else
					src.healths.icon_state = "health6"
		else
			src.healths.icon_state = "health7"

/mob/living/carbon/alien/humanoid/royal/queen/movement_delay()
	. = ..()
	. += 5


//Queen verbs
/obj/effect/proc_holder/alien/lay_egg
	name = "Lay Egg"
	desc = "Lay an egg to produce huggers to impregnate prey with."
	plasma_cost = 75
	check_turf = 1
	action_icon_state = "alien_egg"

/obj/effect/proc_holder/alien/lay_egg/fire(mob/living/carbon/user)
	if(locate(/obj/structure/alien/egg) in get_turf(user))
		user << "There's already an egg here."
		return 0
	user.visible_message("<span class='alertalien'>[user] has laid an egg!</span>")
	new /obj/structure/alien/egg(user.loc)
	return 1

//Button to let queen choose her praetorian.
/obj/effect/proc_holder/alien/royal/queen/promote
	name = "Create Royal Parasite"
	desc = "Produce a royal parasite to grant one of your children the honor of being your Praetorian."
	plasma_cost = 450 //Plasma cost used on promotion, not spawning the parasite.

	action_icon_state = "alien_queen_promote"



/obj/effect/proc_holder/alien/royal/queen/promote/fire(mob/living/carbon/alien/user)
	var/obj/item/queenpromote/prom
	if(alien_type_present(/mob/living/carbon/alien/humanoid/royal/praetorian/))
		user << "<span class='noticealien'>You already have a Praetorian!</span>"
		return 0
	else
		for(prom in user)
			user << "<span class='noticealien'>You discard [prom].</span>"
			qdel(prom)
			return 0

		prom = new (user.loc)
		if(!user.put_in_active_hand(prom, 1))
			user << "<span class='warning'>You must empty your hands before preparing the parasite.</span>"
			return 0
		else //Just in case telling the player only once is not enough!
			user << "<span class='noticealien'>Use the royal parasite on one of your children to promote her to Praetorian!</span>"
	return 0


/obj/item/queenpromote
	name = "\improper royal parasite"
	desc = "Inject this into one of your grown children to promote her to a Praetorian!"
	icon_state = "alien_medal"
	flags = ABSTRACT|NODROP
	icon = 'icons/mob/alien.dmi'

/obj/item/queenpromote/attack(mob/living/M, mob/living/user)
	if(!isalienadult(M) || istype(M, /mob/living/carbon/alien/humanoid/royal))
		user << "<span class='noticealien'>You may only use this with your adult, non-royal children!</span>"
		return
	if(alien_type_present(/mob/living/carbon/alien/humanoid/royal/praetorian/))
		user << "<span class='noticealien'>You already have a Praetorian!</span>"
		return

	var/mob/living/carbon/alien/humanoid/A = M
	if(A.stat == CONSCIOUS && A.mind && A.key)
		if(!A.usePlasma(450))
			user << "<span class='noticealien'>You must have 450 plasma stored to use this!</span>"
			return

		A << "<span class='noticealien'>The queen has granted you a promotion to Praetorian!</span>"
		user.visible_message("<span class='alertalien'>[A] begins to expand, twist and contort!</span>")
		var/mob/living/carbon/alien/humanoid/royal/praetorian/new_prae = new (A.loc)
		A.mind.transfer_to(new_prae)
		qdel(A)
		qdel(src)
		return
	else
		user << "<span class='warning'>This child must be alert and responsive to become a Praetorian!</span>"
{'fraction_non_alphanumeric': 0.13014119091467158, 'fraction_numerical': 0.015756087579292, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 91, '<?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': '6956391', 'n_tokens_mistral': 4043, 'n_tokens_neox': 3569, 'n_words': 839}