33 aiNPCState_Approach::~aiNPCState_Approach(
void)
42 fp->readText(strDialog);
47 pSound_SeePlayer = ::laSystemIntegrator::getSound()->soundCreate(
"collect(sonar).mp3");
51 void aiNPCState_Approach::perceive_active( std::string strID_Old )
57 pMonster->agressive(M_FALSE);
58 pMonster->enableBattleGUI(M_FALSE);
59 pMonster->enableNPCGUI(M_FALSE);
62 void aiNPCState_Approach::perceive_inactive( std::string strID_New )
66 void aiNPCState_Approach::perceive_InTerritory(
unsigned state)
71 if( (state!=PERCEPT_RESET) && (!dialog.isFinished()) )
73 pPlayer->ctlBattleMode();
75 if(state==PERCEPT_SET)
77 pSound_SeePlayer->play();
78 pMonster->setOutline(
laOutline(M_TRUE, laColor(255,255,255), 1.5) );
79 pMonster->enableNPCGUI();
80 pPlayer->enableControl(M_FALSE);
83 ps->enableCinematicMode();
87 if( ! agent()->isPerceiving(P__PLAYER_IN_RANGE) )
89 pMonster->enableNPCGUI();
91 if( pPlayer->getPosition().x() < pMonster->getPosition().x()) pMonster->move(-1);
92 else pMonster->move(+1);
96 pMonster->enableNPCGUI(M_FALSE);
103 pMonster->setOutline(
laOutline(M_TRUE, laColor(0,0,0), 1.5) );
104 pMonster->enableNPCGUI(M_FALSE);
111 void aiNPCState_Approach::perceive_InRange(
unsigned state)
117 if( (state==PERCEPT_SET) && (!dialog.isFinished()) )
119 pPlayer->setFaceDirection( pPlayer->getPosition().x() > pMonster->getPosition().x() ? -1 : +1 );
121 dialog.pPlayer = pPlayer;
122 dialog.pMonster = pMonster;
123 pPlayer->enableDialog( &dialog );
128 void aiNPCState_Approach::perceive_Touched(
unsigned state)
133 pPlayer->reflect( pMonster->boundingRect() );
136 void aiNPCState_Approach::perceive_UnderAttack(
unsigned state)
141 void aiNPCState_Approach::perceive(
unsigned state, M_BOOL global,
unsigned id, aiPerceptData data)
143 aiMobState::perceive(state, global,
id, data);
149 if( dialog.isFinished() )
151 pPlayer->enableDialog( NULL );
152 pPlayer->enableControl();
155 ps->enableCinematicMode(M_FALSE);
158 pMonster->setFaceDirection( pPlayer->getPosition().x() > pMonster->getPosition().x() ? +1 : -1 );
Object outline properties.
Adds capabilities and percepts specific to monster creatures.