[wpdev-commits] wolfpack/ai ai.cpp,1.24,1.25 ai_monsters.cpp,1.16,1.17
Brought to you by:
rip,
thiagocorrea
From: Correa <thi...@us...> - 2004-08-19 01:56:06
|
Update of /cvsroot/wpdev/wolfpack/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26553/ai Modified Files: ai.cpp ai_monsters.cpp Log Message: QT_CLEAN_NAMESPACE Index: ai.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ai/ai.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ai.cpp 19 Aug 2004 01:22:54 -0000 1.24 --- ai.cpp 19 Aug 2004 01:55:56 -0000 1.25 *************** *** 541,545 **** case enFreely: { ! UINT8 dir = m_npc->direction(); if ( RandomNum( 0, 100 ) < 20 ) dir = RandomNum( 0, 7 ); --- 541,545 ---- case enFreely: { ! Q_UINT8 dir = m_npc->direction(); if ( RandomNum( 0, 100 ) < 20 ) dir = RandomNum( 0, 7 ); *************** *** 556,560 **** Q_UINT16 rndy = RandomNum( m_npc->wanderY1(), m_npc->wanderY2() ); ! UINT8 dir = m_npc->pos().direction( Coord_cl( rndx, rndy ) ); m_npc->setDirection( dir ); Movement::instance()->Walking( m_npc, dir, 0xFF ); --- 556,560 ---- Q_UINT16 rndy = RandomNum( m_npc->wanderY1(), m_npc->wanderY2() ); ! Q_UINT8 dir = m_npc->pos().direction( Coord_cl( rndx, rndy ) ); m_npc->setDirection( dir ); Movement::instance()->Walking( m_npc, dir, 0xFF ); *************** *** 571,578 **** // now get a point on this circle around the m_npc float rndphi = ( float ) RandomNum( 0, 100 ) / 100.0f * 2.0f * 3.14159265358979323846f; ! pos.x = pos.x + ( INT16 ) floor( cos( rndphi ) * rnddist ); ! pos.y = pos.y + ( INT16 ) floor( sin( rndphi ) * rnddist ); ! UINT8 dir = m_npc->pos().direction( pos ); m_npc->setDirection( dir ); Movement::instance()->Walking( m_npc, dir, 0xFF ); --- 571,578 ---- // now get a point on this circle around the m_npc float rndphi = ( float ) RandomNum( 0, 100 ) / 100.0f * 2.0f * 3.14159265358979323846f; ! pos.x = pos.x + ( Q_INT16 ) floor( cos( rndphi ) * rnddist ); ! pos.y = pos.y + ( Q_INT16 ) floor( sin( rndphi ) * rnddist ); ! Q_UINT8 dir = m_npc->pos().direction( pos ); m_npc->setDirection( dir ); Movement::instance()->Walking( m_npc, dir, 0xFF ); *************** *** 612,616 **** { // simply move towards the target ! UINT8 dir = m_npc->pos().direction( pos ); Coord_cl newPos = Movement::instance()->calcCoordFromDir( dir, m_npc->pos() ); if ( !mayWalk( m_npc, newPos ) ) --- 612,616 ---- { // simply move towards the target ! Q_UINT8 dir = m_npc->pos().direction( pos ); Coord_cl newPos = Movement::instance()->calcCoordFromDir( dir, m_npc->pos() ); if ( !mayWalk( m_npc, newPos ) ) *************** *** 647,651 **** if ( ( waitForPathCalculation <= 0 && !m_npc->hasPath() ) || pos != m_npc->pathDestination() ) { ! UINT8 range = 1; if ( m_npc->rightHandItem() ) { --- 647,651 ---- if ( ( waitForPathCalculation <= 0 && !m_npc->hasPath() ) || pos != m_npc->pathDestination() ) { ! Q_UINT8 range = 1; if ( m_npc->rightHandItem() ) { *************** *** 672,676 **** waitForPathCalculation = 0; Coord_cl nextmove = m_npc->nextMove(); ! UINT8 dir = m_npc->pos().direction( nextmove ); m_npc->setDirection( dir ); Movement::instance()->Walking( m_npc, dir, 0xFF ); --- 672,676 ---- waitForPathCalculation = 0; Coord_cl nextmove = m_npc->nextMove(); ! Q_UINT8 dir = m_npc->pos().direction( nextmove ); m_npc->setDirection( dir ); Movement::instance()->Walking( m_npc, dir, 0xFF ); *************** *** 700,711 **** int v2 = newPos.y - fleePos.y; float v_norm = sqrt( ( double ) ( v1* v1 + v2* v2 ) ); ! newPos.x = newPos.x + ( INT16 ) floor( rnddist * v1 / v_norm ); ! newPos.y = newPos.y + ( INT16 ) floor( rnddist * v2 / v_norm ); } else { float rndphi = ( float ) RandomNum( 0, 100 ) / 100.0f * 2 * 3.14; ! newPos.x = newPos.x + ( INT16 ) floor( sin( rndphi ) * rnddist ); ! newPos.y = newPos.y + ( INT16 ) floor( cos( rndphi ) * rnddist ); } --- 700,711 ---- int v2 = newPos.y - fleePos.y; float v_norm = sqrt( ( double ) ( v1* v1 + v2* v2 ) ); ! newPos.x = newPos.x + ( Q_INT16 ) floor( rnddist * v1 / v_norm ); ! newPos.y = newPos.y + ( Q_INT16 ) floor( rnddist * v2 / v_norm ); } else { float rndphi = ( float ) RandomNum( 0, 100 ) / 100.0f * 2 * 3.14; ! newPos.x = newPos.x + ( Q_INT16 ) floor( sin( rndphi ) * rnddist ); ! newPos.y = newPos.y + ( Q_INT16 ) floor( cos( rndphi ) * rnddist ); } *************** *** 798,802 **** return 0.0f; ! UINT8 range = 1; if ( m_npc->rightHandItem() ) { --- 798,802 ---- return 0.0f; ! Q_UINT8 range = 1; if ( m_npc->rightHandItem() ) { *************** *** 840,844 **** return 1.0f; ! UINT8 range = 1; if ( m_npc->rightHandItem() ) { --- 840,844 ---- return 1.0f; ! Q_UINT8 range = 1; if ( m_npc->rightHandItem() ) { Index: ai_monsters.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ai/ai_monsters.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ai_monsters.cpp 4 Aug 2004 23:17:38 -0000 1.16 --- ai_monsters.cpp 19 Aug 2004 01:55:56 -0000 1.17 *************** *** 270,274 **** return 0.0f; ! UINT8 range = 1; P_ITEM weapon = m_npc->getWeapon(); --- 270,274 ---- return 0.0f; ! Q_UINT8 range = 1; P_ITEM weapon = m_npc->getWeapon(); *************** *** 305,309 **** return 1.0f; ! UINT8 range = 1; P_ITEM weapon = m_npc->getWeapon(); if ( weapon && weapon->hasTag( "range" ) ) --- 305,309 ---- return 1.0f; ! Q_UINT8 range = 1; P_ITEM weapon = m_npc->getWeapon(); if ( weapon && weapon->hasTag( "range" ) ) *************** *** 362,366 **** return 0.0f; ! UINT8 range = 1; P_ITEM weapon = m_npc->getWeapon(); if ( weapon && weapon->hasTag( "range" ) ) --- 362,366 ---- return 0.0f; ! Q_UINT8 range = 1; P_ITEM weapon = m_npc->getWeapon(); if ( weapon && weapon->hasTag( "range" ) ) *************** *** 397,401 **** return 1.0f; ! UINT8 range = 1; P_ITEM weapon = m_npc->getWeapon(); if ( weapon && weapon->hasTag( "range" ) ) --- 397,401 ---- return 1.0f; ! Q_UINT8 range = 1; P_ITEM weapon = m_npc->getWeapon(); if ( weapon && weapon->hasTag( "range" ) ) |