Jelajahi Sumber

Merge remote-tracking branch 'Milky_boobs/master'

KevinSmarts 3 tahun lalu
induk
melakukan
41d5f02d72
1 mengubah file dengan 38 tambahan dan 23 penghapusan
  1. 38 23
      locations/femcyc.qsrc

+ 38 - 23
locations/femcyc.qsrc

@@ -239,6 +239,8 @@ if Luth_Max = 0: LutH_Max = rand(312,360) & !! 13-15 days including ovulation
 if Foch_Max = 0: FocH_Max = rand(312,360) & !! 13-15 days including menstruation
 if Foch_Max = 0: FocH_Max = rand(312,360) & !! 13-15 days including menstruation
 
 
 if $ARGS[0] = '':
 if $ARGS[0] = '':
+	!!	calling the variable error handler, fixing variables here.
+	gs 'femcyc', 'femcyc_errhdl'
 	!{Hourly reduction in semen potency}
 	!{Hourly reduction in semen potency}
 	!{First it sets the array index to the first index, then it checks to be sure the array tracking the age is less than 144 hours. If it is 144 hours old, it kills that index, which should shift the index up. If it is less than 144 hours old, it sets a current potency drop. The drop is 2x or 3x regularly, but during ovulation it is only 1x, to represent the better environment from fertile cervical mucus.}
 	!{First it sets the array index to the first index, then it checks to be sure the array tracking the age is less than 144 hours. If it is 144 hours old, it kills that index, which should shift the index up. If it is less than 144 hours old, it sets a current potency drop. The drop is 2x or 3x regularly, but during ovulation it is only 1x, to represent the better environment from fertile cervical mucus.}
 	!{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.}
 	!{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.}
@@ -435,7 +437,7 @@ if $ARGS[0] = '':
 		cumsumbod = ctemp[0]
 		cumsumbod = ctemp[0]
 		cumsumvag = ctemp[1]
 		cumsumvag = ctemp[1]
 		cumsumass = ctemp[2]
 		cumsumass = ctemp[2]
-		KILLVAR 'ctemp'
+		killvar 'ctemp'
 	end
 	end
 	!!	Breastcycle. Every breast related change with lactation happens in here.
 	!!	Breastcycle. Every breast related change with lactation happens in here.
 	if cheat_NoLactation > 0:
 	if cheat_NoLactation > 0:
@@ -523,9 +525,9 @@ end
 if $ARGS[0] = 'cyc2':
 if $ARGS[0] = 'cyc2':
 	can_sz = arrsize('$cumarrnam')
 	can_sz = arrsize('$cumarrnam')
 	if Ovulate > 0 and can_sz > 0 and UnfertEgg > 0:
 	if Ovulate > 0 and can_sz > 0 and UnfertEgg > 0:
-		KILLVAR 'cumtime'
-		KILLVAR 'cumfthname'
-		KILLVAR '$wombpotfath'
+		killvar 'cumtime'
+		killvar 'cumfthname'
+		killvar '$wombpotfath'
 		$cumfthname[0] = 'unknown'
 		$cumfthname[0] = 'unknown'
 		cumtime[0] = 0
 		cumtime[0] = 0
 		can_idx = 0
 		can_idx = 0
@@ -588,7 +590,7 @@ if $ARGS[0] = 'cyc2':
 		end
 		end
 
 
 !!{Create lotto of potential fathers based on each potential fathers sperm as a percentage of the total. The higher percentage of sperm from a given father, the more lotto entries he will have.}
 !!{Create lotto of potential fathers based on each potential fathers sperm as a percentage of the total. The higher percentage of sperm from a given father, the more lotto entries he will have.}
-		KILLVAR '$cumfathlotto'
+		killvar '$cumfathlotto'
 		cfw_idx = 0
 		cfw_idx = 0
 		cfw_sz = arrsize('wombAmount')
 		cfw_sz = arrsize('wombAmount')
 		:FathLottoLoop
 		:FathLottoLoop
@@ -784,18 +786,18 @@ if $ARGS[0] = 'cyc3':
 		:lutcycloop
 		:lutcycloop
 		if rej_idx < rej_sz:
 		if rej_idx < rej_sz:
 			if Babyptype[rej_idx] = 0:
 			if Babyptype[rej_idx] = 0:
