本文整理汇总了C++中GetMover函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMover函数的具体用法?C++ GetMover怎么用?C++ GetMover使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetMover函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetMover
bool AntiCheat::CheckFly()
{
if (GetMover()->GetTerrain()->IsUnderWater(m_currentmovementInfo->GetPos()->x, m_currentmovementInfo->GetPos()->y, m_currentmovementInfo->GetPos()->z - 2.0f))
return true;
if (!m_currentmovementInfo->HasMovementFlag(MovementFlags(MOVEFLAG_CAN_FLY | MOVEFLAG_FLYING | MOVEFLAG_ROOT)))
return true;
if (GetMover()->HasAuraType(SPELL_AURA_FEATHER_FALL))
return true;
float ground_z = GetMover()->GetTerrain()->GetHeight(GetPlayer()->GetPositionX(),GetPlayer()->GetPositionY(),MAX_HEIGHT);
float floor_z = GetMover()->GetTerrain()->GetHeight(GetPlayer()->GetPositionX(),GetPlayer()->GetPositionY(),GetPlayer()->GetPositionZ());
float map_z = ((floor_z <= (INVALID_HEIGHT+5.0f)) ? ground_z : floor_z);
if (map_z + m_currentConfig->checkFloatParam[0] > GetPlayer()->GetPositionZ() && map_z > (INVALID_HEIGHT + m_currentConfig->checkFloatParam[0] + 5.0f))
return true;
if (m_currentDeltaZ > 0.0f)
return true;
char buffer[255];
sprintf(buffer," flying without fly auras on height %e but allowed %e",
GetPlayer()->GetPositionZ(), map_z + m_currentConfig->checkFloatParam[0]);
m_currentCheckResult.clear();
m_currentCheckResult.append(buffer);
return false;
}
开发者ID:Seehub,项目名称:mangos,代码行数:29,代码来源:AntiCheat.cpp
示例2: SetActiveMover
// Movement checks
bool AntiCheat::CheckMovement()
{
if (!GetPlayer()->IsSelfMover() && isActiveMover())
{
SetActiveMover(false);
m_currentMover = GetPlayer()->GetMover();
m_MovedLen = 0.0f;
SetImmune(ANTICHEAT_DEFAULT_DELTA);
}
else if (GetPlayer()->IsSelfMover() && !isActiveMover())
{
SetActiveMover(true);
m_currentMover = ((Unit*)GetPlayer());
m_MovedLen = 0.0f;
SetImmune(ANTICHEAT_DEFAULT_DELTA);
}
if (GetPlayer()->IsBeingTeleported())
SetImmune(ANTICHEAT_DEFAULT_DELTA);
SetLastLiveState(GetPlayer()->getDeathState());
float delta_x = GetMover()->GetPositionX() - m_currentmovementInfo->GetPos()->x;
float delta_y = GetMover()->GetPositionY() - m_currentmovementInfo->GetPos()->y;
m_currentDeltaZ = GetMover()->GetPositionZ() - m_currentmovementInfo->GetPos()->z;
m_currentDelta = sqrt(delta_x * delta_x + delta_y * delta_y);
m_MovedLen += m_currentDelta;
return true;
}
开发者ID:Seehub,项目名称:mangos,代码行数:33,代码来源:AntiCheat.cpp
示例3: if
bool AntiCheat::CheckSpeed()
{
float speedRate = 1.0f;
int serverDelta = WorldTimer::getMSTimeDiff(m_oldCheckTime[CHECK_MOVEMENT_SPEED],WorldTimer::getMSTime());
if (m_currentTimeSkipped > 0 && (float)m_currentTimeSkipped < serverDelta)
{
serverDelta += m_currentTimeSkipped;
m_currentTimeSkipped = 0;
}
else if (m_currentTimeSkipped > 0 && (float)m_currentTimeSkipped > serverDelta)
{
m_currentTimeSkipped = 0;
return true;
}
uint32 clientTime = m_currentmovementInfo->time;
int clientDelta = clientTime - m_lastClientTime;
m_lastClientTime = clientTime;
float delta_t = float(std::max(clientDelta,serverDelta));
float moveSpeed = m_MovedLen / delta_t;
m_MovedLen = 0.0f;
std::string mode;
if (m_currentmovementInfo->GetMovementFlags() & MOVEFLAG_FLYING)
{
speedRate = GetMover()->GetSpeed(MOVE_FLIGHT);
mode = "MOVE_FLIGHT";
}
else if (m_currentmovementInfo->GetMovementFlags() & MOVEFLAG_SWIMMING)
{
speedRate = GetMover()->GetSpeed(MOVE_SWIM);
mode = "MOVE_SWIM";
}
else if (m_currentmovementInfo->GetMovementFlags() & MOVEFLAG_WALK_MODE)
{
speedRate = GetMover()->GetSpeed(MOVE_WALK);
mode = "MOVE_WALK";
}
else
{
speedRate = GetMover()->GetSpeed(MOVE_RUN);
mode = "MOVE_RUN";
}
if ( moveSpeed / speedRate <= m_currentConfig->checkFloatParam[0] )
return true;
char buffer[255];
sprintf(buffer," Speed is %f but allowed %f Mode is %s, opcode is %s, client delta is %d, server delta is %d",
moveSpeed / speedRate, m_currentConfig->checkFloatParam[0],mode.c_str(), LookupOpcodeName(m_currentOpcode), clientDelta, serverDelta);
m_currentCheckResult.clear();
m_currentCheckResult.append(buffer);
return false;
}
开发者ID:Seehub,项目名称:mangos,代码行数:59,代码来源:AntiCheat.cpp
示例4: HideActor
/**
* Set actor hidden status to true.
* For a moving actor, actually hide it.
* @param ano Actor Id
*/
void HideActor(CORO_PARAM, int ano) {
PMOVER pMover;
assert((ano > 0 && ano <= NumActors) || ano == LEAD_ACTOR); // illegal actor
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx);
if (TinselV2) {
actorInfo[ano - 1].bHidden = true;
// Send event to tagged actors
// (this is duplicated in HideMover())
if (IsTaggedActor(ano)) {
CORO_INVOKE_ARGS(ActorEvent, (CORO_SUBCTX, ano, HIDEEVENT, true, 0));
// It may be pointed to
SetActorPointedTo(ano, false);
SetActorTagWanted(ano, false, false, 0);
}
}
// Get moving actor involved
pMover = GetMover(ano);
if (pMover)
HideMover(pMover, 0);
else if (!TinselV2)
actorInfo[ano - 1].bHidden = true;
CORO_END_CODE;
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:38,代码来源:actors.cpp
示例5: storeActorReel
/**
* More properly should be called:
* 'store_actor_reel_and/or_film_and/or_object()'
*/
void storeActorReel(int ano, const FREEL *reel, SCNHANDLE hFilm, OBJECT *pobj, int reelnum, int x, int y) {
PMOVER pActor;
assert(ano > 0 && ano <= NumActors); // illegal actor number
pActor = GetMover(ano);
// Only store the reel and film for a moving actor if NOT called from MoverProcess()
// (MoverProcess() calls with reel=film=NULL, pobj not NULL)
if (!pActor
|| !(reel == NULL && hFilm == 0 && pobj != NULL)) {
actorInfo[ano - 1].presReel = reel; // Store reel
actorInfo[ano - 1].presRnum = reelnum; // Store reel number
actorInfo[ano - 1].presFilm = hFilm; // Store film
actorInfo[ano - 1].presPlayX = x;
actorInfo[ano - 1].presPlayY = y;
}
// Only store the object for a moving actor if called from MoverProcess()
if (!pActor) {
actorInfo[ano - 1].presObj = pobj; // Store object
} else if (reel == NULL && hFilm == 0 && pobj != NULL) {
actorInfo[ano - 1].presObj = pobj; // Store object
}
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:29,代码来源:actors.cpp
示例6: NextTaggedActor
/**
* Called from TagProcess, NextTaggedActor() is
* called repeatedly until the caller gets fed up or
* there are no more tagged actors to look at.
*/
int NextTaggedActor(int previous) {
PMOVER pMover;
// Convert actor number to index
if (!previous)
previous = -1;
else
previous = TaggedActorIndex(previous);
while (++previous < numTaggedActors) {
pMover = GetMover(taggedActors[previous].id);
// No tag on lead actor while he's moving
if ((taggedActors[previous].id) == GetLeadId() && MoverMoving(pMover)) {
taggedActors[previous].tagFlags &= ~(POINTING | TAGWANTED);
continue;
}
// Not if the actor doesn't exist at the moment
if (pMover && !MoverIs(pMover))
continue;
if (!(pMover ? MoverHidden(pMover) : ActorHidden(taggedActors[previous].id))) {
return taggedActors[previous].id;
}
}
return 0;
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:34,代码来源:actors.cpp
示例7: if
// Transport checks
bool AntiCheat::CheckOnTransport()
{
if (GetMover()->HasAura(56266))
return true;
// transports size limited
// (also received at zeppelin/lift leave by some reason with t_* as absolute in continent coordinates, can be safely skipped)
if ( m_currentmovementInfo->GetTransportPos()->x < m_currentConfig->checkFloatParam[1] &&
m_currentmovementInfo->GetTransportPos()->y < m_currentConfig->checkFloatParam[1] &&
m_currentmovementInfo->GetTransportPos()->z < 2.0f * m_currentConfig->checkFloatParam[1])
return true;
float trans_rad = sqrt(m_currentmovementInfo->GetTransportPos()->x * m_currentmovementInfo->GetTransportPos()->x + m_currentmovementInfo->GetTransportPos()->y * m_currentmovementInfo->GetTransportPos()->y + m_currentmovementInfo->GetTransportPos()->z * m_currentmovementInfo->GetTransportPos()->z);
if (trans_rad < + m_currentConfig->checkFloatParam[0])
return true;
char buffer[255];
sprintf(buffer," Transport radius = %f, opcode = %s, on-transport coordinates %f, %f, %f ",
trans_rad, LookupOpcodeName(m_currentOpcode),
m_currentmovementInfo->GetTransportPos()->x,
m_currentmovementInfo->GetTransportPos()->y,
m_currentmovementInfo->GetTransportPos()->z);
m_currentCheckResult.clear();
m_currentCheckResult.append(buffer);
return false;
}
开发者ID:sergeev,项目名称:mangos4,代码行数:29,代码来源:AntiCheat.cpp
示例8: ScrollFocus
/**
* Change which actor the camera is following.
*/
void ScrollFocus(int ano) {
if (g_scrollActor != ano) {
g_oldx = g_oldy = 0;
g_scrollActor = ano;
g_pScrollMover = ano ? GetMover(g_scrollActor) : NULL;
}
}
开发者ID:AReim1982,项目名称:scummvm,代码行数:11,代码来源:scroll.cpp
示例9: GetMover
// AI가 제어할 수 있는가?
BOOL CAIMonster2::IsControllable()
{
CMover* pMover = GetMover();
// 죽었을 경우 or 데미지 플라이 상태?
if( pMover->IsDie() || (pMover->m_pActMover->GetState() & OBJSTA_DMG_FLY_ALL) )
return FALSE;
return TRUE;
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:9,代码来源:AIMonster2.cpp
示例10: GetMover
bool AntiCheat::CheckTp2Plane()
{
if (m_currentmovementInfo->GetPos()->z > m_currentConfig->checkFloatParam[0] || m_currentmovementInfo->GetPos()->z < -m_currentConfig->checkFloatParam[0])
return true;
if (GetMover()->HasAuraType(SPELL_AURA_GHOST)
|| GetMover()->HasAuraType(SPELL_AURA_WATER_WALK)
|| GetMover()->HasAura(60068) //Path of Frost
|| GetMover()->HasAura(61081) //dummy Path of Frost(60068)
|| GetMover()->HasAura(11319) //SPELL_AURA_WATER_WALK, Spell Water Walking
|| GetMover()->HasAura(27986) // SPELL_AURA_FEATHER_FALL and SPELL_AURA_HOVER and SPELL_EFFECT_APPLY_AURA
)
return true;
float plane_z = 0.0f;
plane_z = GetMover()->GetMap()->GetHeight(GetPlayer()->GetPhaseMask(),m_currentmovementInfo->GetPos()->x, m_currentmovementInfo->GetPos()->y, MAX_HEIGHT) - m_currentmovementInfo->GetPos()->z;
plane_z = (plane_z < -500.0f) ? 0 : plane_z; //check holes in heigth map
if(plane_z < m_currentConfig->checkFloatParam[1] && plane_z > -m_currentConfig->checkFloatParam[1])
return true;
char buffer[255];
sprintf(buffer," Plane Z = %e, player Z = %e, opcode %s",
plane_z, GetPlayer()->GetPositionZ(), LookupOpcodeName(m_currentOpcode));
m_currentCheckResult.clear();
m_currentCheckResult.append(buffer);
return false;
}
开发者ID:Sar777,项目名称:mangos,代码行数:30,代码来源:AntiCheat.cpp
示例11: defined
DWORD CActionMover::_ProcessMsgDmg( DWORD dwMsg, CMover* pAttacker, DWORD dwAtkFlags, int nParam, BOOL bTarget, int nReflect )
{
#if defined(__WORLDSERVER)
CAttackArbiter arbiter( dwMsg, pAttacker, GetMover(), dwAtkFlags, nParam, bTarget, nReflect );
return arbiter.OnDamageMsgW();
#elif defined(__CLIENT)
return OnDamageMsgC( dwMsg, pAttacker, dwAtkFlags, nParam );
#else
return 0;
#endif
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:11,代码来源:ActionMoverDmg.cpp
示例12: unHideMovingActor
/**
* Unhide an actor if it's a moving actor.
* @param ano Actor Id
*/
void unHideMovingActor(int ano) {
PMOVER pActor;
assert((ano > 0 && ano <= NumActors) || ano == LEAD_ACTOR); // illegal actor
// Get moving actor involved
pActor = GetMover(ano);
assert(pActor); // not a moving actor
UnHideMover(pActor);
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:16,代码来源:actors.cpp
示例13: DisableActor
/**
* Kill actors.
* @param ano Actor Id
*/
void DisableActor(int ano) {
PMOVER pActor;
assert(ano > 0 && ano <= NumActors); // illegal actor number
actorInfo[ano - 1].bAlive = false; // Record as dead
actorInfo[ano - 1].x = actorInfo[ano - 1].y = 0;
// Kill off moving actor properly
pActor = GetMover(ano);
if (pActor)
KillMover(pActor);
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:17,代码来源:actors.cpp
示例14: GetActorPos
void GetActorPos(int ano, int *x, int *y) {
PMOVER pActor;
assert((ano > 0 && ano <= NumActors) || ano == LEAD_ACTOR); // unknown actor
pActor = GetMover(ano);
if (pActor)
GetMoverPosition(pActor, x, y);
else {
*x = actorInfo[ano - 1].x;
*y = actorInfo[ano - 1].y;
}
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:14,代码来源:actors.cpp
示例15: CheckAirJump
bool AntiCheat::CheckAirJump()
{
if (m_currentOpcode != CMSG_MOVE_JUMP)
return true;
if (!m_currentmovementInfo->HasMovementFlag(MOVEFLAG_FALLING) || !GetMover()->m_movementInfo.HasMovementFlag(MOVEFLAG_FALLING))
return true;
char buffer[255];
sprintf(buffer," player Z = %f, opcode %s", GetPlayer()->GetPositionZ(), LookupOpcodeName(m_currentOpcode));
m_currentCheckResult.clear();
m_currentCheckResult.append(buffer);
return false;
}
开发者ID:sergeev,项目名称:mangos4,代码行数:14,代码来源:AntiCheat.cpp
示例16: switch
//
// 비행중 공격 액션 처리
//
void CActionMover::_ProcessStateAttack2( DWORD dwState, int nParam )
{
CMover* pMover = m_pMover;
CModelObject *pModel = (CModelObject *)pMover->m_pModel;
switch( dwState )
{
case OBJSTA_ATK1:
if( pModel->IsEndFrame() )
ResetState( OBJSTA_ATK_ALL );
if( pModel->m_nPause > 0 )
{
--pModel->m_nPause;
}
else
{
if( pModel->IsAttrHit() )
{
CMover* pHitObj = prj.GetMover( m_objidHit );
if( IsInvalidObj( pHitObj ) || pHitObj->IsDie() ) // 타겟이 거시기하거나 죽었으면 취소
return;
BOOL bSuccess = pHitObj->m_pActMover->SendDamage( AF_GENERIC, pMover->GetId() );
if( bSuccess == FALSE )
return;
#ifdef __CLIENT
ItemProp* pItemProp = pMover->GetActiveHandItemProp();
if( pItemProp )
{
D3DXVECTOR3 v = pMover->GetPos();
PLAYSND( pItemProp->dwSndAttack1, &v );
}
#endif
if( GetMover()->IsPlayer() )
{
pModel->m_nPause = 5; // frame 멈춤
}
else
{
pModel->m_nPause = 0; // 몬스터는 멈추지 않음
pHitObj->m_pModel->m_nPause = 0;
}
}
}
break;
}
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:52,代码来源:ActionMoverState2.cpp
示例17:
BOOL CAIMonster2::IsInValidTarget()
{
if( m_idTarget == NULL_ID )
return TRUE;
CMover* pTarget = prj.GetMover( m_idTarget );
if( IsValidObj( pTarget ) == FALSE )
return TRUE;
if( pTarget->IsDie() )
return TRUE;
if( GetMover()->IsFlyingNPC() != pTarget->m_pActMover->IsFly() )
return TRUE;
return FALSE;
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:17,代码来源:AIMonster2.cpp
示例18: HideMovingActor
/**
* Hide an actor if it's a moving actor.
* @param ano Actor Id
* @param sf sf
*/
bool HideMovingActor(int ano, int sf) {
PMOVER pActor;
assert((ano > 0 && ano <= NumActors) || ano == LEAD_ACTOR); // illegal actor
// Get moving actor involved
pActor = GetMover(ano);
if (pActor) {
HideMover(pActor, sf);
return true;
} else {
if (actorInfo[ano - 1].presObj != NULL)
MultiHideObject(actorInfo[ano - 1].presObj); // Hidee object
return false;
}
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:22,代码来源:actors.cpp
示例19: GetMover
bool AntiCheat::isCanFly()
{
if ( GetMover()->HasAuraType(SPELL_AURA_FLY)
|| GetMover()->HasAuraType(SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED)
|| GetMover()->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)
|| GetMover()->HasAuraType(SPELL_AURA_MOD_VEHICLE_SPEED_ALWAYS)
|| GetMover()->HasAuraType(SPELL_AURA_MOD_MOUNTED_FLIGHT_SPEED_ALWAYS)
|| GetMover()->HasAuraType(SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK)
)
return true;
return false;
}
开发者ID:Archives,项目名称:TrinityCore,代码行数:13,代码来源:AntiCheat.cpp
示例20: restoreMovement
/**
* Called after a moving actor had been replaced by an splay().
* Moves the actor to where the splay() left it, and continues the
* actor's walk (if any) from the new co-ordinates.
*/
void restoreMovement(int ano) {
PMOVER pActor;
assert(ano > 0 && ano <= NumActors); // illegal actor number
// Get moving actor involved
pActor = GetMover(ano);
assert(pActor); // not a moving actor
if (pActor->objX == actorInfo[ano - 1].x && pActor->objY == actorInfo[ano - 1].y)
return;
pActor->objX = actorInfo[ano - 1].x;
pActor->objY = actorInfo[ano - 1].y;
if (pActor->actorObj)
SSetActorDest(pActor);
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:24,代码来源:actors.cpp
注:本文中的GetMover函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论