void LargeSlimeEntity::fire()
{
  SoundManager::getInstance().playSound(fireSound);
  EnemyBoltEntity* bolt = new EnemyBoltEntity(x, y + 10, fireType, 0, enemyType);
  bolt->setDamages(fireDamage);
  bolt->setVelocity(Vector2D(x, y).vectorTo(game().getPlayerPosition(),GIANT_SLIME_FIRE_VELOCITY ));
}
void GiantSlimeEntity::fire()
{
  SoundManager::getInstance().playSound(SOUND_BLAST_FLOWER);
  EnemyBoltEntity* bolt = new EnemyBoltEntity
  (x, y + 10, ShotTypeStandard, 0, enemyType);
  bolt->setFrame(1);
  bolt->setMap(map, TILE_WIDTH, TILE_HEIGHT, 0, 0);

  bolt->setVelocity(Vector2D(x, y).vectorTo(game().getPlayerPosition(),GIANT_SLIME_FIRE_VELOCITY ));
}
Beispiel #3
0
void ImpEntity::fire()
{
    SoundManager::getInstance().playSound(SOUND_BLAST_FLOWER);

    EnemyBoltEntity* bolt;
    if (impType == ImpTypeBlue)
    {
      bolt = new EnemyBoltEntity(x, y, ShotTypeIce, 0);
      bolt->setDamages(5);
    }
    else
    {
      bolt = new EnemyBoltEntity(x, y, ShotTypeFire, 0);
      bolt->setDamages(8);
    }
    bolt->setFlying(true);

    float fireVelocity = IMP_FIRE_VELOCITY;
    if (specialState[SpecialStateIce].active) fireVelocity *= 0.5f;
    bolt->setVelocity(Vector2D(x, y).vectorTo(game().getPlayerPosition(), fireVelocity ));
}
Beispiel #4
0
void WitchEntity::fire()
{
  if (witchType == WitchTypeNormal)
  {
    SoundManager::getInstance().playSound(SOUND_BLAST_FLOWER);
    EnemyBoltEntity* bolt = new EnemyBoltEntity
          (x, y + 10, ShotTypeStandard, 0);
    bolt->setMap(map, TILE_WIDTH, TILE_HEIGHT, OFFSET_X, OFFSET_Y);

    float flowerFireVelocity = EVIL_FLOWER_FIRE_VELOCITY;
    if (specialState[SpecialStateIce].active) flowerFireVelocity *= 0.7f;
    bolt->setVelocity(Vector2D(x, y).vectorNearlyTo(game().getPlayerPosition(), flowerFireVelocity, 1.0f ));
  }
  else
  {
    SoundManager::getInstance().playSound(SOUND_BLAST_FLOWER);
    EnemyBoltEntity* bolt = new EnemyBoltEntity
          (x, y + 10, ShotTypeBomb, 0);
    bolt->setMap(map, TILE_WIDTH, TILE_HEIGHT, OFFSET_X, OFFSET_Y);

    float flowerFireVelocity = EVIL_FLOWER_FIRE_VELOCITY * 0.9f;
    if (specialState[SpecialStateIce].active) flowerFireVelocity *= 0.5f;
    bolt->setVelocity(Vector2D(x, y).vectorNearlyTo(game().getPlayerPosition(), flowerFireVelocity, 1.0f ));
  }
}
void ObstacleEntity::readCollidingEntity(CollidingSpriteEntity* entity)
{
  if (entity == this) return;
  if (!isDying && !isAgonising && collideWithEntity(entity))
  {
    if (entity->getType() == ENTITY_BOLT )
    {
      BoltEntity* boltEntity = dynamic_cast<BoltEntity*>(entity);

      if (!boltEntity->getDying() && boltEntity->getAge() > 0.05f)
      {
        EnemyEntity::collideWithBolt(boltEntity);
        correctFrame();
      }
    }
    else if (entity->getType() == ENTITY_ENEMY_BOLT )
    {
      EnemyBoltEntity* boltEntity = dynamic_cast<EnemyBoltEntity*>(entity);

      if (!boltEntity->getDying() && boltEntity->getAge() > 0.05f)
      {
        EnemyEntity::collideWithBolt(boltEntity);
        correctFrame();
      }
    }
    else if (entity->getType() >= ENTITY_ENEMY && entity->getType() <= ENTITY_ENEMY_MAX)
    {
      EnemyEntity* enemyEntity = dynamic_cast<EnemyEntity*>(entity);

      if (!enemyEntity->getDying() && enemyEntity->canCollide()&& enemyEntity->getMovingStyle() != movFlying)
      {
        hurt(getHurtParams(hp, ShotTypeStandard, 0, false, SourceTypeMelee, enemyEntity->getEnemyType(), false));
      }
    }
  }
}