public static LegacyMapDifficulty?ToLegacyMapDifficulty(this MapDifficulty mapDifficulty)
        {
            switch (mapDifficulty)
            {
            case MapDifficulty.DungeonNormal:
            case MapDifficulty.Raid10Player:
                return(LegacyMapDifficulty.NormalDungeonOr10ManNormalRaid);

            case MapDifficulty.DungeonHeroic:
            case MapDifficulty.Raid25Player:
                return(LegacyMapDifficulty.HeroicDungeonOr25ManNormalRaid);

            case MapDifficulty.Raid10PlayerHeroic:
                return(LegacyMapDifficulty.HeroicRaid10Player);

            case MapDifficulty.Raid25PlayerHeroic:
                return(LegacyMapDifficulty.HeroicRaid25Player);

            case MapDifficulty.RaidLookingForRaid:
                return(LegacyMapDifficulty.LookingForRaid);

            default:
                return(null);
            }
        }
Esempio n. 2
0
        protected override void ApplyMapPropertiesSelf(ControlPointGroup controlPoints, MapDifficulty difficulty)
        {
            base.ApplyMapPropertiesSelf(controlPoints, difficulty);

            ApproachDuration = MapDifficulty.GetDifficultyValue(difficulty.ApproachRate, 2000, 1500, 900);
            Scale            = MapDifficulty.GetDifficultyValue(difficulty.CircleSize, 1, 0.85f, 0.7f);
        }
        public static BeatMapDifficulty ConvertToBeatMapDifficulty(MapDifficulty mapDifficulty)
        {
            var result = BeatMapDifficulty.Easy;

            switch (mapDifficulty)
            {
            case MapDifficulty.Easy:
                result = BeatMapDifficulty.Easy;
                break;

            case MapDifficulty.Normal:
                result = BeatMapDifficulty.Normal;
                break;

            case MapDifficulty.Hard:
                result = BeatMapDifficulty.Hard;
                break;

            case MapDifficulty.Expert:
                result = BeatMapDifficulty.Expert;
                break;

            case MapDifficulty.ExpertPlus:
                result = BeatMapDifficulty.ExpertPlus;
                break;

            default:
                break;
            }
            return(result);
        }
Esempio n. 4
0
 public Highscore(
     string name, int minesHit, int totalMines,
     TimeSpan time, DateTime stamp, MapDifficulty difficulty)
     : this(name, minesHit, totalMines, time, difficulty)
 {
     TimeStamp = stamp;
 }
Esempio n. 5
0
 public override void SetDifficulty(float difficulty)
 {
     Perfect = MapDifficulty.GetDifficultyValue(difficulty, timingRanges[HitResultType.Perfect]);
     Great   = MapDifficulty.GetDifficultyValue(difficulty, timingRanges[HitResultType.Great]);
     Good    = MapDifficulty.GetDifficultyValue(difficulty, timingRanges[HitResultType.Good]);
     Miss    = MapDifficulty.GetDifficultyValue(difficulty, timingRanges[HitResultType.Miss]);
 }
Esempio n. 6
0
 /// <summary>
 /// Sets the difficulty value to calculate the timing values.
 /// </summary>
 public virtual void SetDifficulty(float difficulty)
 {
     Perfect = MapDifficulty.GetDifficultyValue(difficulty, DefaultRanges[HitResultType.Perfect]);
     Great   = MapDifficulty.GetDifficultyValue(difficulty, DefaultRanges[HitResultType.Great]);
     Good    = MapDifficulty.GetDifficultyValue(difficulty, DefaultRanges[HitResultType.Good]);
     Ok      = MapDifficulty.GetDifficultyValue(difficulty, DefaultRanges[HitResultType.Ok]);
     Bad     = MapDifficulty.GetDifficultyValue(difficulty, DefaultRanges[HitResultType.Bad]);
     Miss    = MapDifficulty.GetDifficultyValue(difficulty, DefaultRanges[HitResultType.Miss]);
 }
Esempio n. 7
0
 public MapData(string name, string url, MapDifficulty difficulty, PathModel[] paths, PathSpawnerModel spawner, Il2CppReferenceArray <AreaModel> areas)
 {
     this.name       = name;
     this.url        = url;
     this.difficulty = difficulty;
     this.paths      = paths;
     this.spawner    = spawner;
     this.areas      = areas;
 }
