本文整理汇总了C++中Inventory::getSlots方法的典型用法代码示例。如果您正苦于以下问题:C++ Inventory::getSlots方法的具体用法?C++ Inventory::getSlots怎么用?C++ Inventory::getSlots使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Inventory
的用法示例。
在下文中一共展示了Inventory::getSlots方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runNewStandardTurnEvents
void GameTime::runNewStandardTurnEvents() {
turn_++;
Actor* actor = NULL;
unsigned int loopSize = actors_.size();
bool visionBlockingArray[MAP_X_CELLS][MAP_Y_CELLS];
eng->mapTests->makeVisionBlockerArray(eng->player->pos, visionBlockingArray);
for(unsigned int i = 0; i < loopSize; i++) {
actor = actors_.at(i);
//Update status effects on all actors, this also makes the monster player-aware if
//it has any active status effect.
actor->getStatusEffectsHandler()->newTurnAllEffects(visionBlockingArray);
if(actor->deadState == actorDeadState_alive) {
actor->actorSpecificOnStandardTurn();
}
//Delete dead, mangled actors
if(actor->deadState == actorDeadState_mangled) {
delete actor;
if(eng->player->target == actor) {
eng->player->target = NULL;
}
actors_.erase(actors_.begin() + i);
i--;
loopSize--;
if(static_cast<unsigned int>(currentActorVectorPos_) >= actors_.size()) {
currentActorVectorPos_ = 0;
}
}
}
//Update all timed features
for(unsigned int i = 0; i < featureMobs_.size(); i++) {
featureMobs_.at(i)->newTurn(); //Note: this may erase the feature
}
for(int y = 0; y < MAP_Y_CELLS; y++) {
for(int x = 0; x < MAP_X_CELLS; x++) {
eng->map->featuresStatic[x][y]->newTurn();
}
}
//Spawn more monsters? (If an unexplored cell is selected, the spawn is aborted)
if(eng->map->getDungeonLevel() >= 1 && eng->map->getDungeonLevel() <= LAST_CAVERN_LEVEL) {
const int SPAWN_N_TURN = 125;
if(turn_ == (turn_ / SPAWN_N_TURN) * SPAWN_N_TURN) {
eng->populateMonsters->trySpawnDueToTimePassed();
}
}
//Player spell cooldowns
for(unsigned int i = 1; i < endOfItemIds; i++) {
ItemDefinition& d = *(eng->itemData->itemDefinitions[i]);
if(d.isScroll) {
if(d.isScrollLearned) {
if(eng->playerBonusHandler->isBonusPicked(playerBonus_occultist)) {
if(turn_ == (turn_ / d.spellTurnsPerPercentCooldown) * d.spellTurnsPerPercentCooldown) {
if(d.castFromMemoryCurrentBaseChance < CAST_FROM_MEMORY_CHANCE_LIM) {
d.castFromMemoryCurrentBaseChance++;
}
}
}
}
}
}
//Run new turn events on all player items
Inventory* playerInv = eng->player->getInventory();
vector<Item*>* playerBackpack = playerInv->getGeneral();
for(unsigned int i = 0; i < playerBackpack->size(); i++) {
playerBackpack->at(i)->newTurnInInventory(eng);
}
vector<InventorySlot>* playerSlots = playerInv->getSlots();
for(unsigned int i = 0; i < playerSlots->size(); i++) {
Item* const item = playerSlots->at(i).item;
if(item != NULL) {
item->newTurnInInventory(eng);
}
}
eng->soundEmitter->resetNrSoundsHeardByPlayerCurTurn();
}