gmansano

Atividade 6 - Exercício 3 [Goren.cs]

Sep 30th, 2020
724
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.29 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Atividade6Ex3
  4. {
  5.     public class Goren : Guerreiro
  6.     {
  7.         public Goren()
  8.         {
  9.             vida = 620;
  10.             defesa = 36;
  11.             velocidade = 340;
  12.             velocidade_ataque = 0.625f;
  13.             forca = 66;
  14.             energia = 0;
  15.         }
  16.  
  17.         public override string AtaqueBasico()
  18.         {
  19.             bool acerto = false;
  20.             string resultado;
  21.             Random rnd = new Random();
  22.             rnd.Next(1);
  23.             switch (rnd.Next())
  24.             {
  25.                 case 0:
  26.                     acerto = false;
  27.                     break;
  28.                 case 1:
  29.                     acerto = true;
  30.                     break;
  31.                 default:
  32.                     break;
  33.             }
  34.             if (acerto == true)
  35.             {
  36.                 resultado = "Golpe acertado com sucesso.";
  37.             }
  38.             else { resultado = "O Golpe não foi acertado."; }
  39.             return resultado;
  40.         }
  41.         public override string AtaqueHabilidade()
  42.         {
  43.             string girar = "Habilidade Girar ativada: ataque em área.";
  44.             return girar;
  45.         }
  46.         public override void Correr()
  47.         {
  48.             Console.WriteLine("Velocidade aumentada em 10 pontos. \r\n" +
  49.                 "Velocide atual: {0}", velocidade + 10);
  50.         }
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment