Advertisement
gmansano

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

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