package Personajes;
import Monstruos.*;
import java.util.Random;


public class Soldado extends Personaje{
	
		public Soldado(int hp, int pp, int atc, int def, int suerte, int agilidad,String mote){
		this.hp = hp;
    		this.hp_max = hp;
    		this.pp = pp;
    		this.pp_max = pp;
    		this.atc = atc;
    		this.def = def;
    		this.suerte = suerte;
    		this.agilidad = agilidad;
                this.tipo = 5;
                this.atc1 = 0;
                this.atc2 = 0;
    		this.mote = mote;
    		this.nivel = 1;
    		this.exp = 0;
    		this.dinero = 0;
                this.posicion = 1;
                this.robo = false;
		}
        public Soldado(){

        }
        public int Atc1(Personaje pers){
            Random rand = new Random();
            if (pers.pp >= 5){
             pers.pp= pers.pp - 5;
             int azar = rand.nextInt(suerte+1);
             pers.result = 1;
             double valor = atc+azar*1.1;
             int valor2 = (int)valor;
            return (valor2);
            }
            else {
                pers.result = 0;
                return 0;
            }
        }
        public int Atc2(Personaje pers,Monstruo rival){
            Random rand = new Random();
            if (pers.pp >= 10){
            pp= pp - 10;
            int azar = rand.nextInt(suerte+1);
            pers.result = 1;
            double valor = atc+azar*1.2;
            int valor2 = (int)valor;
            rival.retroceso = rand.nextInt(11);
            return (valor2);
            }
            else {
                pers.result = 0;
                return 0;
            }
        }
    			
    	public int Defensa(){
    		return 0;	
    	}

        public void AprenderAtac(Personaje pers){
            if (pers.nivel == 5){
                pers.atc1_nom = "Espadazo";
                pers.atc1_def = "Ataque +10%";
                pers.atc1 = 1;
                pers.aprender = true;
            }
            if (pers.nivel == 10){
                pers.atc2_nom = "Patada Alta";
                pers.atc1_def = "Ataque +10%. Puede causar retroceso (10%).";
                pers.atc2 = 1;
                pers.aprender = true;
            }
            }

        public void AsignarAtac(Personaje pers){
            if (pers.nivel == 5){
                pers.atc1_nom = "Espadazo";
                pers.atc1_def = "Ataque +10%";
                pers.atc1 = 1;
            }
            if (pers.nivel == 10){
                pers.atc2_nom = "Patada Alta";
                pers.atc1_def = "Ataque +10%. Puede causar retroceso (10%).";
                pers.atc2 = 1;
            }
            }
}