mirror of
https://github.com/ppy/osu
synced 2025-01-18 20:10:49 +00:00
Now spin in mod; circles spin in
This commit is contained in:
parent
3a0d376645
commit
51d26fb648
@ -17,6 +17,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public override string Description => @"Play with no approach circles and fading circles/sliders.";
|
||||
public override double ScoreMultiplier => 1.06;
|
||||
public override Type[] IncompatibleMods => new[] { typeof(OsuModSpinIn) };
|
||||
private const double fade_in_duration_multiplier = 0.4;
|
||||
private const double fade_out_duration_multiplier = 0.3;
|
||||
|
||||
|
@ -1,35 +1,43 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public class OsuModZoomIn : Mod, IApplicableToDrawableHitObjects
|
||||
public class OsuModSpinIn : Mod, IApplicableToDrawableHitObjects
|
||||
{
|
||||
public override string Name => "Zoom In";
|
||||
public override string ShortenedName => "ZI";
|
||||
public override FontAwesome Icon => FontAwesome.fa_dot_circle_o;
|
||||
public override string Name => "Spin In";
|
||||
public override string ShortenedName => "SI";
|
||||
public override FontAwesome Icon => FontAwesome.fa_rotate_right;
|
||||
public override ModType Type => ModType.Fun;
|
||||
public override string Description => "Circles zoom in. No approach circles.";
|
||||
public override string Description => "Circle spin in. No approach circles.";
|
||||
public override double ScoreMultiplier => 1;
|
||||
public override Type[] IncompatibleMods => new[] { typeof(OsuModHidden) };
|
||||
|
||||
private const int rotate_offset = 360;
|
||||
private const float rotate_starting_width = 2.5f;
|
||||
|
||||
|
||||
public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
|
||||
{
|
||||
foreach (var drawable in drawables)
|
||||
{
|
||||
drawable.ApplyCustomUpdateState += ApplyBounceState;
|
||||
drawable.ApplyCustomUpdateState += ApplyZoomState;
|
||||
}
|
||||
}
|
||||
|
||||
protected void ApplyBounceState(DrawableHitObject drawable, ArmedState state)
|
||||
protected void ApplyZoomState(DrawableHitObject drawable, ArmedState state)
|
||||
{
|
||||
if (!(drawable is DrawableOsuHitObject)) return;
|
||||
if (state != ArmedState.Idle) return;
|
||||
@ -41,15 +49,21 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
switch (drawable)
|
||||
{
|
||||
case DrawableHitCircle circle:
|
||||
foreach (var t in circle.Transforms.Where(t => t.TargetMember == "Alpha"))
|
||||
circle.RemoveTransform(t);
|
||||
// Disable Fade
|
||||
circle.Transforms
|
||||
.Where(t => t.TargetMember == "Alpha")
|
||||
.ForEach(t => circle.RemoveTransform(t));
|
||||
|
||||
using (circle.BeginAbsoluteSequence(appearTime, true))
|
||||
{
|
||||
var origScale = drawable.Scale;
|
||||
var origRotate = circle.Rotation;
|
||||
|
||||
circle
|
||||
.ScaleTo(0)
|
||||
.ScaleTo(origScale, moveDuration, Easing.OutSine)
|
||||
.RotateTo(origRotate+rotate_offset)
|
||||
.RotateTo(origRotate, moveDuration)
|
||||
.ScaleTo(origScale * new Vector2(rotate_starting_width, 0))
|
||||
.ScaleTo(origScale, moveDuration)
|
||||
.FadeTo(1);
|
||||
}
|
||||
|
||||
@ -58,8 +72,10 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
break;
|
||||
|
||||
case DrawableSlider slider:
|
||||
foreach (var t in slider.Transforms.Where(t => t.TargetMember == "Alpha"))
|
||||
slider.RemoveTransform(t);
|
||||
// Disable fade
|
||||
slider.Transforms
|
||||
.Where(t => t.TargetMember == "Alpha")
|
||||
.ForEach(t => slider.RemoveTransform(t));
|
||||
|
||||
using (slider.BeginAbsoluteSequence(appearTime, true))
|
||||
{
|
||||
@ -67,7 +83,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
|
||||
slider
|
||||
.ScaleTo(0)
|
||||
.ScaleTo(origScale, moveDuration, Easing.OutSine)
|
||||
.ScaleTo(origScale, moveDuration)
|
||||
.FadeTo(1);
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ namespace osu.Game.Rulesets.Osu
|
||||
return new Mod[] {
|
||||
new OsuModTransform(),
|
||||
new OsuModWiggle(),
|
||||
new OsuModZoomIn(),
|
||||
new OsuModSpinIn(),
|
||||
};
|
||||
default:
|
||||
return new Mod[] { };
|
||||
|
Loading…
Reference in New Issue
Block a user