当前位置: 首页>>代码示例>>C++>>正文


C++ cRng::percent方法代码示例

本文整理汇总了C++中cRng::percent方法的典型用法代码示例。如果您正苦于以下问题:C++ cRng::percent方法的具体用法?C++ cRng::percent怎么用?C++ cRng::percent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cRng的用法示例。


在下文中一共展示了cRng::percent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: UpdateTraits

void cGirlTorture::UpdateTraits()
{
	int nWeekMod = 1;
	bool harshtorture = false;
	/* `J` added to allow permanent trait gain on torture
	if TortureTraitWeekMod is set to a negative number in the config.xml
	then "Broken Will", "Masochist" and "Mind Fucked" are permanent
	doubles chance of injuring girls when torturing them
	evil gained from torture is also doubled  */
	if (cfg.initial.torture_mod() < 0){ harshtorture = true; }
	else	{ nWeekMod = cfg.initial.torture_mod() * m_DungeonGirl->m_Weeks; }

	if (g_Dice.percent(30) && m_Girl->spirit() < 20 && m_Girl->health() < 20)
	{
		if (harshtorture)	{ m_Girl->add_trait("Broken Will", false); }
		else				{ m_Girl->add_trait("Broken Will", 5 + nWeekMod / 2); }
	}
	if (g_Dice.percent(30) && m_Girl->bdsm() > 30)
	{
		if (harshtorture)	{ m_Girl->add_trait("Masochist", false); }
		else				{ m_Girl->add_trait("Masochist", 10 + nWeekMod); }
	}
	if (g_Dice.percent(30) && m_Girl->health() < 10)
	{
		if (harshtorture)	{ m_Girl->add_trait("Mind Fucked", false); }
		else				{ m_Girl->add_trait("Mind Fucked", 10 + nWeekMod); }
	}
}
开发者ID:DagothRa,项目名称:crazys-wm-mod,代码行数:28,代码来源:cGirlTorture.cpp

示例2: SetGoals

void cCustomers::SetGoals(sCustomer* customer)
{
	if (!customer) return;
	int a = g_Dice % NUM_GOALS, b = g_Dice % NUM_GOALS, c = g_Dice % NUM_GOALS;
	
	if ((g_Dice.percent(50) && a == GOAL_FIGHT) || (g_Dice.percent(80) && a == GOAL_RAPE))
	{
		customer->m_GoalA  = GOAL_SEX;
		customer->m_GoalB  = GOAL_FIGHT;
		customer->m_GoalC  = GOAL_RAPE;
		return;
	}


	// GOAL_UNDECIDED
	// GOAL_FIGHT
	// GOAL_RAPE
	// GOAL_SEX
	// GOAL_GETDRUNK
	// GOAL_GAMBLE
	// GOAL_ENTERTAINMENT
	// GOAL_XXXENTERTAINMENT
	// GOAL_MASSAGE
	// GOAL_STRIPSHOW
	// GOAL_FREAKSHOW
	// GOAL_CULTURALEXPLORER
	// GOAL_OTHER

	customer->m_GoalA = a;
	customer->m_GoalB = b;
	customer->m_GoalC = c;
}
开发者ID:diamondialis,项目名称:crazys-wm-mod,代码行数:32,代码来源:cCustomers.cpp

示例3: add_trait

void cGirlTorture::add_trait(string trait, int pc)
{
	if (m_Girl->has_trait(trait)) return;
	/*
	*	WD:	To balance a crash bug workaround for Job Torturer
	*		unable to call GirlGangFight()
	*		Halve chance of gaining trait
	*/
	if (!m_TorturedByPlayer) pc /= 2;
	if (!g_Dice.percent(pc)) return;

	string sMsg = m_Girl->m_Realname + gettext(" has gained trait \"") + trait + gettext("\" from being tortured.");

	if (m_TorturedByPlayer)
	{
		g_MessageQue.AddToQue(sMsg, 2);
		m_Girl->m_Events.AddMessage(sMsg, IMGTYPE_TORTURE, EVENT_WARNING);
	}
	else MakeEvent(sMsg);

	// Add trait
	m_Girl->add_trait(trait);
}
开发者ID:DagothRa,项目名称:crazys-wm-mod,代码行数:23,代码来源:cGirlTorture.cpp

示例4: WorkMilker

