Scriptname SuH_Fun extends Quest  

SexLabFramework property SexLab auto

;ent/ Variables
GlobalVariable property SuH_PCSabsorbhealth auto
GlobalVariable property SuH_PCSabsorbmagicka auto
GlobalVariable property SuH_PCSabsorbstamina auto
GlobalVariable property SuH_PCScaphealth auto
GlobalVariable property SuH_PCScapmagicka auto
GlobalVariable property SuH_PCScapstamina auto
GlobalVariable property SuH_PCSspermhealth auto
GlobalVariable property SuH_PCSspermmagicka auto
GlobalVariable property SuH_PCSspermstamina auto
GlobalVariable property SuH_PCSmilkhealth auto
GlobalVariable property SuH_PCSmilkmagicka auto
GlobalVariable property SuH_PCSmilkstamina auto
GlobalVariable property SuH_PCSxp auto
GlobalVariable property SuH_PCSxpearn auto
GlobalVariable property SuH_PCSxpgain auto
GlobalVariable property SuH_PCSforce auto
GlobalVariable property SuH_PCSdesire auto
GlobalVariable property SuH_SETallowmalehomo auto
GlobalVariable property SuH_SETallowfemalehomo auto
;end/
;ent/ Actors
Actor property PlayerRef auto
;end/

;ent/ XPcalc
Function XPcalc(string aPreset, float aMOD, int XPearn, float lvlS, bool dReport) 

	If aPreset != "0"
		if aPreset == "PCmastery" ; Mastery Sex Act (Player as aggressor)
			int desireCost = Math.Floor(SuH_PCSdesire.GetValue() * 0.05)
			int desireV = Math.Floor(SuH_PCSdesire.GetValue() - desireCost)
			SuH_PCSdesire.SetValue(desireV)
			XPearn = Math.Floor(XPearn + desireCost + SuH_PCSxpearn.GetValue())
			aMOD = 0.2
			lvlS = 2.0
		elseIf aPreset == "PCtraining" ; Consent Sex Act (Player with consent)
			int desireCost = Math.Floor(SuH_PCSdesire.GetValue() * 0.05)
			int desireV = Math.Floor(SuH_PCSdesire.GetValue() - desireCost)
			SuH_PCSdesire.SetValue(desireV)
			XPearn = Math.Floor(XPearn + desireCost + SuH_PCSxpearn.GetValue())
			aMOD = 0.0
			lvlS = 2.0
		elseIf aPreset == "PCsubmit" ; Submit Sex Act (Player as victim)
			int desireCost = Math.Floor(SuH_PCSdesire.GetValue() * 0.05)
			int desireV = Math.Floor(SuH_PCSdesire.GetValue() - desireCost)
			SuH_PCSdesire.SetValue(desireV)
			XPearn = Math.Floor(XPearn + desireCost + SuH_PCSxpearn.GetValue())
			aMOD = -0.2
			lvlS = 2.0
		elseIf aPreset == "PCsperm" ; Consume Sperm
			aMOD = 0.0
			XPearn = Math.Floor(XPearn + SuH_PCSxpearn.GetValue())
			lvlS = 0.5
		elseIf aPreset == "PCmilk" ; Consume Milk
			aMOD = 0.0
			XPearn = Math.Floor(XPearn + SuH_PCSxpearn.GetValue())
			lvlS = 0.5
		else
			debug.trace("SuH ERROR : XPcalc aPreset was invalid", 2)
		endIf
	endIf
		if XPearn == 0
			XPearn = SuH_PCSxpearn.GetValue() as int
		endIf
		float eMOD = aMOD + SuH_PCSxpgain.GetValue()
		int PClevel = PlayerRef.GetLevel() as int
		int x = Math.Floor(((XPearn+(PClevel*lvlS))*eMOD))
		int y = SuH_PCSxp.GetValue() as int
		SuH_PCSxp.SetValue(x+y)
		debug.trace("SuH : "+x+" XP earned")
endFunction
;end/