-				KILLVAR 'polkid',tempbabyi
-				KILLVAR '$kidname',tempbabyi
-				KILLVAR 'kidage',tempbabyi
-				KILLVAR 'daykid',tempbabyi
-				KILLVAR 'monthkid',tempbabyi
-				KILLVAR 'yearkid',tempbabyi
-				KILLVAR 'Babyptype',tempbabyi
-				KILLVAR '$ChildFath',tempbabyi
-				KILLVAR '$ChildThFath',tempbabyi
-				KILLVAR 'hairkid',tempbabyi
-				KILLVAR 'eyeskid',tempbabyi
-				KILLVAR 'cumarrcon',tempbabyi
+				killvar 'polkid',tempbabyi
+				killvar '$kidname',tempbabyi
+				killvar 'kidage',tempbabyi
+				killvar 'daykid',tempbabyi
+				killvar 'monthkid',tempbabyi
+				killvar 'yearkid',tempbabyi
+				killvar 'Babyptype',tempbabyi
+				killvar '$ChildFath',tempbabyi
+				killvar '$ChildThFath',tempbabyi
+				killvar 'hairkid',tempbabyi
+				killvar 'eyeskid',tempbabyi
+				killvar 'cumarrcon',tempbabyi
 				FertEgg -= 1
 				FertEgg -= 1
 			end
 			end
 			rej_idx += 1
 			rej_idx += 1
@@ -805,13 +807,13 @@ if $ARGS[0] = 'cyc3':
 		if preg = 1:
 		if preg = 1:
 			cycle = 5
 			cycle = 5
 		elseif menoage <= age:
 		elseif menoage <= age:
-			KILLVAR '$wombpotfath'
+			killvar '$wombpotfath'
 			killvar '$cumfthname'
 			killvar '$cumfthname'
 			killvar '$cumfthusedname'
 			killvar '$cumfthusedname'
 			killvar 'cumtime'
 			killvar 'cumtime'
 			cycle = 6
 			cycle = 6
 		else
 		else
-			KILLVAR '$wombpotfath'
+			killvar '$wombpotfath'
 			killvar '$cumfthname'
 			killvar '$cumfthname'
 			killvar '$cumfthusedname'
 			killvar '$cumfthusedname'
 			killvar 'cumtime'
 			killvar 'cumtime'
@@ -840,7 +842,7 @@ if $ARGS[0] = 'cyc3':
 			end
 			end
 		end
 		end
 	else
 	else
-		if preg = 1:PregChem += 1+pregspeedcheat
+		if preg = 1:PregChem += 1 + pregspeedcheat
 		if rand(0,100) < 100: LutH += 1
 		if rand(0,100) < 100: LutH += 1
 	end
 	end
 end
 end
@@ -898,7 +900,7 @@ if $ARGS[0] = 'preg':
 		!!	switch on lactation if not already active.
 		!!	switch on lactation if not already active.
 		if lactation['active'] < 1: func('lact_lib','lact_switch')
 		if lactation['active'] < 1: func('lact_lib','lact_switch')
 		$cycreport_txt = 'In labour'
 		$cycreport_txt = 'In labour'
-		arrmodtmp =arrsize('$ChildFath')
+		arrmodtmp = arrsize('$ChildFath')
 		arrmodtmp -= (babyembryo+1)
 		arrmodtmp -= (babyembryo+1)
 		:babyfinalpreploop
 		:babyfinalpreploop
 		if arrmodtmp < arrsize('$ChildFath') and daykid[arrmodtmp] = 0:
 		if arrmodtmp < arrsize('$ChildFath') and daykid[arrmodtmp] = 0:
@@ -907,8 +909,8 @@ if $ARGS[0] = 'preg':
 			arrmodtmp += 1
 			arrmodtmp += 1
 			jump 'babyfinalpreploop'
 			jump 'babyfinalpreploop'
 		end
 		end
-		KILLVAR '$wombpotfath'
-		KILLVAR '$wombthfath'
+		killvar '$wombpotfath'
+		killvar '$wombthfath'
 		preg = 2
 		preg = 2
 		pregminut = totminut + 1440
 		pregminut = totminut + 1440
 		if babyembryo > 1:
 		if babyembryo > 1:
@@ -938,5 +940,18 @@ if $ARGS[0] = 'preg':
 	end
 	end
 end
 end
 
 
+!!	Variable error handler for femcyc. Checking if variables are out of range and resets them.
+if $ARGS[0] = 'femcyc_errhdl':
+	if cycle < 0 or cycle > 6: cycle = 0
+	if rcntorgzmtmp < 0 or rcntorgzmtmp > 1: rcntorgzmtmp = 0
+	if rcntorgzm < 0 or rcntorgzm > 1: rcntorgzm = 0
+	if PregChem < 0: PregChem = 0
+	if preg < 0 or preg > 2: preg = 0
+	if ferteggage < 0: ferteggage = 0
+	if EggRH < 0: EggRH = 0
+	if FocH < 0: FocH = 0
+	if FertEgg < 0: FertEgg = 0
+end
+
 --- femcyc ---------------------------------
 --- femcyc ---------------------------------