Exemplo n.º 1
0
        public void CurarMago(Mago p1)
        {
            Random valor = new Random();
            int    curar = valor.Next(1, 15);

            if (p1.Health > 0)
            {
                p1.Health = p1.Health + curar;
                Console.WriteLine("Se cura {0} puntos al personaje {1}. Vida actual: {2}.", curar, p1.Name, p1.Health);
            }
            else
            {
                Console.WriteLine("No se puede curar a un jugador muerto.");
            }
        }
Exemplo n.º 2
0
 public Tablero(Queue <Monstruo> mazoJugador, Queue <Monstruo> mazoEnemigo, int playerdamage)
 {
     this.casillas         = new Casilla[9];
     this.jugador          = new Mago(mazoJugador, Equipo.Player);
     this.enemigo          = new Mago(mazoEnemigo, Equipo.Enemy);
     this.damagePlayer     = playerdamage;
     this.casillasOcupadas = 0;
     this.casillas[0]      = new Casilla();
     this.casillas[1]      = new Casilla();
     this.casillas[2]      = new Casilla();
     this.casillas[3]      = new Casilla();
     this.casillas[4]      = new Casilla();
     this.casillas[5]      = new Casilla();
     this.casillas[6]      = new Casilla();
     this.casillas[7]      = new Casilla();
     this.casillas[8]      = new Casilla();
     this.enemyTurn        = new Thread(TurnoEnemigo);
     this.enemyTurn.Start();
 }
Exemplo n.º 3
0
        public string AtacarMago(Mago p1)
        {
            int damageReceived = 0;

            damageReceived = this.GetAttackValue() - p1.GetDeffValue();

            if (damageReceived > 0)
            {
                string log = string.Empty;
                p1.Health = p1.Health - damageReceived;
                log       = $"El jugador {p1.Name} recibe {damageReceived} puntos de daño";
                return(log);
            }
            else
            {
                string log = string.Empty;
                log = $"El jugador {p1.Name} no recibe daño.";
                return(log);
            }
        }