示例#1
0
        public float Attack(FNPlayer enemy)
        {
            float damage = 10;

            enemy.TakeDamage(damage);
            return(damage);
        }
示例#2
0
        public float Attack(FNPlayer enemy)
        {
            float damage = 10;

            enemy.health -= damage;
            ammo--;
            return(damage);
        }
示例#3
0
        static void Main(string[] args)
        {
            FNPlayer p1 = new FNPlayer();
            FNPlayer p2 = new FNPlayer(100, 50);

            Console.WriteLine("P2's health before: " + p2.GetHealth());
            p1.Attack(p2);
            Console.WriteLine("P2's health after: " + p2.GetHealth());
        }
示例#4
0
        static void Main(string[] args)
        {
            FNPlayer player1 = new FNPlayer();
            FNPlayer player2 = new FNPlayer("MachineGun", 100, 100);

            Console.WriteLine("Shield before: " + player2.GetShield());
            player1.Attack(player2);
            Console.WriteLine("Shield after: " + player2.GetShield());

            Console.WriteLine("Shield before: " + player1.GetShield());
            player1.SetShield(50);
            Console.WriteLine("Shield after: " + player1.GetShield());
        }
示例#5
0
        static void Main(string[] args)
        {
            FNPlayer player  = new FNPlayer();
            FNPlayer player2 = new FNPlayer(100, 50);

            Console.WriteLine("HP" + player.GetHealth());
            Console.WriteLine("HP" + player2.GetHealth());

            player.Attack(player2);

            Console.WriteLine("HP" + player.GetHealth());
            Console.WriteLine("HP" + player2.GetHealth());
        }
示例#6
0
        static void Main(string[] args)
        {
            FNPlayer player1 = new FNPlayer();
            FNPlayer player2 = new FNPlayer("MachineGun", 100, 100);

            Console.WriteLine("P2 Shield Before: " + player2.GetShield());
            Console.WriteLine("P2 HP Before: " + player2.GetShield());

            player1.Attack(player2);
            Console.WriteLine();
            Console.WriteLine("****************");
            Console.WriteLine("*P1 PICKAXED P2*");
            Console.WriteLine("****************");
            Console.WriteLine();

            Console.WriteLine("P2 Shield after: " + player2.GetShield());
            Console.WriteLine("P2 HP after: " + player2.GetShield());

            Console.WriteLine();
            Console.WriteLine("P1 Shield after: " + player1.GetShield());
            player1.SetShield(50);
            Console.WriteLine("P2 Shield after: " + player1.GetShield());
        }
示例#7
0
 public void Attack(FNPlayer enemy)
 {
     enemy.TakeDamage(10);
 }