// `J` Job Brothel - Sleazy Bar
bool cJobManager::WorkSleazyBarmaid(sGirl* girl, sBrothel* brothel, bool Day0Night1, string& summary)
{
#pragma region //	Job setup				//
	int actiontype = ACTION_WORKCLUB;
	stringstream ss; string girlName = girl->m_Realname; ss << girlName;
	int roll_a = g_Dice.d100(), roll_b = g_Dice.d100(), roll_c = g_Dice.d100();
	if (g_Girls.DisobeyCheck(girl, actiontype, brothel))
	{
		ss << " refused to work during the " << (Day0Night1 ? "night" : "day") << " shift.";
		girl->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, EVENT_NOWORK);
		return true;
	}
	ss << " worked as a bartender in the strip club.\n\n";

	g_Girls.UnequipCombat(girl);	// put that shit away, you'll scare off the customers!

	int HateLove = 0;
	HateLove = g_Girls.GetStat(girl, STAT_PCLOVE) - g_Girls.GetStat(girl, STAT_PCHATE);
	double wages = 15, tips = 0;
	int enjoy = 0, fame = 0;
	int imagetype = IMGTYPE_ECCHI;
	int msgtype = Day0Night1;

#pragma endregion
#pragma region //	Job Performance			//

	double jobperformance = JP_SleazyBarmaid(girl, false);



	if (jobperformance >= 245)
	{
		ss << " She must be the perfect bar tender customers go on and on about her and always come to see her when she works.\n\n";
		wages += 155;
	}
	else if (jobperformance >= 185)
	{
		ss << " She's unbelievable at this and is always getting praised by the customers for her work.\n\n";
		wages += 95;
	}
	else if (jobperformance >= 145)
	{
		ss << " She's good at this job and gets praised by the customers often.\n\n";
		wages += 55;
	}
	else if (jobperformance >= 100)
	{
		ss << " She made a few mistakes but overall she is okay at this.\n\n";
		wages += 15;
	}
	else if (jobperformance >= 70)
	{
		ss << " She was nervous and made a few mistakes. She isn't that good at this.\n\n";
		wages -= 5;
	}
	else
	{
		ss << " She was nervous and constantly making mistakes. She really isn't very good at this job.\n\n";
		wages -= 15;
	}


	//base tips, aprox 10-20% of base wages
	tips += (((10 + jobperformance / 22) * wages) / 100);
	
	//try and add randomness here
	if (g_Girls.GetStat(girl, STAT_BEAUTY) > 85 && g_Dice.percent(20))
	{
		ss << "Stunned by her beauty a customer left her a great tip.\n\n"; tips += 25;
	}

	if (g_Girls.GetStat(girl, STAT_BEAUTY) > 99 && g_Dice.percent(5))
	{
		ss << girlName << " looked absolutely stunning during her shift and was unable to hide it. Instead of her ass or t**s, the patrons couldn't glue their eyes off her face, and spent a lot more than usual on tipping her.\n"; tips += 50;
	}

	if (g_Girls.GetStat(girl, STAT_CHARISMA) > 85 && g_Dice.percent(20))
	{
		ss << girlName << " surprised a couple of gentlemen discussing some complicated issue by her insightful comments when she was taking her order. They decided her words were worth a heavy tip.\n"; tips += 35;
	}

	if (g_Girls.HasTrait(girl, "Clumsy") && g_Dice.percent(15))
	{
		ss << "Her clumsy nature caused her to spill a drink on a customer resulting in them storming off without paying.\n"; wages -= 15;
	}

	if (g_Girls.HasTrait(girl, "Pessimist") && g_Dice.percent(5))
	{
		if (jobperformance < 125)
		{
			ss << "Her pessimistic mood depressed the customers making them tip less.\n"; tips -= 10;
		}
		else
		{
			ss << girlName << " was in a poor mood so the patrons gave her a bigger tip to try and cheer her up.\n"; tips += 10;
		}
	}

	if (g_Girls.HasTrait(girl, "Optimist") && g_Dice.percent(5))
	{
		if (jobperformance < 125)
		{
			ss << girlName << " was in a cheerful mood but the patrons thought she needed to work more on her services.\n"; tips -= 10;
		}
		else
		{
			ss << "Her optimistic mood made patrons cheer up increasing the amount they tip.\n"; tips += 10;
		}
	}
	// `J` slightly higher percent compared to regular barmaid, I would think sleazy barmaid's uniform is more revealing
	if ((g_Dice.percent(5) && g_Girls.HasTrait(girl, "Busty Boobs")) ||
		(g_Dice.percent(10) && g_Girls.HasTrait(girl, "Big Boobs")) ||
		(g_Dice.percent(15) && g_Girls.HasTrait(girl, "Giant Juggs")) ||
		(g_Dice.percent(20) && g_Girls.HasTrait(girl, "Massive Melons")) ||
		(g_Dice.percent(25) && g_Girls.HasTrait(girl, "Abnormally Large Boobs")) ||
		(g_Dice.percent(30) && g_Girls.HasTrait(girl, "Titanic T**s")))
	{
		if (jobperformance < 150)
		{
			ss << "A patron was staring obviously at her large breasts. But she had no idea how to take advantage of it.\n";
		}
		else
		{
			ss << "A patron was staring obviously at her large breasts. So she over charged them for drinks while they drooled not paying any mind to the price.\n"; wages += 15;
		}
	}

	if (g_Girls.HasTrait(girl, "Meek") && g_Dice.percent(5) && jobperformance < 125)
	{
		ss << girlName << " spilled a drink all over a man's lap. He told her she had to lick it up and forced her to clean him up which she Meekly accepted and went about licking his c**k clean.\n";
		imagetype = IMGTYPE_ORAL;
		enjoy -= 3;
	}

	if (g_Dice.percent(5)) //may get moved to waitress
	{
		ss << "A drunken patron decide to grab " << girlName << "'s boob. ";
		if (g_Girls.HasTrait(girl, "Meek"))
		{
			ss << "She was shocked and didn't react. The man molested her for a few minutes!\n";
		}
		else if (g_Girls.HasTrait(girl, "Tough"))
		{
			ss << "She knocked him out! You could swear that she knocked a couple of his teeth out too!\n";
		}
		else if (g_Girls.HasTrait(girl, "Your Daughter"))
		{
			ss << "She screamed do you know who my dad is? He will have your head for this!\n";
		}
		else if (g_Girls.HasTrait(girl, "Your Wife"))
		{
			ss << "She screamed do you know who my husband is? He will have your head for this!\n";
		}
		else if (HateLove >= 80) //loves you
		{
			ss << "She screamed do you know who my love is? He will have your head for this!\n";
		}
		else
		{
			ss << "She screamed and shook his hand off.\n";
		}
	}

	if ((g_Girls.HasTrait(girl, "Nymphomaniac") || g_Girls.HasTrait(girl, "Succubus")) && g_Girls.GetStat(girl, STAT_LIBIDO) > 80 && g_Dice.percent(20) && !g_Girls.HasTrait(girl, "Virgin") && !g_Girls.HasTrait(girl, "Lesbian"))
	{
		if (roll_b <= 50)
		{
			ss << girlName << " dragged one of the less sober clients outside into a back alley and ordered him to f**k her senseless against a wall. After the deed, the poor fellow passed out and " << girlName << " returned to her job as if nothing happened.\n";
		}
		else
		{
			ss << girlName << " spotted a relatively good-looking guy walking into the bathroom alone. She followed him inside, and as he tried to exit the bathroom stall, he got pushed back in by her. " << girlName << " didn't waste any time and in a matter of seconds was vigorously f*****g the client. After the deed, the client made sure " << girlName << " had a pretty hefty wad of money stuck behind her skirt.\n"; tips += 50;
		}
		imagetype = IMGTYPE_SEX;
		g_Girls.UpdateStatTemp(girl, STAT_LIBIDO, -20);
		g_Girls.UpdateSkill(girl, SKILL_NORMALSEX, 1);
		sCustomer* Cust = new sCustomer; g_Customers.GetCustomer(Cust, brothel); Cust->m_Amount = 1;
		if (!girl->calc_pregnancy(Cust, false, 1.0))
		{
			g_MessageQue.AddToQue(girl->m_Realname + " has gotten pregnant.", 0);
		}
		delete Cust;
	}

#pragma endregion
#pragma region	//	Enjoyment and Tiredness		//

	//enjoyed the work or not
	if (roll_a <= 5)
	{
		ss << "\nSome of the patrons abused her during the shift.";
		enjoy -= 1;
	}
	else if (roll_a <= 25)
	{
		ss << "\nShe had a pleasant time working.";
		enjoy += 3;
	}
	else
	{
		ss << "\nOtherwise, the shift passed uneventfully.";
		enjoy += 1;
	}


#pragma endregion
#pragma region	//	Money					//


#pragma endregion
#pragma region	//	Finish the shift			//


	g_Girls.UpdateEnjoyment(girl, actiontype, enjoy);
	girl->m_Events.AddMessage(ss.str(), imagetype, Day0Night1);


	int roll_max = (g_Girls.GetStat(girl, STAT_BEAUTY) + g_Girls.GetStat(girl, STAT_CHARISMA));
	roll_max /= 4;
	wages += 10 + g_Dice%roll_max;
	// Money
	if (wages < 0)	wages = 0;	girl->m_Pay = (int)wages;
	if (tips < 0)	tips = 0;	girl->m_Tips = (int)tips;

	// Improve stats
	int xp = 15, libido = 1, skill = 3;

	if (g_Girls.HasTrait(girl, "Quick Learner"))		{ skill += 1; xp += 3; }
	else if (g_Girls.HasTrait(girl, "Slow Learner"))	{ skill -= 1; xp -= 3; }
	if (g_Girls.HasTrait(girl, "Nymphomaniac"))			{ libido += 2; }
	if (!g_Girls.HasTrait(girl, "Straight"))	{ libido += min(3, g_Brothels.GetNumGirlsOnJob(0, JOB_BARSTRIPPER, false)); }
	if (girl->fame() < 10 && jobperformance >= 70)		{ fame += 1; }
	if (girl->fame() < 20 && jobperformance >= 100)		{ fame += 1; }
	if (girl->fame() < 40 && jobperformance >= 145)		{ fame += 1; }
	if (girl->fame() < 60 && jobperformance >= 185)		{ fame += 1; }

	g_Girls.UpdateStat(girl, STAT_FAME, fame);
	g_Girls.UpdateStat(girl, STAT_EXP, xp);
	g_Girls.UpdateSkill(girl, SKILL_PERFORMANCE, g_Dice%skill);
	g_Girls.UpdateSkill(girl, SKILL_SERVICE, g_Dice%skill + 1);
	g_Girls.UpdateStatTemp(girl, STAT_LIBIDO, libido);

	//gained
	g_Girls.PossiblyGainNewTrait(girl, "Charismatic", 60, actiontype, "Dealing with customers at the bar and talking with them about their problems has made " + girlName + " more Charismatic.", Day0Night1);
	if (jobperformance < 100 && roll_a <= 2) { g_Girls.PossiblyGainNewTrait(girl, "Assassin", 10, actiontype, girlName + "'s lack of skill at mixing drinks has been killing people left and right making her into quite the Assassin.", Day0Night1); }
	if (g_Dice.percent(25) && g_Girls.GetStat(girl, STAT_DIGNITY) < 0 && (imagetype == IMGTYPE_SEX || imagetype == IMGTYPE_ORAL))
	{
		g_Girls.PossiblyGainNewTrait(girl, "S**t", 80, ACTION_SEX, girlName + " has turned into quite a s**t.", Day0Night1);
	}

	//lose
	g_Girls.PossiblyLoseExistingTrait(girl, "Nervous", 20, actiontype, girlName + " seems to finally be getting over her shyness. She's not always so Nervous anymore.", Day0Night1);


