本文整理汇总了C++中Bank::setCredits方法的典型用法代码示例。如果您正苦于以下问题:C++ Bank::setCredits方法的具体用法?C++ Bank::setCredits怎么用?C++ Bank::setCredits使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bank
的用法示例。
在下文中一共展示了Bank::setCredits方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: missionComplete
void MissionManager::missionComplete(PlayerObject* player, MissionObject* mission)
{
wchar_t sm[100];
swprintf(sm,100, L"","mission/mission_generic",L"success_w_amount",mission->getReward());
gMessageLib->sendSystemMessage(player,sm);
//remove mission
gMessageLib->sendSetWaypointActiveStatus(mission->getWaypoint(),false,player);
gMessageLib->sendDestroyObject(mission->getId(),player);
//Give the player the credit reward
gMessageLib->sendPlayMusicMessage(2501,player); //sound/music_mission_complete.snd
gMessageLib->sendMissionComplete(player);
Bank* bank = dynamic_cast<Bank*>(player->getEquipManager()->getEquippedObject(CreatureEquipSlot_Bank));
bank->setCredits(bank->getCredits() + mission->getReward());
gTreasuryManager->saveAndUpdateBankCredits(player);
return;
}