internal override void Disarm() { bool hidden = ModManager.CheckActive(hitObjectManager.ActiveMods, Mods.Hidden); if (hidden) { return; } base.Disarm(); for (int i = 0; i < SpriteCollection.Count; i++) { pSprite p = SpriteCollection[i]; if (p.Clock == Clocks.Game) { continue; } p.Transformations.RemoveAll(t => t.TagNumeric == ARMED); p.Transformations.Add(new Transformation(TransformationType.Fade, 1, 0, StartTime, StartTime) { TagNumeric = ARMED }); } }
internal override void InitializeModSettings() { HitObjectManagerMania manager = (HitObjectManagerMania)hitObjectManager; //Don't consider score increase mods to not go over mania max double multiplier = ModManager.ScoreMultiplier(Player.currentScore.EnabledMods & ~(Mods.ScoreIncreaseMods), Player.Mode, manager.Beatmap); ScoreMultiplier = (double)JudgementMania.ScoreMax / manager.CountTotal * multiplier; if (!ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.SuddenDeath)) { if (ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.Easy)) { Recoveries = 2; } } if (ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.Flashlight)) { spriteManagerFlashlight = new SpriteManager(true); s_Flashlight = new pSprite(null, Fields.Storyboard, Origins.CentreLeft, Clocks.Game, new Vector2(0, 220), 1, true, Color.White); s_Flashlight.Scale = 1.4F; spriteManagerFlashlight.Add(s_Flashlight); loadFlashlight(); } }
internal override void Arm(bool isHit) { bool hidden = ModManager.CheckActive(hitObjectManager.ActiveMods, Mods.Hidden); if (!isHit || hidden || (GameBase.Mode == OsuModes.Edit && !ConfigManager.sEditorHitAnimations)) { return; } foreach (pSprite p in SpriteCollection) { if (p == SpriteSelectionCircle) { continue; } p.Transformations.RemoveAll(t => t.TagNumeric == ARMED); p.Transformations.Add(new Transformation(TransformationType.Fade, 1, 0, StartTime, StartTime + HitObjectManager.FadeOut) { TagNumeric = ARMED }); p.Transformations.Add(new Transformation(TransformationType.Scale, 1.0F, 1.4F, StartTime, (int)(StartTime + HitObjectManager.FadeOut), EasingTypes.Out) { TagNumeric = ARMED }); } }
private int VariablesCalcu(double val) { if (ModManager.CheckActive(ActiveMods, Mods.HardRock)) { val /= 1.4; } else if (ModManager.CheckActive(ActiveMods, Mods.Easy)) { val *= 1.4; } /* * DT changes the audio rate and therefore shortens the hitwindow * at a system time level. But in mania, we don't want this side effect * so we multiply a corressponding value to val to keep the hitwindow the same * in system time level. */ if (ModManager.CheckActive(ActiveMods, Mods.DoubleTime)) { val *= 1.5; } else if (ModManager.CheckActive(ActiveMods, Mods.HalfTime)) { val *= 0.75; } return((int)val); }
internal override void Disarm() { base.Disarm(); bool hidden = ModManager.CheckActive(hitObjectManager.ActiveMods, Mods.Hidden); bool hasApproachCircle = ShowApproachCircle && (!hidden || hitObjectManager.hitObjects.Count == 0); Transformation fadeout = hidden ? new Transformation(TransformationType.Fade, 1, 0, StartTime - (int)(LocalPreEmpt * 0.6), StartTime - (int)(LocalPreEmpt * 0.3)) { TagNumeric = ARMED } : new Transformation(TransformationType.Fade, 1, 0, StartTime + hitObjectManager.HitWindow100, StartTime + hitObjectManager.HitWindow50) { TagNumeric = ARMED }; SpriteHitCircle1.Transformations.Add(fadeout.Clone()); SpriteHitCircle2.Transformations.Add(fadeout.Clone()); SpriteHitCircleText.Transformations.Add(fadeout.Clone()); if (hasApproachCircle && hidden) { SpriteApproachCircle.Transformations.Add(fadeout.Clone()); } SpriteHitCircle1.Scale = 1; SpriteHitCircle2.Scale = 1; SpriteHitCircleText.Scale = TEXT_SIZE; }
private void checkSpecialWaitingState() { if (specialStateColourChange != (specialMovementModifier != 1) && !ModManager.CheckActive(Mods.Cinema)) { specialStateColourChange = specialMovementModifier != 1; catcher1.FadeColour(specialStateColourChange ? SkinManager.CurrentFruitsSkin.ColourHyperDash : Color.White, 100); if (player.eventManager.backgroundEvent != null && player.eventManager.backgroundEvent.Sprite != null) { player.eventManager.backgroundEvent.Sprite.FadeColour(specialStateColourChange ? new Color(100, 100, 100) : Color.White, 100); } } if (specialMovementModifier != 1 && specialMovementNextFruit != null) { if ((specialMovementDirection > 0 && catcher1.Position.X >= specialMovementNextFruit.Position.X) || (specialMovementDirection < 0 && catcher1.Position.X <= specialMovementNextFruit.Position.X)) { catcher1.Position.X = specialMovementNextFruit.Position.X; ResetMovementSpeed(); specialWaitingState = true; GlowCatcherRed(); } } }
internal void MakeHyperDash(HitObject target) { if (HyperDash) { return; } DistanceToHyperDash = 0; HyperDashTarget = target; if (hitObjectManager.spriteManager == null) { return; } SpriteHyperDash.InitialColour = SkinManager.CurrentFruitsSkin.ColourHyperDashFruit; Transformation t = new Transformation(TransformationType.Scale, SpriteHitCircle1.Scale * 1.2f, SpriteHitCircle1.Scale * 1.3f, SpriteHitCircle1.Transformations[0].Time1, SpriteHitCircle1.Transformations[0].Time1 + 500); t.Loop = true; SpriteHyperDash.Transformations.Add(t); if (!ModManager.CheckActive(hitObjectManager.ActiveMods, Mods.Hidden)) { t = new Transformation(TransformationType.Fade, 1, 0.5f, SpriteHitCircle1.Transformations[0].Time1, SpriteHitCircle1.Transformations[0].Time1 + 500); t.Loop = true; SpriteHyperDash.Transformations.Add(t); } }
public SpinnerTaiko(HitObjectManager hom, int startTime, int endTime, HitObjectSoundType soundType) : base(hom, startTime, endTime, soundType) { rotationRequirement = (int)Math.Max(1, (rotationRequirement * 1.65f)); totalRotationRequirement = rotationRequirement; if (ModManager.CheckActive(hitObjectManager.ActiveMods, Mods.DoubleTime)) { rotationRequirement = Math.Max(1, (int)(rotationRequirement * 0.75f)); } if (ModManager.CheckActive(hitObjectManager.ActiveMods, Mods.HalfTime)) { rotationRequirement = Math.Max(1, (int)(rotationRequirement * 1.5f)); } if (hitObjectManager.spriteManager != null) { SpriteBonusCounter.Transformations = new List <Transformation>(SpriteCircleTop.Transformations); SpriteBonusCounter.Text = (rotationRequirement + 1).ToString(); WarningIcon = new pSprite(TextureManager.Load("spinner-warning"), Fields.GamefieldWide, Origins.Centre, Clocks.Audio, Position, SpriteManager.drawOrderBwd(StartTime + 1), false, Color.White); SpriteCollection.Add(WarningIcon); WarningIcon.TagNumeric = -5; DimCollection.Add(WarningIcon); WarningIcon.Transformations.Add( new Transformation(TransformationType.Fade, 0, 1, startTime - hitObjectManager.PreEmpt, startTime - (int)(hitObjectManager.PreEmpt * 0.6))); } Kiai = false; }
protected override void DrawScoreboardLevelItems() { if (ModManager.CheckActive(Mods.Cinema)) { return; } base.DrawScoreboardLevelItems(); }
internal override void UpdateFlashlight() { if (ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.Flashlight)) { s_Flashlight.Position = new Vector2(208, 208); } base.UpdateFlashlight(); }
public HitCircleFruits(HitObjectManager hom, Vector2 startPosition, int startTime, bool newCombo, HitObjectSoundType soundType, string fruit) : base(hom) { Position = new Vector2(OsuMathHelper.Clamp(startPosition.X, 0, GameField.DEFAULT_WIDTH), 340); BasePosition = Position; StartTime = startTime; EndTime = startTime; SoundType = soundType; NewCombo = newCombo; if (hom.spriteManager != null) { SpriteHitCircle1 = new pSprite(TextureManager.Load(@"fruit-" + fruit), Fields.Gamefield, Origins.Centre, Clocks.Audio, Position, SpriteManager.drawOrderBwd(StartTime), false, Color.White); SpriteCollection.Add(SpriteHitCircle1); DimCollection.Add(SpriteHitCircle1); SpriteHitCircle1.TagNumeric = 1; SpriteHitCircle2 = new pSprite(TextureManager.Load(@"fruit-" + fruit + "-overlay"), Fields.Gamefield, Origins.Centre, Clocks.Audio, Position, SpriteManager.drawOrderBwd(StartTime - 1), false, Color.White); SpriteCollection.Add(SpriteHitCircle2); DimCollection.Add(SpriteHitCircle2); SpriteHyperDash = new pSprite(TextureManager.Load(@"fruit-" + fruit), Fields.Gamefield, Origins.Centre, Clocks.Audio, Position, SpriteManager.drawOrderBwd(StartTime + 1), false, Color.TransparentBlack); SpriteHyperDash.Additive = true; SpriteCollection.Add(SpriteHyperDash); DimCollection.Add(SpriteHyperDash); Transformation fall1 = new Transformation(new Vector2(Position.X, -100), new Vector2(Position.X, 340), StartTime - hitObjectManager.PreEmpt, StartTime); fall1.EndVector.Y += (fall1.EndVector.Y - fall1.StartVector.Y) * 0.2f; fall1.Time2 += (int)(fall1.Duration * 0.2f); float rotation = RNG.NextSingle(-0.2f, 0.2f); SpriteCollection.ForEach(s => { s.Transformations.Add(fall1); s.Rotation = rotation; }); if (ModManager.CheckActive(hitObjectManager.ActiveMods, Mods.Hidden)) { Transformation t = new Transformation(TransformationType.Fade, 1, 0, startTime - (int)(hitObjectManager.PreEmpt * 0.6), startTime - (int)(hitObjectManager.PreEmpt * 0.44)); SpriteCollection.ForEach(s => s.Transformations.Add(t)); } } }
internal override void GotoRanking(bool force = false) { if (ModManager.CheckActive(Mods.Cinema)) { GameBase.ChangeMode(OsuModes.SelectPlay); return; } base.GotoRanking(force); }
internal override void InitializeCalculations() { hitObjectManager.ManiaStage.HPBar.HpDropRate = CalculateHpDropRate(); if (ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.HalfTime)) { hitObjectManager.ManiaStage.HPBar.HpDropRate *= 0.75; } base.InitializeCalculations(); }
protected override void OnSetBeatmap() { if (InputManager.ReplayMode && ModManager.CheckActive(InputManager.ReplayScore.EnabledMods, Mods.Target)) { targetRandom = new Random(InputManager.ReplayScore.Seed); } else { targetRandom = new Random(Player.Seed); } }
protected override void drawRuleset() { if (ModManager.CheckActive(Mods.Cinema)) { hitObjectManager.Draw(); //only draw hitobjects. } else { base.drawRuleset(); } }
internal override void InitializeModSettings() { base.InitializeModSettings(); if (ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.Flashlight)) { pSprite extraBlackness = new pSprite(GameBase.WhitePixel, Fields.Storyboard, Origins.TopLeft, Clocks.Game, new Vector2(640, 0), 0, true, Color.Black); extraBlackness.Scale = 1.6f; extraBlackness.VectorScale = new Vector2(GameBase.WindowManager.WidthScaled - 640, GameBase.WindowManager.HeightScaled); spriteManagerFlashlight.Add(extraBlackness); } }
protected override void DrawOverlay() { if (ModManager.CheckActive(Mods.Cinema)) { return; } if (InputManager.ReplayMode) { replayOverlay.Draw(); } base.DrawOverlay(); }
protected virtual void InitializeLocalScore() { ReplayMode = InputManager.ReplayMode; if (ReplayMode && (Player.currentScore == null || !ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.Autoplay))) { //We are watching a replay that wasn't played by auto mod. if (InputManager.ReplayStreaming && Player.currentScore != null) { score = Player.currentScore; if (score.PlayerName.Length == 0) { score.PlayerName = StreamingManager.CurrentlySpectating.Name; } } else { score = InputManager.ReplayScore; if (Player.currentScore != null && Player.currentScore.HitErrors != null) { score.HitErrors = new List <int>(); score.HitErrors.AddRange(Player.currentScore.HitErrors); } if (score.IsOnline) { //check for a matching local replay based on online score id (allow watching replays based on online ranking. List <Score> localScores = ScoreManager.FindScores(score.FileChecksum, score.PlayMode); if (localScores != null) { Score match = localScores.Find(s => s.OnlineId == score.OnlineId); if (match != null && match.LocalReplayPresent) { score = match; } } } score.LoadLocalData(); if (score.HpGraphString != null) { score.ReadGraphData(score.HpGraphString); } } } else { loadLocalUserScore(true); } }
internal static double AdjustDifficulty(double difficulty) { if (GameBase.Mode == Modes.Play && Player.currentScore != null && ModManager.CheckActive(Player.currentScore.enabledMods, Mods.Easy)) { difficulty = Math.Max(0, difficulty / 2); } if (GameBase.Mode == Modes.Play && Player.currentScore != null && ModManager.CheckActive(Player.currentScore.enabledMods, Mods.HardRock)) { difficulty = Math.Min(10, difficulty * 1.3); } return((difficulty - 5) / 5); }
internal override void OnCompletion() { CurrentScore.Pass = HpBar.CurrentHp > 100; if (!CurrentScore.Pass && !ModManager.CheckActive(CurrentScore.EnabledMods, Mods.NoFail | Mods.Relax) && !GameBase.TestMode) { HpBar.SetCurrentHp(0); //OnFailableHp will handle this exit condition. return; } mascot.SetState(TaikoMascotStates.Clear, true); base.OnCompletion(); }
public SpinnerTaiko(int startTime, int endTime, HitObjectSoundType soundType) : base(startTime, endTime, soundType, false) { rotationRequirement = (int)Math.Max(1, (rotationRequirement * 1.5f)); if (ModManager.CheckActive(Player.currentScore.enabledMods, Mods.DoubleTime)) { rotationRequirement = Math.Max(1, (int)(rotationRequirement * 0.75f)); } if (ModManager.CheckActive(Player.currentScore.enabledMods, Mods.HalfTime)) { rotationRequirement = Math.Max(1, (int)(rotationRequirement * 1.5f)); } spriteBonus.Transformations = spriteCircle.Transformations; spriteBonus.Text = rotationRequirement.ToString(); }
public override void Draw() { if (hitObjectManager != null && ModManager.CheckActive(Mods.Cinema)) { hitObjectManager.spriteManager.Alpha = 0.01f; spriteManager.Alpha = 0; spriteManagerHighest.Alpha = 0; spriteManagerInterfaceWidescreen.Alpha = 0; spriteManagerInterface.Alpha = 0; spriteManagerAdd.Alpha = 0; spriteManagerBelowHitObjectsWidescreen.Alpha = 0; } base.Draw(); }
protected void loadLocalUserScore(bool showRankingDialog) { score = Player.currentScore; if (score.Pass && !ReplayMode && !ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.Relax) && !ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.Relax2)) { if (BeatmapManager.Current.onlinePersonalScore != null) { //global ranking if (score.TotalScore > BeatmapManager.Current.onlinePersonalScore.TotalScore) { BeatmapManager.Current.PlayerRank = score.Rank; } } else { //local ranking if (BeatmapManager.Current.PlayerRank == Ranks.N) { BeatmapManager.Current.PlayerRank = score.Rank; } else { List <Score> s = ScoreManager.FindScores(BeatmapManager.Current.BeatmapChecksum, score.PlayMode); bool noLocalScores = s == null || s.Count == 0; if (noLocalScores) { if (score.Rank < BeatmapManager.Current.PlayerRank) { BeatmapManager.Current.PlayerRank = score.Rank; } } else if (s.FindAll(sc => sc.TotalScore >= score.TotalScore).Count == 0) { BeatmapManager.Current.PlayerRank = score.Rank; } } } if (showRankingDialog) { rankingDialog = new RankingDialog(this); return; //ranking dialog handles score submission in a different place } ScoreManager.InsertScore(score, false); } }
internal override bool Fail(bool continuousPlay) { //Fails are delayed until the end of the map, unless we are using SuddenDeath. //Although SuddenDeath may be active, we must wait until the player interacts with an object that affects combo. if (firstDonKatu?.IsHit == false || (!hitObjectManager.LastObject.IsHit && !ModManager.CheckActive(CurrentScore.EnabledMods, Mods.SuddenDeath))) { return(false); } bool fail = (CurrentScore.TotalHits > 0 && CurrentScore.TotalSuccessfulHits == 0); fail |= CurrentScore.CurrentHp < 100 && !ModManager.CheckActive(CurrentScore.EnabledMods, Mods.NoFail); //Taiko can't fail (mostly). return(fail && base.Fail(continuousPlay)); }
internal override void InitializeCalculations() { if (HpBar == null) { return; } HpBar.HpDropRate = CalculateHpDropRate(); if (ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.HalfTime)) { HpBar.HpDropRate *= 0.75; } base.InitializeCalculations(); }
internal override void AdjustBackgroundSprite(pSprite backgroundSprite) { if (ModManager.CheckActive(Mods.Cinema)) { return; } if (player.eventManager.backgroundEvent == null || player.eventManager.backgroundEvent.Sprite == null) { return; } pSprite eventSprite = player.eventManager.backgroundEvent.Sprite; backgroundSprite.Position.Y += GameBase.WindowManager.HeightScaled - (GameBase.WindowManager.HeightScaled - (TAIKO_BAR_Y + TAIKO_BAR_HEIGHT + title_height)) / 2f - 240; backgroundSprite.OriginPosition.Y = eventSprite.OriginPosition.Y + 15 * (((float)backgroundSprite.Width / backgroundSprite.Height) / 1.333f); }
private void Explode(HitObject h) { if (ModManager.CheckActive(Mods.Cinema)) { return; } float explosionOffset = OsuMathHelper.Clamp(((HitCircleFruits)h).CatchOffset.X, -catcherWidthHalf + catchMargin * 3, catcherWidthHalf - catchMargin * 3); if (!(h is HitCircleFruitsTick)) { float scale = OsuMathHelper.Clamp(ComboCounter.HitCombo / 200f, 0.35f, 1.125f); pSprite exp1 = new pSprite(TextureManager.Load(@"scoreboard-explosion-2", SkinSource.Osu), Fields.Gamefield, Origins.CentreLeft, Clocks.Game, h.Position, 0.99f, false, h.Colour); exp1.Additive = true; exp1.Rotation = (float)(-Math.PI / 2); exp1.FadeOut(300); exp1.Transformations.Add(new Transformation(TransformationType.VectorScale, new Vector2(1, 0.9f), new Vector2(16 * scale, 1.1f), GameBase.Time, GameBase.Time + 160, EasingTypes.Out)); spriteManagerAdd.Add(exp1); exp1.IsVisible = true; exp1.InitialPosition = new Vector2(explosionOffset, 0); caughtSprites.Add(exp1); } pSprite exp2 = new pSprite(TextureManager.Load(@"scoreboard-explosion-1", SkinSource.Osu), Fields.Gamefield, Origins.CentreLeft, Clocks.Game, h.Position, 1, false, h.Colour); exp2.Rotation = (float)(-Math.PI / 2); spriteManagerAdd.Add(exp2); exp2.Additive = true; exp2.FadeOut(700); exp2.Transformations.Add(new Transformation(TransformationType.VectorScale, new Vector2(0.9f, 1), new Vector2(0.9f, 1.3f), GameBase.Time, GameBase.Time + 500, EasingTypes.Out)); exp2.IsVisible = true; exp2.InitialPosition = new Vector2(explosionOffset, 0); caughtSprites.Add(exp2); }
protected override void LoadMods() { int time = 0; float dep = 0; int x = 360; foreach (Mods m in Enum.GetValues(typeof(Mods))) { if (ModManager.CheckActive(score.EnabledMods | PlayerVs.Match.activeMods, m)) { if (m == Mods.DoubleTime && ModManager.CheckActive(score.EnabledMods, Mods.Nightcore)) { continue; } if (m == Mods.SuddenDeath && ModManager.CheckActive(score.EnabledMods, Mods.Perfect)) { continue; } Transformation t2 = new Transformation(TransformationType.Scale, 2, 1, GameBase.Time + time, GameBase.Time + time + 400); Transformation t3 = new Transformation(TransformationType.Fade, 0, 1, GameBase.Time + time, GameBase.Time + time + 400); t2.Easing = EasingTypes.Out; t3.Easing = EasingTypes.Out; pSprite p = new pSprite(TextureManager.Load(@"selection-mod-" + m.ToString().ToLower()), Fields.TopLeft, Origins.Centre, Clocks.Game, new Vector2(x, 440), 0.92F + dep, true, Color.TransparentWhite); p.Transformations.Add(t2); p.Transformations.Add(t3); spriteManagerWideScrolling.Add(p); time += 500; dep += 0.00001f; x -= 20; } } }
internal override void InitializeCalculations() { TotalHitsPossible = hitObjectManager.hitObjectsCount; baseMovementSpeed = ModManager.CheckActive(CurrentScore.EnabledMods, Mods.HalfTime) ? 0.75f : ModManager.CheckActive(CurrentScore.EnabledMods, Mods.DoubleTime) ? 1.5f : 1; HpBar.HpDropRate = CalculateHpDropRate(); if (ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.HalfTime)) { HpBar.HpDropRate *= 0.75; } InitializeHyperDash(); base.InitializeCalculations(); }
internal override void Draw() { if (!IsInitialized) { return; } hitObjectManager.ManiaStage.Draw(); if (ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.Flashlight)) { spriteManagerFlashlight.Draw(); } if (ScoreMeter != null) { ScoreMeter.Draw(); } }