#pragma endregion
	return false;
}
// `J` Job Brothel - Brothel
bool cJobManager::WorkWhore(sGirl* girl, sBrothel* brothel, bool Day0Night1, string& summary)
{
	int actiontype = ACTION_SEX;
	// put that shit away, you'll scare off the customers!
	g_Girls.UnequipCombat(girl);


	/*
	*	WD:	Modified to fix customer service problems.. I hope :)
	*
	*	Change logic as original code is based on linked list of customers
	*	not random generation for each call to GetCustomer()
	*
	*	Pricing issues seem to be resolved with getting lots of money
	*	from customer that cant pay
	*
	*	The numbers I have added need to be tested
	*
	*	Limit number customers a girl can f**k to 10 max
	*
	*	Limit the number of customers a girl can see if they will
	*	f**k her from 5 to Max Customers * 2
	*
	*	Redid the code for deadbeat customers
	*
	*	% Chance of customers without any money getting service is
	*  percent(50 - INTELLIGENCE) / 5) where  20 < INTELLIGENCE < 100
	*	If caught will set deadbeat flag
	*
	*	GetCustomer() is generating a lot of poor customers changed
	*	code to add pay to customers funds instead of generating
	*	New customer.
	*
	*	% Chance of customer refusing to pay despite having funds is
	*	percent((40 - HAPPINESS) / 2) && percent(CONFIDENCE - 25)
	*	If caught by guards they will pay
	*
	*	Only decrement filthiness when service is performed in brothel
	*
	*	Street Work will not decrement number customers
	*  Street work will only service 66% number of customers
	*	Street Work will only generate 66% of brothel income
	*	Street Work Really needs its own NumCustomers() counter
	*
	*	Rival gangs can damage girls doing Street Work
	*  % Chance of destroying rival gang is depended on best of
	*	SKILL_COMBAT & SKILL_MAGIC / 5
	*
	*	Changed message for rival gangs attacking street girls to give
	*	EVENT_WARNING
	*
	*	GROUP sex code caculations now consolidated to one place
	*
	*  Fixed end of shift messages
	*
	*	Fame only to be done in GirlFucks()
	*
	*	Now Base Customer HAPPINESS = 60, code conslidated from 2 places in file
	*
	*/

	string fuckMessage = "";
	string message = "";
	string girlName = girl->m_Realname;
	int iNum = 0;
	int iOriginal = 0;
	int	AskPrice = g_Girls.GetStat(girl, STAT_ASKPRICE);
	int pay;
	int tip;
	int LoopCount;
	bool group = false;	// Group sex flag
	bool bCustCanPay;				// Customer has enough money to pay 
	bool acceptsGirl;				// Customer will sleep girl
	bool bStreetWork;				// Girl Doing StreetWork

	u_int SexType = 0;
	u_int job = (Day0Night1 ? girl->m_NightJob : girl->m_DayJob);
	bStreetWork = (job == JOB_WHORESTREETS);
	stringstream ss;

	girl->m_Pay = 0;

	// work out how many customers the girl can service

	// Changed the number of custmers stats add.. reasone was that old value, 
	// it was only adding 1 customer per stat, unless stat was 100 for beauty and Charisma. Fame would add a max of 3. and only if was = 10
	// there would be NO point in doing this, if it defaults to NumCusts++ since it is basically the same effect.	-PP

	// Max number on customers the girl can f**k
	int b = g_Girls.GetStat(girl, STAT_BEAUTY), c = g_Girls.GetStat(girl, STAT_CHARISMA), f = g_Girls.GetStat(girl, STAT_FAME);
	int NumCusts = min(10, 3 + ((b + 1) / 50) + ((c + 1) / 50) + ((f + 1) / 25));

	int NumSleptWith = 0;		// Total num customers she f***s this session

	if (bStreetWork)
	{
		NumCusts = NumCusts * 2 / 3;
		AskPrice = AskPrice * 2 / 3;
	}

	NumCusts = min(NumCusts, 10);		// No more than 10 Customers per shift

	// Complications

	/*
	*	WD:	Rival Gang is incompleate
	*
	*	Chance of defeating gane is based on  combat / magic skill
	*	Added Damage and Tiredness
	*	ToDo Girl fightrivalgang() if its implemented
	*
	*/

	if (bStreetWork && g_Dice.percent(5))
	{
		cRival* rival = g_Brothels.GetRivalManager()->GetRandomRival();
		if (rival)
		{
			if (rival->m_NumGangs > 0)
			{
				ss.str("");
				summary += girlName + " was attacked by enemy goons. \n";
				//message		+= "She ran into some enemy goons and was attacked.\n";
				ss << girlName << " ran into some enemy goons and was attacked.\n";

				// WD: Health loss, Damage 0-15, 25% chance of 0 damage
				iNum = max(g_Dice % 20 - 5, 0);
				iOriginal = g_Girls.GetStat(girl, STAT_HEALTH);
				g_Girls.UpdateStat(girl, STAT_HEALTH, -iNum);
				iNum = iOriginal - g_Girls.GetStat(girl, STAT_HEALTH);

				if (iNum > 0)
				{
					//message += "She fought back and was hurt.\n";	
					ss << "She fought back and was hurt taking " << iNum << " points of damage.\n";
				}
				else
					ss << "She fought back taking no damage.\n";

				// WD:	Tiredness (5 + 2 * damage) points avg is (6 + Health Damage) is bell curve
				iNum = g_Dice % (iNum)+g_Dice % (iNum)+5;
				g_Girls.UpdateStat(girl, STAT_TIREDNESS, iNum);
				message = ss.str();

				// WD:	If girl used magic to defend herself she will use mana
				if (g_Girls.GetStat(girl, STAT_MANA)  > 20 && g_Girls.GetSkill(girl, SKILL_MAGIC) > g_Girls.GetSkill(girl, SKILL_COMBAT))
				{
					g_Girls.UpdateStat(girl, STAT_MANA, -20);
					iNum = g_Girls.GetSkill(girl, SKILL_MAGIC) / 5;		// WD: Chance to destroy rival gang
				}
				else
					iNum = g_Girls.GetSkill(girl, SKILL_COMBAT) / 5;	// WD: Chance to destroy rival gang

				// WD:	Destroy rival gang
				if (g_Dice.percent(iNum))
					rival->m_NumGangs--;


				girl->m_Events.AddMessage(message, IMGTYPE_PROFILE, EVENT_WARNING);
				// WD TRACE Enemy Goons {girl->m_Name} dmg= {iNum} msg= {message}
			}
		}
	}



	// WD: Set the limits on the Number of customers a girl can try and f**k
	LoopCount = max(NumCusts * 2, 5);

	// WD: limit to number of customers left
	if (!bStreetWork && LoopCount >g_Customers.GetNumCustomers())
		LoopCount = g_Customers.GetNumCustomers();

#if 0 
	// `J` - set to 1 to debug "CustNoPay.script"
	SetGameFlag(FLAG_CUSTNOPAY);
#endif

	for (int i = 0; i < LoopCount; i++)	// Go through all customers
	{
		// WD:	Move exit test to top of loop
		// if she has already slept with the max she can attact then stop processing her f*****g routine
		if (NumSleptWith >= NumCusts) break;

		// WD:	Init Loop variables
		pay = AskPrice;
		SexType = 0;
		group = false;
		acceptsGirl = false;
		// WD:	Create Customer
		sCustomer Cust;
		g_Customers.GetCustomer(Cust, brothel);

		// `J` check for disease
		if (g_Girls.detect_disease_in_customer(brothel, girl, Cust)) continue;

		// filter out unwanted sex types (unless it is street work)
		if (!bStreetWork && !is_sex_type_allowed(Cust.m_SexPref, brothel) && !is_sex_type_allowed(Cust.m_SexPrefB, brothel))
		{
			brothel->m_RejectCustomers++;
			continue;	// `J` if both their sexprefs are banned then they leave
		}
		else if (!bStreetWork && !is_sex_type_allowed(Cust.m_SexPref, brothel)) // it their first sexpref is banned then switch to the second
		{
			Cust.m_SexPref = Cust.m_SexPrefB;
			Cust.m_Stats[STAT_HAPPINESS] = 32 + g_Dice % 9 + g_Dice % 9;	// `J` and they are less happy
		}
		else	// `J` otherwise they are happy with their first choice.
		{
			// WD:	Set the customers begining happiness/satisfaction
			Cust.m_Stats[STAT_HAPPINESS] = 42 + g_Dice % 10 + g_Dice % 10; // WD: average 51 range 42 to 60
		}

		// WD:	Consolidate GROUP Sex Calcs here
		//		adjust price by number of parcitipants
		if (Cust.m_Amount > 1)
		{
			group = true;
			pay *= (int)Cust.m_Amount;
			if (Cust.m_SexPref == SKILL_GROUP) pay = pay * 17 / 10;
			if (Cust.m_SexPref == SKILL_STRIP) pay = pay * 14 / 10;
			// WD: this is complicated total for 1.7 * pay * num of customers
			// pay += (int)((float)(pay*(Cust.m_Amount))*0.7f); 
		}

		// WD: Has the customer have enough money
		bCustCanPay = Cust.m_Money >= (unsigned)pay;

		// WD:	TRACE Customer Money = {Cust.m_Money}, Pay = {pay}, Can Pay = {bCustCanPay}

		// WD:	If the customer doesn't have enough money, he will only sleep with her if he is stupid
		if (!bCustCanPay && !g_Dice.percent((50 - Cust.m_Stats[STAT_INTELLIGENCE]) / 5))
		{
			//continue;
			// WD: Hack to avoid many newcustomer() calls
			Cust.m_Money += (unsigned)pay;
			bCustCanPay = true;
		}

		// test for specific girls
		if (girl->has_trait("Skeleton"))
		{
			fuckMessage = "The customer sees that you are offering up a Skeleton for sex and is scared, if you allow that kind of thing in your brothels, what else do you allow? They left in a hurry, afraid of what might happen if they stay.\n\n";
			brothel->m_Fame -= 5;
			g_Brothels.GetPlayer()->customerfear(2);
			acceptsGirl = false;
			continue;
		}
		if (Cust.m_Fetish == FETISH_SPECIFICGIRL)
		{
			if (Cust.m_ParticularGirl == g_Brothels.GetGirlPos(brothel->m_id, girl))
			{
				fuckMessage = "This is the customer's favorite girl.\n\n";
				acceptsGirl = true;
			}
		}
		else if (girl->has_trait("Zombie") && Cust.m_Fetish == FETISH_FREAKYGIRLS && g_Dice.percent(10))
		{
			fuckMessage = "This customer is intrigued to f**k a Zombie girl.\n\n";
			acceptsGirl = true;
		}
		else
		{
			// 50% chance of getting something a little weirder during the night
			if (Day0Night1 && Cust.m_Fetish < NUM_FETISH - 2 && g_Dice.percent(50)) Cust.m_Fetish += 2;

			// Check for fetish match
			if (g_Girls.CheckGirlType(girl, Cust.m_Fetish))
			{
				fuckMessage = "The customer loves this type of girl.\n\n";
				acceptsGirl = true;
			}
		}

		// Other ways the customer will accept the girl
		if (acceptsGirl == false)
		{
			if (girl->has_trait("Zombie"))
			{
				fuckMessage = "The customer sees that you are offering up a Zombie girl and is scared, if you allow that kind of thing in your brothels, what else do you allow? They left in a hurry, afraid of what might happen if they stay.\n\n";
				brothel->m_Fame -= 10;
				g_Brothels.GetPlayer()->customerfear(5);
				acceptsGirl = false;
			}
			else if (Cust.m_Stats[STAT_LIBIDO] >= 80)
			{
				fuckMessage = "Customer chooses her because they are very horny.\n\n";
				acceptsGirl = true;
			}
			else if (((g_Girls.GetStat(girl, STAT_BEAUTY) + g_Girls.GetStat(girl, STAT_CHARISMA)) / 2) >= 90)	// if she is drop dead gorgeous
			{
				fuckMessage = "Customer chooses her because they are stunned by her beauty.\n\n";
				acceptsGirl = true;
			}
			else if (g_Girls.GetStat(girl, STAT_FAME) >= 80)	// if she is really famous
			{
				fuckMessage = "Customer chooses her because she is so famous.\n\n";
				acceptsGirl = true;
			}
			// WD:	Use Magic only as last resort
			else if (g_Girls.GetSkill(girl, SKILL_MAGIC) > 50 && g_Girls.GetStat(girl, STAT_MANA) >= 20)	// she can use magic to get him
			{
				fuckMessage = girlName + " uses magic to get the customer to choose her.\n\n";
				g_Girls.UpdateStat(girl, STAT_MANA, -20);
				acceptsGirl = true;
			}
		}

		if (!acceptsGirl) continue;		// will the customer sleep with her?

		// Horizontal boogy
		g_Girls.GirlFucks(girl, Day0Night1, &Cust, group, fuckMessage, SexType);
		NumSleptWith++;
		if (!bStreetWork) brothel->m_Filthiness++;

		// update how happy the customers are on average
		brothel->m_Happiness += Cust.m_Stats[STAT_HAPPINESS];


		// Time for the customer to fork over some cash

		// WD:	Customer can not pay
		if (!bCustCanPay)
		{
			pay = 0;	// WD: maybe no money from this customer
			if (g_Dice.percent(Cust.m_Stats[STAT_CONFIDENCE] - 25))	// Runner
			{
				if (g_Gangs.GetGangOnMission(MISS_GUARDING))
				{
					if (g_Dice.percent(50))
						fuckMessage += " The customer couldn't pay and managed to elude your guards.";

					else
					{
						fuckMessage += " The customer couldn't pay and tried to run off. Your men caught him before he got out the door.";
						SetGameFlag(FLAG_CUSTNOPAY);
						pay = (int)Cust.m_Money;	// WD: Take what customer has
						Cust.m_Money = 0;	// WD: ??? not needed Cust record is not saved when this fn ends!  Leave for now just in case ???
					}
				}
				else
					fuckMessage += " The customer couldn't pay and ran off. There were no guards!";

			}
			else
			{
				// offers to pay the girl what he has
				if (g_Dice.percent(g_Girls.GetStat(girl, STAT_INTELLIGENCE)))
				{
					// she turns him over to the goons
					fuckMessage += " The customer couldn't pay the full amount, so your girl turned them over to your men.";
					SetGameFlag(FLAG_CUSTNOPAY);
				}
				else
					fuckMessage += " The customer couldn't pay the full amount.";

				pay = (int)Cust.m_Money;
				Cust.m_Money = 0;	// WD: ??? not needed Cust record is not saved when this fn ends!  Leave for now just in case ???
			}
		}


		// WD:	Unhappy Customer tries not to pay and does a runner
		else if (g_Dice.percent((40 - Cust.m_Stats[STAT_HAPPINESS]) / 2) && g_Dice.percent(Cust.m_Stats[STAT_CONFIDENCE] - 25))
		{
			if (g_Gangs.GetGangOnMission(MISS_GUARDING))
			{
				if (g_Dice.percent(50))
				{
					fuckMessage += " The customer refused to pay and managed to elude your guards.";
					pay = 0;
				}
				else
				{
					fuckMessage += " The customer refused to pay and tried to run off. Your men caught him before he got out the door and forced him to pay.";
					Cust.m_Money -= (unsigned)pay; // WD: ??? not needed Cust record is not saved when this fn ends!  Leave for now just in case ???
				}
			}
			else
			{
				fuckMessage += " The customer refused to pay and ran off. There were no guards!";
				pay = 0;
			}
		}

		else  // Customer has enough money
		{
			Cust.m_Money -= (unsigned)pay; // WD: ??? not needed Cust record is not saved when this fn ends!  Leave for now just in case ???
			if (g_Girls.HasTrait(girl, "Your Daughter") && Cust.m_Money >= 20 && g_Dice.percent(15))//may need to be moved to work right
			{
				if (g_Dice.percent(50))
				{
					message += "Learning that she was your daughter the customer tosses some extra gold down saying no dad should do this to their daughter.\n";
				}
				else
				{
					message += "A smile crossed the customer's face upon learning that " + girlName + " is your daughter and they threw some extra gold down. They seem to enjoy the thought of f*****g the boss's daughter.\n";
				}
				Cust.m_Money -= 20;
				girl->m_Tips += 20;
			}

			// if he is happy and has some extra gold he will give a tip
			if ((int)Cust.m_Money >= 20 && Cust.m_Stats[STAT_HAPPINESS] > 90)
			{
				tip = (int)Cust.m_Money;
				if (tip > 20)
				{
					Cust.m_Money -= 20;	// WD: ??? not needed Cust record is not saved when this fn ends!  Leave for now just in case ???
					tip = 20;
				}
				else
					Cust.m_Money = 0;	// WD: ??? not needed Cust record is not saved when this fn ends!  Leave for now just in case ???

				fuckMessage += ("\nShe received a tip of " + intstring(tip) + " gold");

				girl->m_Tips += tip;

				fuckMessage += ".";

				// If the customer is a government official
				if (Cust.m_Official == 1)
				{
					g_Brothels.GetPlayer()->suspicion(-5);
					fuckMessage += " It turns out that the customer was a government official, which lowers your suspicion.";
				}
			}
		}


		// Match image type to the deed done
		int imageType = IMGTYPE_SEX;
		/* */if (SexType == SKILL_ANAL)			imageType = IMGTYPE_ANAL;
		else if (SexType == SKILL_BDSM)			imageType = IMGTYPE_BDSM;
		else if (SexType == SKILL_NORMALSEX)	imageType = IMGTYPE_SEX;
		else if (SexType == SKILL_BEASTIALITY)	imageType = IMGTYPE_BEAST;
		else if (SexType == SKILL_GROUP)		imageType = IMGTYPE_GROUP;
		else if (SexType == SKILL_LESBIAN)		imageType = IMGTYPE_LESBIAN;
		else if (SexType == SKILL_ORALSEX)		imageType = IMGTYPE_ORAL;
		else if (SexType == SKILL_TITTYSEX)		imageType = IMGTYPE_TITTY;
		else if (SexType == SKILL_HANDJOB)		imageType = IMGTYPE_HAND;
		else if (SexType == SKILL_FOOTJOB)		imageType = IMGTYPE_FOOT;
		else if (SexType == SKILL_STRIP)		imageType = IMGTYPE_STRIP;

		// chance of customer beating or attempting to beat girl
		if (work_related_violence(girl, Day0Night1, bStreetWork))
			pay = 0;		// WD TRACE WorkRelatedViloence {girl->m_Name} earns nothing

		// WD:	Save gold earned
		girl->m_Pay += pay;		// WD TRACE Save Pay {girl->m_Name} earns {pay} totaling {girl->m_Pay}
		girl->m_Events.AddMessage(fuckMessage, imageType, Day0Night1);
	}


	// WD:	Reduce number of availabe customers for next w***e
	if (!bStreetWork)								// WD:	only brothel workers
	{
		iNum = g_Customers.GetNumCustomers();		// WD: Should not happen but lets make sure
		if (iNum < NumSleptWith)	g_Customers.AdjustNumCustomers(-iNum);
		else						g_Customers.AdjustNumCustomers(-NumSleptWith);
	}
	else brothel->m_MiscCustomers += NumSleptWith;	// WD:	 Count number of customers from Street Work

	// WD:	End of shift messages
	// doc: adding braces - gcc warns of ambiguous if nesting
	if (!bStreetWork)
	{
		if (g_Customers.GetNumCustomers() == 0)	{ girl->m_Events.AddMessage("No more customers.", IMGTYPE_PROFILE, Day0Night1); }
		else if (NumSleptWith < NumCusts)		{ girl->m_Events.AddMessage(girlName + " ran out of customers who like her.", IMGTYPE_PROFILE, Day0Night1); }
	}

	// WD:	Summary messages
	ss.str("");
	ss << girlName << (bStreetWork ? " worked the streets and" : "") << " saw " << NumSleptWith << " customers this shift.";
	summary += ss.str();

	girl->m_Events.AddMessage(summary, IMGTYPE_PROFILE, Day0Night1);

	//gain
	g_Girls.PossiblyGainNewTrait(girl, "Good Kisser", 50, actiontype, girlName + " has had a lot of practice kissing and as such as become a Good Kisser.", Day0Night1);
	g_Girls.PossiblyGainNewTrait(girl, "Nymphomaniac", 70, actiontype, girlName + " has been having so much sex she is now wanting sex all the time.", Day0Night1);

	//SIN: use a few of the new traits
	if (g_Dice.percent(1) && g_Dice.percent(girl->oralsex()) && (g_Girls.HasTrait(girl, "Nymphomaniac")))
		g_Girls.PossiblyGainNewTrait(girl, "Cum Addict", 90, actiontype, girlName + " has tasted so much cum she now craves it at all times.", Day0Night1);

	if (g_Dice.percent(min(50, girl->oralsex() - 30)))
		g_Girls.AdjustTraitGroupGagReflex(girl, +1, true, Day0Night1);

	return false;
}
// `J` Job Movie Studio - Actress
bool cJobManager::WorkFilmBondage(sGirl* girl, sBrothel* brothel, bool Day0Night1, string& summary)
{
	int actiontype = ACTION_WORKMOVIE;
	// No film crew.. then go home	// `J` this will be taken care of in building flow, leaving it in for now
	if (g_Studios.GetNumGirlsOnJob(0, JOB_CAMERAMAGE, SHIFT_NIGHT) == 0 || g_Studios.GetNumGirlsOnJob(0, JOB_CRYSTALPURIFIER, SHIFT_NIGHT) == 0)
	{
		girl->m_Events.AddMessage("There was no crew to film the scene, so she took the day off", IMGTYPE_PROFILE, EVENT_NOWORK);
		return false;
	}
	
	stringstream ss;
	string girlName = girl->m_Realname;
	int wages = 50;
	int enjoy = 0;
	int jobperformance = 0;

	g_Girls.UnequipCombat(girl);	// not for actress (yet)

	ss << girlName << " worked as an actress filming BDSM scenes.\n\n";

	int roll = g_Dice.d100();
	if (roll <= 10 && g_Girls.DisobeyCheck(girl, ACTION_WORKMOVIE, brothel))
	{
		ss << "She refused to get beaten on film today.\n";
		girl->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, EVENT_NOWORK);
		return true;
	}
	else if (roll <= 10) { enjoy -= g_Dice % 3 + 1;	ss << "She did not enjoy getting tied up and hurt today.\n\n"; }
	else if (roll >= 90) { enjoy += g_Dice % 3 + 1;	ss << "She had a great time getting spanked and whipped.\n\n"; }
	else /*            */{ enjoy += g_Dice % 2;		ss << "She had just another day in the dungeon.\n\n"; }
	jobperformance = enjoy * 2;

	if (g_Girls.CheckVirginity(girl))
	{
		g_Girls.LoseVirginity(girl);	// `J` updated for trait/status
		jobperformance += 50;
		ss << "She is no longer a virgin.\n";
	}
	sCustomer* Cust = new sCustomer; g_Customers.GetCustomer(Cust, brothel); Cust->m_Amount = 1;
	if (Cust->m_IsWoman)	// FemDom
	{
		jobperformance += 20;
		/* */if (girl->has_trait("Lesbian"))	jobperformance += 20;
		else if (girl->has_trait("Straight"))	jobperformance -= 20;
	}
	else
	{
		if (!girl->calc_pregnancy(Cust, false, 0.75))
			g_MessageQue.AddToQue(girl->m_Realname + " has gotten pregnant", 0);
		/* */if (girl->has_trait("Lesbian"))	jobperformance -= 10;
		else if (girl->has_trait("Straight"))	jobperformance += 10;
	}

	// remaining modifiers are in the AddScene function --PP
	int finalqual = g_Studios.AddScene(girl, SKILL_BDSM, jobperformance);
	ss << "Her scene is valued at: " << finalqual << " gold.\n";

	girl->m_Events.AddMessage(ss.str(), IMGTYPE_BDSM, Day0Night1);

	// work out the pay between the house and the girl
	if (girl->is_slave() && !cfg.initial.slave_pay_outofpocket())
	{
		wages = 0;	// You own her so you don't have to pay her.
	}
	else
	{
		wages += finalqual * 2;
	}
	girl->m_Pay = wages;

	// Improve stats
	int xp = 10, skill = 3;

	if (g_Girls.HasTrait(girl, "Quick Learner"))		{ skill += 1; xp += 3; }
	else if (g_Girls.HasTrait(girl, "Slow Learner"))	{ skill -= 1; xp -= 3; }

	g_Girls.UpdateStat(girl, STAT_EXP, xp);
	g_Girls.UpdateSkill(girl, SKILL_PERFORMANCE, g_Dice%skill);
	g_Girls.UpdateSkill(girl, SKILL_BDSM, g_Dice%skill + 1);

	g_Girls.UpdateEnjoyment(girl, ACTION_SEX, enjoy);
	g_Girls.UpdateEnjoyment(girl, ACTION_WORKMOVIE, enjoy);
	//gain
	g_Girls.PossiblyGainNewTrait(girl, "Fake O****m Expert", 50, ACTION_SEX, "She has become quite the faker.", Day0Night1);
	g_Girls.PossiblyGainNewTrait(girl, "M*******t", 65, ACTION_SEX, girlName + " has turned into a M*******t from filming so many BDSM scenes.", Day0Night1);
	g_Girls.PossiblyGainNewTrait(girl, "S**t", 80, ACTION_SEX, girlName + " has turned into quite a s**t.", Day0Night1);
	g_Girls.PossiblyGainNewTrait(girl, "P**n Star", 80, ACTION_WORKMOVIE, "She has performed in enough sex scenes that she has become a well known P**n Star.", Day0Night1);
	//lose

	delete Cust;
	return false;
}