Commit e6968c4f authored by Gerhard Stein's avatar Gerhard Stein

Reorgs

parent 350fc827
......@@ -501,17 +501,6 @@ int CSpriteObject::checkSolidD( int x1, int x2, int y2, const bool push_mode )
if( (Uint32)y2 > ((mp_Map->m_height)<<CSF) )
exists=false; // Out of map?
// This is a special case for foes which can turn around when they walk over an edge before they fall
if(m_canturnaround &&
( !TileProperty[mp_Map->at((x1-(1<<STC))>>CSF, (y2+(1<<STC))>>CSF)].bup ||
!TileProperty[mp_Map->at((x2+(1<<STC))>>CSF, (y2+(1<<STC))>>CSF)].bup ) )
{
blockedl = TileProperty[mp_Map->at((x2+(1<<STC))>>CSF, (y2+(1<<STC))>>CSF)].bup;
blockedr = TileProperty[mp_Map->at((x1-(1<<STC))>>CSF, (y2+(1<<STC))>>CSF)].bup;
return 1;
}
return 0;
}
......
......@@ -45,7 +45,6 @@ transluceny(0)
m_ActionBaseOffset = 0x0;
m_vDir = m_hDir = NONE;
m_ActionTicker = 0;
m_canturnaround = false;
m_climbing = false;
supportedbyobject = false;
......
......@@ -105,10 +105,7 @@ public:
bool dead, dying;
bool m_canturnaround;
// This is used for action format only
// Hopefully in Vorticons we also can use that structure some time
uint16_t m_ActionTicker;
uint16_t m_ActionNumber;
size_t m_ActionBaseOffset;
......@@ -209,7 +206,7 @@ public:
int checkSolidR( int x1, int x2, int y1, int y2);
int checkSolidL( int x1, int x2, int y1, int y2);
int checkSolidU( int x1, int x2, int y1, const bool push_mode=false );
int checkSolidD( int x1, int x2, int y2, const bool push_mode=false );
virtual int checkSolidD( int x1, int x2, int y2, const bool push_mode=false );
virtual bool checkMapBoundaryL(const int x1);
virtual bool checkMapBoundaryR(const int x2);
......
......@@ -13,7 +13,6 @@ m_Player(PlayerVect)
animtimer = 0;
canbezapped = true; // will stop bullets but are not harmed
m_invincible = true;
m_canturnaround = true;
falling = false;
blockedd = true;
}
......@@ -85,3 +84,21 @@ void CButler::getTouchedBy(CVorticonSpriteObject &theObject)
Player.bump( *this, movedir );
}
}
int CButler::checkSolidD( int x1, int x2, int y2, const bool push_mode )
{
CSpriteObject::checkSolidD(x1, x2, y2, push_mode);
std::vector<CTileProperties> &TileProperty = g_pBehaviorEngine->getTileProperties();
// This is a special case for foes which can turn around when they walk over an edge before they fall
if( !TileProperty[mp_Map->at((x1-(1<<STC))>>CSF, (y2+(1<<STC))>>CSF)].bup ||
!TileProperty[mp_Map->at((x2+(1<<STC))>>CSF, (y2+(1<<STC))>>CSF)].bup )
{
blockedl = TileProperty[mp_Map->at((x2+(1<<STC))>>CSF, (y2+(1<<STC))>>CSF)].bup;
blockedr = TileProperty[mp_Map->at((x1-(1<<STC))>>CSF, (y2+(1<<STC))>>CSF)].bup;
return 1;
}
return 0;
}
......@@ -40,6 +40,8 @@ public:
void process();
void getTouchedBy(CVorticonSpriteObject &theObject);
int checkSolidD( int x1, int x2, int y2, const bool push_mode=false );
private:
// AI for "butler" robot (ep1)
enum {
......
......@@ -23,7 +23,6 @@ m_Object(Object)
dist_to_travel = TANK_MAXTRAVELDIST;
canbezapped = true; // will stop bullets but are not harmed
m_invincible = true;
m_canturnaround = true;
}
void CTank::process()
......@@ -193,3 +192,22 @@ void CTank::getTouchedBy(CVorticonSpriteObject &theObject)
Player.bump( *this, movedir );
}
}
int CTank::checkSolidD( int x1, int x2, int y2, const bool push_mode )
{
CSpriteObject::checkSolidD(x1, x2, y2, push_mode);
std::vector<CTileProperties> &TileProperty = g_pBehaviorEngine->getTileProperties();
// This is a special case for foes which can turn around when they walk over an edge before they fall
if( !TileProperty[mp_Map->at((x1-(1<<STC))>>CSF, (y2+(1<<STC))>>CSF)].bup ||
!TileProperty[mp_Map->at((x2+(1<<STC))>>CSF, (y2+(1<<STC))>>CSF)].bup )
{
blockedl = TileProperty[mp_Map->at((x2+(1<<STC))>>CSF, (y2+(1<<STC))>>CSF)].bup;
blockedr = TileProperty[mp_Map->at((x1-(1<<STC))>>CSF, (y2+(1<<STC))>>CSF)].bup;
return 1;
}
return 0;
}
......@@ -64,6 +64,8 @@ public:
void getTouchedBy(CVorticonSpriteObject &theObject);
int checkSolidD( int x1, int x2, int y2, const bool push_mode=false );
protected:
// Tank Robot
enum{ TANK_WALK,TANK_TURN,TANK_WAIT,TANK_WAIT_LOOK,TANK_FIRE,TANK_LOOK
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment