internal override void OnCompletion() { base.OnCompletion(); HitObjectManagerMania manager = (HitObjectManagerMania)hitObjectManager; player.HaxCheck(); CurrentScore.TotalScore = (int)Math.Round(CurrentScore.TotalScoreDouble); if (CurrentScore.TotalScore == 999999) { CurrentScore.TotalScore = 1000000;//some round issue. } if ((CurrentScore.CountMiss + CurrentScore.Count50 + CurrentScore.Count100) == 0 && ((float)CurrentScore.CountKatu / CurrentScore.TotalHits) < 0.1) { CurrentScore.Perfect = true; } else { CurrentScore.Perfect = false; } //remove invalid mods CurrentScore.EnabledMods = StageMania.CanonicalKeyMods(BeatmapManager.Current, CurrentScore.EnabledMods); if (manager.PressHaxCount > manager.CountNormal * 2 / 3) // 67% normal notes { Player.flag |= BadFlags.FastPress; } haxCheckCount++; player.UpdateChecksum(); Debug.Print("Fast press: {0}", manager.PressHaxCount); }
internal static Mods CanonicalKeyMods(Beatmap map, Mods allMods) { Mods canonMods = allMods & ~Mods.KeyMod; int columnsWithMods = StageMania.ColumnsWithMods(map, allMods); if (StageMania.ColumnsWithoutMods(map) == columnsWithMods) { return(canonMods); } return(canonMods | (Mods)canonicalKeyMods[columnsWithMods]); }
internal override bool IsImportantFrame() { /* if (EventManager.BreakMode) * return false;*/ StageMania stage = hitObjectManager.ManiaStage; for (int i = 0; i < stage.Columns.Count; i++) { if (stage.Columns[i].KeyState != stage.Columns[i].KeyStateLast) { return(true); } } return(false); }
internal ColumnMania(StageMania stage, int column, float widthScale) { this.Host = stage; this.column = column; this.widthScale = widthScale; float spacing = column > 0 ? stage.Skin.ColumnSpacing[column - 1] * widthScale : 0; Left = stage.Left + stage.Width + spacing; Width = stage.Skin.ColumnWidth[column] * widthScale; stage.Width += Width + spacing; if (!stage.Minimal) { float lineHeight = Host.Height - Math.Abs(Host.ActualBottom - Host.HitPosition); //Left column line if (stage.Skin.ColumnLineWidth[column] > 0) { add(new pSprite(GameBase.WhitePixel, Fields.TopLeft, stage.FlipOrigin(Origins.BottomLeft), Clocks.Audio, new Vector2(0, stage.HitPosition), 0.61f, true, stage.Skin.GetColour(@"ColumnLine")) { VectorScale = new Vector2(0.740f * stage.Skin.ColumnLineWidth[column], lineHeight * 1.6f) }, stage.SpriteManager); } //Column background add(new pSprite(GameBase.WhitePixel, Fields.TopLeft, Origins.TopLeft, Clocks.Audio, new Vector2(0, stage.Top), 0.6f, true, stage.Skin.GetColour($@"{column + 1}")) { VectorScale = new Vector2(Width, stage.Height), Scale = 1.6f }, stage.SpriteManager); //Right column line if ((stage.Skin.ColumnLineWidth[column + 1] > 0 && SkinManager.Current.Version >= 2.4) || column == stage.Skin.Columns - 1) { add(new pSprite(GameBase.WhitePixel, Fields.TopLeft, stage.FlipOrigin(Origins.BottomLeft), Clocks.Audio, new Vector2(Width - (column == stage.Skin.Columns - 1 ? 0.10f : 0), stage.HitPosition), 0.61f, true, stage.Skin.GetColour(@"ColumnLine")) { VectorScale = new Vector2(0.740f * stage.Skin.ColumnLineWidth[column + 1], lineHeight * 1.6f) }, stage.SpriteManager); } //Key sprites SpriteManager keySpriteManager = stage.Skin.KeysUnderNotes ? stage.SpriteManager : stage.SpriteManagerAbove; pTexture p = stage.Skin.Load($@"KeyImage{column}", KeyString, stage.SkinSource); keyImageUp = new pSprite(p, Fields.TopLeft, stage.FlipOrigin(Origins.BottomCentre), Clocks.Audio, new Vector2(Width / 2f, stage.ActualBottom), 0.92f, true, Color.White) { VectorScale = new Vector2(Width * 1.6f / p.DisplayWidth, stage.HeightRatio), FlipVertical = stage.Skin.GetFlipVertical("Key", column) }; add(keyImageUp, keySpriteManager); p = stage.Skin.Load($@"KeyImage{column}D", KeyString + 'D', stage.SkinSource); keyImageDown = new pSprite(p, Fields.TopLeft, stage.FlipOrigin(Origins.BottomCentre), Clocks.Audio, new Vector2(Width / 2f, stage.ActualBottom), 0.925f, true, Color.White) { VectorScale = new Vector2(Width * 1.6f / p.DisplayWidth, stage.HeightRatio), FlipVertical = keyImageUp.FlipVertical, Alpha = 0 }; add(keyImageDown, keySpriteManager); //Lights lightImage = new pAnimation(stage.Skin.LoadAll(@"StageLight", @"mania-stage-light", stage.SkinSource), Fields.TopLeft, stage.FlipOrigin(Origins.BottomLeft), Clocks.Audio, new Vector2(0, stage.ScaleFlipPosition(Host.Skin.LightPosition)), 0.72f, true, stage.Skin.GetColour($@"Light{column + 1}")); lightImage.Alpha = 0; lightImage.FrameDelay = 1000f / stage.Skin.LightFramePerSecond; lightImage.RunAnimation = false; lightImage.LoopType = LoopTypes.LoopForever; lightImage.VectorScale = new Vector2(Width * 1.6f / lightImage.Width, stage.HeightRatio); add(lightImage, stage.SpriteManager); //Key warning keyWarning = new pText("", Width / 2f, new Vector2(Width / 2f, stage.ScaleFlipPosition(480 - keyImageUp.DrawHeight / 1.6f / 2)), 0.93f, true, stage.Skin.GetColour(@"KeyWarning")) { TextBold = true, Origin = Origins.Centre, Scale = stage.HeightRatio }; add(keyWarning, stage.SpriteManagerAbove); //Hit lights hitLightFrames = stage.Skin.LoadAll(@"LightingN", @"lightingN", stage.SkinSource); pTexture[] lightLong = stage.Skin.LoadAll(@"LightingL", @"lightingL", stage.SkinSource); if (lightLong == null || lightLong.Length == 0) { lightLong = new pTexture[hitLightFrames.Length]; hitLightFrames.CopyTo(lightLong, 0); } hitLightLong = new pAnimation(lightLong, Fields.TopLeft, Origins.Centre, Clocks.Audio, new Vector2(Width / 2f, stage.HitPosition), 0.98f, true, Color.White); hitLightLong.Scale = Host.Skin.GetLightingLScale(column) * widthScale; hitLightLong.Alpha = 0; hitLightLong.Additive = true; if (lightLong != null) { hitLightLong.FrameDelay = Math.Max(170f / lightLong.Length, GameBase.SIXTY_FRAME_TIME); } add(hitLightLong, stage.SpriteManagerAbove); } }