本文整理汇总了C++中Skill::getIdentifier方法的典型用法代码示例。如果您正苦于以下问题:C++ Skill::getIdentifier方法的具体用法?C++ Skill::getIdentifier怎么用?C++ Skill::getIdentifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skill
的用法示例。
在下文中一共展示了Skill::getIdentifier方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: preloadAllTracks
void MusicManager::preloadAllTracks(CharacterManager* manager, Level* level) {
CCArray* characters = manager->getCharacters();
CCObject* obj0 = NULL;
CCARRAY_FOREACH(characters, obj0) {
Character* chara = (Character*)obj0;
CCArray* skills = level->getAllSkills(chara);
CCObject* obj1 = NULL;
CCARRAY_FOREACH(skills, obj1) {
Skill* skill = (Skill*)obj1;
int repeat = skill->getMaxRepeat();
for (int i = 0; i < repeat; ++i) {
string file = buildTrackName(skill->getIdentifier().c_str(), skill, i, chara);
BufferCache::sharedCache()->addBuffer(this->getTrackFileName(file.c_str()).c_str());
}
}
示例2: checkSkillTrackName
string MusicManager::checkSkillTrackName(Skill* skill, SkillPerformType& performeType) {
performeType = SkillPerformTypeNone;
if (skill) {
_characterManager->setWaitTurn(_characterManager->getWaitTurn() + 1);
if (_characterManager->getWaitTurn() == skill->getTurn()) {
if (_characterManager->getLastSkill() &&
string(_characterManager->getLastSkill()->getIdentifier()) != string(skill->getIdentifier())) {
_characterManager->setRepeatCount(0);
_characterManager->setRepeatCountRaw(0);
}
if (_characterManager->getLastSkill() == NULL || _characterManager->getLastSkill()->getIdentifier() != skill->getIdentifier()) {
// 前のターンがwaitだった場合、カウンターをリセット
_characterManager->setRepeatCount(0);
_characterManager->setRepeatCountRaw(0);
} else {
// そうじゃなかったら+1
_characterManager->setRepeatCount(_characterManager->getRepeatCount() + 1);
_characterManager->setRepeatCountRaw(_characterManager->getRepeatCountRaw() + 1);
}
if (skill->isLoop()) {
_characterManager->setRepeatCount((_characterManager->getRepeatCount()) % skill->getMaxRepeat());
} else {
_characterManager->setRepeatCount(min(_characterManager->getRepeatCount(), skill->getMaxRepeat() - 1));
}
Skill* lastSkill = _characterManager->getLastSkill();
_characterManager->setLastSkill(skill);
_characterManager->setCurrentSkill(NULL);
_characterManager->setWaitTurn(0);
performeType = SkillPerformTypeSuccess;
// 攻撃ミスってたら失敗扱いに
CCArray* targets = _enemyManager->getTargets(skill);
bool isMiss = targets->count() > 0;
if (targets->count() > 0) {
int power = skill->getPower(_characterManager);
for (int i = 0; i < targets->count(); ++i) {
Enemy* enemy = (Enemy*)targets->objectAtIndex(i);
DamageType damageType = DamageTypeNone;
enemy->damage(power, skill, _characterManager, damageType, true); // ダメージは与えずに結果だけ取り出す
if (damageType != DamageTypePhysicalInvalid && damageType != DamageTypeMagicalInvalid && damageType != DamageTypeDisable) {
isMiss = false;
}
}
}
if (skill->getMP() > _characterManager->getMP()) { // MP足りてないとき、失敗に
performeType = SkillPerformTypeFailure;
isMiss = true;
} else if (lastSkill && !skill->canRepeat() && lastSkill->getIdentifier() == skill->getIdentifier()) {
performeType = SkillPerformTypeFailure;
isMiss = true;
}
if (performeType == SkillPerformTypeFailure || isMiss) { // 失敗したとき、もしくはピロったとき、miss音を返す
return this->buildTrackName("miss", NULL, -1);
} else {
return this->buildTrackName(skill->getIdentifier().c_str(), skill, _characterManager->getRepeatCount());
}
} else {
_characterManager->setCurrentSkill(skill);
performeType = SkillPerformTypeCharge;
std::stringstream ss;
ss << _characterManager->getCurrentCharacter()->getIdentifier() << skill->getIdentifier() << "_charge" << (_characterManager->getWaitTurn() - 1); // チャージ中の時、チャージ音返す
return ss.str().c_str();
}
} else {
if (_characterManager->getLastSkill() == NULL) {
int newWaitCount = ((_characterManager->getRepeatCount() + 1) % _musicSet->getWaitCount());
if (_isAfterIntro) {
newWaitCount = 0;
}
_characterManager->setRepeatCount(newWaitCount);
return this->buildTrackName("wait", NULL, newWaitCount);
} else {
_characterManager->setRepeatCount(0);
_characterManager->setRepeatCountRaw(0);
}
_characterManager->setLastSkill(skill);
}
return this->buildTrackName("wait", NULL, _characterManager->getRepeatCount());
}