package enemis;
import com.badlogic.gdx.math.Rectangle;
import com.jln.ld.GameAnimation;
import com.jln.ld.GameEntity;
import com.jln.ld.Shared;

import MapItem.Powerup;
import menus.GameMenu;
import shoot.BasicShoot;
import shoot.DestroyerShoot;
import shoot.HunterShoot;

public class SmallExtraDestroyer extends Destroyer{

	@Override
	protected void initShip(){
		this.x = (float)(Math.random()*(1500)+Shared.GAME_WIDTH);
		this.y = (float)(Math.random()*320)+25;

		this.type = TYPE_01;
		initRandomTarget();
		destroy = false;
		this.collision = new Rectangle(x-15,y-15,30,30);
		maxSpeed = (float) ((Math.random()) + 1.5f);
		this.speed = maxSpeed;
		this.cptPause = 0;
		regions = Shared.SHIP_SMALL_EXTRA_DESTROYER;
		size = 48;
		life = 4 ;
	} 
	
	protected void giveBonus(GameMenu game){
		game.incPointsWithMessage(Shared.POINTS_SMALL_EXTRA_DESTROYER, x, y);
		double r = Math.random();
		if(r < 0.1){
			game.getPowerups().add(new Powerup(x, y, Powerup.POWERUP_SHIELD,game));
		}else if(r < 0.25){
			game.getPowerups().add(new Powerup(x, y, Powerup.POWERUP_INCREASESHOOT,game));
		}else if(r < 0.35){
			game.getPowerups().add(new Powerup(x, y, Powerup.POWERUP_100,game));
		}
	}
	
	protected void shoot(GameMenu game){
		game.addEnemyShoot(new DestroyerShoot(x-12, y, -3.8f,0f ));
		game.addEnemyShoot(new DestroyerShoot(x-12, y+10, -3.4f, 0.4f));
		game.addEnemyShoot(new DestroyerShoot(x-12, y-10, -3.4f, -0.4f));
		playShootSound();
	}
}
