示例#1
0
文件: Program.cs 项目: LozovskiM/GAME
        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());
        }
示例#2
0
文件: Program.cs 项目: LozovskiM/GAME
 public override void UseSkill(MagicPlayer person, int damage, Player enemy)
 {
     if (enemy.Condition != Player.PlayerCondition.Мертв)
     {
         person.UseSkillMana(ArtefactMana);
         enemy.Condition = Player.PlayerCondition.Парализован;
     }
 }
示例#3
0
文件: Program.cs 项目: LozovskiM/GAME
 public override void UseSkill(MagicPlayer person, int damage = 0, Player enemy = null)
 {
     if (person.Condition == Player.PlayerCondition.Отравлен)
     {
         person.UseSkillMana(ArtefactMana);
         person.Condition = Player.PlayerCondition.Здоров;
     }
 }
示例#4
0
 public override void UseSkill(MagicPlayer person = null, int damage = 0)
 {
     SkillMinMana = 20;
     person.UseSkillMana(SkillMinMana);
     if (person.PlayerCondition == "болен")
     {
         person.PlayerCondition = "здоров";
     }
 }
示例#5
0
文件: Program.cs 项目: LozovskiM/GAME
 public override void UseSkill(MagicPlayer person, int damage = 0, Player enemy = null)
 {
     SkillMinMana = 20;
     person.UseSkillMana(SkillMinMana);
     if (person.Condition == Player.PlayerCondition.Болен)
     {
         person.Condition = Player.PlayerCondition.Здоров;
     }
 }
示例#6
0
文件: Program.cs 项目: LozovskiM/GAME
 public bool UseArtefact(Artefact icon, MagicPlayer person = null, Player enemy = null, int power = 0)  // Использовать артефакт из инвенторя
 {
     if (!this.Backpack.ContainsKey(icon))
     {
         return(false);
     }
     icon.UseSkill(person, power = 0, enemy = null);
     return(true);
 }
示例#7
0
 public override void UseSkill(MagicPlayer person = null, int damage = 0)
 {
     damage = PlusMana;
     person.PlayerCurrentMana += damage;
     if (person.PlayerCurrentMana > person.PlayerMaxMana)
     {
         person.PlayerCurrentMana = person.PlayerMaxMana;
     }
 }
示例#8
0
 public override void UseSkill(MagicPlayer person = null, int damage = 0)
 {
     damage = PlusHealth;
     person.UseSkillMana(ArtefactMana);
     person.PlayerCurrentHealth += damage;
     if (person.PlayerCurrentHealth > person.PlayerMaxHealth)
     {
         person.PlayerCurrentHealth = person.PlayerMaxHealth;
     }
 }
示例#9
0
文件: Program.cs 项目: LozovskiM/GAME
 public override void UseSkill(MagicPlayer person, int damage = 0, Player enemy = null)
 {
     SkillMinMana = 85;
     if (person.Condition == Player.PlayerCondition.Парализован)
     {
         person.UseSkillMana(SkillMinMana);
         person.Condition           = Player.PlayerCondition.Здоров;
         person.PlayerCurrentHealth = 1;
     }
 }
示例#10
0
 public override void UseSkill(MagicPlayer person = null, int damage = 0)
 {
     SkillMinMana = 85;
     if (person.PlayerCondition == "парализован")
     {
         person.UseSkillMana(SkillMinMana);
         person.PlayerCondition     = "здоров";
         person.PlayerCurrentHealth = 1;
     }
 }
示例#11
0
 }                                   // минимальное значение маны
 public override void UseSkill(MagicPlayer person = null, int heal = 0)
 {
     heal         = PlusHealth;
     SkillMinMana = PlusHealth * 2;
     person.UseSkillMana(SkillMinMana);
     person.PlayerCurrentHealth += PlusHealth;
     if (person.PlayerCurrentHealth > person.PlayerMaxHealth)
     {
         person.PlayerCurrentHealth = person.PlayerMaxHealth;
     }
 }