Esempio n. 8
0
 public GameSettings(MapDifficulty dif, int w, int h, int d, int av, int mv, WindowMode wm = 0)
 {
     Difficulty   = dif;
     MapWidth     = w;
     MapHeight    = h;
     MineDensitiy = d;
     AudioVolume  = av;
     MusicVolume  = mv;
     WindowMode   = wm;
 }
Esempio n. 9
0
 public Highscore(
     string name, int minesHit, int totalMines,
     TimeSpan time, MapDifficulty difficulty)
 {
     Name       = name;
     MinesHit   = minesHit;
     TotalMines = totalMines;
     Time       = time;
     TimeStamp  = DateTime.Now;
     Difficulty = difficulty;
 }
Esempio n. 10
0
        /// <summary>
        /// Helper method to get a difficulty of this Song
        /// </summary>
        /// <param name="diff">Requested difficulty</param>
        /// <param name="difficulty">the difficulty - Will be a random difficulty if not found, make sure to check the return value of the method!</param>
        /// <returns>True if the requested difficulty exists, false otherwise</returns>
        public bool GetDifficulty(out SongDifficulty difficulty, MapDifficulty diff, MapCharacteristic characteristic = MapCharacteristic.Standard)
        {
            for (int i = 0; i < diffCount; i++)
            {
                ref var x = ref SongDetailsContainer.difficulties[i + diffOffset];

                if (x.difficulty == diff && x.characteristic == characteristic)
                {
                    difficulty = x;
                    return(true);
                }
            }
Esempio n. 11
0
        /// <summary>
        /// 作戦難易度を漢字に変換
        /// </summary>
        /// <param name="mapDif">MapDifficulty列挙体</param>
        /// <returns>作戦難易度の漢字</returns>
        public static string ToKanji(this MapDifficulty mapDif)
        {
            switch (mapDif)
            {
            case MapDifficulty.None: return("不明");

            case MapDifficulty.Hei: return("丙");

            case MapDifficulty.Otsu: return("乙");

            case MapDifficulty.Kou: return("甲");

            default: throw new NotImplementedException("MapDifficultyに対応するToKanjiが実装されていません");
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Applies map properties to this object only.
        /// </summary>
        protected virtual void ApplyMapPropertiesSelf(ControlPointGroup controlPoints, MapDifficulty difficulty)
        {
            IsHighlight = controlPoints.EffectPointAt(StartTime + ControlPointOffset).IsHighlight;

            ApproachDuration = MapDifficulty.GetDifficultyValue(difficulty.ApproachRate, 1000f, 750f, 500f);

            if (Timing == null)
            {
                Timing = CreateHitTiming();
            }
            if (Timing != null)
            {
                Timing.SetDifficulty(difficulty.OverallDifficulty);
            }
        }
Esempio n. 13
0
        /// <summary>
        /// Applies specified map properties to this and all nested hit object.
        /// </summary>
        public void ApplyMapProperties(ControlPointGroup controlPoints, MapDifficulty difficulty)
        {
            // Apply map properties to this object first.
            ApplyMapPropertiesSelf(controlPoints, difficulty);

            // Determine which sample point this object belongs to.
            IHasEndTime endTimeObject = this as IHasEndTime;

            SamplePoint = controlPoints.SamplePointAt(StartTime + ControlPointOffset);

            // Create nested objects if necessary
            NestedObjects.Clear();
            CreateNestedObjects();
            NestedObjects.Sort((x, y) => x.StartTime.CompareTo(y.StartTime));

            // Apply map properties to all nested objects
            foreach (var obj in NestedObjects)
            {
                obj.ApplyMapProperties(controlPoints, difficulty);
            }
        }
Esempio n. 14
0
        protected override void ApplyMapPropertiesSelf(ControlPointGroup controlPoints, MapDifficulty difficulty)
        {
            base.ApplyMapPropertiesSelf(controlPoints, difficulty);

            // Set samples to be played on dragger end.
            EndSamples = NodeSamples[NodeSamples.Count - 1];

            // Set ending position
            EndX = this.GetPosition(1f).x;

            // Calculate tick generation interval.
            TimingControlPoint timingPoint = controlPoints.TimingPointAt(StartTime);

            TickInterval = timingPoint.BeatLength / difficulty.SliderTickRate;
        }
Esempio n. 15
0
 /// <summary>
 /// Sets the waves difficulty multiplier based off of the maps difficulty and the wave number
 /// </summary>
 /// <param name="difficulty">The maps difficulty</param>
 /// <param name="wave">The current wave number</param>
 private void GenerateWaveMultiplier(MapDifficulty difficulty, int wave)
 {
 }
Esempio n. 16
0
        protected override void ApplyMapPropertiesSelf(ControlPointGroup controlPoints, MapDifficulty difficulty)
        {
            base.ApplyMapPropertiesSelf(controlPoints, difficulty);

            TimingControlPoint     timingPoint     = controlPoints.TimingPointAt(StartTime);
            DifficultyControlPoint difficultyPoint = controlPoints.DifficultyPointAt(StartTime);

            float distance = BaseDistance * difficultyPoint.SpeedMultiplier * difficulty.SliderMultiplier;

            Speed = distance / timingPoint.BeatLength;
        }
Esempio n. 17
0
 private int PageCount(MapDifficulty difficulty)
 {
     return(tabMap[difficulty].Tabs.Count);
 }
Esempio n. 18
0
        protected override void Init()
        {
            arrRight = Content.Load <Texture2D>("textures/arrow_right");
            arrLeft  = Content.Load <Texture2D>("textures/arrow_left");
            font     = Content.Load <SpriteFont>("fonts/menu_font");
            blank    = Content.Load <Texture2D>("textures/blank");
            tabMap   = new Dictionary <MapDifficulty, TabPane>();
            selMap   = new Dictionary <MapDifficulty, int>();

            MenuItem leftDiff  = new MenuItem(arrLeft, 32, 32);
            MenuItem rightDiff = new MenuItem(arrRight, 32, 32);
            MenuItem leftPage  = new MenuItem(arrLeft, 32, 32);
            MenuItem rightPage = new MenuItem(arrRight, 32, 32);
            MenuItem back      = new MenuItem("Back", font);

            leftDiff.VAlign = rightDiff.VAlign = VAlignment.Center;
            leftDiff.HAlign = rightDiff.HAlign = HAlignment.Center;
            leftPage.VAlign = rightPage.VAlign = VAlignment.Center;
            leftPage.HAlign = rightPage.HAlign = HAlignment.Center;
            back.HAlign     = HAlignment.Center;
            back.VAlign     = VAlignment.Top;

            TextItem diff = new TextItem(font, "Difficulty: " + game.Settings.Difficulty);

            diff.HAlign = HAlignment.Center;
            diff.VAlign = VAlignment.Center;

            HPane hDiff = new HPane(diff);

            hDiff.HAlign = HAlignment.Center;
            hDiff.HGrow  = 0.4f;

            HPane hDiffArr = new HPane(leftDiff, hDiff, rightDiff);

            hDiffArr.HGrow = 1;

            tabMap.Add(MapDifficulty.Easy, CreateScoresPane(game.Scores.Where(s => s.Difficulty == MapDifficulty.Easy).ToList()));
            tabMap.Add(MapDifficulty.Medium, CreateScoresPane(game.Scores.Where(s => s.Difficulty == MapDifficulty.Medium).ToList()));
            tabMap.Add(MapDifficulty.Hard, CreateScoresPane(game.Scores.Where(s => s.Difficulty == MapDifficulty.Hard).ToList()));
            tabMap.Add(MapDifficulty.Custom, CreateScoresPane(game.Scores.Where(s => s.Difficulty == MapDifficulty.Custom).ToList()));

            TabPane tPane = new TabPane(
                tabMap[MapDifficulty.Easy],
                tabMap[MapDifficulty.Medium],
                tabMap[MapDifficulty.Hard],
                tabMap[MapDifficulty.Custom]);

            ImageItem tBack = new ImageItem(blank);

            tBack.HGrow = tBack.VGrow = 1;
            tBack.Color = Color.Black;
            tBack.Alpha = 0.42f;

            StackPane sPane = new StackPane(tBack, tPane);

            sPane.HAlign = HAlignment.Center;
            sPane.HGrow  = sPane.VGrow = 1;
            tPane.HGrow  = tPane.VGrow = 1;

            HPane hPane = new HPane(leftPage, sPane, rightPage);

            hPane.HAlign = HAlignment.Center;
            hPane.HGrow  = hPane.VGrow = 1;

            VPane vPane = new VPane(hDiffArr, hPane, back);

            vPane.HGrow = vPane.VGrow = 1;

            ImageItem backItem = new ImageItem(Parent.Background);

            backItem.HGrow = backItem.VGrow = 1;

            ViewPane.Clear();
            RootPane       = new StackPane(backItem, vPane);
            RootPane.HGrow = RootPane.VGrow = 1;
            ViewPane.Add(RootPane);

            leftDiff.FocusGain  += (s, a) => leftDiff.ImageItem.Color = Color.Yellow;
            leftDiff.FocusLoss  += (s, a) => leftDiff.ImageItem.Color = Color.White;
            rightDiff.FocusGain += (s, a) => rightDiff.ImageItem.Color = Color.Yellow;
            rightDiff.FocusLoss += (s, a) => rightDiff.ImageItem.Color = Color.White;

            leftPage.FocusGain  += (s, a) => leftPage.ImageItem.Color = Color.Yellow;
            leftPage.FocusLoss  += (s, a) => leftPage.ImageItem.Color = Color.White;
            rightPage.FocusGain += (s, a) => rightPage.ImageItem.Color = Color.Yellow;
            rightPage.FocusLoss += (s, a) => rightPage.ImageItem.Color = Color.White;

            MapDifficulty selectedDiff = game.Settings.Difficulty;

            for (int i = 0; i < (int)selectedDiff; ++i)
            {
                tPane.NextTab();
            }

            leftDiff.IsDisabled  = (int)(selectedDiff) == 0;
            rightDiff.IsDisabled = (int)(selectedDiff) == 3;
            UpdateArrow(leftDiff);
            UpdateArrow(rightDiff);

            leftDiff.Action += (s, a) => {
                if (tPane.PrevTab())
                {
                    --selectedDiff;
                }
                leftDiff.IsDisabled  = (int)(selectedDiff) == 0;
                rightDiff.IsDisabled = (int)(selectedDiff) == 3;
                diff.Text            = "Difficulty: " + (MapDifficulty)selectedDiff;
                UpdateArrow(leftDiff);
                UpdateArrow(rightDiff);

                int sel = selMap[selectedDiff];
                rightPage.IsDisabled = sel >= PageCount(selectedDiff) - 1;
                leftPage.IsDisabled  = sel <= 0;
                UpdateArrow(leftPage);
                UpdateArrow(rightPage);
            };

            rightDiff.Action += (s, a) => {
                if (tPane.NextTab())
                {
                    ++selectedDiff;
                }
                leftDiff.IsDisabled  = (int)(selectedDiff) == 0;
                rightDiff.IsDisabled = (int)(selectedDiff) == 3;
                diff.Text            = "Difficulty: " + (MapDifficulty)selectedDiff;
                UpdateArrow(leftDiff);
                UpdateArrow(rightDiff);

                int sel = selMap[selectedDiff];
                rightPage.IsDisabled = sel >= PageCount(selectedDiff) - 1;
                leftPage.IsDisabled  = sel <= 0;
                UpdateArrow(leftPage);
                UpdateArrow(rightPage);
            };

            leftPage.IsDisabled = true;
            if (PageCount(selectedDiff) < 2)
            {
                rightPage.IsDisabled = true;
            }
            UpdateArrow(leftPage);
            UpdateArrow(rightPage);

            selMap.Add(MapDifficulty.Easy, 0);
            selMap.Add(MapDifficulty.Medium, 0);
            selMap.Add(MapDifficulty.Hard, 0);
            selMap.Add(MapDifficulty.Custom, 0);

            leftPage.Action += (s, a) => {
                int sel = (selMap[selectedDiff] = Math.Max(0, selMap[selectedDiff] - 1));
                rightPage.IsDisabled = sel >= PageCount(selectedDiff) - 1;
                leftPage.IsDisabled  = sel <= 0;
                tabMap[selectedDiff].PrevTab();
                UpdateArrow(leftPage);
                UpdateArrow(rightPage);
            };

            rightPage.Action += (s, a) => {
                int pc  = PageCount(selectedDiff);
                int sel = (selMap[selectedDiff] = Math.Min(pc - 1, selMap[selectedDiff] + 1));
                rightPage.IsDisabled = sel >= pc - 1;
                leftPage.IsDisabled  = sel <= 0;
                tabMap[selectedDiff].NextTab();
                UpdateArrow(leftPage);
                UpdateArrow(rightPage);
            };

            back.FocusGain += (s, a) => back.TextItem.Color = Color.Yellow;
            back.FocusLoss += (s, a) => back.TextItem.Color = Color.White;
            back.Action    += (s, a) => Close();
        }
Esempio n. 19
0
 public List <Highscore> ScoresOf(MapDifficulty difficulty, string name = null)
 {
     return(Scores.Where(score => (name == null || score.Name.Equals(name)) &&
                         score.Difficulty == difficulty).ToList());
 }
        private void ButtonRun_Click(object sender, EventArgs e)
        {
            if (Searcher.IsBusy)
            {
                if (MessageBox.Show("要中断搜索吗?", "正在搜索中", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2)
                    == System.Windows.Forms.DialogResult.Yes)
                {
                    Searcher.CancelAsync();
                }
                return;
            }

            RecordView.Rows.Clear();
            RecordView.Font = Utility.Configuration.Config.UI.JapFont;

            var row = new DataGridViewRow();

            row.CreateCells(RecordView);

            var args = new SearchArgument
            {
                ShipName      = ShipName.Text,
                ItemName      = (string)ItemName.SelectedItem,
                EquipmentName = (string)EquipmentName.SelectedItem,
                DateBegin     = DateBegin.Value,
                DateEnd       = DateEnd.Value,
                MapAreaID     = (int)MapAreaID.SelectedValue,
                MapInfoID     = (int)MapInfoID.SelectedValue,
                MapCellID     = (int)MapCellID.SelectedValue,
                MapDifficulty = (string)MapDifficulty.GetItemText(MapDifficulty.SelectedItem),
                IsBossOnly    = IsBossOnly.CheckState,
                RankS         = RankS.Checked,
                RankA         = RankA.Checked,
                RankB         = RankB.Checked,
                RankX         = RankX.Checked,
                MergeRows     = MergeRows.Checked,
                BaseRow       = row
            };

            RecordView.Tag = args;


            // column initialize
            if (MergeRows.Checked)
            {
                RecordView_Name.DisplayIndex   = 0;
                RecordView_Header.HeaderText   = "次数";
                RecordView_Header.Width        = 100;
                RecordView_Header.DisplayIndex = 1;
                RecordView_RankS.Width         = 100;
                RecordView_RankS.Visible       = true;
                RecordView_RankA.Width         = 100;
                RecordView_RankA.Visible       = true;
                RecordView_RankB.Width         = 100;
                RecordView_RankB.Visible       = true;

                RecordView_Date.Visible = false;
                RecordView_Map.Visible  = false;
                RecordView_Rank.Visible = false;
            }
            else
            {
                RecordView_Header.HeaderText   = "";
                RecordView_Header.Width        = 50;
                RecordView_Header.DisplayIndex = 0;
                RecordView_Date.Width          = 150;
                RecordView_Date.Visible        = true;
                RecordView_Map.Width           = 240;
                RecordView_Map.Visible         = true;
                RecordView_Rank.Width          = 40;
                RecordView_Rank.Visible        = true;

                RecordView_RankS.Visible = false;
                RecordView_RankA.Visible = false;
                RecordView_RankB.Visible = false;
            }
            RecordView.ColumnHeadersVisible = true;


            StatusInfo.Text = "正在搜索中 ...";
            StatusInfo.Tag  = DateTime.Now;

            Searcher.RunWorkerAsync(args);
        }
Esempio n. 21
0
        private void SaveScores(TextField nameField, LayoutPane pane)
        {
            MapDifficulty diff = Game.Settings.Difficulty;

            score.Name = nameField.Text;

            int              p    = 1;
            Highscore        best = null;
            List <Highscore> dups = new List <Highscore>();
            var              it   = Game.ScoresOf(diff).GetEnumerator();

            for (it.MoveNext(); it.Current != null; it.MoveNext())
            {
                if (it.Current.Name.Equals(score.Name))
                {
                    if (best == null)
                    {
                        best = it.Current;
                    }
                    else
                    {
                        dups.Add(it.Current);
                    }
                }

                if (best == null)
                {
                    ++p;
                }
            }

            if (score == best)
            {
                Task.Run(() => {
                    mainPane.Remove(pane);
                    dups.ForEach(Game.RemoveHighscore);
                    FileManager.SaveHighscores(Game.ScoresPath, Game.Scores);
                    MySqlHelper.Instance.Sync(Game);
                    mainPane.Add(CreateNavPane());
                });
            }
            else
            {
                Game.Scores.Remove(score);
                if (kicked != null)
                {
                    Game.Scores.Add(kicked);
                }
                var ti = new TextItem(font, string.Format("A better score by {0} already exists at Rank {1}.", best.Name, p));
                var fp = new FadingPane(2000);
                fp.HGrow  = fp.VGrow = 1;
                ti.HAlign = HAlignment.Center;
                ti.VAlign = VAlignment.Center;
                fp.Add(ti);

                fp.FadedOut += (s, a) => {
                    mainPane.Remove(fp);
                    mainPane.Add(CreateNavPane());
                };

                mainPane.Remove(pane);
                mainPane.Add(fp);
            }
        }