bool monsterTowerDefence::addTowerDefLostCount() { if(map_now == NULL) return false; string towerDefRoomId = map_now->getTd_roomid(); if(towerDefRoomId.empty()) return false; TD_Instancing * myTD_Instancing = Inst_MNG->id2tdRoom(towerDefRoomId); if(NULL == myTD_Instancing) return false; myTD_Instancing->AddSelfInstancingStatus(INST_STATUS_LOSE_COUNT); count4route = 0; forSelf = 0; reStart=0; resetRoute(); flgRec = false; MonsterBase::die(true); return true; }
//----------------------------------------------- void AflChara::setRoute(AflMapRoute* pmapRoute,INT iX,INT iY) { resetRoute(); INT iStartX = getPointX() / 32;//pMap->getTipWidth(); INT iStartY = getPointY() / 32;//pMap->getTipHeight(); INT iTargetX = iX / 32;//pMap->getTipWidth(); INT iTargetY = iY / 32;//pMap->getTipHeight(); LPPOINT pPoint = pmapRoute->getRoute(iStartX,iStartY,iTargetX,iTargetY); if(pPoint) { if(m_ppointRoute) delete m_ppointRoute; m_iRouteCount = pmapRoute->getRouteCount(); m_ppointRoute = pPoint; } }
//----------------------------------------------- void AflChara::moveRoute(AflSpriteMap* pMap) { if(m_ppointRoute) { if(m_iNowPoint < m_iRouteCount) { INT iCenterX = 0; INT iCenterY = pMap->getTipHeight() / 2; INT iX = m_ppointRoute[m_iNowPoint].x * pMap->getTipWidth() + iCenterX + 16; INT iY = m_ppointRoute[m_iNowPoint].y * pMap->getTipHeight() + iCenterY; m_pointTarget.x = iX; m_pointTarget.y = iY; if(iX == getPointX() && iY == getPointY()) m_iNowPoint++; } else { resetRoute(); m_pointTarget.x = getPointX(); m_pointTarget.y = getPointY(); } } }