Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace KDZLibrary
- {
- public class Fighter : Human
- {
- protected int damage;
- protected int guard;
- protected double evade;
- public void Attack(Fighter enemy)
- {
- if (!(enemy.evade >= rnd.Next(0, 100) * 0.01))
- {
- enemy.healthy -= damage - enemy.guard;
- enemy.guard--;
- enemy.BattleCry();
- if ((enemy is KDZLibrary.Samurai) && (enemy.retaliation >= rnd.Next(0, 100) * 0.01))
- {
- enemy.Attack(this);
- this.BattleCry();
- }
- }
- }
- public virtual void BattleCry()
- {
- Console.WriteLine("Хыа!");
- }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace KDZLibrary
- {
- public class Samurai : Fighter
- {
- protected double retaliation;
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace KDZLibrary
- {
- public class Human
- {
- protected Random rnd = new Random();
- protected bool poisoned;
- protected double healthy;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement