public override void CastSkill() { if (Owner.Mp >= MpPrice) { Owner.Mp -= MpPrice; Statistics.OnNextTick += Tick; } else { Message.ShowWarning("Не достаточно маны"); } }
public override void CastSkill() { if (Owner.Mp >= MpPrice) { Owner.Mp -= MpPrice; EffectAddArmor effect = GameDataManager.GetEffect(4000) as EffectAddArmor; effect.Armor = Armor; effect.EffectAction(); Address.Effects.Add(effect); } else { Message.ShowWarning("Не достаточно маны"); } }
public override void CastSkill() { if (Owner.Mp >= MpPrice) { Owner.Mp -= MpPrice; EffectSleep effect = GameDataManager.GetEffect(4003) as EffectSleep; effect.CountMoves = CountMoves; effect.EffectAction(); Address.Effects.Add(effect); } else { Message.ShowWarning("Не достаточно маны"); } }
public void RemoveItem(int itemId) //удалить вещь { bool isOk = false; foreach (var i in Items) { if (i.Id == itemId) { Items.Remove(i); isOk = true; } } if (!isOk) { Message.ShowWarning("Предмет не найден!"); } }
public override void CastSkill() { if (Owner.Mp >= MpPrice) { Owner.Mp -= MpPrice; Address.TakeDamage(Damage); EffectSuccessiveDamage effect = GameDataManager.GetEffect(4002) as EffectSuccessiveDamage; effect.Damage = Damage; effect.CountMoves = CountMoves; effect.EffectAction(); Address.Effects.Add(effect); } else { Message.ShowWarning("Не достаточно маны"); } }
public void GameWork()//работа самой игры { bool isWork = true; Message.ShowStats(Player); Message.ShowAction("ДОБРО ПОЖАЛОВАТЬ"); Message.ShowEnemyStats(Enemy); //Message.DrawImage(CurrentLocation.Image); (НЕ РАБОТАЕТ Т.К. НЕТ БИБЛИОТЕКИ РИСУНКОВ) Message.CloseLine(); Player.Damage = 20; while (isWork) { if (Enemy == null || Enemy.Hp <= 0) { Enemy = GameDataManager.GetCharacter(0); } if (!(CurrentLocation is City)) { if (CurrentLocation is MonsterLocation) { MonsterLocation monsterLocation = CurrentLocation as MonsterLocation; Enemy = monsterLocation.Enemy; } } if (Enemy != null) { if (Enemy.Hp > 0) { War(); } } answer = Message.ReadLine(); if (answer == "go") { int locationId; answer = Message.ReadLine(); if (answer == "up") { locationId = CurrentLocation.UpId; } else if (answer == "down") { locationId = CurrentLocation.DownId; } else if (answer == "left") { locationId = CurrentLocation.LeftId; } else if (answer == "right") { locationId = CurrentLocation.RightId; } else { Message.ShowWarning("НЕ ПРАВИЛЬНАЯ КОМАНДА!!!"); continue; } bool isComplete = false; if (locationId == -1) { Message.ShowWarning("Туда пойти нельзя"); continue; } foreach (var i in Locations) { if (i.Id == locationId) { CurrentLocation = i; isComplete = true; } } if (isComplete == false) { throw new Exception("При перпеходе не найдена нужная локация!"); } } else if (answer == "open stock") { if (CurrentLocation is City) { City city = CurrentLocation as City; List <string> image = new List <string>(); foreach (var i in city.Stock.Items) { image.Add(i.Id + "-" + i.Name + " (" + i.Rarity.ToString() + ")"); } bool stockIsWork = true; while (stockIsWork) { answer = Message.ReadLine(); string[] command = answer.Split(new Char[] { ' ' }); int itemId = -1; int itemIndex = -1; try { int.TryParse(command[0], out itemIndex); itemId = city.Stock.Items[itemIndex].Id; } catch { Message.ShowWarning("Не правильно задана комманда, команда должна быть следующего типа: 'цифра команда'"); continue; } if (command[1] == "exit") { stockIsWork = false; } else if (command[1] == "take") { RenderItem(city.Stock, Player.Inventar, itemId); } else if (command[1] == "drop") { city.Stock.RemoveItem(itemId); } else if (command[1] == "sell") { city.Stock.Items[itemIndex].Sell(Player); } } } } } }