本文整理汇总了C++中Campaign::GetTime方法的典型用法代码示例。如果您正苦于以下问题:C++ Campaign::GetTime方法的具体用法?C++ Campaign::GetTime怎么用?C++ Campaign::GetTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Campaign
的用法示例。
在下文中一共展示了Campaign::GetTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
CombatAction::FailAction()
{
Campaign* campaign = Campaign::GetCampaign();
if (campaign)
time = (int) campaign->GetTime();
count = 0;
status = FAILED;
}
示例2: if
bool
CombatAction::IsAvailable() const
{
CombatAction* pThis = (CombatAction*) this;
if (rval < 0) {
pThis->rval = (int) Random(0, 100);
if (rval > probability)
pThis->status = SKIPPED;
}
if (status != PENDING)
return false;
if (min_rank > 0 || max_rank < 100) {
Player* player = Player::GetCurrentPlayer();
if (player->Rank() < min_rank || player->Rank() > max_rank)
return false;
}
Campaign* campaign = Campaign::GetCampaign();
if (campaign) {
if (campaign->GetTime() < start_after) {
return false;
}
if (campaign->GetTime() > start_before) {
pThis->status = FAILED; // too late!
return false;
}
// check requirements against actions in current campaign:
ListIter<CombatActionReq> iter = pThis->requirements;
while (++iter) {
CombatActionReq* r = iter.value();
bool ok = false;
if (r->action > 0) {
ListIter<CombatAction> action = campaign->GetActions();
while (++action) {
CombatAction* a = action.value();
if (a->Identity() == r->action) {
if (r->not) {
if (a->Status() == r->stat)
return false;
}
else {
if (a->Status() != r->stat)
return false;
}
}
}
}
// group-based requirement
else if (r->group_type > 0) {
if (r->c1) {
CombatGroup* group = r->c1->FindGroup(r->group_type, r->group_id);
if (group) {
int test = 0;
int comp = 0;
if (r->intel) {
test = group->IntelLevel();
comp = r->intel;
}
else {
test = group->CalcValue();
comp = r->score;
}
switch (r->comp) {
case CombatActionReq::LT: ok = (test < comp); break;
case CombatActionReq::LE: ok = (test <= comp); break;
case CombatActionReq::GT: ok = (test > comp); break;
case CombatActionReq::GE: ok = (test >= comp); break;
case CombatActionReq::EQ: ok = (test == comp); break;
}
}
if (!ok)
return false;
}
}
// score-based requirement
else {
int test = 0;
if (r->comp <= CombatActionReq::EQ) { // absolute
if (r->c1) {
int test = r->c1->Score();
switch (r->comp) {
case CombatActionReq::LT: ok = (test < r->score); break;
//.........这里部分代码省略.........
示例3: if
//.........这里部分代码省略.........
AudioConfig* audio_cfg = AudioConfig::GetInstance();
audio_cfg->SetEfxVolume(event_param[0]);
audio_cfg->SetWrnVolume(event_param[0]);
}
break;
case DISPLAY:
if (stars->InCutscene()) {
DisplayView* disp_view = DisplayView::GetInstance();
if (disp_view) {
Color color;
color.Set(event_param[0]);
if (event_message.length() && event_source.length()) {
if (event_message.contains('$')) {
Campaign* campaign = Campaign::GetCampaign();
Player* user = Player::GetCurrentPlayer();
CombatGroup* group = campaign->GetPlayerGroup();
if (user) {
event_message = FormatTextReplace(event_message, "$NAME", user->Name().data());
event_message = FormatTextReplace(event_message, "$RANK", Player::RankName(user->Rank()));
}
if (group) {
event_message = FormatTextReplace(event_message, "$GROUP", group->GetDescription());
}
if (event_message.contains("$TIME")) {
char timestr[32];
FormatDayTime(timestr, campaign->GetTime(), true);
event_message = FormatTextReplace(event_message, "$TIME", timestr);
}
}
disp_view->AddText( event_message,
FontMgr::Find(event_source),
color,
event_rect,
event_point.y,
event_point.x,
event_point.z);
}
else if (event_target.length()) {
DataLoader* loader = DataLoader::GetLoader();
if (loader) {
loader->SetDataPath(0);
loader->LoadBitmap(event_target, image, 0, true);
}
if (image.Width() && image.Height())
disp_view->AddImage( &image,
color,
Video::BLEND_ALPHA,
event_rect,
event_point.y,
event_point.x,
event_point.z);
}
}