This commit is contained in:
parent
55e36f25d3
commit
7a43d05c5f
9 changed files with 15 additions and 23 deletions
|
@ -35,13 +35,6 @@ void CNpcButterflyBackgroundEnemy::processMovementModifier(int _frames, s32 dist
|
||||||
m_animPlaying = true;
|
m_animPlaying = true;
|
||||||
m_frame = 0;
|
m_frame = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLevel &level = GameScene.GetLevel();
|
|
||||||
if ( Pos.vx < 0 || Pos.vx > ( level.getCollisionLayer()->getMapWidth() << 4 ) ||
|
|
||||||
Pos.vy < 0 || Pos.vy > ( level.getCollisionLayer()->getMapHeight() << 4 ) )
|
|
||||||
{
|
|
||||||
setToShutdown();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -28,6 +28,8 @@ public:
|
||||||
void render();
|
void render();
|
||||||
int getFrameCount() {return( FRM_BUTTERFLY_FLAP04 - FRM_BUTTERFLY_FLAP01 + 1 );}
|
int getFrameCount() {return( FRM_BUTTERFLY_FLAP04 - FRM_BUTTERFLY_FLAP01 + 1 );}
|
||||||
u8 canBeCaughtByNet() {return( false );}
|
u8 canBeCaughtByNet() {return( false );}
|
||||||
|
bool allowOffMap() {return(true);}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange );
|
void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange );
|
||||||
};
|
};
|
||||||
|
|
|
@ -162,14 +162,6 @@ void CNpcSmallJellyfishBackgroundEnemy::processMovement( int _frames )
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
processMovementModifier( _frames, moveX, moveY, moveVel, moveDist );
|
processMovementModifier( _frames, moveX, moveY, moveVel, moveDist );
|
||||||
|
|
||||||
CLevel &level = GameScene.GetLevel();
|
|
||||||
DVECTOR const &MapSize=level.getMapSize16();
|
|
||||||
if ( Pos.vx < 0 || Pos.vx >= MapSize.vx ||
|
|
||||||
Pos.vy < 0 || Pos.vy >= MapSize.vy )
|
|
||||||
{
|
|
||||||
setToShutdown();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -26,6 +26,8 @@ public:
|
||||||
void shutdown();
|
void shutdown();
|
||||||
void setTargetHeading( s16 newTargetHeading ) {m_targetHeading = newTargetHeading;}
|
void setTargetHeading( s16 newTargetHeading ) {m_targetHeading = newTargetHeading;}
|
||||||
u8 hasBeenAttacked();
|
u8 hasBeenAttacked();
|
||||||
|
bool allowOffMap() {return(true);}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool processSensor();
|
bool processSensor();
|
||||||
void processMovement( int _frames );
|
void processMovement( int _frames );
|
||||||
|
|
|
@ -65,8 +65,8 @@ inline u8 Get(int X,int Y)
|
||||||
void render(DVECTOR &MapPos);
|
void render(DVECTOR &MapPos);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int getMapWidth() {return(MapWidth);}
|
// int getMapWidth() {return(MapWidth);}
|
||||||
int getMapHeight() {return(MapHeight);}
|
// int getMapHeight() {return(MapHeight);}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
sLayerHdr *LayerHdr;
|
sLayerHdr *LayerHdr;
|
||||||
|
|
|
@ -792,7 +792,7 @@ DVECTOR DP;
|
||||||
// Note: relies on tiles not being top or bottom of map tho!!
|
// Note: relies on tiles not being top or bottom of map tho!!
|
||||||
void CLevel::destroyMapTile(DVECTOR const &Pos)
|
void CLevel::destroyMapTile(DVECTOR const &Pos)
|
||||||
{
|
{
|
||||||
int Width=CollisionLayer->getMapWidth();
|
int Width=getMapWidth();
|
||||||
DVECTOR MP=Pos;
|
DVECTOR MP=Pos;
|
||||||
const int ColT=COLLISION_TYPE_DESTRUCTABLE_FLOOR;
|
const int ColT=COLLISION_TYPE_DESTRUCTABLE_FLOOR;
|
||||||
|
|
||||||
|
@ -855,8 +855,8 @@ DVECTOR DP;
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLevel::CreateTileStore()
|
void CLevel::CreateTileStore()
|
||||||
{
|
{
|
||||||
int MapW=CollisionLayer->getMapWidth();
|
int MapW=getMapWidth();
|
||||||
int MapH=CollisionLayer->getMapHeight();
|
int MapH=getMapHeight();
|
||||||
int X,Y;
|
int X,Y;
|
||||||
|
|
||||||
m_TileStoreCount=0;
|
m_TileStoreCount=0;
|
||||||
|
|
|
@ -719,6 +719,7 @@ if(PadGetDown(0)&PAD_R1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _STATE_DEBUG_
|
||||||
if(PadGetDown(0)&PAD_L1&&m_currentMode!=PLAYER_MODE_DEAD)
|
if(PadGetDown(0)&PAD_L1&&m_currentMode!=PLAYER_MODE_DEAD)
|
||||||
{
|
{
|
||||||
oldmode=m_currentMode;
|
oldmode=m_currentMode;
|
||||||
|
@ -729,7 +730,7 @@ else if(oldmode!=-1&&!(PadGetHeld(0)&PAD_L1))
|
||||||
newmode=oldmode;
|
newmode=oldmode;
|
||||||
oldmode=-1;
|
oldmode=-1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if(newmode!=-1)
|
if(newmode!=-1)
|
||||||
{
|
{
|
||||||
setMode((PLAYER_MODE)newmode);
|
setMode((PLAYER_MODE)newmode);
|
||||||
|
|
|
@ -461,7 +461,7 @@ DVECTOR const &MapSize=Lvl.getMapSize16();
|
||||||
DVECTOR const &ThingPos=thing->getPos();
|
DVECTOR const &ThingPos=thing->getPos();
|
||||||
|
|
||||||
// Will speed this up - doubt it, not now!!
|
// Will speed this up - doubt it, not now!!
|
||||||
if (i!=CThing::TYPE_PLAYER && (ThingPos.vx<0 || ThingPos.vx>=MapSize.vx || ThingPos.vy<0 || ThingPos.vy>=MapSize.vy))
|
if (!thing->allowOffMap() && (ThingPos.vx<0 || ThingPos.vx>=MapSize.vx || ThingPos.vy<0 || ThingPos.vy>=MapSize.vy))
|
||||||
{
|
{
|
||||||
thing->setToShutdown();
|
thing->setToShutdown();
|
||||||
SYSTEM_DBGMSG("ThingOffMap: T:%i S:%i TXY%i %i, MWH%i %i\n",(int)thing->getThingType(),(int)thing->getThingSubType(),ThingPos.vx,ThingPos.vy,MapSize.vx,MapSize.vy);
|
SYSTEM_DBGMSG("ThingOffMap: T:%i S:%i TXY%i %i, MWH%i %i\n",(int)thing->getThingType(),(int)thing->getThingSubType(),ThingPos.vx,ThingPos.vy,MapSize.vx,MapSize.vy);
|
||||||
|
|
|
@ -198,7 +198,8 @@ virtual void leftThinkZone(int _frames) {}
|
||||||
CRECT const &getCollisionArea() {return m_collisionArea;}
|
CRECT const &getCollisionArea() {return m_collisionArea;}
|
||||||
DVECTOR const &getCollisionSize() {return m_collisionSize;}
|
DVECTOR const &getCollisionSize() {return m_collisionSize;}
|
||||||
|
|
||||||
virtual int canCollide() {return true;}
|
virtual int canCollide() {return (true);}
|
||||||
|
virtual bool allowOffMap() {return (false);}
|
||||||
virtual int checkCollisionAgainst(CThing *_thisThing, int _frames);
|
virtual int checkCollisionAgainst(CThing *_thisThing, int _frames);
|
||||||
int checkCollisionAgainstArea(CRECT *_rect);
|
int checkCollisionAgainstArea(CRECT *_rect);
|
||||||
void updateCollisionArea();
|
void updateCollisionArea();
|
||||||
|
@ -254,6 +255,7 @@ public:
|
||||||
};
|
};
|
||||||
virtual TYPE getThingType() {return TYPE_PLAYER;}
|
virtual TYPE getThingType() {return TYPE_PLAYER;}
|
||||||
virtual bool alwaysThink() {return(true);}
|
virtual bool alwaysThink() {return(true);}
|
||||||
|
bool allowOffMap() {return(true);}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue