Example #1
0
void CShelly::processSmoke()
{
    mTimer++;
    
    if(mTimer < SMOKE_TIME)
	return;
    
    mTimer = 0;
    
    dead = true;
      
    // Spawn little explosion shards here!
    const int newX = getXMidPos();      
    const int newY = getYUpPos();
      
    spawnObj( new CShellyFrags( getMapPtr(), 
							     0, newX, newY, -100 ) );
    spawnObj( new CShellyFrags( getMapPtr(), 
							     0, newX, newY, -50 ) );
    spawnObj( new CShellyFrags( getMapPtr(), 
							     0, newX, newY, 50 ) );
    spawnObj( new CShellyFrags( getMapPtr(), 
							     0, newX, newY, 100 ) );
    exists = false;
}
Example #2
0
void CRoboRed::processShoot()
{
  // Shoot many times.  
  if(mTimer%16 == 0)
  {
    playSound(SOUND_ROBORED_SHOOT);
    
    direction_t newXDir = xDirection<0 ? LEFT : RIGHT;
    direction_t newYDir = swapYDir ? UP : DOWN;    
    swapYDir = !swapYDir;
    int newX = 	xDirection == RIGHT ? getXRightPos() : getXLeftPos();
    int newY = 	getYPosition() + 0x300;
    spawnObj( new CRedShot( getMapPtr(), 
							     0, 
							     newX, newY,
							     newXDir, newYDir ) );
  }
				
  mTimer++;
  if(mTimer < TIME_SHOOTING)
    return;
  
  mTimer = 0;
  
  setAction(A_RED_PAUSE);
}
Example #3
0
void CBerkeloid::processMoving()
{
  if(blockedd)
    moveUp(10);
  
	if( mTimer < BERKELOID_TIME )
	{
		mTimer++;
		return;
	}
	else
	{
		mTimer = 0;
	}

	// Chance to throw a flame
	if( getProbability(20) )
	{
		setAction( A_BERKELOID_THROW );
		playSound( SOUND_BERKELOID_WINDUP );
		CBerkFlame *flame = new CBerkFlame( getMapPtr(), getXMidPos(), getYUpPos(), xDirection );
		gEventManager.add( new EventSpawnObject( flame ) );
		return;
	}

}
void FileMap::getRawBlock(BinaryDataRef& bdr, uint64_t offset, uint32_t size,
   std::atomic<uint64_t>& lastSeenCumulative) const
{
   bdr.setRef(getMapPtr(offset), size);

   lastSeenCumulated_.store(
      lastSeenCumulative.fetch_add(size, std::memory_order_relaxed) + size,
      std::memory_order_relaxed);
}