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


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

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


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

示例1: WorkBreastReduction

// `J` Job Clinic - Surgery
bool cJobManager::WorkBreastReduction(sGirl* girl, sBrothel* brothel, bool Day0Night1, string& summary)
{
#pragma region //	Job setup				//
	stringstream ss; string girlName = girl->m_Realname; ss << girlName;
	// if she was not in surgery last turn, reset working days to 0 before proceding
	if (girl->m_YesterDayJob != JOB_BREASTREDUCTION) { girl->m_WorkingDay = girl->m_PrevWorkingDay = 0; }
	girl->m_DayJob = girl->m_NightJob = JOB_BREASTREDUCTION;	// it is a full time job

	if (girl->has_trait( "Flat Chest"))
	{
		ss << " already has a Flat Chest so she was sent to the waiting room.";
		if (Day0Night1 == SHIFT_DAY)	girl->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, EVENT_WARNING);
		girl->m_PrevDayJob = girl->m_PrevNightJob = girl->m_YesterDayJob = girl->m_YesterNightJob = girl->m_DayJob = girl->m_NightJob = JOB_CLINICREST;
		girl->m_WorkingDay = girl->m_PrevWorkingDay = 0;
		return false;	// not refusing
	}
	bool hasDoctor = g_Clinic.GetNumGirlsOnJob(0, JOB_DOCTOR, Day0Night1) > 0;
	int numnurse = g_Clinic.GetNumGirlsOnJob(0, JOB_NURSE, Day0Night1);
	if (!hasDoctor)
	{
		ss << " does nothing. You don't have any Doctors working. (require 1) ";
		girl->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, EVENT_WARNING);
		return false;	// not refusing
	}
	ss << " is in the Clinic to get her breasts reduced.\n\n";

	int msgtype = Day0Night1;
	g_Girls.UnequipCombat(girl);	// not for patient

#pragma endregion
#pragma region //	Count the Days				//

	if (Day0Night1 == SHIFT_DAY)	// the Doctor works on her durring the day
	{
		girl->m_WorkingDay++;
	}
	else	// and if there are nurses on duty, they take care of her at night
	{
		girl->m_WorkingDay = girl->m_PrevWorkingDay = 0;
		ss << "The surgery is a success.\n";
		msgtype = EVENT_GOODNEWS;

		ss << g_Girls.AdjustTraitGroupBreastSize(girl, -1, false) << "\n\n";

		if (numnurse > 2)
		{
			ss << "The Nurses kept her healthy and happy during her recovery.\n";
			g_Girls.UpdateStat(girl, STAT_HEALTH, g_Dice.bell(0, 20));
			g_Girls.UpdateStat(girl, STAT_HAPPINESS, g_Dice.bell(0, 10));
			g_Girls.UpdateStat(girl, STAT_SPIRIT, g_Dice.bell(0, 10));
			g_Girls.UpdateStat(girl, STAT_MANA, g_Dice.bell(0, 20));
			g_Girls.UpdateStat(girl, STAT_BEAUTY, g_Dice.bell(0, 2));
			g_Girls.UpdateStat(girl, STAT_CHARISMA, g_Dice.bell(0, 2));
		}
		else if (numnurse > 0)
		{
			ss << "The Nurse" << (numnurse > 1 ? "s" : "") << " helped her during her recovery.\n";
			g_Girls.UpdateStat(girl, STAT_HEALTH, g_Dice.bell(0, 10));
			g_Girls.UpdateStat(girl, STAT_HAPPINESS, g_Dice.bell(0, 5));
			g_Girls.UpdateStat(girl, STAT_SPIRIT, g_Dice.bell(0, 5));
			g_Girls.UpdateStat(girl, STAT_MANA, g_Dice.bell(0, 10));
			g_Girls.UpdateStat(girl, STAT_BEAUTY, g_Dice % 2);
			g_Girls.UpdateStat(girl, STAT_CHARISMA, g_Dice % 2);
		}
		else
		{
			ss << "She is sad and has lost some health during the operation.\n";
			g_Girls.UpdateStat(girl, STAT_HEALTH, g_Dice.bell(-20, 2));
			g_Girls.UpdateStat(girl, STAT_HAPPINESS, g_Dice.bell(-10, 1));
			g_Girls.UpdateStat(girl, STAT_SPIRIT, g_Dice.bell(-5, 1));
			g_Girls.UpdateStat(girl, STAT_MANA, g_Dice.bell(-20, 3));
			g_Girls.UpdateStat(girl, STAT_BEAUTY, g_Dice.bell(-1, 1));
			g_Girls.UpdateStat(girl, STAT_CHARISMA, g_Dice.bell(-1, 1));
		}

		if (girl->has_trait( "Flat Chest"))
		{
			ss << girlName << "'s breasts are as small as they can get so she was sent to the waiting room.";
			girl->m_PrevDayJob = girl->m_PrevNightJob = girl->m_YesterDayJob = girl->m_YesterNightJob = girl->m_DayJob = girl->m_NightJob = JOB_CLINICREST;
		}
	}

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

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

	// Improve girl
	int libido = 1;
	if (girl->has_trait( "Lesbian"))		libido += numnurse;
	if (girl->has_trait( "Masochist"))	libido += 1;
	if (girl->has_trait( "Nymphomaniac"))	libido += 2;
	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

