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


public class Mago extends Personaje{
	
        public Mago(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 = 2;
    		this.mote = mote;
                this.atc1 = 0;
                this.atc2 = 0;
    		this.nivel=1;
    		this.exp = 0;
    		this.dinero = 0;
                this.posicion = 1;
                this.robo = false;
		}
	public Mago(){
        }
        public int Atc1(Personaje pers,Monstruo rival){
            Random rand = new Random();
            if (pers.pp >= 5){
             pers.pp= pers.pp - 5;
             int azar = rand.nextInt(suerte+1);
             pers.result = 1;
             int paral = rand.nextInt(11);
             if (paral == 1){
                 rival.paralizado = true;
             }
             double valor = atc+azar*1.1;
             int valor2 = (int)valor;
            return (valor2);
            }
            else {
                pers.result = 0;
                return 0;
            }
        }
        public int Atc2(Personaje pers){
            if (pers.pp >= 10){
            pp= pp - 10;
            pers.result = 1;
            pers.hp = pers.hp + 50;
            if (pers.hp > pers.hp_max){
                pers.hp = pers.hp_max;
            }
            return (0);
            }
            else {
                pers.result = 0;
                return 0;
            }
        }

        public int Atc3(Personaje pers,Monstruo rival){
            if (pers.pp >= 15){
             Random rand = new Random();
             int azar = rand.nextInt(2);
             if (azar == 0){
             pers.pp= pers.pp - 15;
             rival.envenenado = true;
             }
             else {
             }
            }
            return 0;
        }

    @Override
        public void AprenderAtac(Personaje pers){
            if (pers.nivel == 5){
                pers.atc1_nom = "Electro";
                pers.atc1_def = "Ataque +10%. Puede paralizar (10%)";
                pers.atc1 = 1;
                pers.aprender = true;
            }
            if (pers.nivel == 10){
                pers.atc2_nom = "Cura";
                pers.atc2_def = "Hp +50";
                pers.atc2 = 1;
                pers.aprender = true;
            }
             if (pers.nivel == 15){
                pers.atc3_nom = "Tóxico";
                pers.atc3_def = "Envenena al enemigo (50% posibilidades)";
                pers.atc3 = 1;
                pers.aprender = true;
            }
            }

    public void AsignarAtac(Personaje pers){
            if (pers.nivel == 5){
                pers.atc1_nom = "Electro";
                pers.atc1_def = "Ataque +10%. Puede paralizar (10%)";
                pers.atc1 = 1;
            }
            if (pers.nivel == 10){
                pers.atc2_nom = "Cura";
                pers.atc2_def = "Hp +50";
                pers.atc2 = 1;
            }
             if (pers.nivel == 15){
                pers.atc3_nom = "Tóxico";
                pers.atc3_def = "Envenena al enemigo (50% posibilidades)";
                pers.atc3 = 1;
            }
            }
}
