本文整理汇总了C++中Heroes::SetVisited方法的典型用法代码示例。如果您正苦于以下问题:C++ Heroes::SetVisited方法的具体用法?C++ Heroes::SetVisited怎么用?C++ Heroes::SetVisited使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Heroes
的用法示例。
在下文中一共展示了Heroes::SetVisited方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: msg
int Interface::Basic::EventDigArtifact(void)
{
Heroes* hero = GetFocusHeroes();
if(hero)
{
if(hero->isShipMaster())
Dialog::Message("", _("Try looking on land!!!"), Font::BIG, Dialog::OK);
else
if(hero->GetMaxMovePoints() <= hero->GetMovePoints())
{
if(world.GetTiles(hero->GetIndex()).GoodForUltimateArtifact())
{
AGG::PlaySound(M82::DIGSOUND);
hero->ResetMovePoints();
if(world.DiggingForUltimateArtifact(hero->GetCenter()))
{
AGG::PlaySound(M82::TREASURE);
const Artifact & ultimate = world.GetUltimateArtifact().GetArtifact();
hero->PickupArtifact(ultimate);
std::string msg(_("After spending many hours digging here, you have uncovered the %{artifact}"));
StringReplace(msg, "%{artifact}", ultimate.GetName());
Dialog::ArtifactInfo(_("Congratulations!"), msg, ultimate());
// set all obelisks visited
Kingdom & kingdom = world.GetKingdom(hero->GetColor());
const MapsIndexes obelisks = Maps::GetObjectPositions(MP2::OBJ_OBELISK, true);
for(MapsIndexes::const_iterator
it = obelisks.begin(); it != obelisks.end(); ++it)
if(!hero->isVisited(world.GetTiles(*it), Visit::GLOBAL))
hero->SetVisited(*it, Visit::GLOBAL);
kingdom.PuzzleMaps().Update(kingdom.CountVisitedObjects(MP2::OBJ_OBELISK), world.CountObeliskOnMaps());
}
else
Dialog::Message("", _("Nothing here. Where could it be?"), Font::BIG, Dialog::OK);
Cursor::Get().Hide();
iconsPanel.RedrawIcons(ICON_HEROES);
Cursor::Get().Show();
Display::Get().Flip();
// check game over for ultimate artifact
return GameOver::Result::Get().LocalCheckGameOver();
}
else
Dialog::Message("", _("Try searching on clear ground."), Font::BIG, Dialog::OK);
}
}
else
Dialog::Message("", _("Digging for artifacts requires a whole day, try again tomorrow."), Font::BIG, Dialog::OK);
return Game::CANCEL;
}