本文整理汇总了C++中MagicField::getDamage方法的典型用法代码示例。如果您正苦于以下问题:C++ MagicField::getDamage方法的具体用法?C++ MagicField::getDamage怎么用?C++ MagicField::getDamage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MagicField
的用法示例。
在下文中一共展示了MagicField::getDamage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: queryAdd
ReturnValue Tile::queryAdd(int32_t, const Thing& thing, uint32_t, uint32_t flags, Creature*) const
{
if (const Creature* creature = thing.getCreature()) {
if (hasBitSet(FLAG_NOLIMIT, flags)) {
return RETURNVALUE_NOERROR;
}
if (hasBitSet(FLAG_PATHFINDING, flags) && hasFlag(TILESTATE_FLOORCHANGE | TILESTATE_TELEPORT)) {
return RETURNVALUE_NOTPOSSIBLE;
}
if (ground == nullptr) {
return RETURNVALUE_NOTPOSSIBLE;
}
if (const Monster* monster = creature->getMonster()) {
if (hasFlag(TILESTATE_PROTECTIONZONE | TILESTATE_FLOORCHANGE | TILESTATE_TELEPORT)) {
return RETURNVALUE_NOTPOSSIBLE;
}
const CreatureVector* creatures = getCreatures();
if (monster->canPushCreatures() && !monster->isSummon()) {
if (creatures) {
for (Creature* tileCreature : *creatures) {
if (tileCreature->getPlayer() && tileCreature->getPlayer()->isInGhostMode()) {
continue;
}
const Monster* creatureMonster = tileCreature->getMonster();
if (!creatureMonster || !tileCreature->isPushable() ||
(creatureMonster->isSummon() && creatureMonster->getMaster()->getPlayer())) {
return RETURNVALUE_NOTPOSSIBLE;
}
}
}
} else if (creatures && !creatures->empty()) {
for (const Creature* tileCreature : *creatures) {
if (!tileCreature->isInGhostMode()) {
return RETURNVALUE_NOTENOUGHROOM;
}
}
}
if (hasFlag(TILESTATE_IMMOVABLEBLOCKSOLID)) {
return RETURNVALUE_NOTPOSSIBLE;
}
if (hasBitSet(FLAG_PATHFINDING, flags) && hasFlag(TILESTATE_IMMOVABLENOFIELDBLOCKPATH)) {
return RETURNVALUE_NOTPOSSIBLE;
}
if (hasFlag(TILESTATE_BLOCKSOLID) || (hasBitSet(FLAG_PATHFINDING, flags) && hasFlag(TILESTATE_NOFIELDBLOCKPATH))) {
if (!(monster->canPushItems() || hasBitSet(FLAG_IGNOREBLOCKITEM, flags))) {
return RETURNVALUE_NOTPOSSIBLE;
}
}
MagicField* field = getFieldItem();
if (field && !field->isBlocking() && field->getDamage() == 0) {
CombatType_t combatType = field->getCombatType();
//There is 3 options for a monster to enter a magic field
//1) Monster is immune
if (!monster->isImmune(combatType)) {
//1) Monster is able to walk over field type
//2) Being attacked while random stepping will make it ignore field damages
if (hasBitSet(FLAG_IGNOREFIELDDAMAGE, flags)) {
if (!(monster->canWalkOnFieldType(combatType) || monster->isIgnoringFieldDamage())) {
return RETURNVALUE_NOTPOSSIBLE;
}
} else {
return RETURNVALUE_NOTPOSSIBLE;
}
}
}
return RETURNVALUE_NOERROR;
}
const CreatureVector* creatures = getCreatures();
if (const Player* player = creature->getPlayer()) {
if (creatures && !creatures->empty() && !hasBitSet(FLAG_IGNOREBLOCKCREATURE, flags) && !player->isAccessPlayer()) {
for (const Creature* tileCreature : *creatures) {
if (!player->canWalkthrough(tileCreature)) {
return RETURNVALUE_NOTPOSSIBLE;
}
}
}
if (player->getParent() == nullptr && hasFlag(TILESTATE_NOLOGOUT)) {
//player is trying to login to a "no logout" tile
return RETURNVALUE_NOTPOSSIBLE;
}
const Tile* playerTile = player->getTile();
if (playerTile && player->isPzLocked()) {
if (!playerTile->hasFlag(TILESTATE_PVPZONE)) {
//player is trying to enter a pvp zone while being pz-locked
if (hasFlag(TILESTATE_PVPZONE)) {
return RETURNVALUE_PLAYERISPZLOCKEDENTERPVPZONE;
//.........这里部分代码省略.........