Exemple #1
0
 public void Attaque(Personnage p)
 {
     AttackEventArgs attackArgs = new AttackEventArgs(this, p);
     OnAttacking(this, attackArgs);
 }
Exemple #2
0
        public void Attaque(Personnage p)
        {
            AttackEventArgs attackArgs = new AttackEventArgs(this, p);

            OnAttacking(this, attackArgs);
        }
Exemple #3
0
 protected void OnAttacking(object sender, AttackEventArgs e)
 {
     EventHandler<AttackEventArgs> att = Attacking;
     if (att != null)
     {
         att(this, e);
     }
 }
Exemple #4
0
 private static void P_Attacking(object sender, AttackEventArgs e)
 {
     Console.ForegroundColor = ConsoleColor.DarkYellow;
     Console.WriteLine("{0} attaque {1}", e.Attaquant.NomPers, e.Defenseur.NomPers);
     e.Defenseur.PvPers = e.Defenseur.PvPers - e.Attaquant.WpPers.DmgPointArme;
     Console.ForegroundColor = ConsoleColor.Yellow;
     Console.WriteLine("{0} perd {1} il lui reste {2} PV", e.Defenseur.NomPers, e.Attaquant.WpPers.DmgPointArme, e.Defenseur.PvPers);
     Console.ResetColor();
     if (e.Defenseur.PvPers <= 0)
     {
         e.Attaquant.Killed(e.Defenseur);
     }
     Console.ResetColor();
 }