Browse Source

[fix] streamlined some of the variables. Variables were writtin in lower case and upper case and then in full lower case again.
[documentation] Added variable and function documentation to the file. Some explanations are still missing. Will be added later.

sandra_schulz 3 years ago
parent
commit
e1ff748910
1 changed files with 247 additions and 19 deletions
  1. 247 19
      locations/femcyc.qsrc

+ 247 - 19
locations/femcyc.qsrc

@@ -1,10 +1,238 @@
 # femcyc
 
-!! important values for pillcon
-!!at 7000 pillcon sveta will begin slowing down the build up of hormone to release eggs - see cyc1
-!!at 20000 pillcon sveta will very rarely even build up hormone to release eggs but its random so it can still happen anyways - see cyc1 and cyc2
-!!at 26000 pillcon sveta only has a 1/400 chance of even releasing an egg at all even if she does build up enough hormone - see cyc2
-!!at 38000 pillcon sveta no longer has periods at all and cannot get pregnant anymore -- see cyc3
+!!
+!!	THIS IS A CORE FILE TO GAME MECHANICS. Please edit CAREFULLY, and leave as many comments as possible!!
+!!
+!!------------------------------------------------------------------------------------------------------------
+!!	femcyc documentation
+!!------------------------------------------------------------------------------------------------------------
+!!
+!!	The femcyc functions try to reproduce a realistic mentruation cycle as well as the proper
+!!	pregnancy of Sveta and the mostly realistic semen absorption/decay cycle.
+!!	The below will explain every variable in use as well as every function and the general construct.
+!!	The femcyc is a highly complex and confusing collection of calculations. So if you do not understand
+!!	it, it is best to leave it alone.
+!!
+!!------------------------------------------------------------------------------------------------------------
+!!
+!!	LutH_Max : maximum Luteal time (in hours)
+!!	FocH_Max : maximum Follicular time (in hours)
+!!	pillcon : variable for contraceptive pills to prevent pregnancy. More on that below.
+!!	rcntorgzm : determine wether Sveta had an orgasm withhin the last hour or not (1 or 0)
+!!	rcntorgzmtmp : temp variable to rewrite to rcntorgzm
+!!	cumarr_idx : cum array index, used to identify how much cum is stored in the cum arrays
+!!	cumpdrop : used for calculation of drop in cum current potential
+!!	succubusflag : used for succubus story arc. If Sveta is a succubus, the sperm will be absorbed
+!!	succycletmp : succubus cycle temp var. Used during sperm absorption function.
+!!	sexnutrition : succubus sex nutrition
+!!	succublvl : succubus level (obviously)
+!!	succubxp : succubus experience
+!!	sucabscum : was cum absorbed by succubus? (1 or 0)
+!!	cumarrtemp : another temp var for cum arrays
+!!	cumcondslip : Introduced in Cum_Manage.qsrc. Did the condom slip off?
+!!	cumcondslip_aware : is Sveta aware it slipped?
+!!	sparrtmpv : temp var for spatter arrays for temporary array index tracking
+!!	cumsumvag : sum of cum on vagina
+!!	cumsumass : sum of cum on ass
+!!	cumsumbod : sum of cum on body
+!!	ctemp : temporay array for cum ammount
+!!	cycle : current state of svetas cycle, can be 0 to 5. 0 to 4 are usual mentruation cycles including fertilization. 5 is for the status 'pregnant'.
+!!	mesec : variable for menstruation
+!!	lastmens : timestamp of last menstruation
+!!	EggRH : The egg counter. Some kind of egg age. Used for various functions.
+!!	FocH : Follicular counter. Hour counter for follicular phase.
+!!	temprand : used as temp var for randomizer
+!!	sterileov : sterile ovulation. used for negative effects on ovulation.
+!!	tempovbonus : temp var for ovulation bonus. Fertility bonus.
+!!	lastovulation : used to store the last ovulation date
+!!	Ovulate : used to trigger ovulation
+!!	ferteggage : fertile egg age. used to check age of the egg (in hours)
+!!	can_sz : has array size of cumarrnam[], used to check if there is cum in the womb.
+!!	UnfertEgg : Unfertilized Egg. Is there an unfertilized egg in the womb?
+!!	cumtime[] : array to store how many times someone came in Sveta. More cumtime means more possibility to be the father.
+!!	can_idx : candidate index - the index for the possible father
+!!	cum_total : how many amounts of cum are in svetas womb
+!!	y : used as temp for a loop
+!!	x : used as temp for a loop
+!!	z : used as temp for a loop
+!!	$wombDNA : sperm in womb potent enough to cause pregnancy
+!!	wombAmount : how potent is the sperm of a guy
+!!	$wombName : the name of the NPC	
+!!	$wombpotfath : the name of the potential father, if sveta is not sure
+!!	$cumfthname : the name of the father if sveta is sure
+!!	cfw_idx : used for the sperm lotto. Index for the father
+!!	cfw_sz : used for the sperm lotto. amount of semen in womb
+!!	cfl_ct : cum father lotto counter. used in a loop
+!!	cumfathlotto[] : used to figure out the name of the father in the sperm lotto
+!!	cumfatherDNA[] : used to figure out the DNA of the father in the sperm lotto
+!!	egg_idx : egg index. There could be more than one egg in Svetas womb, so the eggs have an index
+!!	egg_sz : var to store amount of unfertilized eggs
+!!	fert_thresh : the threshold of an egg to be fertilized. Modified by being on contraceptives and negative factors.
+!!	broodcurse : some modifier for fertility - brood curse
+!!	steriletu : sterilized?
+!!	lotto_idx : lotto index. Used to randomly pick a sperm.
+!!	FertEgg : fertilized egg counter. There can be up to 3 according to the code.
+!!	nextbaby : index for babies.
+!!	$ChildFath :
+!!	$ChildFathDNA :
+!!	$ChildThFath :
+!!	$childtype :
+!!	$cycreport_txt :
+!!	$d_cycreport_update :
+!!	$d_pregmovement :
+!!	$kid_dna :
+!!	$kidname :
+!!	$npc_dna :
+!!	$pcs_dna :
+!!	arrmodtmp :
+!!	babyembryo :
+!!	Babyptype :
+!!	cfl_idx :
+!!	cfl_sz :
+!!	ChildConType:
+!!	cyccustom :
+!!	daykid :
+!!	daylastperiod :
+!!	eyeskid :
+!!	firstmens :
+!!	hairkid :
+!!	imp_rand :
+!!	implant_day :
+!!	implant_hour :
+!!	implant_idx :
+!!	implant_sz :
+!!	isprok :
+!!	kid :
+!!	kidage :
+!!	knowpregloss :
+!!	knowpregrecover :
+!!	lactation[] : The lactation array. More on that in lact_lib
+!!	LutH :
+!!	menoage :
+!!	monthkid :
+!!	polkid :
+!!	preg :
+!!	PregChem :
+!!	pregminut :
+!!	pregspeedcheat :
+!!	RecovH :
+!!	rej_idx :
+!!	rej_sz :
+!!	sterilewb : sterile womb
+!!	tempbabyi :
+!!	tempwbbonus :
+!!	totminut :
+!!	yearkid :
+!!	$d_cycreport_update
+!!
+!!	Cum Array indices (taken from Cum_Manage.qsrc):
+!!
+!!	cumarrnam : Sperm Owner
+!!	cumarrppt : Sperm Potential Potency (max sperm delivery)
+!!	cumarrcpt : Sperm Current Potency	(current amount of sperm)
+!!	cumarrdel : Sperm "Delivery" (method of *VAGINAL ONLY* acquisition)
+!!	cumarrcon :	Contraception typ used
+!!	cumarrage : Sperm age in hours
+!!	cumarrkno : Did you know/realize who did it?
+!!	cumarrcnt : Unique identifier of the exact which time the MC has had this sperm incident occur.
+!!
+!!	Spatter Array indices (taken from Cum_Manage.qsrc):
+!!
+!!	sparrloc : Location of the sperm, as per cumarrdel
+!!	sparrnam : Spatter Owner
+!!	sparrppt : Spatter Potential Potency (Used to increase potency if you don't clean yourself out)
+!!	sparridt : Did you know/realize who did it?
+!!	sparrvol : Volume of the spatter. 40 is average.
+!!	sparrslc : Spread status of the spatter. High volume can spread the contaminant from it's starting place.
+!!	sparrcnt : Unique identifier of the exact which time the MC has had this spatter incident occur.
+!!
+!!	Values of 'cumarrdel' as defined by the cum_arr (taken from Cum_Manage.qsrc):
+!!
+!!	cumarrdel = 0 : 'Vaginal intercourse'
+!!	cumarrdel = 1 : 'From spatter on labia'
+!!	cumarrdel = 2 : 'From the anal area'
+!!	cumarrdel = 3 : 'From sperm on clothing'
+!!	cumarrdel = 4 : 'From sperm on fingers'
+!!	cumarrdel = 5 : 'From sperm on wipes'
+!!	cumarrdel = 6 : 'Unknown'
+!!
+!!	Values of 'cumarrcon' as defined by the cum_arr (taken from Cum_Manage.qsrc):
+!!
+!!	cumarrcon = 0: 'No contraception used'
+!!	cumarrcon = 1: 'You lied about being on the pill'
+!!	cumarrcon = 2: 'You were on the pill'
+!!	cumarrcon = 3: 'You used a condom'
+!!	cumarrcon = 4: 'The condom broke'
+!!	cumarrcon = 5: 'The condom slipped off inside you'
+!!	cumarrcon = 6: 'The condom was sabotaged by someone else'
+!!	cumarrcon = 7: 'You sabotaged the condom'
+!!	cumarrcon = 8: 'Precum had sperm in it'
+!!	cumarrcon = 9: 'You believe are sterile'
+!!
+!!	Values of 'cumarrkno' as defined by the cum_arr (taken from Cum_Manage.qsrc):
+!!
+!!	cumarrkno = -2 : 'You were unaware there was sperm in you'
+!!	cumarrkno = -1 : 'You do not think that any sperm has gotten into you'
+!!	cumarrkno =  0 : 'You know somebody got sperm in you, but you don''t know that person'
+!!	cumarrkno =  1 : 'You know who got sperm in you'
+!!
+!!	Setting for no STD checks
+!!
+!!	cumnostd = 1 : No risk of STD, resets at end of file so must be used for all related cum_management calls
+!!
+!!	0 = 'In your Vagina'
+!!	1 = 'On your labia'
+!!	2 = 'On your panties over your vagina'
+!!	3 = 'In your anus'
+!!	4 = 'On your butt'
+!!	5 = 'On your panties over your butt'
+!!	6 = 'On your clothes in your groin area'
+!!	7 = 'On your clothes'
+!!	8 = 'On your back'
+!!	9 = 'On your legs'
+!!	10 = 'On your arms'
+!!	11 = 'On your face'
+!!	12 = 'Inside your mouth'
+!!	13 = 'On your hands'
+!!	14 = 'On your stomach'
+!!	15 = 'On your breasts'
+!!	16 = 'In your hair'
+!!	17 = 'In a condom in your vagina'
+!!------------------------------------------------------------------------------------------------------------
+!!	important values for pillcon
+!!------------------------------------------------------------------------------------------------------------
+!!	at 7000 pillcon sveta will begin slowing down the build up of hormone to release eggs - see cyc1
+!!	at 20000 pillcon sveta will very rarely even build up hormone to release eggs but its random so it can still happen anyways - see cyc1 and cyc2
+!!	at 26000 pillcon sveta only has a 1/400 chance of even releasing an egg at all even if she does build up enough hormone - see cyc2
+!!	at 38000 pillcon sveta no longer has periods at all and cannot get pregnant anymore -- see cyc3
+!!------------------------------------------------------------------------------------------------------------
+!!	Functions
+!!------------------------------------------------------------------------------------------------------------
+!!	Default :
+!!	- Hourly reduction in semen potency and semen absorption.
+!!	- Hourly call for the breastcycle, managing lactation and changes in the breasts.
+!!	- Hourly call of Svetas cycle via cycle variable.
+!!
+!!	cyc0:
+!!	- Handles actions from Menstruation to Follicular.
+!!
+!!	cyc1:
+!!	- Handles actions from Follicular to Ovulation.
+!!
+!!	cyc2:
+!!	- Handles actions for the Fertilization.
+!!
+!!	cyc3:
+!!	- handles actions from Luteal to Menstration or Pregnancy.
+!!
+!!	cyc4:
+!!	- handles actions from (post pregnancy) Recovery to Follicular..
+!!
+!!	preg:
+!!	- handles actions for the Pregnancy Progression.
+!!------------------------------------------------------------------------------------------------------------
+
+
 
 !! I have to initialize the variables somewhere, maybe in preCUST?
 if Luth_Max = 0: LutH_Max = rand(312,360) & !! 13-15 days including ovulation
@@ -16,7 +244,7 @@ if $ARGS[0] = '':
 	!{144 hours was selected due to that being approximately the maximum amount of time sperm is viable in the womb (120 would be more accurate, but there is leeway). PLEASE DO NOT CHANGE IT.}
 	!{The potency drop may seem small in game-time, but is meant to be a reasonable approximation to real life. Avoid unprotected sex within 5 days of ovulation if you want to mitigate your risk.}
 	!{the 'rcntorgzm' variable is set to determine whether Sveta has orgasmed within the last hour. If she has, a small potency boost for the guys she has slept with in that hour.}
-
+	
 	if rcntorgzm = 1:
 		if rcntorgzmtmp = 1: rcntorgzm = 0 & rcntorgzmtmp = 0
 		if rcntorgzmtmp = 0: rcntorgzmtmp = 1
@@ -272,13 +500,13 @@ if $ARGS[0] = 'cyc1':
 		!! the setting of the max_time can be here although it can be changed in the future
 		LutH_Max = rand(312,360) & !! 13-15 days including ovulation
 		!{If you are ready to ovulate, it creates a chance to double ovulate. That chance is increased by your age. Then it does the same for a triple ovulation. Then it sets the ovulation tag, ovulation hour count, and begins a ticker for the life of the eggs.}
-		Temprand = rand(0,20)
-		Temprand += age/15
-		Temprand -= pillcon/1000
+		temprand = rand(0,20)
+		temprand += age/15
+		temprand -= pillcon/1000
 		if temprand > 20:
 			EggRH += 205
-			Temprand = rand(0,20)
-			Temprand += age/15
+			temprand = rand(0,20)
+			temprand += age/15
 			if temprand > 20: EggRH += 410
 		end
 		FocH = 0
@@ -418,7 +646,7 @@ if $ARGS[0] = 'cyc2':
 				hairkid[nextbaby] = rand(0, 3)
 				eyeskid[nextbaby] = rand(0, 3)
 				ChildConType[nextbaby] = cumarrcon[nextbaby]
-				if fertegg > 1:
+				if FertEgg > 1:
 					$childtype[nextbaby] = 'fraternal twin'
 					$childtype[nextbaby-1] = 'fraternal twin'
 				else
@@ -435,7 +663,7 @@ if $ARGS[0] = 'cyc2':
 !!{Ovulation to Luteal. It checks to see if you are on the ovulation cycle. If you are, it checks you for your pillcon. If it is high enough, no egg is released. Under high concentrations of pill chemical, ovulation ticks away quicker. Otherwise, it checks to see if your ovulation hormone is high enough, and if it is it gives you an egg and drops a good chunk down on your ovulation hormone. if its still high, it drops another egg. Then it checks your ovulation hours. If its down to 0, it starts the Luteal phase. Otherwise, it adds an hour to the egg age and reduces the ovulation window by an hour.}
 	if pillcon > 26000 and rand(0,400) ! 0: EggRH = 0
 	:OviLoop
-	If EggRH > ((UnfertEgg + FertEgg) * 150):
+	if EggRH > ((UnfertEgg + FertEgg) * 150):
 		UnfertEgg += 1
 		EggRH -= (200 * UnfertEgg)
 		jump 'OviLoop'
@@ -444,9 +672,9 @@ if $ARGS[0] = 'cyc2':
 		cycle = 3
 		UnfertEgg = 0
 	end
-	if fertegg = 1 and ferteggage < 330:
+	if FertEgg = 1 and ferteggage < 330:
 		if rand(0,(2000 - age*20)) = 0:
-			fertegg += 1
+			FertEgg += 1
 			nextbaby = arrsize('$ChildFath')
 			polkid[nextbaby] = polkid[nextbaby-1]
 			$kidname[nextbaby] = 'unborn'
@@ -476,9 +704,9 @@ end
 !{Otherwise, it adds your womb sterility factor to the imp_rand. Then it checks if your imp_rand crosses a threshold for implantation. Younger women implant easier. It then sets the next baby to the next unimplanted baby in your kid array. It registers the kid as a normal pregnancy, removes a fertilized egg and adds an embryo. Then it adds some pregnancy hormone if you arent already pregnant, and calls you officially pregnant.}
 
 if $ARGS[0] = 'cyc3':
-	if fertegg = 1 and ferteggage < 330:
+	if FertEgg = 1 and ferteggage < 330:
 		if rand(0,(2000 - age*20)) = 0:
-			fertegg += 1
+			FertEgg += 1
 			nextbaby = arrsize('$ChildFath')
 			polkid[nextbaby] = polkid[nextbaby-1]
 			$kidname[nextbaby] = 'unborn'
@@ -642,7 +870,7 @@ end
 !{Pregnancy Progression. It checks to see if you are in the pregnancy phase of a cycle. If you are, it progresses your pregnancy chemical. Then it gives a fluxuation of possible due dates. If you cross the due date threshold, you enter labor, marked by preg = 2. Other milestones will also be placed in here, including body deformations. Right now this is mostly an empty placeholder.}
 
 if $ARGS[0] = 'preg':
-	if fertegg = 1 and ferteggage < 330:
+	if FertEgg = 1 and ferteggage < 330:
 		if rand(0,(2000 - age*20)) = 0:
 			babyembryo += 1
 			PregChem += rand(10,30)
@@ -702,7 +930,7 @@ if $ARGS[0] = 'preg':
 		'You need to get to a clinic.'
 	end
 	if PregChem > 2203:
-		if pregchem > 2853 or kid > 0:
+		if PregChem > 2853 or kid > 0:
 			if rand(0,7) = 0: dynamic $d_pregmovement
 		else
 			if rand(0,500) = 0: dynamic $d_pregmovement