示例#12
0
文件: Program.cs 项目: LozovskiM/GAME
 public override void UseSkill(MagicPlayer person, int damage, Player enemy)
 {
     if (person.Condition == Player.PlayerCondition.Здоров || person.Condition == Player.PlayerCondition.Ослаблен)
     {
         person.UseSkillMana(ArtefactMana);
         enemy.ApplyDamage(Damage);
         if (enemy.Condition != Player.PlayerCondition.Мертв)
         {
             enemy.Condition = Player.PlayerCondition.Отравлен;
         }
     }
 }
示例#13
0
文件: Program.cs 项目: LozovskiM/GAME
        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);
        }
示例#14
0
 public override void UseSkill(MagicPlayer person = null, int damage = 0)
 {
     SkillMinMana = 30;
     if (person.PlayerCondition == "отравлен")
     {
         person.UseSkillMana(SkillMinMana);
         person.PlayerCondition = "здоров";
     }
     else
     {
         throw new Exception("Персонаж не отравлен!");
     }
 }
示例#15
0
文件: Program.cs 项目: LozovskiM/GAME
 public override void UseSkill(MagicPlayer person, int damage = 0, Player enemy = null)
 {
     if (Damage != 0)
     {
         person.UseSkillMana(ArtefactMana);
         enemy.ApplyDamage(damage);
         Damage -= damage;
     }
     else
     {
         ArtefactResume = false;
     }
 }
示例#16
0
文件: Program.cs 项目: LozovskiM/GAME
 public override void UseSkill(MagicPlayer person, int damage = 0, Player enemy = null)
 {
     SkillMinMana = 30;
     if (person.Condition == Player.PlayerCondition.Отравлен)
     {
         person.UseSkillMana(SkillMinMana);
         person.Condition = Player.PlayerCondition.Здоров;
     }
     else
     {
         throw new Exception("Персонаж не отравлен!");
     }
 }
示例#17
0
 public override void UseSkill(MagicPlayer person = null, int damage = 0)
 {
     SkillMinMana = 150;
     if (person.PlayerCondition == "мертв")
     {
         person.UseSkillMana(SkillMinMana);
         person.PlayerCondition     = "ослаблен";
         person.PlayerCurrentHealth = 1;
     }
     else
     {
         throw new Exception("Персонаж жив!");
     }
 }
示例#18
0
文件: Program.cs 项目: LozovskiM/GAME
 public override void UseSkill(MagicPlayer person, int damage = 0, Player enemy = null)
 {
     SkillMinMana = 150;
     if (person.Condition == Player.PlayerCondition.Мертв)
     {
         person.UseSkillMana(SkillMinMana);
         person.Condition           = Player.PlayerCondition.Ослаблен;
         person.PlayerCurrentHealth = 1;
     }
     else
     {
         throw new Exception("Персонаж жив!");
     }
 }
示例#19
0
 public override void UseSkill(MagicPlayer person, int damage)
 {
     if (Damage != 0)
     {
         person.UseSkillMana(ArtefactMana);
         if (person.PlayerCurrentMana > person.PlayerMaxMana)
         {
             person.PlayerCurrentMana = person.PlayerMaxMana;
         }
         Damage -= damage;
     }
     else
     {
         ArtefactResume = false;
     }
 }
示例#20
0
        }                                                   // максимальное кол-во маны

        public void ApplyHeal(int heal, MagicPlayer person) // пополнение здоровья
        {
            RegenHealth Health = new RegenHealth(heal);

            Health.UseSkill(person, heal);
        }
示例#21
0
 public override void UseSkill(MagicPlayer person = null, int time = 0)
 {
     SkillMinMana = 50 * time;
     person.UseSkillMana(SkillMinMana);
     // тут работа со временем, обработать в UNITY!!!!!
 }
示例#22
0
文件: Program.cs 项目: LozovskiM/GAME
 public abstract void UseSkill(MagicPlayer person, int damage = 0, Player enemy = null);
示例#23
0
 public abstract void UseSkill(MagicPlayer person, int damage = 0);