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


C++ cGangManager::GetGangOnMission方法代码示例

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


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

示例1: WorkWhore


//.........这里部分代码省略.........
			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 ???
			}
		}
开发者ID:taukita,项目名称:crazys-wm-mod,代码行数:67,代码来源:WorkBrothelWhore.cpp

示例2: do_take_gold

/*
* returns TRUE if the girl won
*/
bool cScreenGirlDetails::do_take_gold(sGirl *girl, string &message)
{
	const int GIRL_LOSES = false;
	const int GIRL_WINS = true;
	bool girl_win_flag = GIRL_WINS;
	/*
	*	we're taking the girl's gold. Life gets complicated if she
	*	makes a fight of it - so lets do the case where she meekly complies
	*	first
	*/
	if (!g_Brothels.FightsBack(girl))
	{
		message += gettext("She quietly allows you to take her gold.");
		return GIRL_LOSES;	// no fight -> girl lose
	}
	/*
	*	OK - she's going to fight -
	*/
	sGang* gang;
	/*
	*	ok: to win she needs to defeat all the gangs on
	*	guard duty. I've made a change here so that she doesn't
	*	need to wipe one gang out before moving on to the next one
	*	which means that she can cause some damage on the way out
	*	without necessarily slaying all who stand before her
	*
	*	it also means that if you have 5 gangs guarding, she needs
	*	to get past 5 gangs, but you don't have to have them all die
	*	in the process
	*/
	while ((gang = g_Gangs.GetGangOnMission(MISS_GUARDING)))
	{
		/*
		*		this returns true if the girl wins, false if she loses
		*
		*		Suggestion on the forums that we allow clever girls to
		*		outwit stupid gang memebers here, which sounds cool.
		*		Also nice would be if a strongly magical girl could
		*		use sorcery to evade a none-too-crafty goon squad.
		*		(possibly make her fight the first one).
		*
		*		But none of this makes much difference if the user
		*		never sees it happen. We can make combat as textured as
		*		we like, but unless the details are reported to the player
		*		we might as well roll a single die and be done with it.
		*/
		girl_win_flag = g_Gangs.GangCombat(girl, gang);
		/*
		*		if she didn't win, exit the loop
		*/
		if (girl_win_flag == GIRL_LOSES) break;
	}
	/*
	*	the "girl lost" case is easier
	*/
	if (girl_win_flag == GIRL_LOSES)
	{		// put her in the dungeon
		message += gettext("She puts up a fight ");
		if (gang && gang->m_Num == 0)
		{
			message += gettext("and the gang is wiped out, ");
		}
		message += gettext(" but you take her gold anyway.");
		return girl_win_flag;
	}
	/*
	*	from here on down, the girl won against the goons
	*/
	message += gettext("She puts up a fight ");
	if (gang && gang->m_Num == 0)	message += gettext(" and the gang is wiped out ");
	/*
	*	can the player tame this particular shrew?
	*/
	if (!g_Brothels.PlayerCombat(girl))	// fight with the player
	{
		message += gettext("but you defeat her yourself and take her gold.");
		return false;	// girl did not win, after all
	}
	/*
	*	Looks like she won: put her out of the brothel
	*	and post her as a runaway
	*/
	message += gettext("after defeating you as well she escapes to the outside.\n");

	sGirl* nextGirl = remove_selected_girl();
	sGirl* temp = girl;
	/*
	*	what we have to do depends on whether she was in brothel
	*	or dungeon
	*/
	if (girl->m_DayJob != JOB_INDUNGEON)
		g_Brothels.RemoveGirl(g_CurrBrothel, girl, false);
	else
		temp = g_Brothels.GetDungeon()->RemoveGirl(girl);
	/*
	*	set her job
	*/
//.........这里部分代码省略.........
开发者ID:diamondialis,项目名称:crazys-wm-mod,代码行数:101,代码来源:cScreenGirlDetails.cpp

示例3: check_events


//.........这里部分代码省略.........
	if (g_InterfaceEvents.CheckButton(reldungeon_id))
	{
		g_Brothels.GetDungeon()->GetDungeonPos(selected_girl);
		if ((g_Brothels.GetBrothel(g_CurrBrothel)->m_NumRooms - g_Brothels.GetBrothel(g_CurrBrothel)->m_NumGirls) == 0)
		{
			g_MessageQue.AddToQue(gettext("The current brothel has no more room.\nBuy a new one, get rid of some girls, or change the brothel you are currently managing."), 0);
		}
		else
		{
			sGirl* nextGirl = remove_selected_girl();
			sGirl* tempGirl = g_Brothels.GetDungeon()->RemoveGirl(g_Brothels.GetDungeon()->GetGirl(g_Brothels.GetDungeon()->GetGirlPos(selected_girl)));
			g_Brothels.AddGirl(g_CurrBrothel, tempGirl);

			if (g_Brothels.GetDungeon()->GetNumGirls() == 0)
			{
				selected_girl = 0;
				g_WinManager.Pop();
			}
			else
				selected_girl = nextGirl;
		}
		g_InitWin = true;
		return;
	}
	if (g_InterfaceEvents.CheckButton(senddungeon_id))
	{
		ss.str("");
		g_Brothels.GetGirlPos(g_CurrBrothel, selected_girl);

		// does she decide to fight back
		if (g_Brothels.FightsBack(selected_girl))
		{
			bool win = true;
			sGang* gang = g_Gangs.GetGangOnMission(MISS_GUARDING);
			int count = 8;
			while (gang && win && count >= 0)
			{
				win = (g_Gangs.GangCombat(selected_girl, gang));
				if (gang->m_Num == 0) gang = g_Gangs.GetGangOnMission(MISS_GUARDING);
				count--;
				if (count<0) win = true;
			}
			// Calculate combat between goons and girl if she decides to fight back
			if (win)
			{
				ss << gettext("She puts up a fight");
				if (gang && gang->m_Num == 0) ss << gettext(", and the gang is completely wiped out");
				ss << ". ";

				if (g_Brothels.PlayerCombat(selected_girl))				// fight with the player
				{
					// If girl wins she escapes and leaves the brothel
					ss << gettext("After defeating you as well, she escapes to the outside.\n");
					ss << gettext("She will escape for good in 6 weeks if you don't send someone after her.");

					sGirl* nextGirl = remove_selected_girl();
					sGirl* temp = selected_girl;
					if (selected_girl->m_DayJob == JOB_INDUNGEON)	temp = g_Brothels.GetDungeon()->RemoveGirl(selected_girl);
					else if (selected_girl->m_InHouse)	g_House.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InFarm)	g_Farm.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InClinic)	g_Clinic.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InCentre)	g_Centre.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InArena)	g_Arena.RemoveGirl(0, selected_girl, false);
					else if (selected_girl->m_InStudio)	g_Studios.RemoveGirl(0, selected_girl, false);
					else g_Brothels.RemoveGirl(selected_girl->where_is_she, selected_girl, false);
开发者ID:diamondialis,项目名称:crazys-wm-mod,代码行数:66,代码来源:cScreenGirlDetails.cpp

示例4: Update


//.........这里部分代码省略.........
				default:	
					missionid = MISS_GUARDING;		// don't do anything but guard
					break;
				}
				tries++;
			}


			switch (missionid)
			{
			case MISS_EXTORTION:		// gain territory
			{
				int numB = GetNumBusinesses() + NumPlayerBussiness;
				if (numB < TOWN_NUMBUSINESSES)	// if there are uncontrolled businesses
				{
					int n = g_Dice % 5 - 2;
					if (n > 0)					// try to take some
					{
						if (numB + n > TOWN_NUMBUSINESSES)
							n = TOWN_NUMBUSINESSES - numB;

						curr->m_BusinessesExtort += n;
						income += n * 20;
					}
				}
				else			// if there are no uncontrolled businesses
				{
					stringstream ss;
					int who = (g_Dice % (m_NumRivals + 1));				// who to attack
					if (who == m_NumRivals)								// try to attack you
					{
						if (!player_safe() && NumPlayerBussiness > 0)	// but only if you are a valid target
						{
							sGang* miss1 = g_Gangs.GetGangOnMission(MISS_GUARDING);
							if (miss1)									// if you have a gang guarding
							{
								ss << gettext("Your guards encounter ") << curr->m_Name << gettext(" going after some of your territory.");

								sGang* rGang = g_Gangs.GetTempGang(curr->m_Power);
								if (g_Gangs.GangBrawl(miss1, rGang))	// if you win
								{
									if (rGang->m_Num == 0) curr->m_NumGangs--;
									ss << gettext("\nBut you maintain control of the territory.");
									miss1->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, EVENT_GANG);
								}
								else									// if you lose
								{
									if (miss1->m_Num == 0) g_Gangs.RemoveGang(miss1);
									ss << gettext("\nYou lose the territory.");
									NumPlayerBussiness--;
									curr->m_BusinessesExtort++;
									g_MessageQue.AddToQue(ss.str(), COLOR_RED);
								}
								delete rGang; rGang = 0;	// cleanup
							}
							else										// if you do not have a gang guarding
							{
								ss << gettext("Your rival ") << curr->m_Name << gettext(" has taken one of the undefended territories you control.");
								g_MessageQue.AddToQue(ss.str(), COLOR_RED);
								NumPlayerBussiness--;
								curr->m_BusinessesExtort++;
							}
						}
					}
					else	// attack another rival
					{
开发者ID:taukita,项目名称:crazys-wm-mod,代码行数:67,代码来源:cRival.cpp


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