/// <summary>
        /// Ранг для параметра
        /// </summary>
        /// <param name="типХарактеристики">
        /// Тип параметра (опыт, скилл, характеристика, квест)
        /// </param>
        /// <param name="valueProperty">
        /// Значение параметра
        /// </param>
        /// <param name="isPocazatelProperty">
        /// Показатель?
        /// </param>
        /// <param name="rangsParam">
        /// Ранги
        /// </param>
        /// <returns>
        /// Ранг
        /// </returns>
        private string getRang(
            string типХарактеристики,
            double valueProperty,
            bool isPocazatelProperty,
            ObservableCollection <Rangs> rangsParam)
        {
            switch (типХарактеристики)
            {
            case "Квест":
                return(string.Empty);

            case "Опыт":
                break;

            case "Навык":
                return(this.RangName(rangsParam, StaticMetods.GetLevel(valueProperty, RpgItemsTypes.ability)));

            case "Характеристика":
                return(isPocazatelProperty != true
                        ? this.RangName(rangsParam, StaticMetods.GetLevel(valueProperty, RpgItemsTypes.characteristic))
                        : string.Empty);
            }

            return(string.Empty);
        }
        /// <summary>
        /// Редактирование награды
        /// </summary>
        /// <param name="item"></param>
        public static void EditReward(Revard item)
        {
            var showRevard = new AddOrEditRevard
            {
                // Topmost = true,
                btnOk     = { Visibility = Visibility.Visible },
                btnAdd    = { Visibility = Visibility.Collapsed },
                btnCansel = { Visibility = Visibility.Collapsed }
            };

            var showRevardVM = new AddOrEditRevardViewModel(item, false, false);

            showRevard.DataContext = showRevardVM;

            showRevard.btnOk.Click += (sender, args) => { showRevard.Close(); };
            var HotSaveCommand = new RelayCommand(() =>
            {
                showRevard.Close();
            });

            showRevard.InputBindings.Add(new KeyBinding(HotSaveCommand,
                                                        new KeyGesture(Key.S,
                                                                       ModifierKeys.Control)));

            showRevard.ShowDialog();
            StaticMetods.refreshShopItems(StaticMetods.PersProperty);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ColumnsSettingsViewModel"/> class.
        /// Конструктор
        /// </summary>
        /// <param name="pers">
        /// The pers.
        /// </param>
        public ColumnsSettingsViewModel(Pers pers)
        {
            this.pers = pers;

            this.NewTaskType = new TypeOfTask()
            {
                NameOfTypeOfTask   = "Новый тип",
                IntervalForDefoult = TimeIntervals.Нет,
                ContextForDefoult  = pers.Contexts.FirstOrDefault(),
                StatusForDefoult   = pers.Statuses.FirstOrDefault()
            };

            // Заполняем интервалы времени
            this.IntervalsOfTime = StaticMetods.GetRepeatIntervals();

            this.StatSetVMProperty = new ucStatusesSettingsViewModel(
                pers.Statuses,
                pers.Tasks,
                pers.TasksTypes,
                pers.Views);
            this.ContSetVMProperty = new ucContextSettingsViewModel(
                pers.Contexts,
                pers.Tasks,
                pers.TasksTypes,
                pers.Views);
        }
예제 #4
0
    void Update()
    {
        Power = StaticMetods.GetPower(this);

        ReloadAutoattack();
        AttackTarget();
    }
        /// <summary>
        ///     Получить элементы от которых зависит этот элемент
        /// </summary>
        public void getNeedsItems()
        {
            List <RelaysItem> rel = new List <RelaysItem>();

            if (this.SelectedChaProperty != null)
            {
                var needAb =
                    this.SelectedChaProperty.NeedAbilitisProperty.Where(n => n.KoeficientProperty > 0)
                    .OrderByDescending(n => n.KoeficientProperty)
                    .ToList();

                foreach (var needAbility in needAb)
                {
                    var progress = Convert.ToDouble(needAbility.AbilProperty.LevelProperty)
                                   / Convert.ToDouble(needAbility.AbilProperty.MaxLevelProperty);
                    progress = Math.Round(progress * 100.0, 0);
                    rel.Add(
                        new RelaysItem
                    {
                        IdProperty             = needAbility.AbilProperty.GUID,
                        ElementToolTipProperty = needAbility.AbilProperty.NameOfProperty,
                        PictureProperty        = needAbility.AbilProperty.PictureProperty,
                        BorderColorProperty    =
                            StaticMetods.getBorderColorFromRelaysWithHardness(
                                Convert.ToInt32(needAbility.KoeficientProperty)),
                        ReqvirementTextProperty = progress + "%"
                    });
                }
            }

            NeedsItemsVM.RelaysItemsesProperty = rel;
        }
예제 #6
0
        public static void SetDefoultImages()
        {
            DefoultTaskImage =
                StaticMetods.pathToImage(Path.Combine(Directory.GetCurrentDirectory(), "Images", "Task.png"));
            DefoultAbilImage =
                StaticMetods.pathToImage(
                    Path.Combine(Directory.GetCurrentDirectory(), "Images", "AbDefoult.png"));
            DefoultCharactImage =
                StaticMetods.pathToImage(
                    Path.Combine(Directory.GetCurrentDirectory(), "Images", "ChaDefoult.jpg"));
            DefoultQwestImage =
                StaticMetods.pathToImage(Path.Combine(Directory.GetCurrentDirectory(), "Images", "mission.jpg"));
            DefoultRewImage =
                StaticMetods.pathToImage(Path.Combine(Directory.GetCurrentDirectory(), "Images", "gold.png"));

            // Картинки
            DefoultTaskPic =
                StaticMetods.getImagePropertyFromImage(DefoultTaskImage);
            DefoultAbilPic =
                StaticMetods.getImagePropertyFromImage(DefoultAbilImage);
            DefoultCharactPic =
                StaticMetods.getImagePropertyFromImage(DefoultCharactImage);
            DefoultQwestPic =
                StaticMetods.getImagePropertyFromImage(DefoultQwestImage);
            DefoultRewPic =
                StaticMetods.getImagePropertyFromImage(DefoultRewImage);
        }
예제 #7
0
 public override void ImportItems()
 {
     foreach (AbilitiModel ab in ImportList.Where(n => n.IsChecked))
     {
         var fod = PersProperty.Abilitis.FirstOrDefault(n => n.NameOfProperty == ab.NameOfProperty);
         if (fod == null || Cha == null)
         {
             AbilitiModel cc = new AbilitiModel(ab, PersProperty);
             foreach (var needTaskse in ab.NeedTasks)
             {
                 AddOrEditAbilityViewModel.CloneTask(needTaskse, 0, cc, false);
             }
             foreach (var source in cc.NeedTasks.ToList())
             {
                 source.TaskProperty.BeginDateProperty = MainViewModel.selectedTime;
             }
             if (Cha != null)
             {
                 Cha.NeedAbilitisProperty.First(n => n.AbilProperty == cc).KoeficientProperty = 3;
             }
         }
         else
         {
             if (Cha != null)
             {
                 Cha.NeedAbilitisProperty.First(n => n.AbilProperty == fod).KoeficientProperty = 3;
             }
         }
     }
     StaticMetods.AbillitisRefresh(PersProperty);
     StaticMetods.Locator.MainVM.RefreshTasksInMainView();
     PersProperty.SellectedAbilityProperty = PersProperty.Abilitis.LastOrDefault();
 }
예제 #8
0
        /// <summary>
        /// Купить награду
        /// </summary>
        /// <param name="_pers">Персонаж</param>
        /// <param name="costProperty">Цена награды</param>
        public void BuyReward(Pers _pers, int costProperty)
        {
            StaticMetods.PlaySound(Properties.Resources.coin);
            var editableReward = this;
            ObservableCollection <Revard> shopItems = _pers.ShopItems;

            List <Revard> uni = (_pers.InventoryItems.Union(_pers.ShopItems)).ToList();

            var vc = new ViewChangesClass(uni);

            vc.GetValBefore();

            _pers.GoldProperty -= costProperty;
            _pers.InventoryItems.Add(editableReward);

            vc.GetValAfter();

            var   header            = $"{editableReward.GetTypeOfRevard()} \"{editableReward.NameOfProperty}\" добавлен в инвентарь!!!";
            Brush col               = Brushes.Green;
            var   itemImageProperty = StaticMetods.pathToImage(Path.Combine(Directory.GetCurrentDirectory(), "Images", "good.png"));

            vc.ShowChanges(header, col, itemImageProperty);

            if (editableReward.IsArtefact)
            {
                shopItems.Remove(editableReward);
            }

            StaticMetods.AbillitisRefresh(_pers);
            StaticMetods.refreshShopItems(_pers);
        }
예제 #9
0
 static void Main(string[] args)
 {
     using (var form = StaticMetods.GetRenderForm("By Victorem"))
         using (var game = new Class1(form))
         {
             game.Run();
         }
 }
예제 #10
0
 static void Main(string[] args)
 {
     using (var f = StaticMetods.GetRenderForm("Differed Rendering"))
         using (var g = new AppMy(f))
         {
             g.Run();
         }
 }
예제 #11
0
 void Start()
 {
     _context = this;
     DontDestroyOnLoad(this.gameObject);
     StaticMetods    = GetComponent <StaticMetods>();
     ResourceManager = GetComponent <ResourceManager>();
     loca            = new List <Localization>();
 }
        public override void ShowMainElement(TaskGraphItem item)
        {
            Aim qwest = this.PersProperty.Aims.First(n => n.GUID == item.Uid);

            StaticMetods.editAim(qwest);
            PersProperty.SellectedAimProperty = qwest;
            SelectedAimProperty = PersProperty.SellectedAimProperty;
        }
예제 #13
0
 static void Main(string[] args)
 {
     using (var f = StaticMetods.GetRenderForm("Cube Map"))
         using (var g = new App(f))
         {
             g.Run();
         }
 }
예제 #14
0
 static void Main(string[] args)
 {
     using (var form = StaticMetods.GetRenderForm("Victorem_P", "LogoVW.ico"))
         using (var game = new Game(form))
             using (var presenter = new Presenter(game))
             {
                 game.Run();
             }
 }
예제 #15
0
 static void Main(string[] args)
 {
     using (var form = StaticMetods.GetRenderForm("By Victorem", "LogoVW.ico"))
         using (var game = new Game(form))
             using (var logic = new LogicMy(game))
             {
                 game.Run();
             }
 }
예제 #16
0
 private RelaysItem getRelaysItemForGold(int goldIfDoneProperty)
 {
     return(new RelaysItem
     {
         ElementToolTipProperty = $"Золото +{goldIfDoneProperty}",
         IdProperty = "gold",
         PictureProperty =
             StaticMetods.getImagePropertyFromImage(Pers.GoldImageProperty)
     });
 }
예제 #17
0
 private RelaysItem getRelaysItemForExp(int plusExp)
 {
     return(new RelaysItem
     {
         ElementToolTipProperty = $"Опыт +{plusExp}",
         IdProperty = "exp",
         PictureProperty =
             StaticMetods.getImagePropertyFromImage(Pers.ExpImageProperty)
     });
 }
        public static AbilitiModel DublicateAbility(AbilitiModel _selAb, Pers prs)
        {
            if (_selAb == null)
            {
                return(null);
            }

            var context = StaticMetods.Locator.AddOrEditAbilityVM;
            var oldAb   = _selAb;

            context.addAb();
            var addedAbility = context.SelectedAbilitiModelProperty;

            addedAbility.ImageProperty  = oldAb.ImageProperty;
            addedAbility.NameOfProperty = oldAb.NameOfProperty;
            foreach (var characteristic in prs.Characteristics)
            {
                var k =
                    characteristic.NeedAbilitisProperty.First(n => n.AbilProperty == oldAb)
                    .KoeficientProperty;

                characteristic.NeedAbilitisProperty.First(n => n.AbilProperty == addedAbility)
                .KoeficientProperty = k;
            }


            AddOrEditAbilityView addAbilityView = new AddOrEditAbilityView
            {
                btnOk =
                {
                    Visibility =
                        Visibility.Collapsed
                },
                btnAddAbility =
                {
                    Visibility =
                        Visibility
                        .Visible
                },
                btnCansel =
                {
                    Visibility =
                        Visibility.Visible
                }
            };

            addedAbility.SetMinMaxValue();
            context.RefreshInfoCommand.Execute(null);
            //addAbilityView.chaRelays.IsExpanded = true;
            Messenger.Default.Send("Фокусировка на названии!");
            addAbilityView.ShowDialog();
            StaticMetods.RecauntAllValues();

            return(addedAbility);
        }
예제 #19
0
 static void Main(string[] args)
 {
     Console.WriteLine("Загрузка ресурсов ...");
     using (var window = StaticMetods.GetRenderForm("FrameworkTesting", "LogoVW.ico"))
         using (var game = new Game(window))
             using (var presenter = new Presenter(game))
             {
                 Console.WriteLine("Для начала игры нажмите \"Enter\"");
                 Console.ReadLine();
                 game.Run();
             }
 }
        /// <summary>
        /// Получаем максимальное значение для прогресс бара параметра
        /// </summary>
        /// <param name="typeParam">
        /// тип параметра (квест, опыт, характеристика, скилл)
        /// </param>
        /// <param name="valueParam">
        /// значение параметра
        /// </param>
        /// <param name="pocazatelParam">
        /// Это показатель?
        /// </param>
        /// <param name="maxParamValue">
        /// Максимальное значение для показателя
        /// </param>
        /// <returns>
        /// Максимальное значение прогресс бара
        /// </returns>
        private double getMax(string typeParam, double valueParam, bool pocazatelParam = false, int maxParamValue = 0)
        {
            RpgItemsTypes rpgType = RpgItemsTypes.exp;

            switch (typeParam)
            {
            case "Опыт":
                rpgType = RpgItemsTypes.exp;
                break;

            case "Характеристика":
                rpgType = RpgItemsTypes.characteristic;
                break;

            case "Навык":
                rpgType = RpgItemsTypes.ability;
                break;

            case "Перк":
                rpgType = RpgItemsTypes.ability;
                break;
            }

            if (typeParam != "Квест")
            {
                if (pocazatelParam == false)
                {
                    int level = StaticMetods.GetLevel(valueParam, rpgType);
                    if (valueParam < MainViewModel.опытаДоПервогоУровня)
                    {
                        return(System.Convert.ToInt32(MainViewModel.опытаДоПервогоУровня));
                    }
                    else
                    {
                        if (level == 1)
                        {
                            return(System.Convert.ToInt32(MainViewModel.опытаДоПервогоУровня - 1));
                        }

                        return(System.Convert.ToInt32((MainViewModel.опытаДоПервогоУровня * level * (level - 1)) - 1));
                    }
                }
                else
                {
                    return(maxParamValue);
                }
            }
            else
            {
                return(100);
            }
        }
예제 #21
0
        /// <summary>
        /// Метод удаления выбранной характеристики
        /// </summary>
        /// <param name="persProperty">Персонаж</param>
        public void RemoveCharacteristic(Pers persProperty)
        {
            var inventory          = persProperty.InventoryItems;
            var shopItems          = persProperty.ShopItems;
            var allCharacteristics = persProperty.Characteristics;

            // Удаляем связанные навыки
            //foreach (AbilitiModel abilitiModel in persProperty.Abilitis.Where(n => n.RuleCharacterisic == this).ToList())
            //{
            //    StaticMetods.DeleteAbility(persProperty, abilitiModel);
            //}

            // Удаляем из магазинов и инвентаря
            removeChaFromShopAndInventory(inventory, this, shopItems);
            //persProperty.ChaLevAndValues.ChaLevAndValuesListWhenDelCharact(this);

            // Удаляем из требований навыков
            foreach (var abilitiModel in persProperty.Abilitis)
            {
                foreach (var needsForLevel in abilitiModel.NeedsForLevels)
                {
                    foreach (var source in needsForLevel.NeedCharacts.Where(n => n.CharactProperty == this).ToList())
                    {
                        needsForLevel.NeedCharacts.Remove(source);
                    }
                }

                foreach (var needCharact in abilitiModel.NeedCharacts.Where(n => n.CharactProperty == this).ToList())
                {
                    abilitiModel.NeedCharacts.Remove(needCharact);
                }
            }

            // Удаляем из требований квестов
            foreach (var qw in persProperty.Aims)
            {
                foreach (var needCharact in qw.NeedCharacts.Where(n => n.CharactProperty == this).ToList())
                {
                    qw.NeedCharacts.Remove(needCharact);
                }
            }
            allCharacteristics.Remove(this);

            // Удаляем из навыков
            //foreach (var source in persProperty.Abilitis.Where(n => n.RuleCharacterisic == this))
            //{
            //    source.RuleCharacterisic = null;
            //}

            StaticMetods.RecauntAllValues();
            StaticMetods.PersProperty.NewRecountExp();
        }
예제 #22
0
 private void setAbRevards(List <AbilitiModel> abs, List <RelaysItem> rev)
 {
     if (abs.Any())
     {
         rev.AddRange(abs.Select(n => new RelaysItem
         {
             ElementToolTipProperty = $"↑ \"{n.NameOfProperty}\"",
             IdProperty             = n.GUID,
             PictureProperty        =
                 StaticMetods.getImagePropertyFromImage(n.ImageProperty)
         }));
     }
 }
        private double getMaxForExp(double val, viewChangesModel vc)
        {
            var lev        = StaticMetods.GetLevel(val, RpgItemsTypes.exp);
            var expToLevel = Pers.ExpToLevel(lev + 1, RpgItemsTypes.exp);

            //if (vc.to < vc.from && val == Pers.ExpToLevel(lev, RpgItemsTypes.exp))
            //{
            //    var level = lev - 1;
            //    if (level < 1) level = 1;
            //    expToLevel = Pers.ExpToLevel(level, RpgItemsTypes.exp);
            //}
            return(System.Convert.ToInt32(expToLevel));
        }
예제 #24
0
        /// <summary>
        ///     Пользовательская заставка (из папки с файлами)
        /// </summary>
        /// <param name="who"></param>
        /// <param name="text"></param>
        /// <param name="img"></param>
        private static void UserSplash(ref string who, ref string text, ref BitmapImage img)
        {
            var im       = StaticMetods.GetRandomImage(Settings.Default.userSplashesFolder);
            var fileName = im.Item2;

            if (Settings.Default.ShowFileSplashName == false)
            {
                fileName = string.Empty;
            }

            who  = string.Empty;
            text = fileName;
            img  = im.Item1;
        }
        public void ExpToLevelTest()
        {
            double expTo0 = StaticMetods.ExpToLevel(0, false);
            double expTo1 = StaticMetods.ExpToLevel(1, false);
            double expTo2 = StaticMetods.ExpToLevel(2, false);
            double expTo3 = StaticMetods.ExpToLevel(3, false);
            double expTo4 = StaticMetods.ExpToLevel(4, false);

            Debug.Assert(expTo0 == 0);
            Debug.Assert(expTo1 == 10);
            Debug.Assert(expTo2 == 20);
            Debug.Assert(expTo3 == 50);
            Debug.Assert(expTo4 == 110);
        }
        public void GetMinAbilityCharacteristicTest()
        {
            double expTo0 = StaticMetods.GetMinAbilityCharacteristic(5, false);
            double expTo1 = StaticMetods.GetMinAbilityCharacteristic(11, false);
            double expTo2 = StaticMetods.GetMinAbilityCharacteristic(21, false);
            double expTo3 = StaticMetods.GetMinAbilityCharacteristic(51, false);
            double expTo4 = StaticMetods.GetMinAbilityCharacteristic(111, false);

            Debug.Assert(expTo0 == 0);
            Debug.Assert(expTo1 == 10);
            Debug.Assert(expTo2 == 20);
            Debug.Assert(expTo3 == 50);
            Debug.Assert(expTo4 == 110);
        }
        public void GetMaxCharacteristicAbilityTest()
        {
            double expTo0 = StaticMetods.GetMaxCharacteristicAbility(5, false);
            double expTo1 = StaticMetods.GetMaxCharacteristicAbility(11, false);
            double expTo2 = StaticMetods.GetMaxCharacteristicAbility(21, false);
            double expTo3 = StaticMetods.GetMaxCharacteristicAbility(51, false);
            double expTo4 = StaticMetods.GetMaxCharacteristicAbility(111, false);

            Debug.Assert(expTo0 == 9);
            Debug.Assert(expTo1 == 19);
            Debug.Assert(expTo2 == 49);
            Debug.Assert(expTo3 == 109);
            Debug.Assert(expTo4 == 209);
        }
        public void GetLevelTest()
        {
            int level0 = StaticMetods.GetLevel(9);
            int level1 = StaticMetods.GetLevel(11);
            int level2 = StaticMetods.GetLevel(21);
            int level3 = StaticMetods.GetLevel(51);
            int level4 = StaticMetods.GetLevel(111);

            Debug.Assert(level0 == 0);
            Debug.Assert(level1 == 1);
            Debug.Assert(level2 == 2);
            Debug.Assert(level3 == 3);
            Debug.Assert(level4 == 4);
        }
예제 #29
0
        private List <RelaysItem> getRevardsForQwest()
        {
            List <RelaysItem> rev = new List <RelaysItem>();

            var plusExp = Qwest.PlusExp;

            if (plusExp != 0)
            {
                rev.Add(getRelaysItemForExp(plusExp));
            }
            var goldIfDoneProperty = Qwest.GoldIfDoneProperty;

            if (goldIfDoneProperty != 0)
            {
                rev.Add(getRelaysItemForGold(goldIfDoneProperty));
            }

            // Прокачка навыков
            var abs = Qwest.UpUbilitys.ToList();

            if (abs.Any())
            {
                rev.AddRange(abs.Select(n => new RelaysItem
                {
                    ElementToolTipProperty = $"\"{n.Ability.NameOfProperty}\" +{n.ValueToUp}",
                    IdProperty             = n.Ability.GUID,
                    PictureProperty        =
                        StaticMetods.getImagePropertyFromImage(n.Ability.ImageProperty)
                }));
            }

            //rev.AddRange(StaticMetods.PersProperty
            //    .ShopItems.Where(n => n.NeedQwests.Any(q => q == Qwest))
            //    .Select(
            //        getRelaysItemFromRevard).ToList());

            var abs2 = StaticMetods.PersProperty.Abilitis.Where(n => n.ReqwireAims.Any(q => q == Qwest)).ToList();

            setAbRevards(abs2, rev);

            rev.AddRange(StaticMetods.PersProperty
                         .ShopItems.Where(n => n.NeedQwests.Any(q => q == Qwest))
                         .Select(
                             getRelaysItemFromRevard).ToList());

            return(rev);
        }
예제 #30
0
 static void Main(string[] args)
 {
     System.Console.WriteLine("ТАНЕЦ МИЛЛИОНА ЗВЕЗД ДЛЯ BY_OWL");
     System.Console.WriteLine("Для продолжения нажмите Enter");
     System.Console.WriteLine("Чтобы врашать используйте клавиши W A S D ");
     System.Console.WriteLine("Для приблежения стрелка вверх на клавиатуре. ");
     System.Console.WriteLine("Для отдаления стрелка вниз на клавиатуре");
     System.Console.WriteLine("Для выхода нажмите клавишу Esc");
     System.Console.ReadLine();
     System.Console.WriteLine("Загрузка... ");
     using (var form = StaticMetods.GetRenderForm("Winbringer", "LogoVW.ico"))
         using (var game = new Game(form))
             using (var presenter = new Logic(game))
             {
                 game.Run();
             }
 }