#pragma endregion
	return false;
}
开发者ID:mjsmagalhaes,项目名称:crazys-wm-mod,代码行数:100,代码来源:WorkBreastReduction.cpp

示例2: WorkGetFertility

// `J` Job Clinic - Surgery
bool cJobManager::WorkGetFertility(sGirl* girl, sBrothel* brothel, bool Day0Night1, string& summary)
{
#pragma region //	Job setup				//
	stringstream ss; string girlName = girl->m_Realname; ss << girlName;
	// if she was not in surgery last turn, reset working days to 0 before proceding
	if (girl->m_YesterDayJob != JOB_FERTILITY) { girl->m_WorkingDay = girl->m_PrevWorkingDay = 0; }
	girl->m_DayJob = girl->m_NightJob = JOB_FERTILITY;	// it is a full time job

	if (girl->is_pregnant() || g_Girls.HasTrait(girl, "Broodmother"))
	{
		if (g_Girls.HasTrait(girl, "Broodmother"))	ss << " is already as Fertile as she can be so she was sent to the waiting room.";
		else if (girl->is_pregnant())				ss << " is pregant.\nShe must either have her baby or get an abortion before She can get recieve any more fertility treatments.";
		if (Day0Night1 == SHIFT_DAY)	girl->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, EVENT_WARNING);
		girl->m_PrevDayJob = girl->m_PrevNightJob = girl->m_YesterDayJob = girl->m_YesterNightJob = girl->m_DayJob = girl->m_NightJob = JOB_CLINICREST;
		girl->m_WorkingDay = girl->m_PrevWorkingDay = 0;
		return false;	// not refusing
	}
	bool hasDoctor = g_Clinic.GetNumGirlsOnJob(0, JOB_DOCTOR, Day0Night1) > 0;
	int numnurse = g_Clinic.GetNumGirlsOnJob(0, JOB_NURSE, Day0Night1);
	if (!hasDoctor)
	{
		ss << " does nothing. You don't have any Doctors working. (require 1) ";
		girl->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, EVENT_WARNING);
		return false;	// not refusing
	}
	ss << " is in the Clinic to get fertility treatment.\n\n";

	g_Girls.UnequipCombat(girl);	// not for patient
	int msgtype = Day0Night1;