;ent/ STATcalc
Function STATcalc(Actor eChar,bool PCin, string aPreset,string Stat, bool drainC,float aMOD,float aEffect,bool dReport)
	if PCin ; If Player Character is involved
		If aPreset != "0"
			if aPreset == "PCmastery" ; Mastery Sex Act
				aMOD = 0.2
				aEffect = 0.0
			elseif aPreset == "PCtraining" ; Consent Sex Act
				aMOD = 0.0
				aEffect = 0.0
			elseif aPreset == "PCsubmit" ; Submit Sex Act
				aMOD = -0.2
				aEffect = 0
			elseif aPreset == "PCsperm" ; Consume Sperm
				aMOD = 0.0
				aEffect = 0.0
			elseif aPreset == "PCmilk" ; Consume Milk
				aMOD = 0.0
				aEffect = 0.0
			else
				debug.trace("SuH ERROR : STATcalc aPreset was invalid", 2)
			endIf
		endIf
		if eChar == PlayerRef ; if character is the player
			if drainC ; if drain is TRUE
				; [][][] Currently Disabled
			else ; if drain is FALSE
				if Stat == "All" || Stat == "Health" ; Earn Health 
						float eMOD = 1.0+aMOD ; Set Multiplier
						float cS = eChar.GetBaseActorValue("health") ; Get Base Stat
						float cScap = SuH_PCScaphealth.GetValue() ; Get Stat Cap
						float k = 0.0 ; Set-up Absorption Variable
						if aEffect == 0 ; if aEffect is set to default
							if aPreset == "PCsperm" ; Check if preset is PCsperm
								k = SuH_PCSspermhealth.GetValue() as int ; set to default
							elseIf aPreset == "PCmilk" ; Check if preset is PCmilk
								k = SuH_PCSmilkhealth.GetValue() as int ; set to default
							else ; Set to general absorption stat
								k = SuH_PCSabsorbhealth.GetValue() as int ; set to default
							endIf
						else ; If aEffect isn't default
							k = aEffect ; Set absorption calculation to k
						endIf
					if cS >= cScap ; Check if Stat is capped
						int x = Math.Floor(k*eMOD) ; Find total absorption
						int y = SuH_PCSforce.GetValue() as int ; Get Force value
						SuH_PCSforce.SetValue(x+y) ; Set Force
						debug.trace("SuH : "+x+" Force Earned") ; Output
					else ; If stat wasn't capped
						int x = Math.Floor(k*eMOD) ; Find total absorption
						int y = Math.Floor(x+cS) ; Find result stat
						if y <= cScap ; If result is below cap
							eChar.SetActorValue("health", y) ; Set Stat
							debug.trace("SuH : "+x+" Health Earned") ; Output
						else ; If result was above cap
							eChar.SetActorValue("health", cScap) ; Set Stat to cap
							int j = Math.Floor(x-cScap) ; Find absorbed value
							int z = Math.Floor(y+SuH_PCSforce.GetValue()) ; Get Force and add
							SuH_PCSforce.SetValue(z) ; Set Force
							debug.trace("SuH : "+j+" Force Earned and Health was capped") ; Output
						endIf
					endIf
				endIf
				if Stat == "All" || Stat == "Magicka" ; Earn Magicka
						float eMOD = 1.0+aMOD
						float cS = eChar.GetBaseActorValue("magicka")
						float cScap = SuH_PCScapmagicka.GetValue()
						float k = 0.0
						if aEffect == 0
							if aPreset == "PCsperm"
								k = SuH_PCSspermmagicka.GetValue() as int
							elseIf aPreset == "PCmilk"
								k = SuH_PCSmilkmagicka.GetValue() as int
							else
								k = SuH_PCSabsorbmagicka.GetValue() as int
							endIf
						else
							k = aEffect
						endIf
					if cS >= cScap
						int x = Math.Floor(k*eMOD)
						int y = SuH_PCSforce.GetValue() as int
						SuH_PCSforce.SetValue(x+y)
						debug.trace("SuH : "+x+" Force Earned")
					else
						int x = Math.Floor(k*eMOD)
						int y = Math.Floor(x+cS)
						if y <= cScap
							eChar.SetActorValue("magicka", y)
							debug.trace("SuH : "+x+" Magicka Earned")
						else
							eChar.SetActorValue("magicka", cScap)
							int j = Math.Floor(x-cScap)
							int z = Math.Floor(y+SuH_PCSforce.GetValue())
							SuH_PCSforce.SetValue(z)
							debug.trace("SuH : "+j+" Force Earned and Magicka was capped")
						endIf
					endIf
				endIf
				if Stat == "All" || Stat == "Stamina" ; Earn Stamina
						float eMOD = 1.0+aMOD
						float cS = eChar.GetBaseActorValue("Stamina")
						float cScap = SuH_PCScapstamina.GetValue()
						float k = 0
						if aEffect == 0
							if aPreset == "PCsperm"
								k = SuH_PCSspermstamina.GetValue() as int
							elseIf aPreset == "PCmilk"
								k = SuH_PCSmilkstamina.GetValue() as int
							else
								k = SuH_PCSabsorbstamina.GetValue() as int
							endIf
						else
							k = aEffect
						endIf
					if cS >= cScap
						int x = Math.Floor(k*eMOD)
						int y = SuH_PCSforce.GetValue() as int
						SuH_PCSforce.SetValue(x+y)
						debug.trace("SuH : "+x+" Force Earned")
					else
						int x = Math.Floor(k*eMOD)
						int y = Math.Floor(x+cS)
						if y <= cScap
							eChar.SetActorValue("stamina", y)
							debug.trace("SuH : "+x+" Stamina Earned")
						else
							eChar.SetActorValue("stamina", cScap)
							int j = Math.Floor(x-cScap)
							int z = Math.Floor(y+SuH_PCSforce.GetValue())
							SuH_PCSforce.SetValue(z)
							debug.trace("SuH : "+j+" Force Earned and Stamina was capped")
						endIf
					endIf
				endIf
			endIf
		else ; if character isn't the player
			if aEffect == 0
				aEffect = SuH_PCSabsorbhealth.GetValue()
			endIf
			if drainC ; if drain is TRUE
				if Stat == "All" || Stat == "Health"
					float eMOD = 1.0+aMOD
					float cS = eChar.GetBaseActorValue("health")
					int x = Math.Floor(aEffect*eMOD)
					if x >= cS
						eChar.SetActorValue("health",0)
					else
						int y = Math.Floor(cS-x)
						eChar.SetActorValue("health",y)
					endIf
				endIf
				if Stat == "All" || Stat == "Magicka"
					float eMOD = 1.0+aMOD
					float cS = eChar.GetBaseActorValue("magicka")
					int x = Math.Floor(aEffect*eMOD)
					if x >= cS
						eChar.SetActorValue("magicka",0)
					else
						int y = Math.Floor(cS-x)
						eChar.SetActorValue("magicka",y)
					endIf
				endIf
				if Stat == "All" || Stat == "Stamina"
					float eMOD = 1.0+aMOD
					float cS = eChar.GetBaseActorValue("stamina")
					int x = Math.Floor(aEffect*eMOD)
					if x >= cS
						eChar.SetActorValue("stamina",0)
					else
						int y = Math.Floor(cS-x)
						eChar.SetActorValue("stamina",y)
					endIf
				endIf
			else ; if drain is FALSE
				; [][][] Currently Disabled
			endIf
		endIf
	endIf
