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 override void UseSkill(MagicPlayer person, int damage, Player enemy) { if (enemy.Condition != Player.PlayerCondition.Мертв) { person.UseSkillMana(ArtefactMana); enemy.Condition = Player.PlayerCondition.Парализован; } }
public override void UseSkill(MagicPlayer person, int damage = 0, Player enemy = null) { if (person.Condition == Player.PlayerCondition.Отравлен) { person.UseSkillMana(ArtefactMana); person.Condition = Player.PlayerCondition.Здоров; } }
public override void UseSkill(MagicPlayer person = null, int damage = 0) { SkillMinMana = 20; person.UseSkillMana(SkillMinMana); if (person.PlayerCondition == "болен") { person.PlayerCondition = "здоров"; } }
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.Здоров; } }
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); }
public override void UseSkill(MagicPlayer person = null, int damage = 0) { damage = PlusMana; person.PlayerCurrentMana += damage; if (person.PlayerCurrentMana > person.PlayerMaxMana) { person.PlayerCurrentMana = person.PlayerMaxMana; } }
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; } }
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; } }
public override void UseSkill(MagicPlayer person = null, int damage = 0) { SkillMinMana = 85; if (person.PlayerCondition == "парализован") { person.UseSkillMana(SkillMinMana); person.PlayerCondition = "здоров"; person.PlayerCurrentHealth = 1; } }
} // минимальное значение маны 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; } }
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.Отравлен; } } }
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); }
public override void UseSkill(MagicPlayer person = null, int damage = 0) { SkillMinMana = 30; if (person.PlayerCondition == "отравлен") { person.UseSkillMana(SkillMinMana); person.PlayerCondition = "здоров"; } else { throw new Exception("Персонаж не отравлен!"); } }
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; } }
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("Персонаж не отравлен!"); } }
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("Персонаж жив!"); } }
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("Персонаж жив!"); } }
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; } }
} // максимальное кол-во маны public void ApplyHeal(int heal, MagicPlayer person) // пополнение здоровья { RegenHealth Health = new RegenHealth(heal); Health.UseSkill(person, heal); }
public override void UseSkill(MagicPlayer person = null, int time = 0) { SkillMinMana = 50 * time; person.UseSkillMana(SkillMinMana); // тут работа со временем, обработать в UNITY!!!!! }
public abstract void UseSkill(MagicPlayer person, int damage = 0, Player enemy = null);
public abstract void UseSkill(MagicPlayer person, int damage = 0);