#pragma endregion
#pragma region //	Count the Days				//

	if (Day0Night1 == SHIFT_DAY)	// the Doctor works on her durring the day
	{
		girl->m_WorkingDay++;
	}
	else	// and if there are nurses on duty, they take care of her at night
	{
		if (g_Clinic.GetNumGirlsOnJob(0, JOB_NURSE, 1) > 0)
		{
			girl->m_WorkingDay++;
			g_Girls.UpdateStat(girl, STAT_HEALTH, 10);
			g_Girls.UpdateStat(girl, STAT_HAPPINESS, 10);
			g_Girls.UpdateStat(girl, STAT_MANA, 10);
		}
	}

#pragma endregion
#pragma region //	In Progress				//

	if (girl->m_WorkingDay < 5 || Day0Night1 == SHIFT_DAY)
	{
		int wdays = (5 - girl->m_WorkingDay);
		if (g_Clinic.GetNumGirlsOnJob(0, JOB_NURSE, 1) > 0)
		{
			if (wdays >= 3)		{ wdays = 3; }
			else if (wdays > 1)	{ wdays = 2; }
			else				{ wdays = 1; }
		}
		ss << "The operation is in progress (" << wdays << " day remaining).\n";
		if (g_Clinic.GetNumGirlsOnJob(0, JOB_NURSE, 1) > 1)		{ ss << "The Nurses are taking care of her at night."; }
		else if (g_Clinic.GetNumGirlsOnJob(0, JOB_NURSE, 1) > 0){ ss << "The Nurse is taking care of her at night."; }
		else							{ ss << "Having a Nurse on duty will speed up her recovery."; }
	}

