public void Frappe(Personnage Personnage) { //Calcule des Dégâts int Degat = De4.Lance() + GetModificateur(For); Console.WriteLine("{0} Frappe {1} et lui inflige {2} Point(s) de dégat", this.GetType().Name, Personnage.GetType().Name, Degat); //Retrait des dégâts des points de vie de la cible Personnage.PV -= Degat; }
public Monster() { Type TMonster = this.GetType(); if (this is ICuir) { TMonster.GetProperty("Cuir").SetMethod.Invoke(this, new object[] { De4.Lance() });; } if (this is IOr) { TMonster.GetProperty("Or").SetMethod.Invoke(this, new object[] { De6.Lance() });; } }