endFunction
;end/

;ent/ ANIMcalc
Function ANIMcalc(string aPreset, actor[] animActor, bool aggressiveAct)
	if aPreset != "0" ; If preset is used
		if aPreset == "Combat"
			; [][][] Disabled
		elseIf aPreset == "Seduction"
			; [][][] Disabled
		else
			debug.trace("SuH ERROR : ANIMcalc aPreset was invalid", 2)
		endIf
	else ; If no preset is used (start up non-guided animation)
		if aggressiveAct ; if act is aggressive (animActor[1] is considered victim)
			int c0gender = SexLab.GetGender(animActor[0]) ; Get Attacker Gender
			int c1gender = SexLab.GetGender(animActor[1]) ; Get Victim Gender
			if c0gender == 1 ; Female Attacker
				if c1gender == 1 && SuH_SETallowfemalehomo.GetValue() ; Female
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2, "Lesbian", "",requireALL=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				elseif c1gender == 0 ; Male
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"Aggressive", "Lesbian", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				elseif c1gender == 2 ; Male Creature
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				elseif SuH_SETallowfemalehomo.GetValue() ; Female Creature
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				endIf
			elseIf c0gender == 0 ; Male Attacker
				if c1gender == 1 ; Female
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				elseif c1gender == 0 && SuH_SETallowmalehomo.GetValue() ; Male
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"Aggressive", "Lesbian", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				elseif c1gender == 2 && SuH_SETallowmalehomo.GetValue() ; Male Creature
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				else ; Female Creature
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				endIf
			elseif c0gender == 2 ; Male Creature Attacker
				if c1gender == 1 ; Female
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				elseIf c1gender == 0 && SuH_SETallowmalehomo.GetValue() ; Male
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				else
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				endIf
			else ; Female Creature Attacker
				if c1gender == 1 && SuH_SETallowfemalehomo.GetValue() ; Female
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				elseIf c1gender == 0 ; Male
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				else
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				endIf
			endIf
		elseif animActor.Length > 1 ; If there's more than 1 actor
			int c0gender = SexLab.GetGender(animActor[0]) ; Get char1 Gender
			int c1gender = SexLab.GetGender(animActor[1]) ; Get char2 Gender
			if c0gender == 1 ; Female char1
				if c1gender == 1 && SuH_SETallowfemalehomo.GetValue() ; Female char2
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"Lesbian", "", requireAll=true)
						SexLab.StartSex(animActor, animSET)
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				elseif c1gender == 0 ; Male 
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
						SexLab.StartSex(animActor, animSET)
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				elseif c1gender == 2 ; Male Creature 
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET)
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				elseif SuH_SETallowfemalehomo.GetValue() ; Female Creature 
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET)
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				endIf
			elseIf c0gender == 0 ; Male char1
				if c1gender == 1 ; Female 
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
						SexLab.StartSex(animActor, animSET)
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				elseif c1gender == 0 && SuH_SETallowmalehomo.GetValue() ; Male
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "Lesbian", requireAll=true)
						SexLab.StartSex(animActor, animSET)
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				elseif c1gender == 2 && SuH_SETallowmalehomo.GetValue() ; Male Creature Attacker
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET)
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				else ; Female Creature Attacker
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET)
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				endIf
			elseif c0gender == 2 ; Male Creature Attacker
				if c1gender == 1 ; Female
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				elseIf c1gender == 0 && SuH_SETallowmalehomo.GetValue() ; Male
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				else
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				endIf
			else ; Female Creature Attacker
				if c1gender == 1 && SuH_SETallowfemalehomo.GetValue() ; Female
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				elseIf c1gender == 0 ; Male
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				else
					bool c0valid = SexLab.IsValidActor(animActor[0])
					bool c1valid = SexLab.IsValidActor(animActor[1])
					if c0valid == TRUE && c1valid == TRUE ; If both actors are valid
						sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(2,"", "", requireAll=true)
						SexLab.StartSex(animActor, animSET, victim=animActor[1])
					else
						debug.trace("SuH : ANIMcalc actor was invalid")
					endIf
				endIf
			endIf
		else ; if there's only 1 actor
			bool c0valid = SexLab.IsValidActor(animActor[0])
			if c0valid == TRUE ; If actor is valid
				sslBaseAnimation[] animSET = SexLab.GetAnimationsByTags(1,"", "", requireAll=true)
				SexLab.StartSex(animActor, animSET)
			else
				debug.trace("SuH : ANIMcalc actor was invalid")
			endIf
		endIf
	endIf
endFunction
;end/