This commit is contained in:
parent
bf00970278
commit
2a71836478
59
source/enemy/nffolk.cpp
Normal file
59
source/enemy/nffolk.cpp
Normal file
@ -0,0 +1,59 @@
|
||||
/*=========================================================================
|
||||
|
||||
nffolk.cpp
|
||||
|
||||
Author: CRB
|
||||
Created:
|
||||
Project: Spongebob
|
||||
Purpose:
|
||||
|
||||
Copyright (c) 2000 Climax Development Ltd
|
||||
|
||||
===========================================================================*/
|
||||
|
||||
#ifndef __ENEMY_NPC_H__
|
||||
#include "enemy\npc.h"
|
||||
#endif
|
||||
|
||||
#ifndef __UTILS_HEADER__
|
||||
#include "utils\utils.h"
|
||||
#endif
|
||||
|
||||
#ifndef __GAME_GAME_H__
|
||||
#include "game\game.h"
|
||||
#endif
|
||||
|
||||
|
||||
void CNpc::processFishFolkMovementModifier( int _frames, s32 distX, s32 distY )
|
||||
{
|
||||
if ( m_movementTimer > 0 )
|
||||
{
|
||||
Pos.vx += distX;
|
||||
Pos.vy += distY;
|
||||
|
||||
m_movementTimer -= _frames;
|
||||
|
||||
if ( m_movementTimer <= 0 )
|
||||
{
|
||||
m_timerTimer = GameState::getOneSecondInFrames() * ( ( getRnd() % 5 ) + 1 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( m_timerTimer > 0 )
|
||||
{
|
||||
// pause and look around
|
||||
|
||||
m_timerTimer -= _frames;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( getRnd() % 2 )
|
||||
{
|
||||
m_npcPath.reversePathDir();
|
||||
}
|
||||
|
||||
m_movementTimer = GameState::getOneSecondInFrames() * ( ( getRnd() & 10 ) + 4 );
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user