#pragma endregion
#pragma region //	Surgery Finished			//

	else
	{
		ss << "The surgery is a success.\n";
		msgtype = EVENT_GOODNEWS;
		girl->m_WorkingDay = girl->m_PrevWorkingDay = 0;

		if (numnurse > 2)
		{
			ss << "The Nurses kept her healthy and happy during her recovery.\n";
			g_Girls.UpdateStat(girl, STAT_HEALTH, g_Dice.bell(0, 20));
			g_Girls.UpdateStat(girl, STAT_HAPPINESS, g_Dice.bell(0, 10));
			g_Girls.UpdateStat(girl, STAT_SPIRIT, g_Dice.bell(0, 10));
			g_Girls.UpdateStat(girl, STAT_MANA, g_Dice.bell(0, 20));
			g_Girls.UpdateStat(girl, STAT_BEAUTY, g_Dice.bell(0, 2));
			g_Girls.UpdateStat(girl, STAT_CHARISMA, g_Dice.bell(0, 2));
		}
		else if (numnurse > 0)
		{
			ss << "The Nurse" << (numnurse > 1 ? "s" : "") << " helped her during her recovery.\n";
			g_Girls.UpdateStat(girl, STAT_HEALTH, g_Dice.bell(0, 10));
			g_Girls.UpdateStat(girl, STAT_HAPPINESS, g_Dice.bell(0, 5));
			g_Girls.UpdateStat(girl, STAT_SPIRIT, g_Dice.bell(0, 5));
			g_Girls.UpdateStat(girl, STAT_MANA, g_Dice.bell(0, 10));
			g_Girls.UpdateStat(girl, STAT_BEAUTY, g_Dice % 2);
			g_Girls.UpdateStat(girl, STAT_CHARISMA, g_Dice % 2);
		}
		else
		{
			ss << "She is sad and has lost some health during the operation.\n";
			g_Girls.UpdateStat(girl, STAT_HEALTH, g_Dice.bell(-20, 2));
//.........这里部分代码省略.........
开发者ID:Jenocke,项目名称:test,代码行数:101,代码来源:WorkGetFertility.cpp

示例3: WorkBeastCapture

// `J` Job Farm - Laborers - Combat_Job
bool cJobManager::WorkBeastCapture(sGirl* girl, sBrothel* brothel, bool Day0Night1, string& summary)
{
#pragma region //	Job setup				//
	int actiontype = ACTION_COMBAT;
	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 capture beasts during the " << (Day0Night1 ? "night" : "day") << " shift.";
		girl->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, EVENT_NOWORK);
		return true;
	}
	ss << " equipped herself and went out to hunt for exotic beasts and animals.\n\n";

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

	int wages = 40, tips = 0;
	int enjoy = 0;
	int imagetype = IMGTYPE_COMBAT;
	int msgtype = Day0Night1;

#pragma endregion
#pragma region //	The Fight to get the Beasts		//

	int tired = 0;
	int gainmax = (int)(JP_BeastCapture(girl, false) / 30) + 1;
	int gain = g_Dice % gainmax + 1;
	sGirl* tempgirl = g_Girls.CreateRandomGirl(18, false, false, false, true, false);
	Uint8 fight_outcome = 0;
	if (tempgirl)		// `J` reworked incase there are no Non-Human Random Girls
	{
		fight_outcome = g_Girls.girl_fights_girl(girl, tempgirl);
	}
	else
	{
		g_LogFile.write("Error: You have no Non-Human Random Girls for your girls to fight\n");
		g_LogFile.write("Error: You need a Non-Human Random Girl to allow WorkBeastCapture randomness");
		fight_outcome = 7;
	}
	if (tempgirl) delete tempgirl; tempgirl = 0;	// Cleanup
	if (fight_outcome == 7)
	{
		ss << "She came back with just one animal today.\n\n";
		ss << "(Error: You need a Non-Human Random Girl to allow WorkBeastCapture randomness)";
		gain = 1;
		msgtype = EVENT_WARNING;
		tired = 15;
	}
	else if (fight_outcome == 1)	// she won
	{
		if (gain <= 2)	gain = 2;
		if (gain >= gainmax)	gain = gainmax;
		ss << "She had fun hunting today and came back with " << gain << " new beasts.";;
		imagetype = IMGTYPE_COMBAT;
		tired = g_Dice % (3 * gain);
		enjoy += g_Dice % 4 + 2;
	}
	else		// she lost or it was a draw
	{
		gain = g_Dice.bell(-gainmax / 3, gainmax / 2);
		ss << " The animals were difficult to track today. " << girlName << " eventually returned worn out and frustrated, ";
		if (gain <= 0)
		{
			gain = 0;
			ss << "empty handed.";
		}
		else
		{
			ss << "dragging ";
			if (gain == 1)	ss << "one";
			if (gain > 1)	ss << gain;
			ss << " captured beast" << (gain > 1 ? "s" : "") << " behind her.";
		}
		imagetype = IMGTYPE_COMBAT;
		enjoy -= g_Dice % 3 + 1;
		tired = g_Dice % (10 * gain) + 20;
	}
	ss << "\n\n";

#pragma endregion
#pragma region	//	A Little Randomness			//

	//SIN: A little randomness
	if (((g_Girls.GetSkill(girl, SKILL_ANIMALHANDLING) + g_Girls.GetStat(girl, STAT_CHARISMA)) > 125) && g_Dice.percent(30))
	{
		ss << girlName << " has a way with animals, a" << (gain > 1 ? "nother" : "") << " beast freely follows her back.\n";
		gain++;
	}
	//SIN: most the rest rely on more than one cap so might as well skip the lot if less than this...
	if (gain > 1)
	{
		// `J` added a switch with a use next if check fails and changed percents to (gain * 5)
		switch (g_Dice % 10)
		{
		case 0:
			if (girl->has_trait( "Twisted") && girl->has_trait( "Nymphomaniac") && (g_Girls.GetStat(girl, STAT_LIBIDO) >= 80))
			{
				ss << "Being a horny, twisted nymphomaniac, " << girlName << " had some fun with the beasts before she handed them over.\n";
				g_Girls.UpdateSkill(girl, SKILL_BEASTIALITY, g_Dice % gain);
//.........这里部分代码省略.........
开发者ID:mjsmagalhaes,项目名称:crazys-wm-mod,代码行数:101,代码来源:WorkBeastCapture.cpp


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