Ejemplo n.º 1
0
        public override void ImplementAttack(Pokemon user, Pokemon opponent)
        {
            if(0 == GetModifier(user, opponent))
            {
                this.Damage = 0;
            }
            else
            {
                if(user.Speed >= opponent.Speed)
                {
                    if(new Random().Next(100) < 30)
                    {
                        this.Damage = opponent.HP;
                    }
                    else
                    {
                        this.Damage = 0;
                    }
                }
                else
                {
                    this.Damage = 0;
                }
            }

            if(0 == this.Damage) Console.WriteLine(user.GetType().Name + " missed!");
            else
            {
                this.Attacker = user.GetType().Name + " uses " + this.GetType().Name + ". It's an instant KO!";
                opponent.TakeDamage(this);
            }
        }
Ejemplo n.º 2
0
 public override void ImplementAttack(Pokemon user, Pokemon opponent)
 {
     this.Damage = -(user.MaxHP / 2);
     this.WasEffective = null;
     this.WasCritical = false;
     this.Attacker = user.GetType().Name + " uses " + this.GetType().Name;
     user.TakeDamage(this);
 }
Ejemplo n.º 3
0
 public override void ImplementAttack(Pokemon user, Pokemon opponent)
 {
     if(IsAHit(user, opponent))
     {
         this.Damage = GenerateDamage(user.Attack, opponent.Defense, GetModifier(user, opponent));
         this.Attacker = user.GetType().Name + " uses " + this.GetType().Name;
         opponent.TakeDamage(this);
     }
     else
     {
         Console.WriteLine(user.GetType().Name + " missed!");
         this.Attacker = user.GetType().Name + " keeps going and crashes!";
         this.Damage = 1;
         this.WasCritical = false;
         this.WasEffective = null;
         user.TakeDamage(this);
     }
 }
Ejemplo n.º 4
0
 public override void ImplementAttack(Pokemon user, Pokemon opponent)
 {
     if(IsAHit(user, opponent))
     {
         this.Damage = GenerateDamage(user.Attack, opponent.Defense, GetModifier(user, opponent));
         this.Attacker = user.GetType().Name + " uses " + this.GetType().Name;
         opponent.TakeDamage(this);
         if(0 != RecoilDivider) this.Damage /= RecoilDivider;
         else this.Damage = user.HP;
         this.WasEffective = null;
         this.WasCritical = false;
         this.Attacker = "The attack recoiled!";
         user.TakeDamage(this);
     }
     else
     {
         Console.WriteLine(user.GetType().Name + " missed!");
     }
 }
Ejemplo n.º 5
0
        public override void ImplementAttack(Pokemon user, Pokemon opponent)
        {
            int attacks = new Random().Next(8);
            if(attacks < 3) attacks = 2;
            else if(attacks < 6) attacks = 3;
            else if(6 == attacks) attacks = 4;
            else if(7 == attacks) attacks = 5;

            this.Damage = GenerateDamage(user.Attack, opponent.Defense, GetModifier(user, opponent));

            for(int i = 0; i < attacks; i++)
            {
                this.Attacker = user.GetType().Name + " uses " + this.GetType().Name;
                opponent.TakeDamage(this);
            }
        }
Ejemplo n.º 6
0
 public override void ImplementAttack(Pokemon user, Pokemon opponent)
 {
     if(IsAHit(user, opponent))
     {
         this.Damage = opponent.HP / 2;
         this.WasEffective = null;
         this.WasCritical = false;
         this.Attacker = user.GetType().Name + " uses " + this.GetType().Name;
         opponent.TakeDamage(this);
     }
     else
     {
         Console.WriteLine(user.GetType().Name + " missed!");
     }
 }
Ejemplo n.º 7
0
 public override void ImplementAttack(Pokemon user, Pokemon opponent)
 {
     this.Damage = 40; //This one always does 40 damage no matter what. (A little OP for this game!)
     this.Attacker = user.GetType().Name + " uses " + this.GetType().Name;
     opponent.TakeDamage(this);
 }
Ejemplo n.º 8
0
 protected void CommonDamageAttack(Pokemon user, Pokemon opponent)
 {
     if(IsAHit(user, opponent))
     {
         this.Damage = GenerateDamage(user.Attack, opponent.Defense, GetModifier(user, opponent));
         this.Attacker = user.GetType().Name + " uses " + this.GetType().Name;
         opponent.TakeDamage(this);
     }
     else
     {
         Console.WriteLine(user.GetType().Name + " missed!");
     }
 }