本文整理汇总了C++中cGangManager类的典型用法代码示例。如果您正苦于以下问题:C++ cGangManager类的具体用法?C++ cGangManager怎么用?C++ cGangManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了cGangManager类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: use_potions
int cGirlGangFight::use_potions(sGang *gang, int casualties)
{
/*
* if there's zero casualties - nothing do to
* and we won't reduce below 1 for potions
*/
if(casualties < 2) {
if(casualties < 0) casualties = 0;
return casualties;
}
/*
* maximum deaths prevented by potions is one less than the total
* or the total number of potions - whichever is less
*/
int max = casualties - 1;
int *pots_pt = g_Gangs.GetHealingPotions();
if(*pots_pt < max) {
max = *pots_pt;
}
/*
* reduction random number in that range
*/
int reduction = g_Dice.in_range(1,max);
*pots_pt -= reduction;
casualties -= reduction;
if(casualties < 0) casualties = 0;
return casualties;
}
开发者ID:taukita,项目名称:crazys-wm-mod,代码行数:28,代码来源:cGirlGangFight.cpp
示例2: check_farm
void cScreenTown::check_farm(int FarmNum)
{ // player clicked on one of the brothels
if (g_Farm.GetNumBrothels() == FarmNum)
{ // player doesn't own this Studio... can he buy it?
static_brothel_data *bck = farm_data + FarmNum;
locale syslocale("");
stringstream ss;
ss.imbue(syslocale);
if (!g_Gold.afford(bck->price) || g_Gangs.GetNumBusinessExtorted() < bck->business)
{ // can't buy it
ss << gettext("This building costs ") << bck->price << gettext(" gold and you need to control at least ") << bck->business << gettext(" businesses.");
if (!g_Gold.afford(bck->price))
ss << "\n" << gettext("You need ") << (bck->price - g_Gold.ival()) << gettext(" more gold to afford it.");
if (g_Gangs.GetNumBusinessExtorted() < bck->business)
ss << "\n" << gettext("You need to control ") << (bck->business - g_Gangs.GetNumBusinessExtorted()) << gettext(" more businesses.");
g_MessageQue.AddToQue(ss.str(), 0);
}
else
{ // can buy it
ss << gettext("Do you wish to purchase this building for ") << bck->price << gettext(" gold? It has ") << bck->rooms << gettext(" rooms.");
g_MessageQue.AddToQue(ss.str(), 2);
g_ChoiceManager.CreateChoiceBox(224, 112, 352, 384, 0, 2, 32, 8);
g_ChoiceManager.AddChoice(0, gettext("Buy It"), 0);
g_ChoiceManager.AddChoice(0, gettext("Don't Buy It"), 1);
g_ChoiceManager.SetActive(0);
BuyFarm = FarmNum;
}
}
else
{ // player owns this brothel... go to it
g_Building = BUILDING_FARM;
g_CurrFarm = FarmNum;
g_WinManager.push("Farm Screen");
}
}
开发者ID:belroshir,项目名称:crazys-wm-mod,代码行数:36,代码来源:cScreenTown.cpp
示例3: WorkWhore
// `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 fuck to 10 max
*
* Limit the number of customers a girl can see if they will
* fuck 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 fuck
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 fucks this session
if (bStreetWork)
{
NumCusts = NumCusts * 2 / 3;
AskPrice = AskPrice * 2 / 3;
}
//.........这里部分代码省略.........
开发者ID:taukita,项目名称:crazys-wm-mod,代码行数:101,代码来源:WorkBrothelWhore.cpp
示例4: check_events
void cScreenGirlDetails::check_events()
{
// no events means we can go home
if (g_InterfaceEvents.GetNumEvents() == 0) return;
// if it's the back button, pop the window off the stack and we're done
if (g_InterfaceEvents.CheckButton(back_id))
{
g_InitWin = true;
g_WinManager.Pop();
return;
}
if (g_InterfaceEvents.CheckSlider(houseperc_id))
{
g_Girls.SetStat(selected_girl, STAT_HOUSE, SliderValue(houseperc_id));
ss.str("");
ss << gettext("House Percentage: ") << SliderValue(houseperc_id) << gettext("%");
EditTextItem(ss.str(), housepercval_id);
// Rebelliousness might have changed, so update details
if (DetailLevel == 0)
{
string detail = g_Girls.GetDetailsString(selected_girl);
EditTextItem(detail, girldesc_id);
}
return;
}
if (g_InterfaceEvents.CheckButton(more_id))
{
if (DetailLevel == 0) { DetailLevel = 1; EditTextItem(g_Girls.GetMoreDetailsString(selected_girl), girldesc_id); }
else if (DetailLevel == 1) { DetailLevel = 2; EditTextItem(g_Girls.GetThirdDetailsString(selected_girl), girldesc_id); }
else { DetailLevel = 0; EditTextItem(g_Girls.GetDetailsString(selected_girl), girldesc_id); }
}
if (g_InterfaceEvents.CheckButton(day_id))
{
DisableButton(day_id, true);
DisableButton(night_id, false);
g_InitWin = true;
Day0Night1 = SHIFT_DAY;
}
if (g_InterfaceEvents.CheckButton(night_id))
{
DisableButton(day_id, false);
DisableButton(night_id, true);
g_InitWin = true;
Day0Night1 = SHIFT_NIGHT;
}
if (g_InterfaceEvents.CheckCheckbox(antipreg_id))
{
selected_girl->m_UseAntiPreg = (IsCheckboxOn(antipreg_id));
}
if (g_InterfaceEvents.CheckListbox(traitlist_id))
{
int selection = GetLastSelectedItemFromList(traitlist_id);
if (selection != -1)
EditTextItem(selected_girl->m_Traits[selection]->m_Desc, traitdesc_id);
else
EditTextItem("", traitdesc_id);
}
if (g_InterfaceEvents.CheckListbox(jobtypelist_id))
{
SetJob = true;
RefreshJobList();
}
if (g_InterfaceEvents.CheckListbox(joblist_id))
{
bool fulltime = g_CTRLDown;
int selection = GetSelectedItemFromList(joblist_id);
if (selection != -1)
{
int old_job = (Day0Night1 ? selected_girl->m_NightJob : selected_girl->m_DayJob);
// handle special job requirements and assign - if HandleSpecialJobs returns true, the job assignment was modified or cancelled
if (g_Brothels.m_JobManager.HandleSpecialJobs(g_CurrBrothel, selected_girl, selection, old_job, Day0Night1, fulltime))
{
selection = (Day0Night1 ? selected_girl->m_NightJob : selected_girl->m_DayJob);
SetSelectedItemInList(joblist_id, selection, false);
}
// refresh job worker counts for former job and current job
if (old_job != selection)
{
SetSelectedItemText(joblist_id, old_job, g_Brothels.m_JobManager.JobDescriptionCount(old_job, g_CurrBrothel, Day0Night1));
SetSelectedItemText(joblist_id, selection, g_Brothels.m_JobManager.JobDescriptionCount(selection, g_CurrBrothel, Day0Night1));
}
RefreshJobList();
}
}
if (g_InterfaceEvents.CheckButton(inventory_id))
{
if (selected_girl)
{
if (GirlDead(selected_girl)) return;
g_InitWin = true;
g_AllTogle = true;
g_WinManager.push("Item Management");
return;
}
}
if (g_InterfaceEvents.CheckButton(gallery_id))
{
g_WinManager.push("Gallery");
//.........这里部分代码省略.........
开发者ID:diamondialis,项目名称:crazys-wm-mod,代码行数:101,代码来源:cScreenGirlDetails.cpp
示例5: 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
示例6: hire_recruitable
void cScreenGangs::hire_recruitable()
{
if ((g_Gangs.GetNumGangs() >= g_Gangs.GetMaxNumGangs()) || (sel_recruit == -1)) return;
g_Gangs.HireGang(sel_recruit);
g_InitWin = true;
}
开发者ID:mjsmagalhaes,项目名称:crazys-wm-mod,代码行数:6,代码来源:cScreenGangs.cpp
示例7: check_events
void cScreenGangs::check_events()
{
if (g_InterfaceEvents.GetNumEvents() == 0) return; // no events means we can go home
if (g_InterfaceEvents.CheckButton(back_id)) // if it's the back button, pop the window off the stack and we're done
{
g_InitWin = true;
g_WinManager.Pop();
return;
}
if (g_InterfaceEvents.CheckButton(ganghire_id))
{
hire_recruitable();
return;
}
if (g_InterfaceEvents.CheckButton(weaponup_id))
{
int cost = 0;
int *wlev = g_Gangs.GetWeaponLevel();
cost = tariff.goon_weapon_upgrade(*wlev);
if (g_Gold.item_cost(cost) == true)
{
*wlev += 1;
g_InitWin = true;
}
wlev = 0;
return;
}
int buynets = 0;
if (g_InterfaceEvents.CheckButton(netbuy_id)) buynets = 1;
if (g_InterfaceEvents.CheckButton(netbuy10_id)) buynets = 10;
if (g_InterfaceEvents.CheckButton(netbuy20_id)) buynets = 20;
if (buynets > 0)
{
int cost = 0;
int amount = buynets;
int *nets = g_Gangs.GetNets();
if (((*nets) + buynets) > 60) amount = 60 - (*nets);
cost = tariff.nets_price(amount);
if (g_Gold.item_cost(cost) == true)
{
*nets += amount;
if (IsCheckboxOn(netautobuy_id)) g_Gangs.KeepNetStocked(*nets);
g_InitWin = true;
}
nets = 0;
buynets = 0;
return;
}
int buypots = 0;
if (g_InterfaceEvents.CheckButton(healbuy_id)) buypots = 1;
if (g_InterfaceEvents.CheckButton(healbuy10_id)) buypots = 10;
if (g_InterfaceEvents.CheckButton(healbuy20_id)) buypots = 20;
if (buypots > 0)
{
int cost = 0;
int amount = buypots;
int *potions = g_Gangs.GetHealingPotions();
if (((*potions) + buypots) > 200) amount = 200 - (*potions);
cost = tariff.healing_price(amount);
if (g_Gold.item_cost(cost) == true)
{
*potions += amount;
if (IsCheckboxOn(healautobuy_id)) g_Gangs.KeepHealStocked(*potions);
g_InitWin = true;
}
potions = 0;
buypots = 0;
return;
}
if (g_InterfaceEvents.CheckCheckbox(netautobuy_id))
{
int *nets = g_Gangs.GetNets();
g_Gangs.KeepNetStocked(IsCheckboxOn(netautobuy_id) ? *nets : 0);
}
if (g_InterfaceEvents.CheckCheckbox(healautobuy_id))
{
int *potions = g_Gangs.GetHealingPotions();
g_Gangs.KeepHealStocked(IsCheckboxOn(healautobuy_id) ? *potions : 0);
}
if (g_InterfaceEvents.CheckButton(gangfire_id))
{
selection = GetLastSelectedItemFromList(ganglist_id);
if (selection != -1)
{
g_Gangs.FireGang(selection);
g_InitWin = true;
}
return;
}
if (g_InterfaceEvents.CheckListbox(recruitlist_id))
{
string ClickedHeader = HeaderClicked(recruitlist_id);
if (ClickedHeader != "")
{
g_LogFile.ss() << "User clicked \"" << ClickedHeader << "\" column header on Recruit listbox" << endl; g_LogFile.ssend();
return;
}
//.........这里部分代码省略.........
开发者ID:mjsmagalhaes,项目名称:crazys-wm-mod,代码行数:101,代码来源:cScreenGangs.cpp
示例8: init
void cScreenGangs::init()
{
g_CurrentScreen = SCREEN_GANGMANAGEMENT;
if (!g_InitWin) return;
Focused();
g_InitWin = false;
selection = GetLastSelectedItemFromList(ganglist_id);
sel_recruit = GetLastSelectedItemFromList(recruitlist_id);
ClearListBox(missionlist_id);
AddToListBox(missionlist_id, 0, "GUARDING");
AddToListBox(missionlist_id, 1, "SABOTAGE");
AddToListBox(missionlist_id, 2, "SPY ON GIRLS");
AddToListBox(missionlist_id, 3, "RECAPTURE");
AddToListBox(missionlist_id, 4, "ACQUIRE TERRITORY");
AddToListBox(missionlist_id, 5, "PETTY THEFT");
AddToListBox(missionlist_id, 6, "GRAND THEFT");
AddToListBox(missionlist_id, 7, "KIDNAPPING");
AddToListBox(missionlist_id, 8, "CATACOMBS");
AddToListBox(missionlist_id, 9, "TRAINING");
AddToListBox(missionlist_id, 10, "RECRUITING");
AddToListBox(missionlist_id, 11, "SERVICE");
SetCheckBox(controlcatacombs_id, (g_Gangs.Control_Gangs()));
SliderRange(girlspercslider_id, 0, 100, g_Gangs.Gang_Gets_Girls(), 1);
SliderRange(itemspercslider_id, 0, 100, g_Gangs.Gang_Gets_Girls() + g_Gangs.Gang_Gets_Items(), 1);
ss.str(""); ss << "Girls : " << g_Gangs.Gang_Gets_Girls() << "%"; EditTextItem(ss.str(), ganggetsgirls_id);
ss.str(""); ss << "Items : " << g_Gangs.Gang_Gets_Items() << "%"; EditTextItem(ss.str(), ganggetsitems_id);
ss.str(""); ss << "Beasts : " << g_Gangs.Gang_Gets_Beast() << "%"; EditTextItem(ss.str(), ganggetsbeast_id);
SetCheckBox(netautobuy_id, (g_Gangs.GetNetRestock() > 0));
SetCheckBox(healautobuy_id, (g_Gangs.GetHealingRestock() > 0));
// weapon upgrades
int *wlev = g_Gangs.GetWeaponLevel();
ss.str(""); ss << "Weapon Level: " << *wlev;
if ((*wlev) < 4)
{
EnableButton(weaponup_id);
ss << " Next: " << tariff.goon_weapon_upgrade(*wlev) << "g";
}
else DisableButton(weaponup_id);
g_LogFile.ss() << "weapon text = '" << ss.str() << "'" << endl; g_LogFile.ssend();
EditTextItem(ss.str(), weaponlevel_id);
int *nets = g_Gangs.GetNets();
ss.str(""); ss << "Nets (" << tariff.nets_price(1) << "g each): " << *nets;
EditTextItem(ss.str(), netdesc_id);
DisableButton(netbuy_id, *nets >= 60);
DisableButton(netbuy10_id, *nets >= 60);
DisableButton(netbuy20_id, *nets >= 60);
DisableCheckBox(netautobuy_id, *nets < 1);
int *potions = g_Gangs.GetHealingPotions();
ss.str(""); ss << "Heal Potions (" << tariff.healing_price(1) << "g each): " << *potions;
EditTextItem(ss.str(), healdesc_id);
DisableButton(healbuy_id, *potions >= 200);
DisableButton(healbuy10_id, *potions >= 200);
DisableButton(healbuy20_id, *potions >= 200);
DisableCheckBox(healautobuy_id, *potions < 1);
int cost = 0;
if (g_Gangs.GetNumGangs() > 0)
{
for (int i = 0; i < g_Gangs.GetNumGangs(); i++)
{
sGang* g = g_Gangs.GetGang(i);
if (g == 0) g = g_Gangs.GetGang(i - 1);
cost += tariff.goon_mission_cost(g->m_MissionID);
}
}
ss.str(""); ss << "Weekly Cost: " << cost;
EditTextItem(ss.str(), totalcost_id);
if (gold_id >= 0)
{
ss.str(""); ss << "Gold: " << g_Gold.ival();
EditTextItem(ss.str(), gold_id);
}
ClearListBox(ganglist_id);
int num = 0;
sGang* current = g_Gangs.GetGang(0);
// loop through the gangs, populating the list box
g_LogFile.write("Setting gang mission descriptions\n");
for (current = g_Gangs.GetGang(0); current; current = current->m_Next)
{
// format the string with the gang name, mission and number of men
string Data[11];
ss.str(""); ss << current->m_Name; Data[0] = ss.str();
ss.str(""); ss << current->m_Num; Data[1] = ss.str();
ss.str(""); ss << short_mission_desc(current->m_MissionID); Data[2] = ss.str();
ss.str(""); ss << current->m_Skills[SKILL_COMBAT] << "%"; Data[3] = ss.str();
ss.str(""); ss << current->m_Skills[SKILL_MAGIC] << "%"; Data[4] = ss.str();
ss.str(""); ss << current->m_Stats[STAT_INTELLIGENCE] << "%"; Data[5] = ss.str();
ss.str(""); ss << current->m_Stats[STAT_AGILITY] << "%"; Data[6] = ss.str();
ss.str(""); ss << current->m_Stats[STAT_CONSTITUTION] << "%"; Data[7] = ss.str();
ss.str(""); ss << current->m_Stats[STAT_CHARISMA] << "%"; Data[8] = ss.str();
ss.str(""); ss << current->m_Stats[STAT_STRENGTH] << "%"; Data[9] = ss.str();
//.........这里部分代码省略.........
开发者ID:mjsmagalhaes,项目名称:crazys-wm-mod,代码行数:101,代码来源:cScreenGangs.cpp
示例9: 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
示例10: init
void cScreenHouse::init()
{
g_CurrentScreen = SCREEN_HOUSE;
if (!g_InitWin) { return; }
Focused();
g_InitWin = false;
locale syslocale("");
stringstream ss;
ss.imbue(syslocale);
ss << gettext("CURRENT OBJECTIVE: ");
sObjective* obj = g_Brothels.GetObjective();
if (obj)
{
switch (obj->m_Objective)
{
case OBJECTIVE_REACHGOLDTARGET:
ss << gettext("Gather ") << obj->m_Target << gettext(" gold");
if (obj->m_Limit != -1) {
ss << gettext(" in ") << obj->m_Limit << gettext(" weeks");
}
ss << gettext(", ") << g_Gold.ival() << gettext(" gathered so far.");
break;
case OBJECTIVE_GETNEXTBROTHEL:
fmt_objective(ss, gettext("Purchase the next brothel"), obj->m_Limit);
break;
/*----
case OBJECTIVE_PURCHASENEWGAMBLINGHALL:
fmt_objective(ss, "Purchase a gambling hall", obj->m_Limit);
break;
case OBJECTIVE_PURCHASENEWBAR:
fmt_objective(ss, "Purchase a bar", obj->m_Limit);
break;
----*/
case OBJECTIVE_LAUNCHSUCCESSFULATTACK:
fmt_objective(ss, gettext("Launch a successful attack"), obj->m_Limit);
break;
case OBJECTIVE_HAVEXGOONS:
ss << gettext("Have ") << obj->m_Target << gettext(" gangs");
fmt_objective(ss, "", obj->m_Limit);
break;
case OBJECTIVE_STEALXAMOUNTOFGOLD:
ss << gettext("Steal ") << obj->m_Target << gettext(" gold");
fmt_objective(ss, "", obj->m_Limit, obj->m_SoFar);
break;
case OBJECTIVE_CAPTUREXCATACOMBGIRLS:
ss << gettext("Capture ") << obj->m_Target << gettext(" girls from the catacombs");
fmt_objective(ss, "", obj->m_Limit, obj->m_SoFar);
break;
case OBJECTIVE_HAVEXMONSTERGIRLS:
ss << gettext("Have a total of ") << obj->m_Target << gettext(" monster (non-human) girls");
fmt_objective(ss, "", obj->m_Limit, g_Brothels.GetTotalNumGirls(true));
break;
case OBJECTIVE_KIDNAPXGIRLS:
ss << gettext("Kidnap ") << obj->m_Target << gettext(" girls from the streets");
fmt_objective(ss, "", obj->m_Limit, obj->m_SoFar);
break;
case OBJECTIVE_EXTORTXNEWBUSINESS:
ss << gettext("Control ") << obj->m_Target << gettext(" city business");
fmt_objective(ss, "", obj->m_Limit, obj->m_SoFar);
break;
case OBJECTIVE_HAVEXAMOUNTOFGIRLS:
ss << gettext("Have a total of ") << obj->m_Target << gettext(" girls");
fmt_objective(ss, "", obj->m_Limit, g_Brothels.GetTotalNumGirls(false));
break;
}
}
else ss << gettext("NONE\n");
ss << gettext("\n")
<< gettext("Current gold: ") << g_Gold.ival() << gettext("\n")
<< gettext("Bank account: ") << g_Brothels.GetBankMoney() << gettext("\n")
<< gettext("Businesses controlled: ")
<< g_Gangs.GetNumBusinessExtorted()
<< gettext("\n")
;
ss << gettext("\nCurrent number of runaways: ") << g_Brothels.GetNumRunaways() << gettext("\n");
// `J` added while loop to add runaway's names to the list
if (g_Brothels.GetNumRunaways() > 0)
{
sGirl* rgirl = g_Brothels.m_Runaways;
while (rgirl)
{
ss << rgirl->m_Realname << gettext(" (") << rgirl->m_RunAway << gettext(")");
rgirl = rgirl->m_Next;
if (rgirl) ss << gettext(" , ");
}
}
EditTextItem(ss.str(), details_id);
obj = 0;
}
开发者ID:DagothRa,项目名称:crazys-wm-mod,代码行数:94,代码来源:cScreenHouse.cpp
示例11: gettext
cGirlGangFight::cGirlGangFight(sGirl *girl)
{
m_girl = girl;
m_girl_stats = 0;
/*
* set this up on the basis that she refuses to fight
*/
m_goon_stats = 0;
m_max_goons = 0;
// m_ratio = 0.0;
// m_dead_goons = 0;
m_girl_fights = false;
m_girl_wins = false;
m_wipeout = false;
m_unopposed = false;
m_player_wins = false;
/*
* decide if she's going to fight or flee
*/
if (!g_Brothels.FightsBack(m_girl)) {
return;
}
m_girl_fights = true;
/*
* ok, she fights. Find all the gangs on guard duty
*/
m_girl_wins = false;
vector<sGang*> v = g_Gangs.gangs_on_mission(MISS_GUARDING);
/*
* no gang, so girl wins. PC combat is outside this class ATM
*/
if (v.size() == 0) {
m_girl_wins = true;
m_unopposed = true;
return;
}
/*
* we'll take goons from a random gang - distributes the casualties a bit
* more evenly for multi-select brandings and the like
*/
int index = g_Dice.in_range(0, v.size() - 1);
l.ss() << gettext("\ncGirlGangFight: random gang index = ") << index;
l.ssend();
sGang *gang = v[index];
l.ss() << gettext("\ncGirlGangFight: gang = ") << gang->m_Name;
l.ssend();
/*
* 4 + 1 for each gang on guard duty
* that way there's a benefit to multiple gangs guarding
*/
m_max_goons = 4 + v.size();
/*
* to the maximum of the number in the gang
*/
if (m_max_goons > gang->m_Num) {
m_max_goons = gang->m_Num;
}
/*
* now - sum the girl and gang stats
* we're not going to average the gangs.
* yes this gives them an unfair advantage
* that's the point of having 5:1 odds :)
*/
m_girl_stats = m_girl->combat() + m_girl->magic() + m_girl->intelligence();
/*
* Now the gangs. I'm not factoring the girl's health
* because there's something dramatically satisfying
* about her breeaking out of the dungeon after being
* tortured near unto death, and then still beating the
* thugs up. You'd buy into it in a Hollywood blockbuster...
*
* Annnnyway....
*/
m_goon_stats = *g_Gangs.GetWeaponLevel() * 5 * m_max_goons;
for (int i = 0; i < m_max_goons; i++) {
m_goon_stats += gang->combat() +
gang->magic() +
gang->intelligence()
;
}
/*
* the girl's base chance of winning is determined by the stat ratio
*/
m_odds = 1.0 * m_girl_stats / (m_goon_stats + m_girl_stats);
/*
* let's add some trait based bonuses
* I'm not going to do any that are already reflected in stat values
* (so no "Psychic" bonus, no "Tough" either)
* we can streamline this with the trait overhaul
*/
if (m_girl->has_trait("Clumsy")) m_odds -= 0.05;
if (m_girl->has_trait("Broken Will")) m_odds -= 0.10;
if (m_girl->has_trait("Meek")) m_odds -= 0.05;
if (m_girl->has_trait("Dependant")) m_odds -= 0.10;
if (m_girl->has_trait("Fearless")) m_odds += 0.10;
if (m_girl->has_trait("Fleet of Foot")) m_odds += 0.10;
/*
* get it back into the 0 <= N <= 1 range
*/
if (m_odds < 0) m_odds = 0;
//.........这里部分代码省略.........
开发者ID:taukita,项目名称:crazys-wm-mod,代码行数:101,代码来源:cGirlGangFight.cpp
注:本文中的cGangManager类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论