本文整理汇总了C++中StaticANIObject::changeStatics1方法的典型用法代码示例。如果您正苦于以下问题:C++ StaticANIObject::changeStatics1方法的具体用法?C++ StaticANIObject::changeStatics1怎么用?C++ StaticANIObject::changeStatics1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StaticANIObject
的用法示例。
在下文中一共展示了StaticANIObject::changeStatics1方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleInteraction
bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject *obj, int invId) {
if (subj) {
if (!subj->isIdle() || (subj->_flags & 0x100))
return false;
}
if (!_interactions.size())
return false;
Interaction *inter = 0;
Interaction *previnter = 0;
int dur = 0;
int mindur = 0xFFFF;
MessageQueue *mq;
ExCommand *ex;
for (InteractionList::iterator i = _interactions.begin(); i != _interactions.end(); ++i) {
Interaction *cinter = *i;
if (!cinter->canInteract(subj, obj, invId))
continue;
if ((inter || cinter->_objectId2) && (!obj || cinter->_objectId3 != obj->_id)) {
if (cinter->_messageQueue)
cinter->_messageQueue->calcDuration(subj);
debugC(5, kDebugInteractions, "Interaction: %s", transCyrillic(cinter->_actionName));
PicAniInfo aniInfo;
obj->getPicAniInfo(aniInfo);
if (cinter->_staticsId1 && obj->_objtype == kObjTypeStaticANIObject) {
StaticANIObject *ani = static_cast<StaticANIObject *>(obj);
ani->_messageQueueId = 0;
ani->changeStatics2(cinter->_staticsId1);
}
int xpos = cinter->_xOffs + obj->_ox;
int ypos = cinter->_yOffs + obj->_oy;
obj->setPicAniInfo(aniInfo);
if (abs(xpos - subj->_ox) > 1 || abs(ypos - subj->_oy) > 1) {
debugC(0, kDebugPathfinding, "Calling makeQueue() at [%d, %d]", xpos, ypos);
mq = getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->makeQueue(subj, xpos, ypos, 1, cinter->_staticsId2);
if (mq) {
dur = mq->calcDuration(subj);
delete mq;
} else {
dur = 0x10000;
}
inter = previnter;
} else {
dur = 0;
}
if (dur < mindur) {
inter = cinter;
mindur = dur;
previnter = cinter;
}
} else {
inter = cinter;
break;
}
}
if (!inter)
return false;
if (!inter->_objectId2) {
if (obj->_objtype == kObjTypeStaticANIObject) {
StaticANIObject *ani = static_cast<StaticANIObject *>(obj);
if (inter->_flags & 1) {
if (!ani->isIdle())
return false;
if (ani->_flags & 0x100)
return false;
} else if (inter->_staticsId1 != 0) {
if (ani->_movement || ani->_statics == 0 || ani->_statics->_staticsId != inter->_staticsId1) {
mq = ani->changeStatics1(inter->_staticsId1);
if (!mq)
return false;
ex = new ExCommand((subj ? subj->_id : 0), 55, 0, 0, 0, 0, 1, 0, 0, 0);
ex->_x = obj->_id;
ex->_y = obj->_odelay;
ex->_param = subj ? subj->_odelay : 0;
ex->_excFlags = 3;
ex->_z = (obj->_objtype != kObjTypePictureObject);
ex->_field_20 = invId;
mq->addExCommandToEnd(ex);
if (mq->_isFinished) {
mq->_isFinished = 0;
ani->queueMessageQueue(mq);
}
//.........这里部分代码省略.........
示例2: handleInteraction
bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject *obj, int invId) {
if (subj) {
if (!subj->isIdle() || (subj->_flags & 0x100))
return false;
}
if (!_interactions.size())
return false;
Interaction *inter = 0;
Interaction *previnter = 0;
int dur = 0;
int mindur = 0xFFFF;
MessageQueue *mq;
ExCommand *ex;
for (ObList::iterator i = _interactions.begin(); i != _interactions.end(); ++i) {
Interaction *cinter = (Interaction *)*i;
if (!cinter->canInteract(subj, obj, invId))
continue;
if ((inter || cinter->_objectId2) && (!obj || cinter->_objectId3 != obj->_id)) {
if (cinter->_messageQueue)
cinter->_messageQueue->calcDuration(subj);
PicAniInfo aniInfo;
obj->getPicAniInfo(&aniInfo);
if (cinter->_staticsId1) {
StaticANIObject *ani = (StaticANIObject *)obj;
ani->_messageQueueId = 0;
ani->changeStatics2(cinter->_staticsId1);
}
int xpos = cinter->_xOffs + obj->_ox;
int ypos = cinter->_yOffs + obj->_oy;
obj->setPicAniInfo(&aniInfo);
if (abs(xpos - subj->_ox) > 1 || abs(ypos - subj->_oy) > 1) {
mq = getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId)->doWalkTo(subj, xpos, ypos, 1, cinter->_staticsId2);
if (mq) {
dur = mq->calcDuration(subj);
delete mq;
} else {
dur = 0x10000;
}
inter = previnter;
} else {
dur = 0;
}
if (dur < mindur) {
inter = cinter;
mindur = dur;
previnter = cinter;
}
} else {
inter = cinter;
break;
}
}
if (!inter)
return false;
if (!inter->_objectId2) {
StaticANIObject *ani = (StaticANIObject *)obj;
if (!ani->isIdle())
return false;
if (ani->_flags & 0x100)
return false;
if (!inter->_staticsId1 || !(inter->_flags & 1))
goto LABEL_38;
if (ani->_movement || ani->_statics == 0 || ani->_statics->_staticsId != inter->_staticsId1) {
mq = ani->changeStatics1(inter->_staticsId1);
if (!mq)
return false;
ex = new ExCommand((subj ? subj->_id : 0), 55, 0, 0, 0, 0, 1, 0, 0, 0);
ex->_x = obj->_id;
ex->_y = obj->_okeyCode;
ex->_keyCode = subj ? subj->_okeyCode : 0;
ex->_excFlags = 3;
ex->_field_14 = (obj->_objtype != kObjTypePictureObject);
ex->_field_20 = invId;
mq->_exCommands.push_back(ex);
if (mq->_isFinished) {
mq->_isFinished = 0;
ani->queueMessageQueue(mq);
}
} else {
if (ani->getMessageQueue())
ani->queueMessageQueue(0);
//.........这里部分代码省略.........
示例3: global_messageHandler4
//.........这里部分代码省略.........
}
break;
}
case 21:
if (!g_fp->_currentScene)
break;
ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_param);
if (!ani)
break;
ani->queueMessageQueue(0);
ani->playIdle();
break;
case 9:
// Nop in original
break;
case 3:
g_fp->_currentScene->_y = cmd->_messageNum - cmd->_messageNum % g_fp->_scrollSpeed;
break;
case 4:
g_fp->_currentScene->_x = cmd->_messageNum - cmd->_messageNum % g_fp->_scrollSpeed;
break;
case 19: {
if (!g_fp->_currentScene)
break;
ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_param);
if (!ani)
break;
MessageQueue *mq = ani->getMessageQueue();
MessageQueue *mq2 = ani->changeStatics1(cmd->_messageNum);
if (!mq2 || !mq2->getExCommandByIndex(0) || !mq)
break;
mq2->_parId = mq->_id;
mq2->_flag1 = (cmd->_field_24 == 0);
break;
}
case 22:
if (!g_fp->_currentScene)
break;
ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_param);
if (!ani)
break;
ani->_flags |= 4;
ani->changeStatics2(cmd->_messageNum);
break;
case 6:
if (!g_fp->_currentScene)
break;
ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_param);
if (!ani)
break;
ani->hide();
break;
case 27: