本文整理汇总了C++中CItemArmor::getID方法的典型用法代码示例。如果您正苦于以下问题:C++ CItemArmor::getID方法的具体用法?C++ CItemArmor::getID怎么用?C++ CItemArmor::getID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CItemArmor
的用法示例。
在下文中一共展示了CItemArmor::getID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ActionAbilityStart
void CAIPetDummy::ActionAbilityStart()
{
if (m_PPet->StatusEffectContainer->HasPreventActionEffect())
{
return;
}
if (m_PPet->objtype == TYPE_MOB && m_PPet->PMaster->objtype == TYPE_PC)
{
if (m_MasterCommand == MASTERCOMMAND_SIC && m_PPet->health.tp >= 1000 && m_PBattleTarget != nullptr)
{
m_MasterCommand = MASTERCOMMAND_NONE;
CMobEntity* PMob = (CMobEntity*)m_PPet->PMaster->PPet;
std::vector<CMobSkill*> MobSkills = battleutils::GetMobSkillsByFamily(PMob->m_Family);
if (MobSkills.size() > 0)
{
int maxSearch = 10;
// keep looking for an ability until one is valid
do {
SetCurrentMobSkill(MobSkills.at(dsprand::GetRandomNumber(MobSkills.size())));
} while (luautils::OnMobSkillCheck(m_PBattleTarget, m_PPet, GetCurrentMobSkill()) != 0 && maxSearch--);
// could not find skill
if (maxSearch == 0)
{
TransitionBack(true);
return;
}
preparePetAbility(m_PBattleTarget);
return;
}
return;
}
}
if (m_PPet->getPetType() == PETTYPE_JUG_PET){
if (m_MasterCommand == MASTERCOMMAND_SIC && m_PPet->health.tp >= 1000 && m_PBattleTarget != nullptr){ //choose random tp move
m_MasterCommand = MASTERCOMMAND_NONE;
if (m_PPet->PetSkills.size() > 0){
SetCurrentMobSkill(m_PPet->PetSkills.at(dsprand::GetRandomNumber(m_PPet->PetSkills.size())));
preparePetAbility(m_PBattleTarget);
return;
}
}
}
else if (m_PPet->getPetType() == PETTYPE_AVATAR){
for (int i = 0; i < m_PPet->PetSkills.size(); i++){
if (m_PPet->PetSkills[i]->getAnimationTime() == m_MasterCommand){
SetCurrentMobSkill(m_PPet->PetSkills[i]);
m_MasterCommand = MASTERCOMMAND_NONE;
preparePetAbility(m_PPet);
return;
}
}
m_MasterCommand = MASTERCOMMAND_NONE;
}
else if (m_PPet->getPetType() == PETTYPE_WYVERN){
WYVERNTYPE wyverntype = m_PPet->getWyvernType();
if (m_MasterCommand == MASTERCOMMAND_ELEMENTAL_BREATH && (wyverntype == WYVERNTYPE_MULTIPURPOSE || wyverntype == WYVERNTYPE_OFFENSIVE)){
m_MasterCommand = MASTERCOMMAND_NONE;
//offensive or multipurpose wyvern
if (m_PBattleTarget != nullptr){ //prepare elemental breaths
int skip = dsprand::GetRandomNumber(6);
int hasSkipped = 0;
for (int i = 0; i < m_PPet->PetSkills.size(); i++){
if (m_PPet->PetSkills[i]->getValidTargets() == TARGET_ENEMY){
if (hasSkipped == skip){
SetCurrentMobSkill(m_PPet->PetSkills[i]);
break;
}
else{
hasSkipped++;
}
}
}
preparePetAbility(m_PBattleTarget);
return;
}
}
else if (m_MasterCommand == MASTERCOMMAND_HEALING_BREATH && (wyverntype == WYVERNTYPE_DEFENSIVE || wyverntype == WYVERNTYPE_MULTIPURPOSE))
{
m_MasterCommand = MASTERCOMMAND_NONE;
m_PBattleSubTarget = nullptr;
//TODO: CHECK FOR STATUS EFFECTS FOR REMOVE- BREATH (higher priority than healing breaths)
// if(m_PPet->PMaster->PParty==nullptr){//solo with master-kun
CItemArmor* masterHeadItem = ((CCharEntity*)(m_PPet->PMaster))->getEquip(SLOT_HEAD);
uint16 masterHead = masterHeadItem ? masterHeadItem->getID() : 0;
//.........这里部分代码省略.........
示例2: ActionAbilityStart
void CAIPetDummy::ActionAbilityStart()
{
if (m_PPet->StatusEffectContainer->HasPreventActionEffect())
{
return;
}
if (m_PPet->objtype == TYPE_MOB && m_PPet->PMaster->objtype == TYPE_PC)
{
if (m_MasterCommand == MASTERCOMMAND_SIC && m_PPet->health.tp >= 1000 && m_PBattleTarget != nullptr)
{
m_MasterCommand = MASTERCOMMAND_NONE;
CMobEntity* PMob = (CMobEntity*)m_PPet->PMaster->PPet;
std::vector<CMobSkill*> MobSkills = battleutils::GetMobSkillsByFamily(PMob->m_Family);
if (MobSkills.size() > 0)
{
int maxSearch = 10;
// keep looking for an ability until one is valid
do {
SetCurrentMobSkill(MobSkills.at(WELL512::irand() % MobSkills.size()));
} while (luautils::OnMobSkillCheck(m_PBattleTarget, m_PPet, GetCurrentMobSkill()) != 0 && maxSearch--);
// could not find skill
if (maxSearch == 0)
{
TransitionBack(true);
return;
}
preparePetAbility(m_PBattleTarget);
return;
}
return;
}
}
if (m_PPet->getPetType() == PETTYPE_JUG_PET){
if (m_MasterCommand == MASTERCOMMAND_SIC && m_PPet->health.tp >= 1000 && m_PBattleTarget != nullptr){ //choose random tp move
m_MasterCommand = MASTERCOMMAND_NONE;
if (m_PPet->PetSkills.size() > 0){
SetCurrentMobSkill(m_PPet->PetSkills.at(WELL512::irand() % m_PPet->PetSkills.size()));
preparePetAbility(m_PBattleTarget);
return;
}
}
}
else if (m_PPet->getPetType() == PETTYPE_AVATAR){
for (int i = 0; i < m_PPet->PetSkills.size(); i++){
if (m_PPet->PetSkills[i]->getAnimationTime() == m_MasterCommand){
SetCurrentMobSkill(m_PPet->PetSkills[i]);
m_MasterCommand = MASTERCOMMAND_NONE;
preparePetAbility(m_PPet);
return;
}
}
m_MasterCommand = MASTERCOMMAND_NONE;
}
else if (m_PPet->getPetType() == PETTYPE_WYVERN){
WYVERNTYPE wyverntype = m_PPet->getWyvernType();
if (m_MasterCommand == MASTERCOMMAND_ELEMENTAL_BREATH && (wyverntype == WYVERNTYPE_MULTIPURPOSE || wyverntype == WYVERNTYPE_OFFENSIVE)){
m_MasterCommand = MASTERCOMMAND_NONE;
//offensive or multipurpose wyvern
if (m_PBattleTarget != nullptr){ //prepare elemental breaths
int skip = WELL512::irand() % 6;
int hasSkipped = 0;
for (int i = 0; i < m_PPet->PetSkills.size(); i++){
if (m_PPet->PetSkills[i]->getValidTargets() == TARGET_ENEMY){
if (hasSkipped == skip){
SetCurrentMobSkill(m_PPet->PetSkills[i]);
break;
}
else{
hasSkipped++;
}
}
}
preparePetAbility(m_PBattleTarget);
return;
}
}
else if (m_MasterCommand == MASTERCOMMAND_HEALING_BREATH && (wyverntype == WYVERNTYPE_DEFENSIVE || wyverntype == WYVERNTYPE_MULTIPURPOSE))
{
m_MasterCommand = MASTERCOMMAND_NONE;
m_PBattleSubTarget = nullptr;
//TODO: CHECK FOR STATUS EFFECTS FOR REMOVE- BREATH (higher priority than healing breaths)
// if(m_PPet->PMaster->PParty==nullptr){//solo with master-kun
CItemArmor* masterHeadItem = ((CCharEntity*)(m_PPet->PMaster))->getEquip(SLOT_HEAD);
uint16 masterHead = masterHeadItem ? masterHeadItem->getID() : 0;
//.........这里部分代码省略.........