static void Main(string[] args) { MagicPlayer Max = new MagicPlayer("Maxim", Player.PlayerRace.Человек, Player.PlayerSex.Мужчина); Max.PlayerCurrentHealth = 100; Max.PlayerCurrentMana = 300; Max.PlayerMaxMana = 300; Max.PlayerMaxHealth = 100; Max.PlayerExp = 1000; Max.PlayerAge = 18; Max.Condition = Player.PlayerCondition.Отравлен; Paralyzed paralyzed = new Paralyzed(); FrogLegs legs = new FrogLegs(); Max.LearnSkill(paralyzed); Max.AddToBackpack(legs, 1); try { paralyzed.UseSkill(Max); Max.UseArtefact(legs, Max); } catch (InvalidCastException e) { Console.WriteLine(e); } Console.WriteLine(Max.ToString()); }
public bool GiveArtefact(Artefact icon, MagicPlayer person, int count = 1) // отдать артефакт другому персонажу { if (!this.Backpack.ContainsKey(icon) || person.Backpack.Count() == person.BackpackSize) { return(false); } this.DeleteFromBackpakc(icon, count); person.AddToBackpack(icon, count); return(true); }