// `J` Job Farm - Laborers
bool cJobManager::WorkMilker(sGirl* girl, sBrothel* brothel, bool Day0Night1, string& summary)
{
#pragma region //	Job setup				//
	int actiontype = ACTION_WORKFARM;
	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))			// they refuse to work 
	{
		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 milker on the farm.\n\n";

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

	double wages = 20, tips = 0;
	int enjoy = 0;
	int imagetype = IMGTYPE_FARM;
	int msgtype = Day0Night1;

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

	double jobperformance = JP_Milker(girl, false);
	double drinks = jobperformance / 2;

	if (jobperformance >= 245)
	{
		ss << "Her milk bucket practically fills itself as she walks down the rows of cows.";
		drinks *= 5; roll_a += 10; roll_b += 25;
	}
	else if (jobperformance >= 185)
	{
		ss << "Her hands moved like lightning as she gracefully milks the cows teats.";
		drinks *= 4; roll_a += 5; roll_b += 18;
	}
	else if (jobperformance >= 145)
	{
		ss << "She knows exactly when the cows are ready to be milked and how to best milk them.";
		drinks *= 3; roll_a += 2; roll_b += 10;
	}
	else if (jobperformance >= 100)
	{
		ss << "She can milk the cows without spilling much.";
		drinks *= 2;
	}
	else if (jobperformance >= 70)
	{
		ss << "She isn't very good at aiming the teats into the bucket.";
		roll_a -= 2; roll_b -= 5;
	}
	else
	{
		ss << "She can't seem to get the hang of this.";
		wages -= 10; drinks *= 0.8; roll_a -= 5; roll_b -= 10;
	}
	ss << "\n\n";

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

	// Complications
	if (roll_a <= 10)
	{
		enjoy -= g_Dice % 3 + 1;
		ss << "The animals were uncooperative and some didn't even let her get near them.\n";
		drinks *= 0.8;
		if (g_Dice.percent(20))
		{
			enjoy--;
			ss << "Several animals kicked over the milking buckets and soaked " << girlName << ".\n";
			girl->happiness(-(1 + g_Dice % 5));
			drinks -= (5 + g_Dice % 6);
		}
		if (g_Dice.percent(20))
		{
			enjoy--;
			ss << "One of the animals urinated on " << girlName << " and contaminated the milk she had collected.\n";
			girl->happiness(-(1 + g_Dice % 3));
			drinks -= (5 + g_Dice % 6);
		}
		if (g_Dice.percent(20))
		{
			enjoy--;
			int healthmod = g_Dice % 10 + 1;
			girl->health(-healthmod);
			girl->happiness(-(healthmod + g_Dice % healthmod));
			ss << "One of the animals kicked " << girlName << " and ";
			if (girl->health() < 1)
			{
				ss << "killed her.\n";
				g_MessageQue.AddToQue(girlName + " was killed when an animal she was milking kicked her in the head.", COLOR_RED);
				return false;	// not refusing, she is dead
			}
			else ss << (healthmod > 5 ? "" : "nearly ") << "broke her arm.\n";
			drinks -= (5 + g_Dice % 6);
		}
	}
//.........这里部分代码省略.........
开发者ID:Jenocke,项目名称:test,代码行数:101,代码来源:WorkMilker.cpp

示例5: IsGirlInjured

bool cGirlTorture::IsGirlInjured(unsigned int unModifier)
{  // modifier: 5 = 5% chance, 10 = 10% chance

	// Sanity check, Can't get injured
	if (m_Girl->has_trait("Incorporeal")) return false;


	/*
	*	WD	Injury was only possible if girl is pregnant or
	*		hasn't got the required traits.
	*
	*		Now check for injury first
	*		Use usigned int so can't pass negative chance
	*/
	string	sMsg;
	string	sGirlName = m_Girl->m_Realname;
	int		nMod = static_cast<int>(unModifier);
	if (cfg.initial.torture_mod() < 0){ nMod += nMod; }


	if (m_Girl->has_trait("Fragile"))	nMod += nMod;	// nMod *= 2;
	if (m_Girl->has_trait("Tough"))		nMod /= 2;
	if (nMod < 1) nMod = 1;		// `J` always at least a 1% chance

	// Did the girl get injured
	if (!g_Dice.percent(nMod)) return false;
	/*
	*	INJURY PROCESSING
	*	Only injured girls continue past here
	*/

	// Post any outstanding Player messages
	if (m_TorturedByPlayer && !m_Message.empty())
	{
		g_MessageQue.AddToQue(m_Message, 0);
		m_Girl->m_Events.AddMessage(m_Message, IMGTYPE_TORTURE, EVENT_SUMMARY);	// `J` added

		m_Message = sGirlName + ": ";
	}

	// getting hurt badly could lead to scars
	if (g_Dice.percent(nMod * 2) &&
		!m_Girl->has_trait("Small Scars") &&
		!m_Girl->has_trait("Cool Scars") &&
		!m_Girl->has_trait("Horrific Scars"))
	{
		int chance = g_Dice % 6;
		if (chance == 0)
		{
			m_Girl->add_trait("Horrific Scars", false);
			if (m_TorturedByPlayer)
				m_Message += gettext("She was badly injured, and now has to deal with Horrific Scars.\n");
			else
				MakeEvent(sGirlName + gettext(" was badly injured, and now has Horrific Scars.\n"));
		}
		else if (chance <= 2)
		{
			m_Girl->add_trait("Small Scars", false);
			if (m_TorturedByPlayer)
				m_Message += gettext("She was injured and now has a couple of Small Scars.\n");
			else
				MakeEvent(sGirlName + gettext(" was injured, and now has Small Scars.\n"));
		}
		else
		{
			m_Girl->add_trait("Cool Scars", false);
			if (m_TorturedByPlayer)
				m_Message += gettext("She was injured and scarred. As scars go however, at least they are pretty Cool Scars.\n");
			else
				MakeEvent(sGirlName + gettext(" was injured and scarred. She now has Cool Scars.\n"));
		}
	}

	// in rare cases, she might even lose an eye
	if (g_Dice.percent((nMod / 2)) &&
		!m_Girl->has_trait("One Eye") &&
		!m_Girl->has_trait("Eye Patch"))
	{
		int chance = g_Dice % 3;
		if (chance == 0)
		{
			m_Girl->add_trait("One Eye", false);
			if (m_TorturedByPlayer)
				m_Message += gettext("Oh, no! She was badly injured, and now only has One Eye!\n");
			else
				MakeEvent(sGirlName + gettext(" was badly injured and lost an eye.\n"));
		}
		else
		{
			m_Girl->add_trait("Eye Patch", false);
			if (m_TorturedByPlayer)
				m_Message += gettext("She was injured and lost an eye, but at least she has a cool Eye Patch to wear.\n");
			else
				MakeEvent(sGirlName + gettext(" was injured and lost an eye, but at least she has a cool Eye Patch to wear.\n"));
		}
	}

	// or lose tough or become fragile
	if (m_Girl->has_trait("Tough"))
	{
//.........这里部分代码省略.........
开发者ID:DagothRa,项目名称:crazys-wm-mod,代码行数:101,代码来源:cGirlTorture.cpp

示例6: WorkPeepShow


//.........这里部分代码省略.........
            sextype = SKILL_LESBIAN;
            /* `J` g_Girls.GirlFucks handles skill gain from sex
            g_Girls.UpdateSkill(girl, SKILL_LESBIAN, 1);
            //*/
        }
        else if (g_Girls.HasTrait(girl, "Bisexual") && (g_Girls.HasTrait(girl, "Nymphomaniac") || g_Girls.HasTrait(girl, "Succubus")))
        {
            if (roll <= 50)
            {
                ss << "\nShe was horny and she loves sex so she brought in another girl and had sex with her while the customers watched.\n";
                sextype = SKILL_LESBIAN;
                /* `J` g_Girls.GirlFucks handles skill gain from sex
                g_Girls.UpdateSkill(girl, SKILL_LESBIAN, 1);
                //*/
            }
            else
            {
                ss << "\nShe was horny and she loves sex so she brought in one of the customers and had sex with him while the others watched.";
                sextype = SKILL_NORMALSEX;
            }
        }
        else if (g_Girls.HasTrait(girl, "Straight") && (g_Girls.HasTrait(girl, "Nymphomaniac") || g_Girls.HasTrait(girl, "Succubus")))
        {
            ss << "\nShe was horny and she loves sex so she brought in one of the customers and had sex with him while the others watched.\n";
            sextype = SKILL_NORMALSEX;
        }
        //New stuff
        else if (g_Girls.HasTrait(girl, "Futanari"))
        {
            //Addiction bypasses confidence check
            if (g_Girls.HasTrait(girl, "Cum Addict"))
            {
                //Autofellatio, belly gets in the way if pregnant, requires extra flexibility
                if (g_Girls.HasTrait(girl, "Flexible") && !(girl->is_pregnant()) && g_Dice.percent(50))
                {
                    ss << "\nDuring her shift " << girlName << " couldn't resist the temptation of taking a load of hot, delicious cum in her mouth and began to suck her own cock. The customers enjoyed a lot such an unusual show.";
                    g_Girls.UpdateSkill(girl, SKILL_ORALSEX, 1);
                    g_Girls.UpdateStat(girl, STAT_HAPPINESS, 1);
                    tips += 30;
                }
                else
                {
                    //default Cum Addict
                    ss << "\n" << girlName << " won't miss a chance to taste some yummy cum. She came up on the stage with a goblet, cummed in it and then drank the content to entertain the customers.";
                    g_Girls.UpdateStat(girl, STAT_HAPPINESS, 1);
                    tips += 10;
                }
                GetMiscCustomer(brothel, Cust);
                brothel->m_Happiness += 100;
                g_Girls.UpdateStatTemp(girl, STAT_LIBIDO, -30);
                // work out the pay between the house and the girl
                wages += g_Girls.GetStat(girl, STAT_ASKPRICE) + 60;
                imagetype = IMGTYPE_MAST;
            }
            //Let's see if she has what it takes to do it: Confidence > 65 or Exhibitionist trait, maybe shy girls should be excluded
            else if (!g_Girls.HasTrait(girl, "Cum Addict") && g_Girls.HasTrait(girl, "Exhibitionist") || !g_Girls.HasTrait(girl, "Cum Addict") && g_Girls.GetStat(girl, STAT_CONFIDENCE) > 65)
            {
                //Some variety
                //Autopaizuri, requires very big breasts
                if (g_Dice.percent(25) && g_Girls.HasTrait(girl, "Abnormally Large Boobs") || g_Dice.percent(25) && (g_Girls.HasTrait(girl, "Titanic Tits")))
                {
                    ss << "\n" << girlName << " was horny and decided to deliver a good show. She put her cock between her huge breasts and began to slowly massage it. The crowd went wild when she finally came on her massive tits.";
                    g_Girls.UpdateSkill(girl, SKILL_TITTYSEX, 1);
                    tips += 30;
                }
                //cums over self
开发者ID:diamondialis,项目名称:crazys-wm-mod,代码行数:67,代码来源:WorkPeepShow.cpp

示例7: WorkHallEntertainer

// `J` Job Brothel - Hall
bool cJobManager::WorkHallEntertainer(sGirl* girl, sBrothel* brothel, bool Day0Night1, string& summary)
{
#pragma region //	Job setup				//
	int actiontype = ACTION_WORKHALL;
	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))
	{
		//SIN - More informative mssg to show *what* she refuses
		//ss << " refused to work during the " << (Day0Night1 ? "night" : "day") << " shift.";
		ss << " refused to entertain patrons in the gambling hall " << (Day0Night1 ? "tonight." : "today.");
		girl->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, EVENT_NOWORK);
		return true;
	}
	ss << " worked as an entertainer in the gambling hall.\n\n";

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

	sGirl* dealeronduty = g_Brothels.GetRandomGirlOnJob(0, JOB_DEALER, Day0Night1);
	string dealername = (dealeronduty ? "Dealer " + dealeronduty->m_Realname + "" : "the Dealer");

	int wages = 25, tips = 0;
	int work = 0, fame = 0;
	int imagetype = IMGTYPE_BUNNY;
	int msgtype = Day0Night1;

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

	double jobperformance = JP_HallEntertainer(girl, false);

	//SIN: A little pre-randomness
	if (g_Dice.percent(50))
	{
		if (g_Girls.GetStat(girl, STAT_TIREDNESS) > 75)
		{
			ss << "She was very tired, negatively affecting her performance.\n";
			jobperformance -= 10;
		}
		else if (g_Girls.GetStat(girl, STAT_HAPPINESS) > 90)
		{
			ss << "Her cheeriness improved her performance.\n";
			jobperformance += 5;
		}
		if (g_Dice.percent(10))
		{
			if (g_Girls.GetSkill(girl, SKILL_STRIP) > 60)
			{
				ss << "A born stripper, " << girlName << " wears her clothes just short of showing flesh, just the way the customers like it.\n";
				jobperformance += 15;
			}
			if (g_Girls.GetStat(girl, STAT_PCHATE) > g_Girls.GetStat(girl, STAT_PCFEAR))
			{
				ss << " " << girlName << " opened with some rather rude jokes about you. While this annoys you a little, ";
				if (girl->has_trait( "Your Daughter"))
				{
					ss << "she is your daughter, and ";
				}
				ss << "it seems to get the audience on her side.\n";
				jobperformance += 15;
			}
		}
	}

	if (jobperformance >= 245)
	{
		ss << " She must be the perfect entertainer customers go on and on about her and always come to see her when she works.\n\n";
		wages += 155;
		if (roll_b <= 20)
		{
			if (girl->has_trait( "Aggressive"))
			{
				ss << "The heat of her passion and strength of her fierce nature make " << girlName << "'s songs absolutely riveting to listen to.\n";
			}
			else
			{
				ss << "Every one of " << girlName << "'s jokes elicits a wave of laughter from the crowd of patrons, many of whom have no interest in gambling.\n";
			}
		}
		else if (roll_b <= 40)
		{
			if (girl->has_trait( "Elegant"))
			{
				ss << girlName << "'s very appearance in the door of the gambling hall leads to applause and the sudden appearance of a clear way to the stage steps.\n";
			}
			else
			{
				ss << "Her voice is that of an angel, and her humor is as sharp and cutting as a blade.\n";
			}
		}
		else if (roll_b <= 60)
		{
			ss << "Each shift, " << girlName << " ends her show by blowing a kiss to her fans, producing waves of applause and cheers.\n";
		}
		else if (roll_b <= 80)
		{
			if (girl->has_trait( "Charming") || girl->has_trait( "Charismatic"))
			{
				ss << "There is no way to resist the raw charisma " << girlName << " practically exudes, drawing everybody around her towards her stage.\n";
//.........这里部分代码省略.........
开发者ID:mjsmagalhaes,项目名称:crazys-wm-mod,代码行数:101,代码来源:WorkHallEntertainer.cpp

示例8: UpdateGirls


//.........这里部分代码省略.........
		}
		summary = "";
		m_JobManager.JobFunc[sw](current, brothel, Day0Night1, summary);

		current = current->m_Next; // Next Girl
	}

	///////////////////////////////////
	//  Finaly do end of day stuff.  //
	///////////////////////////////////
	current = brothel->m_Girls;
	while (current)
	{
		if (current->health() <= 0)
		{	// skip dead girls
			if (current->m_Next) { current = current->m_Next; continue; }
			else { current = 0; break; }
		}
		girlName = current->m_Realname;
		sum = EVENT_SUMMARY; summary = ""; ss.str("");

		// update for girls items that are not used up
		do_daily_items(brothel, current);					// `J` added

		// Level the girl up if nessessary
		g_Girls.LevelUp(current);
		// Natural healing, 2% health and 2% tiredness per day
		g_Girls.UpdateStat(current, STAT_HEALTH, 2, false);
		g_Girls.UpdateStat(current, STAT_TIREDNESS, -2, false);


		if (g_Girls.GetStat(current, STAT_HAPPINESS) < 40)
		{
			if (current->m_NightJob != matronjob && matron && brothel->m_NumGirls > 1 && g_Dice.percent(70))
			{
				ss << "The Centre Manager helps cheer up " << girlName << " when she is feeling sad.\n";
				g_Girls.UpdateStat(current, STAT_HAPPINESS, g_Dice % 10 + 5);
			}
			else if (brothel->m_NumGirls > 10 && g_Dice.percent(50))
			{
				ss << "Some of the other girls help cheer up " << girlName << " when she is feeling sad.\n";
				g_Girls.UpdateStat(current, STAT_HAPPINESS, g_Dice % 8 + 3);
			}
			else if (brothel->m_NumGirls > 1 && g_Dice.percent(max(brothel->m_NumGirls, 50)))
			{
				ss << "One of the other girls helps cheer up " << girlName << " when she is feeling sad.\n";
				g_Girls.UpdateStat(current, STAT_HAPPINESS, g_Dice % 6 + 2);
			}
			else if (brothel->m_NumGirls == 1 && g_Dice.percent(70))
			{
				ss << girlName << " plays around in the empty building until she feels better.\n";
				g_Girls.UpdateStat(current, STAT_HAPPINESS, g_Dice % 10 + 10);
			}
			else if (g_Girls.GetStat(current, STAT_HAPPINESS) < 20) // no one helps her and she is really unhappy
			{
				ss << girlName << " is looking very depressed. You may want to do something about that before she does something drastic.\n";
				sum = EVENT_WARNING;
			}
		}

		if (g_Girls.GetStat(current, STAT_TIREDNESS) > 80 || g_Girls.GetStat(current, STAT_HEALTH) < 40)
		{
			int t = g_Girls.GetStat(current, STAT_TIREDNESS);
			int h = g_Girls.GetStat(current, STAT_HEALTH);

			if (current->m_WorkingDay > 0)
开发者ID:DagothRa,项目名称:crazys-wm-mod,代码行数:67,代码来源:cCentre.cpp

示例9: WorkBarPiano


//.........这里部分代码省略.........
		}
		else
		{
			ss << girlName << " knows a note.  To bad its the only one she knows and plays it over and over.\n";
		}
	}
	else
	{
		ss << " She didn't play the piano so much as banged on it.\n\n";
		wages -= 15;
		if (roll <= 20)
		{
			ss << "Her audience seems paralyzed, as if they couldn't believe that a piano was capable of making such noise.\n";
			brothel->m_Happiness -= 10;
		}
		else if (roll <= 40)
		{
			ss << "After ten seconds you wanted to grab an axe and end the instrument's misery under " << girlName << "'s attempt to play.\n";
			brothel->m_Happiness -= 5;
		}
		else if (roll <= 60)
		{
			ss << "Noone else would call this random key-mashing 'playing', but " << girlName << " thinks otherwise.\n";
		}
		else if (roll <= 80)
		{
			ss << "When " << girlName << " started to play, the bar emptied almost instantly. This could be useful in a fire.\n";
		}
		else
		{
			ss << girlName << " banged on the piano clearly having no clue which note was which.\n";
		}
		//SIN - bit of randomness.
		if (g_Dice.percent(brothel->m_Filthiness / 50)) ss << "Soon after she started her set, some rats jumped out of the piano and fled the building. Patrons could be heard laughing.\n\n";
	}


	//base tips, aprox 5-30% of base wages
	tips += (((5 + jobperformance / 8) * 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 += 15;
	}

	if (g_Girls.HasTrait(girl, "Clumsy") && g_Dice.percent(5))
	{
		ss << "Her clumsy nature caused her to close the lid on her fingers making her have to stop playing for a few hours.\n\n"; wages -= 15;
	}

	if (g_Girls.HasTrait(girl, "Pessimist") && g_Dice.percent(20))
	{
		if (jobperformance < 125)
		{
			ss << "Her pessimistic mood depressed the customers making them tip less.\n\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\n"; tips += 10;
		}
	}

	if (g_Girls.HasTrait(girl, "Optimist") && g_Dice.percent(5))
	{
		if (jobperformance < 125)
开发者ID:DagothRa,项目名称:crazys-wm-mod,代码行数:67,代码来源:WorkBarPiano.cpp

示例10: WorkFilmAction

// Job Movie Studio - // nice Job - Action Scene
//This film will use her combat and magic skills, and will be more popular if she's hot.
bool cJobManager::WorkFilmAction(sGirl* girl, sBrothel* brothel, bool Day0Night1, string& summary)
{
	int actiontype = ACTION_WORKMOVIE;
	//Taken care of in building flow, leaving it in for robustness
	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 tips = 0;
	int enjoy = 0;
	int bonus = 0;
	double jobperformance = JP_FilmAction(girl, false);

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

	ss << girlName;
	int roll = g_Dice.d100();
	if (roll <= 10 && g_Girls.DisobeyCheck(girl, ACTION_WORKMOVIE, brothel))
	{
		ss << " refused to shoot an action scenes today.\n";
		girl->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, EVENT_NOWORK);
		return true;
	}
	else if (g_Girls.GetStat(girl, STAT_TIREDNESS) > 75)
	{
		ss << " was too tired to take part in an action scene.\n\n";
		girl->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, EVENT_NOWORK);
		return true;
	}
	else ss << " worked as an actress in an action scene.\n\n";


	//JOB
	ss << girlName;
	int OPTIONS = 3; //Right now this number of options applies for all levels of job
	if (jobperformance >= 350)
	{
		ss << " made an outstanding action scene,";
		AddStory(&ss);
		ss << " It will definitely win her some fans.";
		g_Girls.UpdateStat(girl, STAT_FAME, 3);
		bonus = 12;
	}
	else if (jobperformance >= 245)
	{
		ss << " made a great action scene,";
		AddStory(&ss);
		ss << " It should win her some fans.";
		g_Girls.UpdateStat(girl, STAT_FAME, 2);
		bonus = 6;
	}
	else if (jobperformance >= 185)
	{
		ss << " made a fairly good action scene,";
		AddStory(&ss);
		ss << " Her fans will enjoy it.";
		bonus = 4;
		g_Girls.UpdateStat(girl, STAT_FAME, 1);
	}
	else if (jobperformance >= 145)
	{
		ss << " made an uninspired action scene,";
		AddStory(&ss);
		ss << " Her diehard fans might enjoy it.";
		bonus = 2;
	}
	else if (jobperformance >= 100)
	{
		ss << " made a weak action scene,";
		AddStory(&ss);
		bonus = 1;
		ss << "\nThe CamerMage advised " << girlName << " how to improve her performance";
		if (g_Dice.percent(40))
		{
			ss << " and her scene got a little better after this.";
			bonus++;
		}
		else
		{
			ss << ", but she wouldn't listen.";
		}
	}
	else
	{
		ss << " made an awful action scene,";
		AddStory(&ss);
		ss << " Even her fans will hate it.";
		g_Girls.UpdateStat(girl, STAT_FAME, -1);
	}

	ss << "\n";

	//Enjoyed? If she performed well, she'd should have enjoyed it.
//.........这里部分代码省略.........
开发者ID:mjsmagalhaes,项目名称:crazys-wm-mod,代码行数:101,代码来源:WorkFilmAction.cpp

示例11: WorkTorturer

// `J` Job Brothel - General
bool cJobManager::WorkTorturer(sGirl* girl, sBrothel* brothel, bool Day0Night1, string& summary)
{
	int actiontype = ACTION_WORKTORTURER;
	if (Day0Night1) return false;		// Do this only once a day
	stringstream ss; string girlName = girl->m_Realname; ss << girlName;
	if (g_Girls.DisobeyCheck(girl, actiontype, brothel))
	{
		ss << " refused to torture anyone.";
		girl->morality(1);
		girl->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, EVENT_NOWORK);
		return true;
	}
	ss << " is assigned to torture people in the dungeon.";
	girl->morality(-1);

	g_Girls.EquipCombat(girl);	// ready armor and weapons!

	// Complications
#if 0
	if (g_Dice.percent(10))
	{
		g_Girls.UpdateEnjoyment(girl, actiontype, -3);
		ss << girlName << gettext(" hurt herself while torturing someone.");
		girl->m_Events.AddMessage(message, IMGTYPE_PROFILE, Day0Night1);
	}
	else
	{
		g_Girls.UpdateEnjoyment(girl, actiontype, +3);
		ss << girlName << gettext(" enjoyed her job working in the dungeon.");
		girl->m_Events.AddMessage(message, IMGTYPE_PROFILE, Day0Night1);
	}
#else
	//SIN: bit more variety for the above
	int roll(g_Dice % 5);
	bool forFree = false;
	if (g_Dice.percent(10))
	{
		g_Girls.UpdateEnjoyment(girl, actiontype, -3);
		if (g_Girls.HasTrait(girl, "Sadistic") || g_Girls.HasTrait(girl, "Merciless") || g_Girls.GetStat(girl, STAT_MORALITY) < 30)
			ss << girlName << gettext(" hurt herself while torturing someone.\n");
		else
		{
			switch (roll)
			{
			case 0:		ss << girlName << gettext(" felt bad torturing people as she could easily see herself in the victim.\n"); break;
			case 1:		ss << girlName << gettext(" doesn't like this as she feels it is wrong to torture people.\n"); break;
			case 2:		ss << girlName << gettext(" feels like a bitch after one of her torture victims wept the entire time and kept begging her to stop.\n"); break;
			case 3:		ss << girlName << gettext(" feels awful after accidentally whipping someone in an excruciating place.\n"); break;
			case 4:		ss << girlName << gettext(" didn't enjoy this as she felt sorry for the victim.\n"); break;
			default:	ss << girlName << gettext(" didn't enjoy this for some illogical reason. [error]\n"); break; //shouldn't happen
			}
			//And a little randomness
			if (g_Dice.percent(40))
			{
				roll = g_Dice % 3;
				switch (roll)
				{
				case 0:
					ss << gettext("She hates you for making her do this today.\n");
					g_Girls.UpdateStat(girl, STAT_PCLOVE, -(g_Dice % 2));
					g_Girls.UpdateStat(girl, STAT_PCHATE, g_Dice % 2);
					break;
				case 1:
					ss << girlName << gettext(" is terrified that you treat people like this.\n");
					g_Girls.UpdateStat(girl, STAT_PCFEAR, g_Dice % 6);
					g_Girls.UpdateStat(girl, STAT_OBEDIENCE, g_Dice % 2);
					break;
				case 2:
					ss << gettext("She learned a bit about medicine while trying to stop the pain.\n");
					g_Girls.UpdateSkill(girl, SKILL_MEDICINE, g_Dice % 10);
					break;
				default:
					ss << girlName << gettext(" did something completely unexpected. [error]");
					break;
				}
			}
		}
		girl->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, Day0Night1);
	}
	else
	{
		g_Girls.UpdateEnjoyment(girl, actiontype, +3);
		switch (roll)
		{
		case 0:		ss << girlName << gettext(" enjoyed her job working in the dungeon.\n"); break;
		case 1:		ss << girlName << gettext(" is turned on by the power of torturing people.\n"); break;
		case 2:		ss << girlName << gettext(" enjoyed trying out different torture devices and watching the effects on the victim.\n"); break;
		case 3:		ss << girlName << gettext(" spent her time in the dungeon whipping her victim in time to music to make amusing sound effects.\n"); break;
		case 4:		ss << girlName << gettext(" uses the victim's cries and screams to to figure out the 'best' areas to torture.\n"); break;
		default:	ss << girlName << gettext(" enjoyed this for some illogical reason. [error]\n"); break;
		}

		//And a little randomness
		if ((g_Girls.GetStat(girl, STAT_MORALITY) < 20 || g_Girls.HasTrait(girl, "Sadistic")) && g_Dice.percent(20))
		{
			ss << girlName << gettext(" loved this so much she wouldn't accept any money, as long as you promise she can do it again soon.\n");
			g_Girls.UpdateEnjoyment(girl, actiontype, +3);
			forFree = true;
		}
//.........这里部分代码省略.........
开发者ID:belroshir,项目名称:crazys-wm-mod,代码行数:101,代码来源:WorkTorturer.cpp

示例12: WorkSecurity

// `J` Job Brothel - General
bool cJobManager::WorkSecurity(sGirl* girl, sBrothel* brothel, bool Day0Night1, string& summary)
{
	int actiontype = ACTION_WORKSECURITY;
	stringstream ss; string girlName = girl->m_Realname; ss << girlName;
	if (g_Girls.DisobeyCheck(girl, actiontype, brothel))
	{
		ss << " refused to work security in your brothel " << (Day0Night1 ? "tonight." : "today.");
		girl->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, EVENT_NOWORK);
		return true;
	}
	ss << " worked Security in the brothel.\n\n";




	int enjoy = 0;
	int wages = 0;
	int tips = 0;
	int roll_a = g_Dice.d100(), roll_b = g_Dice.d100(), roll_c = g_Dice.d100();
	int imagetype = IMGTYPE_COMBAT;

	g_Girls.EquipCombat(girl);	// ready armor and weapons!

	sGirl* stripperonduty = g_Brothels.GetRandomGirlOnJob(brothel->m_id, JOB_BARSTRIPPER, Day0Night1);
	string strippername = (stripperonduty ? "Stripper " + stripperonduty->m_Realname + "" : "the Stripper");

	sGirl* whoreonduty = g_Brothels.GetRandomGirlOnJob(brothel->m_id, JOB_WHOREBROTHEL, Day0Night1);
	string whorename = (whoreonduty ? "Whore " + whoreonduty->m_Realname + "" : "the Whore");


	double SecLev = JP_Security(girl, false);


	// Complications
	if (roll_a <= 25)
	{
        switch(g_Dice%5)
        {
        case 2: //'Mute' Unrulely Customers rape her
        {
            enjoy-=g_Dice%3+1;
            SecLev-=SecLev/10;
            ss<< "She tried to Fight off some unruly patrons, but they turned on her and raped her.";
            int custCount=g_Dice%4+1;
            customer_rape(girl,custCount);
            break;
        }
		case 3:
		{
			enjoy -= g_Dice % 3 + 1;
			double secLvlMod = SecLev / 10.0;
			ss << "She stumbled across some patrons trying to rape a female customer.\n";
			int combatMod = (girl->combat() + girl->magic() + girl->agility()) / 3;
			if (g_Dice.percent(combatMod))
			{
				ss << "She succeeded in saving the girl from being raped."; //'Mute" TODO add posiblity of adding female customers to dungeon
				SecLev += secLvlMod;
			}
			else
			{
				SecLev -= secLvlMod;
				int rapers = g_Dice % 4 + 1;
				ss << "She failed in saving her. They where both raped by " << rapers << " men.\n";
				customer_rape(girl, rapers);
			}
			break;
		}
        default:
        {
            enjoy -= g_Dice % 3 + 1;
            SecLev -= SecLev / 10;
            ss << "She had to deal with some very unruly patrons that gave her a hard time.";
            break;
        }
        }

	}
	else if (roll_a >= 75)
	{
		enjoy += g_Dice % 3 + 1;
		SecLev += SecLev / 10;
		ss << "She successfully handled unruly patrons.";
	}
	else
	{
		enjoy += g_Dice % 2;
		ss << "She had an uneventful day watching over the brothel.";
	}
	ss << "\n\n";

	if (girl->libido() >= 70 && g_Dice.percent(20))
	{
		int choice = g_Dice % 2;
		ss << "Her libido caused her to get distracted while watching ";
		/*might could do more with this FIXME CRAZY*/
		if (girl->has_trait( "Lesbian"))	choice = 0;
		if (girl->has_trait( "Straight"))	choice = 1;
		switch (choice)
		{
//.........这里部分代码省略.........
开发者ID:mjsmagalhaes,项目名称:crazys-wm-mod,代码行数:101,代码来源:WorkSecurity.cpp

示例13: WorkRepairShop

// `J` Job Clinic - Surgery
bool cJobManager::WorkRepairShop(sGirl* girl, sBrothel* brothel, bool Day0Night1, string& summary)
{
	int actiontype = ACTION_GENERAL;
	stringstream ss; string girlName = girl->m_Realname; ss << girlName;
	g_Girls.UnequipCombat(girl);	// not for patients

	if (!g_Girls.HasTrait(girl, "Construct") && !g_Girls.HasTrait(girl, "Half-Construct"))
	{
		ss << girlName << " has no artificial parts so she was sent to the Healing center.";
		if (Day0Night1 == SHIFT_DAY) girl->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, EVENT_WARNING);
		if (girl->m_DayJob == JOB_GETREPAIRS)	girl->m_DayJob = JOB_GETHEALING;
		if (girl->m_NightJob == JOB_GETREPAIRS)	girl->m_NightJob = JOB_GETHEALING;
		return false;	// not refusing
	}

	int nummecs = g_Clinic.GetNumGirlsOnJob(0, JOB_MECHANIC, Day0Night1);
	int numnurse = g_Clinic.GetNumGirlsOnJob(0, JOB_NURSE, Day0Night1);

	// `J` base recovery copied freetime recovery
	int health = 10 + (girl->constitution() / 10);
	int tiredness = 10 + g_Dice % 21;	// build up as positive then apply as negative
	int happy = 10 + g_Dice % 11;
	int mana = 5 + (girl->magic() / 5);
	int libido = (g_Girls.HasTrait(girl, "Nymphomaniac") ? 15 : 5);

	if (nummecs + numnurse < 1)
	{
		ss << "You don't have any Mechanics or Nurses on duty so " << girlName << " just rests in a hospital bed.";
	}
	else
	{
		ss << girlName << " does nothing while ";
	}
	if (nummecs > 0)
	{
		ss << "the Mechanic" << (nummecs > 1 ? "s" : "");
		if (g_Girls.HasTrait(girl, "Half-Construct") && girl->m_DayJob == JOB_GETREPAIRS && girl->m_NightJob == JOB_GETREPAIRS)
		{	// if fixed by Mechanic for both shifts.
			health += 20;	// Total 40 healing per day, heals less because Mechanic does not fix living tissue.
		}
		else
		{
			health += 30;
		}
	}
	if (nummecs > 0 && numnurse > 0) { ss << " and"; }
	if (numnurse > 0)
	{
		ss << " the Nurse" << (numnurse > 1 ? "s" : "");
		health += 10;
		tiredness += 10;
		happy += 10;
		mana += (girl->magic() / 5);
	}
	if (nummecs + numnurse >= 4 && g_Dice.percent(50))	// lots of people making sure she is in good working order
	{
		g_Girls.UpdateStat(girl, STAT_CONSTITUTION, 1);
	}
	ss << (((nummecs > 1 && numnurse < 1) || numnurse > 1) ? " take" : " takes") << " care of her.";

	// Improve girl
	if (g_Girls.HasTrait(girl, "Lesbian"))		libido += numnurse;
	if (g_Girls.HasTrait(girl, "Masochist"))	libido += 1;
	if (g_Girls.HasTrait(girl, "Nymphomaniac"))	libido += 2;

	g_Girls.UpdateStat(girl, STAT_HEALTH, health, false);
	g_Girls.UpdateStat(girl, STAT_TIREDNESS, -tiredness, false);
	g_Girls.UpdateStat(girl, STAT_HAPPINESS, happy);
	g_Girls.UpdateStat(girl, STAT_MANA, mana);
	g_Girls.UpdateStatTemp(girl, STAT_LIBIDO, libido);
	if (g_Dice % 10 == 0) g_Girls.UpdateSkill(girl, SKILL_MEDICINE, 1);	// `J` she watched what the doctors and nurses were doing

	g_Girls.UpdateStat(girl, STAT_EXP, 1);   // Just because!

	// send her to the waiting room when she is healthy
	if (girl->health() > 90 && girl->tiredness() < 10)
	{
		if (nummecs + numnurse < 1)	ss << "\n\nShe wanders out of the Clinic when she is feeling better.";
		else						ss << "\n\nShe has been released from the Clinic.";
		if (girl->m_DayJob == JOB_GETHEALING)	girl->m_DayJob = JOB_CLINICREST;
		if (girl->m_NightJob == JOB_GETHEALING)	girl->m_NightJob = JOB_CLINICREST;
		if (girl->m_DayJob == JOB_GETREPAIRS)	girl->m_DayJob = JOB_CLINICREST;
		if (girl->m_NightJob == JOB_GETREPAIRS)	girl->m_NightJob = JOB_CLINICREST;
	}

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

	return false;
}
开发者ID:Jenocke,项目名称:test,代码行数:90,代码来源:WorkRepairShop.cpp

示例14: Update

void cRivalManager::Update(int& NumPlayerBussiness)
{
	cRival* curr = m_Rivals;
	cConfig cfg;

	if (g_Year >= 1209 && g_Month > 3) m_PlayerSafe = false;

	while (curr)
	{
		// check if rival is killed
		if (curr->m_Gold <= 0 && curr->m_NumBrothels <= 0 && curr->m_NumGangs <= 0 &&
			curr->m_NumGirls <= 0 && curr->m_NumGamblingHalls <= 0 && curr->m_NumBars <= 0 &&
			curr->m_NumInventory <= 0)
		{
			cRival* tmp = curr->m_Next;
			RemoveRival(curr);
			curr = tmp;
			SetGameFlag(FLAG_RIVALLOSE);
			continue;
		}

		int income = 0; int upkeep = 0; int profit = 0;
		int totalincome = 0; int totalupkeep = 0;
		int startinggold = curr->m_Gold;

		// `J` added - rival power
		// `J` reworked to reduce the rival's power
		curr->m_Power = 
			max(0, curr->m_NumBrothels * 5) +
			max(0, curr->m_NumGamblingHalls * 2) +
			max(0, curr->m_NumBars * 1);
	
		// check if a rival is in danger
		if (curr->m_Gold <= 0 || curr->m_NumBrothels <= 0 || curr->m_NumGirls <= 0 || curr->m_NumGamblingHalls <= 0 || curr->m_NumBars <= 0)
		{
			// The AI is in danger so will stop extra spending
			curr->m_BribeRate = 0;
			curr->m_Influence = 0;

			// first try to sell any items
			if (curr->m_NumInventory > 0)
			{
				for (int i = 0; i < MAXNUM_RIVAL_INVENTORY && curr->m_Gold + income + upkeep < 1000; i++)
				{
					sInventoryItem* temp = curr->m_Inventory[i];
					if (temp)
					{
						income += (temp->m_Cost / 2);
						RemoveRivalInvByNumber(curr, i);
					}
				}
			}

			// try to buy at least one of each to make up for losses
			if (curr->m_NumBrothels <= 0 && curr->m_Gold + income + upkeep - 20000 >= 0)
			{
				upkeep -= 20000;
				curr->m_NumBrothels++;
			}
			if (curr->m_NumGirls <= 0 && curr->m_Gold + income + upkeep - 550 >= 0)
			{
				upkeep -= 550;
				curr->m_NumGirls++;
			}
			if (curr->m_NumGamblingHalls <= 0 && curr->m_Gold + income + upkeep - 10000 >= 0)
			{
				curr->m_NumGamblingHalls++;
				upkeep -= 10000;
			}
			if (curr->m_NumBars <= 0 && curr->m_Gold + income + upkeep - 2500 >= 0)
			{
				curr->m_NumBars++;
				upkeep -= 2500;
			}
			// buy more girls if there is enough money left (save at least 1000 in reserve)
			if (curr->m_Gold + income + upkeep >= 1550 && (curr->m_NumGirls < 5 || curr->m_NumGirls < curr->m_NumBrothels * 20))
			{
				int i = 0;
				while (curr->m_Gold + income + upkeep >= 1550 && i < (g_Dice % 5) + 1)	// buy up to 5 girls if they can afford it.
				{
					upkeep -= 550;
					curr->m_NumGirls++;
					i++;
				}
			}
		}

		// process money
		totalincome += income; totalupkeep += upkeep; curr->m_Gold += income; curr->m_Gold += upkeep; profit = totalincome + totalupkeep; 
		income = upkeep = 0;
		
		for (int i = 0; i < curr->m_NumGirls; i++)	// from girls
		{
			// If a rival has more girls than their brothels can handle, the rest work on the streets
			double rapechance = (i > curr->m_NumBrothels * 20 ? cfg.prostitution.rape_brothel() : cfg.prostitution.rape_streets());
			int Customers = g_Dice % 6;				// 0-5 cust per girl
			for (int i = 0; i < Customers;i++)
			{
				if (g_Dice.percent(rapechance))
				{
//.........这里部分代码省略.........
开发者ID:taukita,项目名称:crazys-wm-mod,代码行数:101,代码来源:cRival.cpp

示例15: WorkFarmHand


//.........这里部分代码省略.........
	if ((girl->is_slave() && !cfg.initial.slave_pay_outofpocket()))
	{
		CleanAmt = CleanAmt * 0.9;
		wages = 0;
	}
	else
	{
		wages = int(CleanAmt); // `J` Pay her based on how much she cleaned
	}

	// `J` if she can clean more than is needed, she has a little free time after her shift
	if (brothel->m_Filthiness < CleanAmt / 2) playtime = true;
	ss << "\n\nCleanliness rating improved by " << int(CleanAmt);
	if (playtime)	// `J` needs more variation
	{
		ss << "\n\n" << girlName << " finished her cleaning early so she ";
		if (Day0Night1 == SHIFT_DAY && roll_c % 3 == 1)	// 33% chance she will watch the sunset when working day shift
		{
			ss << "sat beneath an oak tree and watched the sunset.";
			g_Girls.UpdateStat(girl, STAT_TIREDNESS, -((g_Dice % 5) + 2));
		}
		else if (roll_c < 25)
		{
			ss << "played with the baby animals a bit.";
			g_Girls.UpdateSkill(girl, SKILL_ANIMALHANDLING, (g_Dice % 2) + 1);
		}
		else if (roll_c < 50)
		{
			ss << "played in the dirt a bit.";
			g_Girls.UpdateSkill(girl, SKILL_FARMING, (g_Dice % 2));
		}
		else
		{
			ss << "sat in a rocking chair on the farm house front porch whittling.";
			g_Girls.UpdateSkill(girl, SKILL_CRAFTING, (g_Dice % 3));
			g_Girls.UpdateStat(girl, STAT_TIREDNESS, -(g_Dice % 3));
		}
		g_Girls.UpdateStat(girl, STAT_HAPPINESS, (g_Dice % 4) + 2);
	}

#if 0

	// `J` Farm Bookmark - adding in items that can be created in the farm















#endif




	// do all the output
	girl->m_Events.AddMessage(ss.str(), IMGTYPE_MAID, Day0Night1);
	brothel->m_Filthiness -= int(CleanAmt);

	// Money
	if (wages < 0)	wages = 0;	girl->m_Pay = (int)wages;
	if (tips < 0)	tips = 0;	girl->m_Tips = (int)tips;

	// Improve girl
	int xp = 5, libido = 1, skill = 3;

	if (enjoyC + enjoyF > 2)							{ xp += 1; skill += 1; }
	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; }

	g_Girls.UpdateStat(girl, STAT_EXP, (g_Dice % xp) + 1);
	g_Girls.UpdateStatTemp(girl, STAT_LIBIDO, libido);

	// primary (+2 for single or +1 for multiple)
	g_Girls.UpdateSkill(girl, SKILL_SERVICE, (g_Dice % skill));
	// secondary (-1 for one then -2 for others)
	g_Girls.UpdateSkill(girl, SKILL_CRAFTING, max(0, (g_Dice % skill) - 1));
	g_Girls.UpdateSkill(girl, SKILL_FARMING, max(0, (g_Dice % skill) - 2));
	g_Girls.UpdateStat(girl, STAT_STRENGTH, max(0, (g_Dice % skill) - 2));

	g_Girls.UpdateEnjoyment(girl, actiontype, enjoyF);
	g_Girls.UpdateEnjoyment(girl, actiontype2, enjoyC);
	// Gain Traits
	if (g_Dice.percent(girl->service()))
		g_Girls.PossiblyGainNewTrait(girl, "Maid", 90, actiontype2, girlName + " has cleaned enough that she could work professionally as a Maid anywhere.", Day0Night1);
	// Lose Traits
	if (g_Dice.percent(girl->service()))
		g_Girls.PossiblyLoseExistingTrait(girl, "Clumsy", 30, actiontype2, "It took her spilling hundreds of buckets, and just as many reprimands, but " + girl->m_Realname + " has finally stopped being so Clumsy.", Day0Night1);

	return false;
}
开发者ID:Jenocke,项目名称:test,代码行数:101,代码来源:WorkFarmHand.cpp


注:本文中的cRng::percent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。