CCouncilMember::CCouncilMember(CMap *pmap, Uint32 x, Uint32 y) :
CObject(pmap, x, y, OBJ_NONE)
{
	m_ActionBaseOffset = 0x1FB8;
	setActionForce(A_COUNCIL_MEMBER_MOVE);
	setActionSprite();
	calcBouncingBoxes();
}
示例#2
0
void CBlueBird::setActionForce(const size_t ActionNumber)
{
	CGalaxySpriteObject::setActionForce(ActionNumber);

	if( mActionMap.find(ActionNumber) != mActionMap.end() )
		mpProcessState = mActionMap[ActionNumber];
	else
		setActionForce(0); // This might happen, when the action-map is incomplete
}
示例#3
0
CBullets::CBullets(CMap *pmap, Uint32 x, Uint32 y, direction_t dir) :
CObject(pmap, x, y, OBJ_RAY)
{
	m_hDir = NONE;
	m_vDir = NONE;

	if(dir == LEFT || dir == RIGHT)
		m_hDir = dir;
	else if(dir == UP || dir == DOWN)
		m_vDir = dir;

	m_ActionBaseOffset = 0x1738;
	setActionForce(A_KEENSHOT_MOVING);
}
示例#4
0
CFuse::CFuse(CMap *pmap, const Uint16 foeID, const Uint32 x, const Uint32 y, const int sprVar) :
CGalaxySpriteObject(pmap, foeID, x, y, sprVar),
mTimer(0)
{  
	// Adapt this AI
	m_ActionBaseOffset = 0x3186;
	setActionForce(0);
	//setupGalaxyObjectOnMap(0x3186, 0);
	
	xDirection = LEFT;
	
	mp_Map->mNumFuses++;
	mp_Map->mFuseInLevel = true;
}
示例#5
0
CSlicestar::CSlicestar(CMap *pmap, const Uint16 foeID, 
		       const Uint32 x, const Uint32 y, 
		       const bool useBlocker, direction_t horDir, 
		       direction_t verDir) :
CStunnable(pmap, foeID, x, y),
mUseBlocker(useBlocker)
{
	m_ActionBaseOffset = 0x23BC;
	
	xDirection = horDir;
	yDirection = verDir;
	
	setActionForce(A_SLICESTAR_MOVE);
	setActionSprite();
	calcBoundingBoxes();
}
示例#6
0
void CGalaxySpriteObject::setupGalaxyObjectOnMap(const size_t ActionBaseOffset,
						 const size_t ActionNumber )
{
	m_ActionBaseOffset = ActionBaseOffset;
	m_climbing = false;
	m_jumped = false;

	setActionForce(ActionNumber);

	setActionSprite();
	
	calcBoundingBoxes();
		
	alignToTile();
	
	performCollisions();
	
	if(!processActionRoutine())
			exists = false;
}
示例#7
0
CVarPlatform::CVarPlatform(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y,
                           const direction_t horidir,
                           const direction_t vertdir,
                           const int actionOffset, const int sprVar) :
    CGalaxySpriteObject(pmap, foeID, x, y, sprVar),
    CPlatform(pmap, foeID, x, y),
    CMoveTarget(m_Pos, xDirection, yDirection)
{
    m_ActionBaseOffset = actionOffset;

    setActionForce(A_PLATFORM_MOVE);
    setActionSprite();

    xDirection = horidir;
    yDirection = vertdir;

    solid = false; // I think they must be false, because some plats like those in Keen6
    // should only obey to the set markers

    calcBoundingBoxes();
}
示例#8
0
void CPlayerDive::processDiving()
{
	// In case noclipping was triggered, make it solid, or remove it...
	if(m_Cheatmode.noclipping)
	{
		solid = !solid;
		m_Cheatmode.noclipping = false;
	}


	// If Player presses Jump button, make Keen swim faster
	if(g_pInput->getPressedCommand(IC_JUMP))
	{
		// Slow down the swim speed, by time

		if(getActionNumber(A_KEENSWIM_MOVE))
			setActionForce(A_KEENSWIM_MOVE+1);
		else
			setActionForce(A_KEENSWIM_MOVE);

		if(m_swimupspeed<MAXMOVESPEED)
			m_swimupspeed = MAXMOVESPEED;
	}

	// Swimming - Left and Right
	if(g_pInput->getHoldedCommand(IC_LEFT))
	{
		if(!g_pInput->getHoldedCommand(IC_UP) && !g_pInput->getHoldedCommand(IC_DOWN))
			m_vDir = NONE;

		moveLeft(MOVESPEED+m_swimupspeed);
		m_hDir = LEFT;
	}
	else if(g_pInput->getHoldedCommand(IC_RIGHT))
	{
		if(!g_pInput->getHoldedCommand(IC_UP) && !g_pInput->getHoldedCommand(IC_DOWN))
			m_vDir = NONE;

		moveRight(MOVESPEED+m_swimupspeed);
		m_hDir = RIGHT;
	}

	// Up and down swimming
	if( m_swimupspeed>0 && g_pInput->getHoldedCommand(IC_UP))
	{
		moveUp(MOVESPEED+m_swimupspeed);
		m_vDir = UP;
	}
	else if(g_pInput->getHoldedCommand(IC_DOWN))
	{
		moveDown(MOVESPEED+m_swimupspeed);
		m_vDir = DOWN;
	}
	else
	{
		moveDown(WATERFALLSPEED+m_swimupspeed);
		m_vDir = DOWN;
	}


	// Slow down the swim speed, by time
	if(m_swimupspeed>0)
	{
		m_swimupspeed--;
		if(m_swimupspeed<0)
			m_swimupspeed = 0;
	}

	if( m_breathtimer >= BREATH_TIME )
	{
		playSound(SOUND_BUBBLE);
		int dir_offset = (m_hDir==RIGHT) ? +(1<<CSF) : -(1<<CSF) ;
		CBubbles *Bubble = new CBubbles(mp_Map, getXMidPos()+dir_offset, getYMidPos(), false);
		g_pBehaviorEngine->m_EventList.add( new EventSpawnObject( Bubble ) );
		m_breathtimer = 0;
	}
	else
		m_breathtimer++;

	m_camera.process();
	m_camera.processEvents();
}