本文整理汇总了C++中cGold::consumable_cost方法的典型用法代码示例。如果您正苦于以下问题:C++ cGold::consumable_cost方法的具体用法?C++ cGold::consumable_cost怎么用?C++ cGold::consumable_cost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cGold
的用法示例。
在下文中一共展示了cGold::consumable_cost方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateGirls
//.........这里部分代码省略.........
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 (!matron) // do no matron first as it is the easiest
{
ss << "WARNING! " << girlName;
if (t > 80 && h < 20) ss << " is in real bad shape, she is tired and injured.\nShe should go to the Clinic.\n";
else if (t > 80 && h < 40) ss << " is in bad shape, she is tired and injured.\nShe should rest or she may die!\n";
else if (t > 80) ss << " is desparatly in need of rest.\nGive her some free time\n";
else if (h < 20) ss << " is badly injured.\nShe should rest or go to the Clinic.\n";
else if (h < 40) ss << " is hurt.\nShe should rest and recuperate.\n";
}
else if (current->m_NightJob == matronjob && matron) // do matron
{
if (t > 90 && h < 10) // The matron may take herself off work if she is really bad off
{
current->m_PrevDayJob = current->m_DayJob;
current->m_PrevNightJob = current->m_NightJob;
current->m_DayJob = current->m_NightJob = restjob;
ss << "The Doctore takes herself off duty because she is just too damn sore.\n";
g_Girls.UpdateEnjoyment(current, ACTION_WORKMATRON, -10);
}
else
{
ss << "As Doctore, " << girlName << " has the keys to the store room.\nShe used them to 'borrow' ";
if (t > 80 && h < 40)
{
ss << "some potions";
g_Gold.consumable_cost(20);
current->m_Stats[STAT_HEALTH] = min(current->m_Stats[STAT_HEALTH] + 20, 100);
current->m_Stats[STAT_TIREDNESS] = max(current->m_Stats[STAT_TIREDNESS] - 20, 0);
}
else if (t > 80)
{
ss << "a resting potion";
g_Gold.consumable_cost(10, true);
current->m_Stats[STAT_TIREDNESS] = max(current->m_Stats[STAT_TIREDNESS] - 20, 0);
}
else if (h < 40)
{
ss << "a healing potion";
g_Gold.consumable_cost(10, true);
current->m_Stats[STAT_HEALTH] = min(current->m_Stats[STAT_HEALTH] + 20, 100);
}
ss << " for herself.\n";
}
}
else // do all other girls with a matron working
{
if (current->m_PrevNightJob == 255 && current->m_PrevDayJob == 255) // the girl has been working
{
current->m_PrevDayJob = current->m_DayJob;
current->m_PrevNightJob = current->m_NightJob;
current->m_DayJob = current->m_NightJob = restjob;
ss << "The Doctore takes " << girlName << " off duty to rest due to her ";
if (t > 80 && h < 40) ss << "exhaustion.\n";
else if (t > 80) ss << "tiredness.\n";
else if (h < 40) ss << "low health.\n";
else /* */ ss << "current state.\n";
}
else // the girl has already been taken off duty by the matron
{
if (g_Dice.percent(70))
{
ss << "The Doctore helps ";
if (t > 80 && h < 40)
{
ss << girlName << " recuperate.\n";
g_Girls.UpdateStat(current, STAT_TIREDNESS, -(g_Dice % 4 + 2));
g_Girls.UpdateStat(current, STAT_HEALTH, (g_Dice % 4 + 2));
}
else if (t > 80)
{
ss << girlName << " to relax.\n";
g_Girls.UpdateStat(current, STAT_TIREDNESS, -(g_Dice % 5 + 5));
}
else if (h < 40)
{
ss << " heal " << girlName << ".\n";
g_Girls.UpdateStat(current, STAT_HEALTH, (g_Dice % 5 + 5));
}
}
}
}
}
if (ss.str().length() > 0) current->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, sum);
current = current->m_Next; // Process next girl
}
m_Processing_Shift = -1; // WD: Finished Processing Shift set flag
}
示例2: UpdateGirls
//.........这里部分代码省略.........
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)
{
ss << girlName << " is not faring well in rehab.\n";
}
else if (!matron) // do no matron first as it is the easiest
{
ss << "WARNING! " << girlName;
if (t > 80 && h < 20) ss << " is in real bad shape, she is tired and injured.\nShe should go to the Clinic.\n";
else if (t > 80 && h < 40) ss << " is in bad shape, she is tired and injured.\nShe should rest or she may die!\n";
else if (t > 80) ss << " is desparatly in need of rest.\nGive her some free time\n";
else if (h < 20) ss << " is badly injured.\nShe should rest or go to the Clinic.\n";
else if (h < 40) ss << " is hurt.\nShe should rest and recuperate.\n";
}
else if (current->m_NightJob == matronjob && matron) // do matron
{
if (t > 90 && h < 10) // The matron may take herself off work if she is really bad off
{
current->m_PrevDayJob = current->m_DayJob;
current->m_PrevNightJob = current->m_NightJob;
current->m_DayJob = current->m_NightJob = restjob;
ss << "The Centre Manager takes herself off duty because she is just too damn sore.\n";
g_Girls.UpdateEnjoyment(current, ACTION_WORKMATRON, -10);
}
else
{
ss << "As Centre Manager, " << girlName << " has the keys to the store room.\nShe used them to 'borrow' ";
if (t > 80 && h < 40)
{
ss << "some potions";
g_Gold.consumable_cost(20, true);
current->m_Stats[STAT_HEALTH] = min(current->m_Stats[STAT_HEALTH] + 20, 100);
current->m_Stats[STAT_TIREDNESS] = max(current->m_Stats[STAT_TIREDNESS] - 20, 0);
}
else if (t > 80)
{
ss << "a resting potion";
g_Gold.consumable_cost(10, true);
current->m_Stats[STAT_TIREDNESS] = max(current->m_Stats[STAT_TIREDNESS] - 20, 0);
}
else if (h < 40)
{
ss << "a healing potion";
g_Gold.consumable_cost(10, true);
current->m_Stats[STAT_HEALTH] = min(current->m_Stats[STAT_HEALTH] + 20, 100);
}
ss << " for herself.\n";
}
}
else // do all other girls with a matron working
{
if (current->m_PrevNightJob == 255 && current->m_PrevDayJob == 255) // the girl has been working
{
current->m_PrevDayJob = current->m_DayJob;
current->m_PrevNightJob = current->m_NightJob;
current->m_DayJob = current->m_NightJob = restjob;
ss << "The Centre Manager takes " << girlName << " off duty to rest due to her ";
if (t > 80 && h < 40) ss << "exhaustion.\n";
else if (t > 80) ss << "tiredness.\n";
else if (h < 40) ss << "low health.\n";
else /* */ ss << "current state.\n";
}
else // the girl has already been taken off duty by the matron
{
if (g_Dice.percent(70))
{
ss << "The Centre Manager helps ";
if (t > 80 && h < 40)
{
ss << girlName << " recuperate.\n";
g_Girls.UpdateStat(current, STAT_TIREDNESS, -(g_Dice % 4 + 2));
g_Girls.UpdateStat(current, STAT_HEALTH, (g_Dice % 4 + 2));
}
else if (t > 80)
{
ss << girlName << " to relax.\n";
g_Girls.UpdateStat(current, STAT_TIREDNESS, -(g_Dice % 5 + 5));
}
else if (h < 40)
{
ss << "heal " << girlName << ".\n";
g_Girls.UpdateStat(current, STAT_HEALTH, (g_Dice % 5 + 5));
}
}
}
}
}
if (ss.str().length() > 0) current->m_Events.AddMessage(ss.str(), IMGTYPE_PROFILE, sum);
current = current->m_Next; // Process next girl
}
m_Processing_Shift = -1; // WD: Finished Processing Shift set flag
}
示例3: UpdateGirls
//.........这里部分代码省略.........
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;
}
}
// The Clinic Chairman will heal herself if she is injured or tired
if (sw == matronjob && (current->tiredness() > 60 || current->health() < 40))
{
int t = g_Girls.GetStat(current, STAT_TIREDNESS);
int h = g_Girls.GetStat(current, STAT_HEALTH);
if (t > 90 || h < 10) // The matron may take herself off work if she is really bad off
{
current->m_PrevDayJob = current->m_DayJob;
current->m_PrevNightJob = current->m_NightJob;
current->m_DayJob = current->m_NightJob = JOB_GETHEALING;
ss << "The Chairman admits herself to get Healing because she is just too damn sore.\n";
g_Girls.UpdateEnjoyment(current, ACTION_WORKMATRON, -10);
}
else
{
ss << "As Chairman, " << girlName << " has the keys to the store room.\nShe used them to 'borrow' ";
if (t > 50 && h < 50)
{
ss << "some potions";
g_Gold.consumable_cost(20, true);
current->health(min(current->health() + 20, 100));
current->tiredness(max(current->tiredness() - 20, 0));
}
else if (t > 50)
{
ss << "a resting potion";
g_Gold.consumable_cost(10, true);
current->m_Stats[STAT_TIREDNESS] = max(current->m_Stats[STAT_TIREDNESS] - 20, 0);
}
else if (h < 50)
{
ss << "a healing potion";
g_Gold.consumable_cost(10, true);
current->m_Stats[STAT_HEALTH] = min(current->m_Stats[STAT_HEALTH] + 20, 100);
}
ss << " for herself.\n";
}
}
else if (current->tiredness() > 80 || current->health() < 20)
{
int t = g_Girls.GetStat(current, STAT_TIREDNESS);
int h = g_Girls.GetStat(current, STAT_HEALTH);
if (current->m_WorkingDay > 0)
{
ss << girlName << " is not faring well in surgery.\n";
sum = EVENT_WARNING;
}
else if (!matron) // do no matron first as it is the easiest
{
ss << "WARNING! " << girlName;