1
0
Quellcode durchsuchen

[fixes] Fixes to the menstrual checks and difficult setting from Drugas

KevinSmarts vor 4 Jahren
Ursprung
Commit
807901fcd2

+ 27 - 0
locations/Cheatmenu_din.qsrc

@@ -2469,20 +2469,37 @@ $cheatmenu['vartracker'] = {
 	'Kirill''s Relationship (Kirill): <<Kirill>>'
 	'Kirill''s Corruption (Kirill_Crpt): <<Kirill_Crpt>>'
 	'children: <<kid>>'
+	!! BabyEmbryo is for how many unborn babies inside PC.
 	'fetus number: <<BabyEmbryo>>'
+	!! preg is your pregnancy state. 0 is not pregnant, 1 is pregnant in general, 2 is in labor. 
 	'pregnancy state: <<preg>>'
+	!! thinkpreg is if svetka thinks she is pregnant
 	'thinkpreg: <<thinkpreg>>'
+	!! knowpreg is for solid proof svetlana is pregnant, like a pregnancy test.
 	'knowpreg: <<knowpreg>>'
+	!! knowpregrecover is for Svetlanas knowledge that she just gave birth.
 	'knowpregrecover: <<knowpregrecover>>'
+	!! knowpregloss is for Svetlanas knowledge that she lost a baby. 1 is for an abortion, 2 is for a miscarrage. 
+	knowpregloss: <<knowpregloss>>'
+	!! cycle is Svetlanas current fertility cycle. 5 is pregnant, 4 is recovering, 3 is luteal, 2 is ovulation, 1 is foccular, 0 is menstration. 
 	'cycle: <<cycle>>'
+	!! menoage is the age Svetlana will be when she goes through menopause.
 	'menoage: <<menoage>>'
+	!! age is how old Svetlana is in years.
 	'age: <<age>>'
+	!! mesec is for how many hours of bleeding Svetlana has left in her current fertility cycle
 	'mesec: <<mesec>>'
+	!! FocH is for how many hours of Foccular cycle Svetlana has gone through in her current fertility cycle. Focular starts at the end of her Luteal and contains the bleeding period in Svetkas cycle.
 	'FocH: <<FocH>>'
+	!! EggRH is for the level of egg release that Svetlana has for her ovulation event. 150 generates a single egg, higher amounts might release more.
 	'EggRH: <<EggRH>>'
+	!! Ovulate is the amount of hours remaining in Svetlanas ovulation period of her current fertility cycle. 
 	'Ovulate: <<Ovulate>>'
+	!! UnfertEgg is how many unfertilized eggs Svetlana has in her for fertilization during her Ovulation period. Unfertilized eggs are removed at the end of her Ovulation period.
 	'UnfertEgg: <<UnfertEgg>>'
+	!! FertEgg is how many unimplanted eggs Svetlana has in her. These are possible babies, but they die 330 hours after ovulation if they do not implant.
 	'FertEgg: <<FertEgg>>'
+	!! babyptype is the pregnancy type of unborn babies. they might be unimplanted 0, healthy 1, or Ectopic 2. Future pregnancy complications should use this variable
 	if FertEgg > 0:
 		i = arrpos('$kidname','unborn')
 		imax = arrsize('$kidname')-1
@@ -2492,14 +2509,24 @@ $cheatmenu['vartracker'] = {
 		killvar 'i'
 		killvar 'imax'
 	end
+	!! BabyEmbryo is for implanted babies. These are solid pregnancies. 
 	'Implanted Embryos: <<BabyEmbryo>>'
+	!! ferteggage is for the time since the ovulation event. They last 330 hours before they die if not implanted.
 	'ferteggage: <<ferteggage>>'
+	!! PregChem is the level of pregnancy, measured in hour parts. 
 	'PregChem: <<PregChem>>'
+	!! pillcon is the level of birth control to prevent svetlana from getting pregnant. Higher concentrations increase effectivity until it reaches it's ideal level.
 	'pillcon: <<pillcon>>'
+	!! believed pillcon is the level of birth control svetlana thinks she has. This may be different from the actual level due to sabotage or a bad habit of not taking your pill.
 	'Believed pillcon: <<pillcon2>>'
+	!! RecovH is the amount of recover hours before Svetlanas fertility cycle resets after having a baby.
 	'RecovH: <<RecovH>>'
+	!! daylastperiod is for Svetlanas knowledge on when she began her last period
 	'daylastperiod: <<daylastperiod>> (daystart difference: <<daystart-daylastperiod>>)'
+	!! lastmens is for the last day that Svetlana bled during her last cycle.
 	'lastmens: <<lastmens>>'
+	!! firstmens is for the first day that Svetlana bled during her last cycle. this is different than daylastperiod because this is the actual date, while daylastperiod is when Svetlana remembers it being.
+	'firstmens: <<lastmens>> (daystart difference: <<daystart-firstmens>>)'
 	'hypnoTime: <<hypnoTime>>'
 	'hypnoStrength: <<hypnoStrength>>'
 	'hypnoDay: <<hypnoDay>>'

+ 65 - 0
locations/difficulty.qsrc

@@ -0,0 +1,65 @@
+# _difficulty
+
+if difficulty = 0:
+	difficulty = 3
+end
+
+if $ARGS[0] = 'setdifficulty':
+	difficulty = 3 & cyccustom = 0
+	if $ARGS[1] = 'easy peasy': difficulty = 1 & cyccustom = 1
+	if $ARGS[1] = 'relaxed': difficulty = 2 & cyccustom = 1
+	if $ARGS[1] = 'hardcore': difficulty = 4 & cyccustom = 0
+end		
+
+!! following function returns the current difficulty
+if $ARGS[0] = 'getdifficulty':
+	$result = 'realistic'
+	if difficulty = 1:	$result = 'easy peasy'
+	if difficulty = 2:	$result = 'relaxed'
+	if difficulty = 4:	$result = 'hardcore'
+end &! --- getdifficulty ---
+		
+
+!! following function returns the basic adjustment for stat gain via exp.
+!! hardcore: 80
+!! realistic: 60
+!! relaxed: 40
+!! easy peasy: 20
+!! use func('_difficulty','getexpadj')
+if $ARGS[0] = 'getexpadj':
+	!!Trait ''Everything is new again'', gained from the cursed school boy start
+	if csb_start = 1 and daystart <= 84: 
+		result = 10 * difficulty
+	else
+		result = 20 * difficulty
+	end
+end &! --- getexpadj ---
+
+!! following function adjusts money gain by difficulty.
+!! use func('_difficulty','addmoney', x) with x being the base amount (for 'realistic' difficulty)
+if $ARGS[0] = 'addmoney':
+	money += (ARGS[1] * (5-difficulty)) / 2
+end &! --- addmoney ---
+
+!! following function returns the adjusted money added (e.g. for displaying the correct amount of money earnt in texts)
+!! use func('_difficulty','addmoneystring', x) with x being the base amount (for 'realistic' difficulty)
+if $ARGS[0] = 'addmoneystring':
+	result = (ARGS[1] * (5-difficulty)) / 2
+end &! --- addmoneystring ---
+
+!! following function adjusts money spent by difficulty.
+!! use func('_difficulty','spendmoney', x) with x being the base amount (for 'realistic' difficulty)
+if $ARGS[0] = 'spendmoney':
+	money -= (ARGS[1] * (difficulty + 1)) / 4
+end &! --- spendmoney ---
+
+
+!! following function returns the adjusted money spent (e.g. for displaying the correct price in shops)
+!! use func('_difficulty','spendmoneystring', x) with x being the base amount (for 'realistic' difficulty)
+if $ARGS[0] = 'spendmoneystring':
+	result = (ARGS[1] * (difficulty + 1)) / 4
+end &! --- spendmoneystring ---
+
+
+--- _difficulty ---------------------------------
+

+ 51 - 18
locations/din_bad.qsrc

@@ -493,11 +493,16 @@ $d_cycreport_choice = {
 		if thinkpreg = 0:
 			if knowpreg = 1:
 				'<a href="exec: dynamic $d_cycreport_actor, 2 & gs ''stat''">I''m pregnant.</a>'
+				'<a href="exec: dynamic $d_cycreport_actor, 1 & gs ''stat''">I can''t be pregnant no matter the evidence.</a>'
 			else
 				'<a href="exec: dynamic $d_cycreport_actor, 2 & gs ''stat''">I think I''m pregnant.</a>'
 			end
 		elseif thinkpreg = 1:
-			'<a href="exec: dynamic $d_cycreport_actor, 1 & gs ''stat''">I''m not pregnant.</a>'
+			if knowpreg = 1:
+				'<a href="exec: dynamic $d_cycreport_actor, 1 & gs ''stat''">I can''t be pregnant no matter the evidence.</a>'
+			else
+				'<a href="exec: dynamic $d_cycreport_actor, 1 & gs ''stat''">I''m not pregnant.</a>'
+			end
 		end
 		if mesec > 0 and thinkpreg ! 1 and knowpreg ! 1:
 			'<a href="exec: dynamic $d_cycreport_actor, 3">I''m menstruating.</a>'
@@ -509,6 +514,11 @@ $d_cycreport_choice = {
 			'<a href="exec: dynamic $d_cycreport_actor, 6">I think my due date is...</a>'
 			'<a href="exec: dynamic $d_cycreport_actor, 7">I think the father is...</a>'
 		end
+		if knowpregloss = 1:
+			'<a href="exec: dynamic $d_cycreport_actor, 8">I just had an abortion.</a>'
+		elseif knowpregloss > 1 or thinkpreg = 1:
+			'<a href="exec: dynamic $d_cycreport_actor, 8">I think I lost a baby.</a>'
+		end
 	elseif cycle = 5:
 		'Broken water and contractions, it''s pretty clear what is going on. You need to get to a hospital ASAP.'
 	else
@@ -519,24 +529,27 @@ $d_cycreport_choice = {
 }
 
 $d_cycreport_actor = {
+	!! Svetlana has decided she is not pregnant
 	if ARGS[0] = 1:
+		$cycreport_txt = 'It has been <<temp>> days since you last remember having a period.'
 		if knowpreg = 1:
 			denypreg = 1
 			thinkpreg = 0
 		else
 			denypreg = 0
 			thinkpreg = 0
-			temp[1] = daystart - daylastperiod
 		end
 		dynamic $d_cycreport_update
 		gs 'stat'
 		dynamic $d_cycreport_choice
+	!! Svetlana has decided she is pregnant.
 	elseif ARGS[0] = 2:
 		thinkpreg = 1
 		denypreg = 0
 		dynamic $d_cycreport_update
 		gs 'stat'
 		dynamic $d_cycreport_choice
+	!! Svetlana is Menstrating. 
 	elseif ARGS[0] = 3:
 		thinkpreg = 0
 		denypreg = 0
@@ -544,6 +557,7 @@ $d_cycreport_actor = {
 		dynamic $d_cycreport_update
 		gs 'stat'
 		dynamic $d_cycreport_choice
+	!! Svetlana is remembering her last period. 
 	elseif ARGS[0] = 4:
 		thinkpreg = 0
 		denypreg = 0
@@ -553,16 +567,22 @@ $d_cycreport_actor = {
 		'<td width="250" cellspacing="0" cellpadding="0" valign="top">'
 		'How many days ago was it you had your last period?'
 		'Currently: <<pertemp>>'
-		'<a href="exec: pertemp += 1 & dynamic $d_cycreport_actor, 4">+1</a> <a href="exec: pertemp += 5 & dynamic $d_cycreport_actor, 4">+5</a> <a href="exec: pertemp += 10 & dynamic $d_cycreport_actor, 4">+10</a> <a href="exec: pertemp = 0 & dynamic $d_cycreport_actor, 4">Reset</a> <a href="exec: daylastperiod = daystart - pertemp & dynamic $d_cycreport_update & gs ''stat'' & dynamic $d_cycreport_choice">Accept</a>'
+		'<a href="exec: pertemp += 1 & dynamic $d_cycreport_actor, 4">+1</a> <a href="exec: pertemp += 5 & dynamic $d_cycreport_actor, 4">+5</a> <a href="exec: pertemp += 10 & dynamic $d_cycreport_actor, 4">+10</a> <a href="exec: pertemp = 0 & dynamic $d_cycreport_actor, 4">Reset</a> <a href="exec: daylastperiod = (daystart - pertemp) & dynamic $d_cycreport_update & gs ''stat'' & dynamic $d_cycreport_choice">Accept</a>'
 		act 'Return':dynamic $d_cycreport_choice
 		act 'Exit':gs 'stat' & gt $loc, $metka
 		'</td></tr></table></center>'
+	!! Svetlana thinks she doesn't have periods anymore. Good birth control has this effect (as does pregnancy.)
 	elseif ARGS[0] = 5:
+		if knowpreg = 1:
+			denypreg = 1
+		else
+			denypreg = 0
+		end
 		thinkpreg = 0
-		denypreg = 0
 		$cycreport_txt = 'You do not believe you have periods any more.'
 		gs 'stat'
 		dynamic $d_cycreport_choice
+	!! Svetlana is trying to figure out her due date.
 	elseif ARGS[0] = 6:
 		*clr & cla
 		'<center><h1>Fertility Cycle</h1></center>'
@@ -574,6 +594,7 @@ $d_cycreport_actor = {
 		act 'Return':dynamic $d_cycreport_choice
 		act 'Exit':gs 'stat' & gt $loc, $metka
 		'</td></tr></table></center>'
+	!! Svetlana is trying to guess who is the babydaddy.
 	elseif ARGS[0] = 7:
 		*clr & cla
 		'<center><h1>Fertility Cycle</h1></center>'
@@ -634,7 +655,14 @@ $d_cycreport_actor = {
 		killvar 'tempmax'
 		killvar 'tempcurr'
 		}
-		
+	!! Just recently lost a baby to abortion, miscarriage, or think you did because your period finally arrived.
+	elseif ARGS[0] = 8:
+		thinkpreg = 0
+		$cycreport_txt = 'Your body is recovering from the trauma of pregnancy after your miscarrage.'
+		dynamic $d_cycreport_update
+		gs 'stat'
+		dynamic $d_cycreport_choice
+	!! Just recently gave birth.
 	elseif ARGS[0] = 10:
 		temp = arrsize('Babyptype')
 		temp -= 1
@@ -646,8 +674,9 @@ $d_cycreport_actor = {
 $d_cycreport_update = {
 	killvar 'temp'
 	if thinkpreg = 1 or knowpreg = 1: dynamic $d_cycreport_upduedate
-	if mesec > 0:
-		$cycreport_txt = 'You are currently on your period.'
+	!! Vagblood in a future update to account for babydamage and miscarrages.
+	if mesec > 0 or vagblood > 0:
+		$cycreport_txt = 'You are currently bleeding.'
 	else
 		if cyccustom = 1:
 			if preg = 1 and knowpreg = 1:
@@ -656,27 +685,29 @@ $d_cycreport_update = {
 					$cycreport_txt = '<<$cycreport_txt>> You suspect the father being <<$wombthfath>>.'
 				end
 			elseif knowpregloss = 1:
-				$cycreport_txt = 'Your body is recovering from the trauma of pregnancy.'
+				$cycreport_txt = 'Your body is recovering from the trauma of pregnancy after your abortion.'
+			elseif knowpregloss = 2:
+				$cycreport_txt = 'Your body is recovering from the trauma of pregnancy after your miscarrage.'
 			elseif knowpregrecover = 1:
 				$cycreport_txt = 'Your body is recovering from the trauma of childbirth.'
 			elseif menoage <= age and cycle = 6:
 				$cycreport_txt = 'You have gone through menopause.'
 			else
-				temp[1] = daystart-lastmens
+				temp[1] = daystart-daylastperiod
 				if tabletkishot > 0:
-					$cycreport_txt = 'It has been <<temp[1]>> days since you last had a period. <font color=green>You are currently protected by a birth control shot.</font>'
+					$cycreport_txt = 'It has been <<temp[1]>> days since the start of your last period. <font color=green>You are currently protected by a birth control shot.</font>'
 				elseif pillcon2 > 30000:
-					$cycreport_txt = 'It has been <<temp[1]>> days since you last had a period. <font color=green>You are currently on the birth control pill.</font>'
+					$cycreport_txt = 'It has been <<temp[1]>> days since the start of your last period. <font color=green>You are currently on the birth control pill.</font>'
 				elseif pillcon2 > 8000 and ((FocH > (Foch_Max - 96)) or ovulate > 0):
-					$cycreport_txt = 'It has been <<temp[1]>> days since you last had a period. You are currently on the pill but it is not yet effective. <font color=red>It is currently a dangerous day.</font>'
+					$cycreport_txt = 'It has been <<temp[1]>> days since the start of your last period. You are currently on the pill but it is not yet effective. <font color=red>It is currently a dangerous day.</font>'
 				elseif pillcon2 > 8000:
-					$cycreport_txt = 'It has been <<temp[1]>> days since you last had a period. You are currently on the pill but it is not yet effective.'
+					$cycreport_txt = 'It has been <<temp[1]>> days since the start of your last period. You are currently on the pill but it is not yet effective.'
 				elseif daystart = tabletkiday:
-					$cycreport_txt = 'It has been <<temp[1]>> days since you last had a period. You have taken the pill but it will be several weeks before it is fully effective.'
+					$cycreport_txt = 'It has been <<temp[1]>> days since the start of your last period. You have taken the pill but it will be several weeks before it is fully effective.'
 				elseif FocH > (Foch_Max - 96) or ovulate > 0:
-					$cycreport_txt = 'It has been <<temp[1]>> days since you last had a period. <font color=red>It is currently your fertile stage.</font>'
+					$cycreport_txt = 'It has been <<temp[1]>> days since the start of your last period. <font color=red>It is currently your fertile stage.</font>'
 				else
-					$cycreport_txt = 'It has been <<temp[1]>> days since you last had a period.'
+					$cycreport_txt = 'It has been <<temp[1]>> days since the start of your last period.'
 				end
 			end
 		elseif denypreg = 1:
@@ -704,7 +735,7 @@ $d_cycreport_update = {
 				thinkpreg = 0
 				$cycreport_txt = 'Surely if you were pregnant, you''d have had the baby by now, so you can''t possibly be pregnant.'
 			else
-				temp = daystart-lastmens
+				temp = daystart-daylastperiod
 				$cycreport_txt = 'It has been <<temp>> days since you last remember having a period.'
 			end
 		elseif cyccustom = 0:
@@ -716,8 +747,10 @@ $d_cycreport_update = {
 					else
 						$cycreport_txt = 'You<<$temp>> are pregnant with <<$wombthfath>>''s baby. Based on your last remembered period, your due date is probably around <<$pregduedate>>.'
 					end
+				elseif $cycreport_txt = 'Your body is recovering from the trauma of pregnancy after your miscarrage.':
+					if knowpregloss = 1: $cycreport_txt = 'Your body is recovering from the trauma of pregnancy after your abortion.'
 				elseif $cycreport_txt ! 'You do not believe you have periods any more.':
-					temp = daystart-lastmens
+					temp = daystart-daylastperiod
 					$cycreport_txt = 'It has been <<temp>> days since you last remember having a period.'
 				end
 				killvar 'temp'

+ 1 - 1
locations/gpoli.qsrc

@@ -290,7 +290,7 @@ if $ARGS[0] = '':
 			end
 		end
 
-		if (pav_slut >= 125 or pav_prostitute >= 125 or guy > 10 or unprotfilm or whoreQW > 1 or bordelslutty > 0 or cumcondslip_aware > 0 or (daystart - lastmens > 42) or Triper > 2 or Gerpes >= 3 or Sifilis >= 21 or Kandidoz > 30) and gynodaystart ! daystart:
+		if (pav_slut >= 125 or pav_prostitute >= 125 or guy > 10 or unprotfilm or whoreQW > 1 or bordelslutty > 0 or cumcondslip_aware > 0 or (daystart - daylastperiod > 42) or Triper > 2 or Gerpes >= 3 or Sifilis >= 21 or Kandidoz > 30) and gynodaystart ! daystart:
 			act 'Visit your gynaecologist (1,000 <b>₽</b>)':
 				*clr & cla
 				menu_off = 1

+ 14 - 14
locations/stat_display.qsrc

@@ -1191,16 +1191,16 @@ if cheatStatusIcons = 0:
 		$stat_bleed_msg = 'You feel a slight twinge in your abdomen.'
 		$statusIconBarTab += '<td><a href="exec:msg $stat_bleed_msg"><img title="<<$stat_bleed_msg>>" height = 54 src="images/system/icon/status_icons/vunknown.png"></a></td>'
 	elseif thinkpreg = 0 and knowpreg = 0 and cycle ! 6 and pillcon2 <= 30000 and succubusflag ! 1 and cheatSlut = 0 and mesec = 0:
-		if abortionbirthdate = 0 and daystart - lastmens > 28:
-			if (daystart - lastmens > 28) and (daystart - lastmens <= 35):
-				$stat_bleed_msg = 'Your period is late by <<daystart - lastmens - 28>> days.'
-			elseif (daystart - lastmens > 35) and (daystart - lastmens <= 42):
+		if abortionbirthdate = 0 and daystart - daylastperiod > 28:
+			if (daystart - daylastperiod > 28) and (daystart - daylastperiod <= 35):
+				$stat_bleed_msg = 'Your period is late by <<daystart - daylastperiod - 28>> days.'
+			elseif (daystart - daylastperiod > 35) and (daystart - daylastperiod <= 42):
 				$stat_bleed_msg = 'Your period is late by more than a week!'
-			elseif (daystart - lastmens > 42) and (daystart - lastmens <= 56):
+			elseif (daystart - daylastperiod > 42) and (daystart - daylastperiod <= 56):
 				$stat_bleed_msg = 'Your period is late by more than two weeks! Maybe you should see a doctor?'
-			elseif (daystart - lastmens > 56) and (daystart - lastmens <= 84):
+			elseif (daystart - daylastperiod > 56) and (daystart - daylastperiod <= 84):
 				$stat_bleed_msg = 'Your period is late by more than a month! You really should see a doctor about it.'
-			elseif daystart - lastmens > 84:
+			elseif daystart - daylastperiod > 84:
 				$stat_bleed_msg = 'You should consider the possibility of a pregnancy, since apparently you no longer have periods.'
 			end
 			$statusIconBarTab += '<td><a href="exec:msg $stat_bleed_msg"><img title="<<$stat_bleed_msg>>" height = 54 src="images/system/icon/status_icons/vunknown.png"></a></td>'
@@ -1706,16 +1706,16 @@ if enable_extra_msg = 1:
 	if opPRE = 0: $stat_msg += '<BR><<$pcs_makeup>> and your hair is <<$pcs_hairbsh>>.' & !$stat_msg += '<BR>'
 
 	if thinkpreg = 0 and knowpreg = 0 and cycle ! 6 and pillcon2 <= 30000 and succubusflag ! 1 and cheatSlut = 0 and mesec = 0:
-		if abortionbirthdate = 0 and daystart - lastmens > 28:
-			if (daystart - lastmens > 28) and (daystart - lastmens <= 35):
-				$stat_msg += '<BR><font color = #AB052A><b>Your period is late by <<daystart - lastmens - 28>> days.</b></font>'
-			elseif (daystart - lastmens > 35) and (daystart - lastmens <= 42):
+		if abortionbirthdate = 0 and daystart - daylastperiod > 28:
+			if (daystart - daylastperiod > 28) and (daystart - daylastperiod <= 35):
+				$stat_msg += '<BR><font color = #AB052A><b>Your period is late by <<daystart - daylastperiod - 28>> days.</b></font>'
+			elseif (daystart - daylastperiod > 35) and (daystart - daylastperiod <= 42):
 				$stat_msg += '<BR><font color = #AB052A><b>Your period is late by more than a week!</b></font>'
-			elseif (daystart - lastmens > 42) and (daystart - lastmens <= 56):
+			elseif (daystart - daylastperiod > 42) and (daystart - daylastperiod <= 56):
 				$stat_msg += '<BR><font color = #AB052A><b>Your period is late by more than two weeks! Maybe you should see a doctor?</b></font>'
-			elseif (daystart - lastmens > 56) and (daystart - lastmens <= 84):
+			elseif (daystart - daylastperiod > 56) and (daystart - daylastperiod <= 84):
 				$stat_msg += '<BR><font color = #AB052A><b>Your period is late by more than a month! You really should see a doctor about it.</b></font>'
-			elseif daystart - lastmens > 84:
+			elseif daystart - daylastperiod > 84:
 				$stat_msg += '<BR><font color = #AB052A><b>You should consider the possibility of a pregnancy, since apparently you no longer have periods.</b></font>'
 			end
 		!!Recovery period after an abortion is ~14-21 days

+ 2 - 2
locations/telefon.qsrc

@@ -1215,8 +1215,8 @@ if $ARGS[0] = 'Phone_notebook':
 			if m1 = 11 and d1 = 11:$calendarday += $list + 'Last day of Autumn break.'
 		end
 
-		if daynum >= lastmens+28 and daynum < lastmens+31:$calendarday += $list + '<font color=''red''><b>Menstruation!</b></font>'
-		if daynum >= lastmens+12 and daynum < lastmens+14:$calendarday += $list + '<font color=#336600><b>Ovulation!</b></font>'
+		if daynum >= daylastperiod+28 and daynum < daylastperiod+31:$calendarday += $list + '<font color=''red''><b>Menstruation!</b></font>'
+		if daynum >= daylastperiod+12 and daynum < daylastperiod+14:$calendarday += $list + '<font color=#336600><b>Ovulation!</b></font>'
 		if pregchem >= 6720:$calendarday += $list + '<font color=''red''><b>Birthing day!</b></font>'
 
 		if w1 < 5 and (workSec >= 1 or PersSecWork = 1):$calendarday += $list + 'Working as a secretary. <i>(9:00 - 17:00)</i>'