mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Merge remote-tracking branch 'upstream/master' into tournament-tools
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
clone_depth: 1
|
clone_depth: 1
|
||||||
version: '{branch}-{build}'
|
version: '{branch}-{build}'
|
||||||
image: Visual Studio 2017
|
image: Previous Visual Studio 2017
|
||||||
test: off
|
test: off
|
||||||
install:
|
install:
|
||||||
- cmd: git submodule update --init --recursive --depth=5
|
- cmd: git submodule update --init --recursive --depth=5
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#addin "nuget:?package=CodeFileSanity&version=0.0.21"
|
#addin "nuget:?package=CodeFileSanity&version=0.0.21"
|
||||||
#addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2018.2.2"
|
#addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2019.1.1"
|
||||||
#tool "nuget:?package=NVika.MSBuild&version=1.0.1"
|
#tool "nuget:?package=NVika.MSBuild&version=1.0.1"
|
||||||
var nVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First();
|
var nVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First();
|
||||||
|
|
||||||
@ -46,7 +46,9 @@ Task("InspectCode")
|
|||||||
OutputFile = "inspectcodereport.xml",
|
OutputFile = "inspectcodereport.xml",
|
||||||
});
|
});
|
||||||
|
|
||||||
StartProcess(nVikaToolPath, @"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors");
|
int returnCode = StartProcess(nVikaToolPath, $@"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors");
|
||||||
|
if (returnCode != 0)
|
||||||
|
throw new Exception($"inspectcode failed with return code {returnCode}");
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("CodeFileSanity")
|
Task("CodeFileSanity")
|
||||||
|
@ -77,6 +77,7 @@ namespace osu.Desktop
|
|||||||
if (versionManager != null)
|
if (versionManager != null)
|
||||||
versionManager.State = Visibility.Visible;
|
versionManager.State = Visibility.Visible;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (versionManager != null)
|
if (versionManager != null)
|
||||||
versionManager.State = Visibility.Hidden;
|
versionManager.State = Visibility.Hidden;
|
||||||
@ -87,6 +88,7 @@ namespace osu.Desktop
|
|||||||
public override void SetHost(GameHost host)
|
public override void SetHost(GameHost host)
|
||||||
{
|
{
|
||||||
base.SetHost(host);
|
base.SetHost(host);
|
||||||
|
|
||||||
if (host.Window is DesktopGameWindow desktopWindow)
|
if (host.Window is DesktopGameWindow desktopWindow)
|
||||||
{
|
{
|
||||||
desktopWindow.CursorState |= CursorState.Hidden;
|
desktopWindow.CursorState |= CursorState.Hidden;
|
||||||
|
@ -95,6 +95,7 @@ namespace osu.Desktop.Overlays
|
|||||||
|
|
||||||
var version = game.Version;
|
var version = game.Version;
|
||||||
var lastVersion = config.Get<string>(OsuSetting.Version);
|
var lastVersion = config.Get<string>(OsuSetting.Version);
|
||||||
|
|
||||||
if (game.IsDeployedBuild && version != lastVersion)
|
if (game.IsDeployedBuild && version != lastVersion)
|
||||||
{
|
{
|
||||||
config.Set(OsuSetting.Version, version);
|
config.Set(OsuSetting.Version, version);
|
||||||
|
@ -32,6 +32,7 @@ namespace osu.Desktop
|
|||||||
var importer = new ArchiveImportIPCChannel(host);
|
var importer = new ArchiveImportIPCChannel(host);
|
||||||
// Restore the cwd so relative paths given at the command line work correctly
|
// Restore the cwd so relative paths given at the command line work correctly
|
||||||
Directory.SetCurrentDirectory(cwd);
|
Directory.SetCurrentDirectory(cwd);
|
||||||
|
|
||||||
foreach (var file in args)
|
foreach (var file in args)
|
||||||
{
|
{
|
||||||
Console.WriteLine(@"Importing {0}", file);
|
Console.WriteLine(@"Importing {0}", file);
|
||||||
@ -46,6 +47,7 @@ namespace osu.Desktop
|
|||||||
default:
|
default:
|
||||||
host.Run(new OsuGameDesktop(args));
|
host.Run(new OsuGameDesktop(args));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "--tournament":
|
case "--tournament":
|
||||||
host.Run(new TournamentGame());
|
host.Run(new TournamentGame());
|
||||||
break;
|
break;
|
||||||
|
@ -78,6 +78,7 @@ namespace osu.Desktop.Updater
|
|||||||
case RuntimeInfo.Platform.Windows:
|
case RuntimeInfo.Platform.Windows:
|
||||||
bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".exe"));
|
bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".exe"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RuntimeInfo.Platform.MacOsx:
|
case RuntimeInfo.Platform.MacOsx:
|
||||||
bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".app.zip"));
|
bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".app.zip"));
|
||||||
break;
|
break;
|
||||||
|
@ -175,7 +175,7 @@ namespace osu.Desktop.Updater
|
|||||||
|
|
||||||
public SquirrelLogger()
|
public SquirrelLogger()
|
||||||
{
|
{
|
||||||
var file = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "SquirrelSetupUpdater.log");
|
var file = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location ?? Directory.GetCurrentDirectory()), "SquirrelSetupUpdater.log");
|
||||||
if (File.Exists(file)) File.Delete(file);
|
if (File.Exists(file)) File.Delete(file);
|
||||||
path = file;
|
path = file;
|
||||||
}
|
}
|
||||||
|
@ -27,9 +27,9 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="System.IO.Packaging" Version="4.5.0" />
|
<PackageReference Include="System.IO.Packaging" Version="4.5.0" />
|
||||||
<PackageReference Include="ppy.squirrel.windows" Version="1.9.0.3" />
|
<PackageReference Include="ppy.squirrel.windows" Version="1.9.0.4" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.3" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.4" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.3" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Resources">
|
<ItemGroup Label="Resources">
|
||||||
<EmbeddedResource Include="lazer.ico" />
|
<EmbeddedResource Include="lazer.ico" />
|
||||||
|
@ -36,11 +36,13 @@ namespace osu.Game.Rulesets.Catch.Tests
|
|||||||
yield return new ConvertValue((CatchHitObject)nested);
|
yield return new ConvertValue((CatchHitObject)nested);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BananaShower shower:
|
case BananaShower shower:
|
||||||
foreach (var nested in shower.NestedHitObjects)
|
foreach (var nested in shower.NestedHitObjects)
|
||||||
yield return new ConvertValue((CatchHitObject)nested);
|
yield return new ConvertValue((CatchHitObject)nested);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
yield return new ConvertValue((CatchHitObject)hitObject);
|
yield return new ConvertValue((CatchHitObject)hitObject);
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
|||||||
|
|
||||||
protected override Player CreatePlayer(Ruleset ruleset)
|
protected override Player CreatePlayer(Ruleset ruleset)
|
||||||
{
|
{
|
||||||
Beatmap.Value.Mods.Value = Beatmap.Value.Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() });
|
Mods.Value = Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() }).ToArray();
|
||||||
return base.CreatePlayer(ruleset);
|
return base.CreatePlayer(ruleset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
|||||||
initialiseHyperDash((List<CatchHitObject>)Beatmap.HitObjects);
|
initialiseHyperDash((List<CatchHitObject>)Beatmap.HitObjects);
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
|
||||||
foreach (var obj in Beatmap.HitObjects.OfType<CatchHitObject>())
|
foreach (var obj in Beatmap.HitObjects.OfType<CatchHitObject>())
|
||||||
{
|
{
|
||||||
obj.IndexInBeatmap = index++;
|
obj.IndexInBeatmap = index++;
|
||||||
@ -58,6 +59,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JuiceStream juiceStream:
|
case JuiceStream juiceStream:
|
||||||
foreach (var nested in juiceStream.NestedHitObjects)
|
foreach (var nested in juiceStream.NestedHitObjects)
|
||||||
{
|
{
|
||||||
@ -103,6 +105,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
|||||||
double timeToNext = nextObject.StartTime - currentObject.StartTime - 1000f / 60f / 4; // 1/4th of a frame of grace time, taken from osu-stable
|
double timeToNext = nextObject.StartTime - currentObject.StartTime - 1000f / 60f / 4; // 1/4th of a frame of grace time, taken from osu-stable
|
||||||
double distanceToNext = Math.Abs(nextObject.X - currentObject.X) - (lastDirection == thisDirection ? lastExcess : halfCatcherWidth);
|
double distanceToNext = Math.Abs(nextObject.X - currentObject.X) - (lastDirection == thisDirection ? lastExcess : halfCatcherWidth);
|
||||||
float distanceToHyper = (float)(timeToNext * CatcherArea.Catcher.BASE_SPEED - distanceToNext);
|
float distanceToHyper = (float)(timeToNext * CatcherArea.Catcher.BASE_SPEED - distanceToNext);
|
||||||
|
|
||||||
if (distanceToHyper < 0)
|
if (distanceToHyper < 0)
|
||||||
{
|
{
|
||||||
currentObject.HyperDashTarget = nextObject;
|
currentObject.HyperDashTarget = nextObject;
|
||||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
{
|
{
|
||||||
public class CatchRuleset : Ruleset
|
public class CatchRuleset : Ruleset
|
||||||
{
|
{
|
||||||
public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap) => new DrawableCatchRuleset(this, beatmap);
|
public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap, IReadOnlyList<Mod> mods) => new DrawableCatchRuleset(this, beatmap, mods);
|
||||||
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new CatchBeatmapConverter(beatmap);
|
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new CatchBeatmapConverter(beatmap);
|
||||||
public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new CatchBeatmapProcessor(beatmap);
|
public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new CatchBeatmapProcessor(beatmap);
|
||||||
|
|
||||||
@ -87,6 +87,7 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
new CatchModNoFail(),
|
new CatchModNoFail(),
|
||||||
new MultiMod(new CatchModHalfTime(), new CatchModDaycore())
|
new MultiMod(new CatchModHalfTime(), new CatchModDaycore())
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.DifficultyIncrease:
|
case ModType.DifficultyIncrease:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
@ -96,17 +97,20 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
new CatchModHidden(),
|
new CatchModHidden(),
|
||||||
new CatchModFlashlight(),
|
new CatchModFlashlight(),
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.Automation:
|
case ModType.Automation:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
new MultiMod(new CatchModAutoplay(), new ModCinema()),
|
new MultiMod(new CatchModAutoplay(), new ModCinema()),
|
||||||
new CatchModRelax(),
|
new CatchModRelax(),
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.Fun:
|
case ModType.Fun:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
new MultiMod(new ModWindUp<CatchHitObject>(), new ModWindDown<CatchHitObject>())
|
new MultiMod(new ModWindUp<CatchHitObject>(), new ModWindDown<CatchHitObject>())
|
||||||
};
|
};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return new Mod[] { };
|
return new Mod[] { };
|
||||||
}
|
}
|
||||||
|
@ -57,32 +57,20 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
|
|
||||||
CatchHitObject lastObject = null;
|
CatchHitObject lastObject = null;
|
||||||
|
|
||||||
foreach (var hitObject in beatmap.HitObjects.OfType<CatchHitObject>())
|
// In 2B beatmaps, it is possible that a normal Fruit is placed in the middle of a JuiceStream.
|
||||||
|
foreach (var hitObject in beatmap.HitObjects
|
||||||
|
.SelectMany(obj => obj is JuiceStream stream ? stream.NestedHitObjects : new[] { obj })
|
||||||
|
.Cast<CatchHitObject>()
|
||||||
|
.OrderBy(x => x.StartTime))
|
||||||
{
|
{
|
||||||
if (lastObject == null)
|
// We want to only consider fruits that contribute to the combo.
|
||||||
{
|
if (hitObject is BananaShower || hitObject is TinyDroplet)
|
||||||
lastObject = hitObject;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
switch (hitObject)
|
if (lastObject != null)
|
||||||
{
|
yield return new CatchDifficultyHitObject(hitObject, lastObject, clockRate, halfCatchWidth);
|
||||||
// We want to only consider fruits that contribute to the combo. Droplets are addressed as accuracy and spinners are not relevant for "skill" calculations.
|
|
||||||
case Fruit fruit:
|
|
||||||
yield return new CatchDifficultyHitObject(fruit, lastObject, clockRate, halfCatchWidth);
|
|
||||||
|
|
||||||
lastObject = hitObject;
|
lastObject = hitObject;
|
||||||
break;
|
|
||||||
case JuiceStream _:
|
|
||||||
foreach (var nested in hitObject.NestedHitObjects.OfType<CatchHitObject>().Where(o => !(o is TinyDroplet)))
|
|
||||||
{
|
|
||||||
yield return new CatchDifficultyHitObject(nested, lastObject, clockRate, halfCatchWidth);
|
|
||||||
|
|
||||||
lastObject = nested;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case HitResult.Perfect:
|
case HitResult.Perfect:
|
||||||
return 1100;
|
return 1100;
|
||||||
}
|
}
|
||||||
@ -27,8 +28,9 @@ namespace osu.Game.Rulesets.Catch.Judgements
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case HitResult.Perfect:
|
case HitResult.Perfect:
|
||||||
return 8;
|
return 0.008;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case HitResult.Perfect:
|
case HitResult.Perfect:
|
||||||
return 30;
|
return 30;
|
||||||
}
|
}
|
||||||
@ -23,9 +24,10 @@ namespace osu.Game.Rulesets.Catch.Judgements
|
|||||||
switch (result)
|
switch (result)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return 0;
|
return base.HealthIncreaseFor(result);
|
||||||
|
|
||||||
case HitResult.Perfect:
|
case HitResult.Perfect:
|
||||||
return 7;
|
return 0.007;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case HitResult.Perfect:
|
case HitResult.Perfect:
|
||||||
return 300;
|
return 300;
|
||||||
}
|
}
|
||||||
@ -27,9 +28,10 @@ namespace osu.Game.Rulesets.Catch.Judgements
|
|||||||
switch (result)
|
switch (result)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return 0;
|
return -0.02;
|
||||||
|
|
||||||
case HitResult.Perfect:
|
case HitResult.Perfect:
|
||||||
return 10.2;
|
return 0.01;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case HitResult.Perfect:
|
case HitResult.Perfect:
|
||||||
return 10;
|
return 10;
|
||||||
}
|
}
|
||||||
@ -26,8 +27,9 @@ namespace osu.Game.Rulesets.Catch.Judgements
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case HitResult.Perfect:
|
case HitResult.Perfect:
|
||||||
return 4;
|
return 0.004;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
case ArmedState.Miss:
|
case ArmedState.Miss:
|
||||||
this.FadeOut(250).RotateTo(Rotation * 2, 250, Easing.Out).Expire();
|
this.FadeOut(250).RotateTo(Rotation * 2, 250, Easing.Out).Expire();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ArmedState.Hit:
|
case ArmedState.Hit:
|
||||||
this.FadeOut().Expire();
|
this.FadeOut().Expire();
|
||||||
break;
|
break;
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
||||||
@ -105,6 +106,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return new Container();
|
return new Container();
|
||||||
|
|
||||||
case FruitVisualRepresentation.Raspberry:
|
case FruitVisualRepresentation.Raspberry:
|
||||||
return new Container
|
return new Container
|
||||||
{
|
{
|
||||||
@ -143,6 +145,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
case FruitVisualRepresentation.Pineapple:
|
case FruitVisualRepresentation.Pineapple:
|
||||||
return new Container
|
return new Container
|
||||||
{
|
{
|
||||||
@ -181,6 +184,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
case FruitVisualRepresentation.Pear:
|
case FruitVisualRepresentation.Pear:
|
||||||
return new Container
|
return new Container
|
||||||
{
|
{
|
||||||
@ -213,6 +217,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
case FruitVisualRepresentation.Grape:
|
case FruitVisualRepresentation.Grape:
|
||||||
return new Container
|
return new Container
|
||||||
{
|
{
|
||||||
@ -245,6 +250,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
case FruitVisualRepresentation.Banana:
|
case FruitVisualRepresentation.Banana:
|
||||||
return new Container
|
return new Container
|
||||||
{
|
{
|
||||||
@ -282,19 +288,25 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
default:
|
default:
|
||||||
case FruitVisualRepresentation.Pear:
|
case FruitVisualRepresentation.Pear:
|
||||||
return new Color4(17, 136, 170, 255);
|
return new Color4(17, 136, 170, 255);
|
||||||
|
|
||||||
case FruitVisualRepresentation.Grape:
|
case FruitVisualRepresentation.Grape:
|
||||||
return new Color4(204, 102, 0, 255);
|
return new Color4(204, 102, 0, 255);
|
||||||
|
|
||||||
case FruitVisualRepresentation.Raspberry:
|
case FruitVisualRepresentation.Raspberry:
|
||||||
return new Color4(121, 9, 13, 255);
|
return new Color4(121, 9, 13, 255);
|
||||||
|
|
||||||
case FruitVisualRepresentation.Pineapple:
|
case FruitVisualRepresentation.Pineapple:
|
||||||
return new Color4(102, 136, 0, 255);
|
return new Color4(102, 136, 0, 255);
|
||||||
|
|
||||||
case FruitVisualRepresentation.Banana:
|
case FruitVisualRepresentation.Banana:
|
||||||
switch (RNG.Next(0, 3))
|
switch (RNG.Next(0, 3))
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return new Color4(255, 240, 0, 255);
|
return new Color4(255, 240, 0, 255);
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
return new Color4(255, 192, 0, 255);
|
return new Color4(255, 192, 0, 255);
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
return new Color4(214, 221, 28, 255);
|
return new Color4(214, 221, 28, 255);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
@ -95,6 +95,7 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
X = X + Path.PositionAt(e.PathProgress).X / CatchPlayfield.BASE_WIDTH,
|
X = X + Path.PositionAt(e.PathProgress).X / CatchPlayfield.BASE_WIDTH,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SliderEventType.Head:
|
case SliderEventType.Head:
|
||||||
case SliderEventType.Tail:
|
case SliderEventType.Tail:
|
||||||
case SliderEventType.Repeat:
|
case SliderEventType.Repeat:
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
@ -27,20 +26,16 @@ namespace osu.Game.Rulesets.Catch.Scoring
|
|||||||
hpDrainRate = beatmap.BeatmapInfo.BaseDifficulty.DrainRate;
|
hpDrainRate = beatmap.BeatmapInfo.BaseDifficulty.DrainRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
private const double harshness = 0.01;
|
protected override double HealthAdjustmentFactorFor(JudgementResult result)
|
||||||
|
|
||||||
protected override void ApplyResult(JudgementResult result)
|
|
||||||
{
|
{
|
||||||
base.ApplyResult(result);
|
switch (result.Type)
|
||||||
|
|
||||||
if (result.Type == HitResult.Miss)
|
|
||||||
{
|
{
|
||||||
if (!result.Judgement.IsBonus)
|
case HitResult.Miss:
|
||||||
Health.Value -= hpDrainRate * (harshness * 2);
|
return hpDrainRate;
|
||||||
return;
|
|
||||||
|
default:
|
||||||
|
return 10.2 - hpDrainRate; // Award less HP as drain rate is increased
|
||||||
}
|
}
|
||||||
|
|
||||||
Health.Value += Math.Max(result.Judgement.HealthIncreaseFor(result) - hpDrainRate, 0) * harshness;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override HitWindows CreateHitWindows() => new CatchHitWindows();
|
public override HitWindows CreateHitWindows() => new CatchHitWindows();
|
||||||
|
@ -292,6 +292,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
const float hyper_dash_transition_length = 180;
|
const float hyper_dash_transition_length = 180;
|
||||||
|
|
||||||
bool previouslyHyperDashing = HyperDashing;
|
bool previouslyHyperDashing = HyperDashing;
|
||||||
|
|
||||||
if (modifier <= 1 || X == targetPosition)
|
if (modifier <= 1 || X == targetPosition)
|
||||||
{
|
{
|
||||||
hyperDashModifier = 1;
|
hyperDashModifier = 1;
|
||||||
@ -325,9 +326,11 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
case CatchAction.MoveLeft:
|
case CatchAction.MoveLeft:
|
||||||
currentDirection--;
|
currentDirection--;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case CatchAction.MoveRight:
|
case CatchAction.MoveRight:
|
||||||
currentDirection++;
|
currentDirection++;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case CatchAction.Dash:
|
case CatchAction.Dash:
|
||||||
Dashing = true;
|
Dashing = true;
|
||||||
return true;
|
return true;
|
||||||
@ -343,9 +346,11 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
case CatchAction.MoveLeft:
|
case CatchAction.MoveLeft:
|
||||||
currentDirection++;
|
currentDirection++;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case CatchAction.MoveRight:
|
case CatchAction.MoveRight:
|
||||||
currentDirection--;
|
currentDirection--;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case CatchAction.Dash:
|
case CatchAction.Dash:
|
||||||
Dashing = false;
|
Dashing = false;
|
||||||
return true;
|
return true;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
@ -10,6 +11,7 @@ using osu.Game.Rulesets.Catch.Objects;
|
|||||||
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
||||||
using osu.Game.Rulesets.Catch.Replays;
|
using osu.Game.Rulesets.Catch.Replays;
|
||||||
using osu.Game.Rulesets.Catch.Scoring;
|
using osu.Game.Rulesets.Catch.Scoring;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
@ -23,8 +25,8 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
protected override bool UserScrollSpeedAdjustment => false;
|
protected override bool UserScrollSpeedAdjustment => false;
|
||||||
|
|
||||||
public DrawableCatchRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
public DrawableCatchRuleset(Ruleset ruleset, WorkingBeatmap beatmap, IReadOnlyList<Mod> mods)
|
||||||
: base(ruleset, beatmap)
|
: base(ruleset, beatmap, mods)
|
||||||
{
|
{
|
||||||
Direction.Value = ScrollingDirection.Down;
|
Direction.Value = ScrollingDirection.Down;
|
||||||
TimeRange.Value = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.ApproachRate, 1800, 1200, 450);
|
TimeRange.Value = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.ApproachRate, 1800, 1200, 450);
|
||||||
@ -46,14 +48,19 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
{
|
{
|
||||||
case Banana banana:
|
case Banana banana:
|
||||||
return new DrawableBanana(banana);
|
return new DrawableBanana(banana);
|
||||||
|
|
||||||
case Fruit fruit:
|
case Fruit fruit:
|
||||||
return new DrawableFruit(fruit);
|
return new DrawableFruit(fruit);
|
||||||
|
|
||||||
case JuiceStream stream:
|
case JuiceStream stream:
|
||||||
return new DrawableJuiceStream(stream, CreateDrawableRepresentation);
|
return new DrawableJuiceStream(stream, CreateDrawableRepresentation);
|
||||||
|
|
||||||
case BananaShower shower:
|
case BananaShower shower:
|
||||||
return new DrawableBananaShower(shower, CreateDrawableRepresentation);
|
return new DrawableBananaShower(shower, CreateDrawableRepresentation);
|
||||||
|
|
||||||
case TinyDroplet tiny:
|
case TinyDroplet tiny:
|
||||||
return new DrawableTinyDroplet(tiny);
|
return new DrawableTinyDroplet(tiny);
|
||||||
|
|
||||||
case Droplet droplet:
|
case Droplet droplet:
|
||||||
return new DrawableDroplet(droplet);
|
return new DrawableDroplet(droplet);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -8,6 +10,7 @@ using osu.Framework.Timing;
|
|||||||
using osu.Game.Rulesets.Mania.Edit;
|
using osu.Game.Rulesets.Mania.Edit;
|
||||||
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Mania.UI;
|
using osu.Game.Rulesets.Mania.UI;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
using osu.Game.Tests.Visual;
|
using osu.Game.Tests.Visual;
|
||||||
@ -21,6 +24,9 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
{
|
{
|
||||||
private readonly Column column;
|
private readonly Column column;
|
||||||
|
|
||||||
|
[Cached(typeof(IReadOnlyList<Mod>))]
|
||||||
|
private IReadOnlyList<Mod> mods { get; set; } = Array.Empty<Mod>();
|
||||||
|
|
||||||
protected ManiaPlacementBlueprintTestCase()
|
protected ManiaPlacementBlueprintTestCase()
|
||||||
{
|
{
|
||||||
Add(column = new Column(0)
|
Add(column = new Column(0)
|
||||||
|
@ -13,6 +13,7 @@ using osu.Game.Rulesets.Mania.Objects;
|
|||||||
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Mania.UI;
|
using osu.Game.Rulesets.Mania.UI;
|
||||||
using osu.Game.Rulesets.Mania.UI.Components;
|
using osu.Game.Rulesets.Mania.UI.Components;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
using osu.Game.Tests.Visual;
|
using osu.Game.Tests.Visual;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -31,6 +32,9 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
typeof(ColumnHitObjectArea)
|
typeof(ColumnHitObjectArea)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[Cached(typeof(IReadOnlyList<Mod>))]
|
||||||
|
private IReadOnlyList<Mod> mods { get; set; } = Array.Empty<Mod>();
|
||||||
|
|
||||||
private readonly List<Column> columns = new List<Column>();
|
private readonly List<Column> columns = new List<Column>();
|
||||||
|
|
||||||
public TestCaseColumn()
|
public TestCaseColumn()
|
||||||
|
@ -168,11 +168,13 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
foreach (var nested in obj.NestedHitObjects)
|
foreach (var nested in obj.NestedHitObjects)
|
||||||
{
|
{
|
||||||
double finalPosition = (nested.HitObject.StartTime - obj.HitObject.StartTime) / endTime.Duration;
|
double finalPosition = (nested.HitObject.StartTime - obj.HitObject.StartTime) / endTime.Duration;
|
||||||
|
|
||||||
switch (direction)
|
switch (direction)
|
||||||
{
|
{
|
||||||
case ScrollingDirection.Up:
|
case ScrollingDirection.Up:
|
||||||
nested.Y = (float)(finalPosition * content.DrawHeight);
|
nested.Y = (float)(finalPosition * content.DrawHeight);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ScrollingDirection.Down:
|
case ScrollingDirection.Down:
|
||||||
nested.Y = (float)(-finalPosition * content.DrawHeight);
|
nested.Y = (float)(-finalPosition * content.DrawHeight);
|
||||||
break;
|
break;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
@ -13,6 +14,7 @@ using osu.Game.Rulesets.Mania.Beatmaps;
|
|||||||
using osu.Game.Rulesets.Mania.Objects;
|
using osu.Game.Rulesets.Mania.Objects;
|
||||||
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Mania.UI;
|
using osu.Game.Rulesets.Mania.UI;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
using osu.Game.Tests.Visual;
|
using osu.Game.Tests.Visual;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -24,6 +26,9 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
{
|
{
|
||||||
private const int columns = 4;
|
private const int columns = 4;
|
||||||
|
|
||||||
|
[Cached(typeof(IReadOnlyList<Mod>))]
|
||||||
|
private IReadOnlyList<Mod> mods { get; set; } = Array.Empty<Mod>();
|
||||||
|
|
||||||
private readonly List<ManiaStage> stages = new List<ManiaStage>();
|
private readonly List<ManiaStage> stages = new List<ManiaStage>();
|
||||||
|
|
||||||
private FillFlowContainer<ScrollingTestContainer> fill;
|
private FillFlowContainer<ScrollingTestContainer> fill;
|
||||||
|
@ -48,6 +48,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
|
|||||||
if (IsForCurrentRuleset)
|
if (IsForCurrentRuleset)
|
||||||
{
|
{
|
||||||
TargetColumns = (int)Math.Max(1, roundedCircleSize);
|
TargetColumns = (int)Math.Max(1, roundedCircleSize);
|
||||||
|
|
||||||
if (TargetColumns >= 10)
|
if (TargetColumns >= 10)
|
||||||
{
|
{
|
||||||
TargetColumns = TargetColumns / 2;
|
TargetColumns = TargetColumns / 2;
|
||||||
|
@ -179,6 +179,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
|
|
||||||
int usableColumns = TotalColumns - RandomStart - PreviousPattern.ColumnWithObjects;
|
int usableColumns = TotalColumns - RandomStart - PreviousPattern.ColumnWithObjects;
|
||||||
int nextColumn = GetRandomColumn();
|
int nextColumn = GetRandomColumn();
|
||||||
|
|
||||||
for (int i = 0; i < Math.Min(usableColumns, noteCount); i++)
|
for (int i = 0; i < Math.Min(usableColumns, noteCount); i++)
|
||||||
{
|
{
|
||||||
// Find available column
|
// Find available column
|
||||||
@ -217,6 +218,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
nextColumn = FindAvailableColumn(nextColumn, PreviousPattern);
|
nextColumn = FindAvailableColumn(nextColumn, PreviousPattern);
|
||||||
|
|
||||||
int lastColumn = nextColumn;
|
int lastColumn = nextColumn;
|
||||||
|
|
||||||
for (int i = 0; i < noteCount; i++)
|
for (int i = 0; i < noteCount; i++)
|
||||||
{
|
{
|
||||||
addToPattern(pattern, nextColumn, startTime, startTime);
|
addToPattern(pattern, nextColumn, startTime, startTime);
|
||||||
@ -299,6 +301,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
int interval = Random.Next(1, TotalColumns - (legacy ? 1 : 0));
|
int interval = Random.Next(1, TotalColumns - (legacy ? 1 : 0));
|
||||||
|
|
||||||
int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true);
|
int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true);
|
||||||
|
|
||||||
for (int i = 0; i <= spanCount; i++)
|
for (int i = 0; i <= spanCount; i++)
|
||||||
{
|
{
|
||||||
addToPattern(pattern, nextColumn, startTime, startTime);
|
addToPattern(pattern, nextColumn, startTime, startTime);
|
||||||
@ -341,16 +344,19 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
p3 = 0;
|
p3 = 0;
|
||||||
p4 = 0;
|
p4 = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
p2 = Math.Min(p2, 0.1);
|
p2 = Math.Min(p2, 0.1);
|
||||||
p3 = 0;
|
p3 = 0;
|
||||||
p4 = 0;
|
p4 = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
p2 = Math.Min(p2, 0.3);
|
p2 = Math.Min(p2, 0.3);
|
||||||
p3 = Math.Min(p3, 0.04);
|
p3 = Math.Min(p3, 0.04);
|
||||||
p4 = 0;
|
p4 = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
p2 = Math.Min(p2, 0.34);
|
p2 = Math.Min(p2, 0.34);
|
||||||
p3 = Math.Min(p3, 0.1);
|
p3 = Math.Min(p3, 0.1);
|
||||||
@ -440,6 +446,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
bool ignoreHead = !sampleInfoListAt(startTime).Any(s => s.Name == SampleInfo.HIT_WHISTLE || s.Name == SampleInfo.HIT_FINISH || s.Name == SampleInfo.HIT_CLAP);
|
bool ignoreHead = !sampleInfoListAt(startTime).Any(s => s.Name == SampleInfo.HIT_WHISTLE || s.Name == SampleInfo.HIT_FINISH || s.Name == SampleInfo.HIT_CLAP);
|
||||||
|
|
||||||
var rowPattern = new Pattern();
|
var rowPattern = new Pattern();
|
||||||
|
|
||||||
for (int i = 0; i <= spanCount; i++)
|
for (int i = 0; i <= spanCount; i++)
|
||||||
{
|
{
|
||||||
if (!(ignoreHead && startTime == HitObject.StartTime))
|
if (!(ignoreHead && startTime == HitObject.StartTime))
|
||||||
|
@ -38,9 +38,11 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
case 8 when HitObject.Samples.Any(s => s.Name == SampleInfo.HIT_FINISH) && endTime - HitObject.StartTime < 1000:
|
case 8 when HitObject.Samples.Any(s => s.Name == SampleInfo.HIT_FINISH) && endTime - HitObject.StartTime < 1000:
|
||||||
addToPattern(pattern, 0, generateHold);
|
addToPattern(pattern, 0, generateHold);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
addToPattern(pattern, FindAvailableColumn(GetRandomColumn(), PreviousPattern), generateHold);
|
addToPattern(pattern, FindAvailableColumn(GetRandomColumn(), PreviousPattern), generateHold);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (TotalColumns > 0)
|
if (TotalColumns > 0)
|
||||||
addToPattern(pattern, GetRandomColumn(), generateHold);
|
addToPattern(pattern, GetRandomColumn(), generateHold);
|
||||||
|
@ -233,6 +233,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
noteCount = Math.Min(noteCount, TotalColumns - RandomStart - PreviousPattern.ColumnWithObjects);
|
noteCount = Math.Min(noteCount, TotalColumns - RandomStart - PreviousPattern.ColumnWithObjects);
|
||||||
|
|
||||||
int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true);
|
int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true);
|
||||||
|
|
||||||
for (int i = 0; i < noteCount; i++)
|
for (int i = 0; i < noteCount; i++)
|
||||||
{
|
{
|
||||||
nextColumn = allowStacking
|
nextColumn = allowStacking
|
||||||
@ -303,6 +304,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
|
|
||||||
int columnLimit = (TotalColumns % 2 == 0 ? TotalColumns : TotalColumns - 1) / 2;
|
int columnLimit = (TotalColumns % 2 == 0 ? TotalColumns : TotalColumns - 1) / 2;
|
||||||
int nextColumn = GetRandomColumn(upperBound: columnLimit);
|
int nextColumn = GetRandomColumn(upperBound: columnLimit);
|
||||||
|
|
||||||
for (int i = 0; i < noteCount; i++)
|
for (int i = 0; i < noteCount; i++)
|
||||||
{
|
{
|
||||||
nextColumn = FindAvailableColumn(nextColumn, upperBound: columnLimit, patterns: pattern);
|
nextColumn = FindAvailableColumn(nextColumn, upperBound: columnLimit, patterns: pattern);
|
||||||
@ -340,18 +342,21 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
p4 = 0;
|
p4 = 0;
|
||||||
p5 = 0;
|
p5 = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
p2 = Math.Min(p2, 0.1);
|
p2 = Math.Min(p2, 0.1);
|
||||||
p3 = 0;
|
p3 = 0;
|
||||||
p4 = 0;
|
p4 = 0;
|
||||||
p5 = 0;
|
p5 = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
p2 = Math.Min(p2, 0.23);
|
p2 = Math.Min(p2, 0.23);
|
||||||
p3 = Math.Min(p3, 0.04);
|
p3 = Math.Min(p3, 0.04);
|
||||||
p4 = 0;
|
p4 = 0;
|
||||||
p5 = 0;
|
p5 = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
p3 = Math.Min(p3, 0.15);
|
p3 = Math.Min(p3, 0.15);
|
||||||
p4 = Math.Min(p4, 0.03);
|
p4 = Math.Min(p4, 0.03);
|
||||||
@ -384,20 +389,24 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
p2 = 0;
|
p2 = 0;
|
||||||
p3 = 0;
|
p3 = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
centreProbability = Math.Min(centreProbability, 0.03);
|
centreProbability = Math.Min(centreProbability, 0.03);
|
||||||
p2 = 0;
|
p2 = 0;
|
||||||
p3 = 0;
|
p3 = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
centreProbability = 0;
|
centreProbability = 0;
|
||||||
p2 = Math.Min(p2 * 2, 0.2);
|
p2 = Math.Min(p2 * 2, 0.2);
|
||||||
p3 = 0;
|
p3 = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
centreProbability = Math.Min(centreProbability, 0.03);
|
centreProbability = Math.Min(centreProbability, 0.03);
|
||||||
p3 = 0;
|
p3 = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
centreProbability = 0;
|
centreProbability = 0;
|
||||||
p2 = Math.Min(p2 * 2, 0.5);
|
p2 = Math.Min(p2 * 2, 0.5);
|
||||||
|
@ -158,6 +158,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
|
|
||||||
// Ensure that we have at least one free column, so that an endless loop is avoided
|
// Ensure that we have at least one free column, so that an endless loop is avoided
|
||||||
bool hasValidColumns = false;
|
bool hasValidColumns = false;
|
||||||
|
|
||||||
for (int i = lowerBound.Value; i < upperBound.Value; i++)
|
for (int i = lowerBound.Value; i < upperBound.Value; i++)
|
||||||
{
|
{
|
||||||
hasValidColumns = isValid(i);
|
hasValidColumns = isValid(i);
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Mania.UI;
|
using osu.Game.Rulesets.Mania.UI;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
|
|
||||||
@ -14,8 +16,8 @@ namespace osu.Game.Rulesets.Mania.Edit
|
|||||||
{
|
{
|
||||||
public new IScrollingInfo ScrollingInfo => base.ScrollingInfo;
|
public new IScrollingInfo ScrollingInfo => base.ScrollingInfo;
|
||||||
|
|
||||||
public DrawableManiaEditRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
public DrawableManiaEditRuleset(Ruleset ruleset, WorkingBeatmap beatmap, IReadOnlyList<Mod> mods)
|
||||||
: base(ruleset, beatmap)
|
: base(ruleset, beatmap, mods)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ using System.Collections.Generic;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Game.Rulesets.Mania.Edit.Blueprints;
|
using osu.Game.Rulesets.Mania.Edit.Blueprints;
|
||||||
using osu.Game.Rulesets.Mania.UI;
|
using osu.Game.Rulesets.Mania.UI;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osu.Game.Screens.Edit.Compose.Components;
|
using osu.Game.Screens.Edit.Compose.Components;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -41,9 +42,9 @@ namespace osu.Game.Rulesets.Mania.Edit
|
|||||||
|
|
||||||
public int TotalColumns => ((ManiaPlayfield)DrawableRuleset.Playfield).TotalColumns;
|
public int TotalColumns => ((ManiaPlayfield)DrawableRuleset.Playfield).TotalColumns;
|
||||||
|
|
||||||
protected override DrawableRuleset<ManiaHitObject> CreateDrawableRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
protected override DrawableRuleset<ManiaHitObject> CreateDrawableRuleset(Ruleset ruleset, WorkingBeatmap beatmap, IReadOnlyList<Mod> mods)
|
||||||
{
|
{
|
||||||
DrawableRuleset = new DrawableManiaEditRuleset(ruleset, beatmap);
|
DrawableRuleset = new DrawableManiaEditRuleset(ruleset, beatmap, mods);
|
||||||
|
|
||||||
// This is the earliest we can cache the scrolling info to ourselves, before masks are added to the hierarchy and inject it
|
// This is the earliest we can cache the scrolling info to ourselves, before masks are added to the hierarchy and inject it
|
||||||
dependencies.CacheAs(DrawableRuleset.ScrollingInfo);
|
dependencies.CacheAs(DrawableRuleset.ScrollingInfo);
|
||||||
@ -65,6 +66,7 @@ namespace osu.Game.Rulesets.Mania.Edit
|
|||||||
{
|
{
|
||||||
case DrawableNote note:
|
case DrawableNote note:
|
||||||
return new NoteSelectionBlueprint(note);
|
return new NoteSelectionBlueprint(note);
|
||||||
|
|
||||||
case DrawableHoldNote holdNote:
|
case DrawableHoldNote holdNote:
|
||||||
return new HoldNoteSelectionBlueprint(holdNote);
|
return new HoldNoteSelectionBlueprint(holdNote);
|
||||||
}
|
}
|
||||||
|
@ -10,5 +10,17 @@ namespace osu.Game.Rulesets.Mania.Judgements
|
|||||||
public override bool AffectsCombo => false;
|
public override bool AffectsCombo => false;
|
||||||
|
|
||||||
protected override int NumericResultFor(HitResult result) => 20;
|
protected override int NumericResultFor(HitResult result) => 20;
|
||||||
|
|
||||||
|
protected override double HealthIncreaseFor(HitResult result)
|
||||||
|
{
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
case HitResult.Miss:
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 0.040;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,16 +14,47 @@ namespace osu.Game.Rulesets.Mania.Judgements
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case HitResult.Meh:
|
case HitResult.Meh:
|
||||||
return 50;
|
return 50;
|
||||||
|
|
||||||
case HitResult.Ok:
|
case HitResult.Ok:
|
||||||
return 100;
|
return 100;
|
||||||
|
|
||||||
case HitResult.Good:
|
case HitResult.Good:
|
||||||
return 200;
|
return 200;
|
||||||
|
|
||||||
case HitResult.Great:
|
case HitResult.Great:
|
||||||
case HitResult.Perfect:
|
case HitResult.Perfect:
|
||||||
return 300;
|
return 300;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override double HealthIncreaseFor(HitResult result)
|
||||||
|
{
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
case HitResult.Miss:
|
||||||
|
return -0.125;
|
||||||
|
|
||||||
|
case HitResult.Meh:
|
||||||
|
return 0.005;
|
||||||
|
|
||||||
|
case HitResult.Ok:
|
||||||
|
return 0.010;
|
||||||
|
|
||||||
|
case HitResult.Good:
|
||||||
|
return 0.035;
|
||||||
|
|
||||||
|
case HitResult.Great:
|
||||||
|
return 0.055;
|
||||||
|
|
||||||
|
case HitResult.Perfect:
|
||||||
|
return 0.065;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
{
|
{
|
||||||
public class ManiaRuleset : Ruleset
|
public class ManiaRuleset : Ruleset
|
||||||
{
|
{
|
||||||
public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap) => new DrawableManiaRuleset(this, beatmap);
|
public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap, IReadOnlyList<Mod> mods) => new DrawableManiaRuleset(this, beatmap, mods);
|
||||||
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new ManiaBeatmapConverter(beatmap);
|
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new ManiaBeatmapConverter(beatmap);
|
||||||
public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo score) => new ManiaPerformanceCalculator(this, beatmap, score);
|
public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo score) => new ManiaPerformanceCalculator(this, beatmap, score);
|
||||||
|
|
||||||
@ -117,6 +117,7 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
new ManiaModNoFail(),
|
new ManiaModNoFail(),
|
||||||
new MultiMod(new ManiaModHalfTime(), new ManiaModDaycore()),
|
new MultiMod(new ManiaModHalfTime(), new ManiaModDaycore()),
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.DifficultyIncrease:
|
case ModType.DifficultyIncrease:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
@ -126,6 +127,7 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
new MultiMod(new ManiaModFadeIn(), new ManiaModHidden()),
|
new MultiMod(new ManiaModFadeIn(), new ManiaModHidden()),
|
||||||
new ManiaModFlashlight(),
|
new ManiaModFlashlight(),
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.Conversion:
|
case ModType.Conversion:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
@ -142,16 +144,19 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
new ManiaModDualStages(),
|
new ManiaModDualStages(),
|
||||||
new ManiaModMirror(),
|
new ManiaModMirror(),
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.Automation:
|
case ModType.Automation:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
new MultiMod(new ManiaModAutoplay(), new ModCinema()),
|
new MultiMod(new ManiaModAutoplay(), new ModCinema()),
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.Fun:
|
case ModType.Fun:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
new MultiMod(new ModWindUp<ManiaHitObject>(), new ModWindDown<ManiaHitObject>())
|
new MultiMod(new ModWindUp<ManiaHitObject>(), new ModWindDown<ManiaHitObject>())
|
||||||
};
|
};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return new Mod[] { };
|
return new Mod[] { };
|
||||||
}
|
}
|
||||||
@ -214,6 +219,7 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
SpecialAction = ManiaAction.Special1,
|
SpecialAction = ManiaAction.Special1,
|
||||||
NormalActionStart = ManiaAction.Key1,
|
NormalActionStart = ManiaAction.Key1,
|
||||||
}.GenerateKeyBindingsFor(variant, out _);
|
}.GenerateKeyBindingsFor(variant, out _);
|
||||||
|
|
||||||
case PlayfieldType.Dual:
|
case PlayfieldType.Dual:
|
||||||
int keys = getDualStageKeyCount(variant);
|
int keys = getDualStageKeyCount(variant);
|
||||||
|
|
||||||
@ -271,6 +277,7 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return $"{variant}K";
|
return $"{variant}K";
|
||||||
|
|
||||||
case PlayfieldType.Dual:
|
case PlayfieldType.Dual:
|
||||||
{
|
{
|
||||||
var keys = getDualStageKeyCount(variant);
|
var keys = getDualStageKeyCount(variant);
|
||||||
|
@ -7,6 +7,7 @@ using osuTK.Graphics;
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
case ArmedState.Miss:
|
case ArmedState.Miss:
|
||||||
this.FadeOut(150, Easing.In).Expire();
|
this.FadeOut(150, Easing.In).Expire();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ArmedState.Hit:
|
case ArmedState.Hit:
|
||||||
this.FadeOut(150, Easing.OutQuint).Expire();
|
this.FadeOut(150, Easing.OutQuint).Expire();
|
||||||
break;
|
break;
|
||||||
|
@ -5,7 +5,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces;
|
using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
@ -7,6 +7,7 @@ using osuTK.Graphics;
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
@ -144,6 +145,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
|
|||||||
const float animation_length = 50;
|
const float animation_length = 50;
|
||||||
|
|
||||||
Foreground.ClearTransforms(false, nameof(Foreground.Colour));
|
Foreground.ClearTransforms(false, nameof(Foreground.Colour));
|
||||||
|
|
||||||
if (hitting)
|
if (hitting)
|
||||||
{
|
{
|
||||||
// wait for the next sync point
|
// wait for the next sync point
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
@ -28,6 +28,7 @@ namespace osu.Game.Rulesets.Mania.Replays
|
|||||||
var normalAction = ManiaAction.Key1;
|
var normalAction = ManiaAction.Key1;
|
||||||
var specialAction = ManiaAction.Special1;
|
var specialAction = ManiaAction.Special1;
|
||||||
int totalCounter = 0;
|
int totalCounter = 0;
|
||||||
|
|
||||||
foreach (var stage in Beatmap.Stages)
|
foreach (var stage in Beatmap.Stages)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < stage.Columns; i++)
|
for (int i = 0; i < stage.Columns; i++)
|
||||||
@ -51,6 +52,7 @@ namespace osu.Game.Rulesets.Mania.Replays
|
|||||||
var pointGroups = generateActionPoints().GroupBy(a => a.Time).OrderBy(g => g.First().Time);
|
var pointGroups = generateActionPoints().GroupBy(a => a.Time).OrderBy(g => g.First().Time);
|
||||||
|
|
||||||
var actions = new List<ManiaAction>();
|
var actions = new List<ManiaAction>();
|
||||||
|
|
||||||
foreach (var group in pointGroups)
|
foreach (var group in pointGroups)
|
||||||
{
|
{
|
||||||
foreach (var point in group)
|
foreach (var point in group)
|
||||||
@ -60,6 +62,7 @@ namespace osu.Game.Rulesets.Mania.Replays
|
|||||||
case HitPoint _:
|
case HitPoint _:
|
||||||
actions.Add(columnActions[point.Column]);
|
actions.Add(columnActions[point.Column]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ReleasePoint _:
|
case ReleasePoint _:
|
||||||
actions.Remove(columnActions[point.Column]);
|
actions.Remove(columnActions[point.Column]);
|
||||||
break;
|
break;
|
||||||
|
@ -39,6 +39,7 @@ namespace osu.Game.Rulesets.Mania.Replays
|
|||||||
|
|
||||||
int activeColumns = (int)(legacyFrame.MouseX ?? 0);
|
int activeColumns = (int)(legacyFrame.MouseX ?? 0);
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
|
|
||||||
while (activeColumns > 0)
|
while (activeColumns > 0)
|
||||||
{
|
{
|
||||||
var isSpecial = stage.IsSpecialColumn(counter);
|
var isSpecial = stage.IsSpecialColumn(counter);
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Mania.Judgements;
|
|
||||||
using osu.Game.Rulesets.Mania.Objects;
|
using osu.Game.Rulesets.Mania.Objects;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
@ -28,36 +27,6 @@ namespace osu.Game.Rulesets.Mania.Scoring
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private const double hp_multiplier_max = 1;
|
private const double hp_multiplier_max = 1;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The default BAD hit HP increase.
|
|
||||||
/// </summary>
|
|
||||||
private const double hp_increase_bad = 0.005;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The default OK hit HP increase.
|
|
||||||
/// </summary>
|
|
||||||
private const double hp_increase_ok = 0.010;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The default GOOD hit HP increase.
|
|
||||||
/// </summary>
|
|
||||||
private const double hp_increase_good = 0.035;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The default tick hit HP increase.
|
|
||||||
/// </summary>
|
|
||||||
private const double hp_increase_tick = 0.040;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The default GREAT hit HP increase.
|
|
||||||
/// </summary>
|
|
||||||
private const double hp_increase_great = 0.055;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The default PERFECT hit HP increase.
|
|
||||||
/// </summary>
|
|
||||||
private const double hp_increase_perfect = 0.065;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The MISS HP multiplier at OD = 0.
|
/// The MISS HP multiplier at OD = 0.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -73,11 +42,6 @@ namespace osu.Game.Rulesets.Mania.Scoring
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private const double hp_multiplier_miss_max = 1;
|
private const double hp_multiplier_miss_max = 1;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The default MISS HP increase.
|
|
||||||
/// </summary>
|
|
||||||
private const double hp_increase_miss = -0.125;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The MISS HP multiplier. This is multiplied to the miss hp increase.
|
/// The MISS HP multiplier. This is multiplied to the miss hp increase.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -88,10 +52,6 @@ namespace osu.Game.Rulesets.Mania.Scoring
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private double hpMultiplier = 1;
|
private double hpMultiplier = 1;
|
||||||
|
|
||||||
public ManiaScoreProcessor()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public ManiaScoreProcessor(DrawableRuleset<ManiaHitObject> drawableRuleset)
|
public ManiaScoreProcessor(DrawableRuleset<ManiaHitObject> drawableRuleset)
|
||||||
: base(drawableRuleset)
|
: base(drawableRuleset)
|
||||||
{
|
{
|
||||||
@ -122,42 +82,8 @@ namespace osu.Game.Rulesets.Mania.Scoring
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void ApplyResult(JudgementResult result)
|
protected override double HealthAdjustmentFactorFor(JudgementResult result)
|
||||||
{
|
=> result.Type == HitResult.Miss ? hpMissMultiplier : hpMultiplier;
|
||||||
base.ApplyResult(result);
|
|
||||||
|
|
||||||
bool isTick = result.Judgement is HoldNoteTickJudgement;
|
|
||||||
|
|
||||||
if (isTick)
|
|
||||||
{
|
|
||||||
if (result.IsHit)
|
|
||||||
Health.Value += hpMultiplier * hp_increase_tick;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
switch (result.Type)
|
|
||||||
{
|
|
||||||
case HitResult.Miss:
|
|
||||||
Health.Value += hpMissMultiplier * hp_increase_miss;
|
|
||||||
break;
|
|
||||||
case HitResult.Meh:
|
|
||||||
Health.Value += hpMultiplier * hp_increase_bad;
|
|
||||||
break;
|
|
||||||
case HitResult.Ok:
|
|
||||||
Health.Value += hpMultiplier * hp_increase_ok;
|
|
||||||
break;
|
|
||||||
case HitResult.Good:
|
|
||||||
Health.Value += hpMultiplier * hp_increase_good;
|
|
||||||
break;
|
|
||||||
case HitResult.Great:
|
|
||||||
Health.Value += hpMultiplier * hp_increase_great;
|
|
||||||
break;
|
|
||||||
case HitResult.Perfect:
|
|
||||||
Health.Value += hpMultiplier * hp_increase_perfect;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override HitWindows CreateHitWindows() => new ManiaHitWindows();
|
public override HitWindows CreateHitWindows() => new ManiaHitWindows();
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
|
@ -7,6 +7,7 @@ using osu.Framework.Extensions.Color4Extensions;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
@ -18,6 +18,7 @@ using osu.Game.Rulesets.Mania.Objects;
|
|||||||
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Mania.Replays;
|
using osu.Game.Rulesets.Mania.Replays;
|
||||||
using osu.Game.Rulesets.Mania.Scoring;
|
using osu.Game.Rulesets.Mania.Scoring;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
@ -39,8 +40,8 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
|
|
||||||
private readonly Bindable<ManiaScrollingDirection> configDirection = new Bindable<ManiaScrollingDirection>();
|
private readonly Bindable<ManiaScrollingDirection> configDirection = new Bindable<ManiaScrollingDirection>();
|
||||||
|
|
||||||
public DrawableManiaRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
public DrawableManiaRuleset(Ruleset ruleset, WorkingBeatmap beatmap, IReadOnlyList<Mod> mods)
|
||||||
: base(ruleset, beatmap)
|
: base(ruleset, beatmap, mods)
|
||||||
{
|
{
|
||||||
// Generate the bar lines
|
// Generate the bar lines
|
||||||
double lastObjectTime = (Objects.LastOrDefault() as IHasEndTime)?.EndTime ?? Objects.LastOrDefault()?.StartTime ?? double.MaxValue;
|
double lastObjectTime = (Objects.LastOrDefault() as IHasEndTime)?.EndTime ?? Objects.LastOrDefault()?.StartTime ?? double.MaxValue;
|
||||||
@ -56,6 +57,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
double endTime = i < timingPoints.Count - 1 ? timingPoints[i + 1].Time - point.BeatLength : lastObjectTime + point.BeatLength * (int)point.TimeSignature;
|
double endTime = i < timingPoints.Count - 1 ? timingPoints[i + 1].Time - point.BeatLength : lastObjectTime + point.BeatLength * (int)point.TimeSignature;
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
|
||||||
for (double t = timingPoints[i].Time; Precision.DefinitelyBigger(endTime, t); t += point.BeatLength, index++)
|
for (double t = timingPoints[i].Time; Precision.DefinitelyBigger(endTime, t); t += point.BeatLength, index++)
|
||||||
{
|
{
|
||||||
barLines.Add(new BarLine
|
barLines.Add(new BarLine
|
||||||
@ -104,8 +106,10 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
{
|
{
|
||||||
case HoldNote holdNote:
|
case HoldNote holdNote:
|
||||||
return new DrawableHoldNote(holdNote);
|
return new DrawableHoldNote(holdNote);
|
||||||
|
|
||||||
case Note note:
|
case Note note:
|
||||||
return new DrawableNote(note);
|
return new DrawableNote(note);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
||||||
|
@ -38,6 +38,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
var normalColumnAction = ManiaAction.Key1;
|
var normalColumnAction = ManiaAction.Key1;
|
||||||
var specialColumnAction = ManiaAction.Special1;
|
var specialColumnAction = ManiaAction.Special1;
|
||||||
int firstColumnIndex = 0;
|
int firstColumnIndex = 0;
|
||||||
|
|
||||||
for (int i = 0; i < stageDefinitions.Count; i++)
|
for (int i = 0; i < stageDefinitions.Count; i++)
|
||||||
{
|
{
|
||||||
var newStage = new ManiaStage(firstColumnIndex, stageDefinitions[i], ref normalColumnAction, ref specialColumnAction);
|
var newStage = new ManiaStage(firstColumnIndex, stageDefinitions[i], ref normalColumnAction, ref specialColumnAction);
|
||||||
@ -92,6 +93,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
private ManiaStage getStageByColumn(int column)
|
private ManiaStage getStageByColumn(int column)
|
||||||
{
|
{
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
|
|
||||||
foreach (var stage in stages)
|
foreach (var stage in stages)
|
||||||
{
|
{
|
||||||
sum = sum + stage.Columns.Count;
|
sum = sum + stage.Columns.Count;
|
||||||
|
@ -35,6 +35,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
yield return createConvertValue(nested);
|
yield return createConvertValue(nested);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
yield return createConvertValue(hitObject);
|
yield return createConvertValue(hitObject);
|
||||||
|
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Tests.Beatmaps;
|
using osu.Game.Tests.Beatmaps;
|
||||||
using Decoder = osu.Game.Beatmaps.Formats.Decoder;
|
using Decoder = osu.Game.Beatmaps.Formats.Decoder;
|
||||||
@ -22,7 +24,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
using (var reader = new StreamReader(stream))
|
using (var reader = new StreamReader(stream))
|
||||||
{
|
{
|
||||||
var beatmap = Decoder.GetDecoder<Beatmap>(reader).Decode(reader);
|
var beatmap = Decoder.GetDecoder<Beatmap>(reader).Decode(reader);
|
||||||
var converted = new TestWorkingBeatmap(beatmap).GetPlayableBeatmap(new OsuRuleset().RulesetInfo);
|
var converted = new TestWorkingBeatmap(beatmap).GetPlayableBeatmap(new OsuRuleset().RulesetInfo, Array.Empty<Mod>());
|
||||||
|
|
||||||
var objects = converted.HitObjects.ToList();
|
var objects = converted.HitObjects.ToList();
|
||||||
|
|
||||||
|
@ -30,7 +30,6 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
private int depthIndex;
|
private int depthIndex;
|
||||||
protected readonly List<Mod> Mods = new List<Mod>();
|
|
||||||
|
|
||||||
public TestCaseHitCircle()
|
public TestCaseHitCircle()
|
||||||
{
|
{
|
||||||
@ -68,7 +67,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
Depth = depthIndex++
|
Depth = depthIndex++
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var mod in Mods.OfType<IApplicableToDrawableHitObjects>())
|
foreach (var mod in Mods.Value.OfType<IApplicableToDrawableHitObjects>())
|
||||||
mod.ApplyToDrawableHitObjects(new[] { drawable });
|
mod.ApplyToDrawableHitObjects(new[] { drawable });
|
||||||
|
|
||||||
Add(drawable);
|
Add(drawable);
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
|
|
||||||
public TestCaseHitCircleHidden()
|
public TestCaseHitCircleHidden()
|
||||||
{
|
{
|
||||||
Mods.Add(new OsuModHidden());
|
Mods.Value = new[] { new OsuModHidden() };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
19
osu.Game.Rulesets.Osu.Tests/TestCaseOsuFlashlight.cs
Normal file
19
osu.Game.Rulesets.Osu.Tests/TestCaseOsuFlashlight.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using osu.Game.Rulesets.Osu.Mods;
|
||||||
|
using osu.Game.Screens.Play;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Osu.Tests
|
||||||
|
{
|
||||||
|
public class TestCaseOsuFlashlight : TestCaseOsuPlayer
|
||||||
|
{
|
||||||
|
protected override Player CreatePlayer(Ruleset ruleset)
|
||||||
|
{
|
||||||
|
Mods.Value = new Mod[] { new OsuModAutoplay(), new OsuModFlashlight(), };
|
||||||
|
|
||||||
|
return base.CreatePlayer(ruleset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -44,7 +44,6 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
private int depthIndex;
|
private int depthIndex;
|
||||||
protected readonly List<Mod> Mods = new List<Mod>();
|
|
||||||
|
|
||||||
public TestCaseSlider()
|
public TestCaseSlider()
|
||||||
{
|
{
|
||||||
@ -292,7 +291,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
Depth = depthIndex++
|
Depth = depthIndex++
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var mod in Mods.OfType<IApplicableToDrawableHitObjects>())
|
foreach (var mod in Mods.Value.OfType<IApplicableToDrawableHitObjects>())
|
||||||
mod.ApplyToDrawableHitObjects(new[] { drawable });
|
mod.ApplyToDrawableHitObjects(new[] { drawable });
|
||||||
|
|
||||||
drawable.OnNewResult += onNewResult;
|
drawable.OnNewResult += onNewResult;
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
|
|
||||||
public TestCaseSliderHidden()
|
public TestCaseSliderHidden()
|
||||||
{
|
{
|
||||||
Mods.Add(new OsuModHidden());
|
Mods.Value = new[] { new OsuModHidden() };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -353,6 +353,8 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
public new ScoreProcessor ScoreProcessor => base.ScoreProcessor;
|
public new ScoreProcessor ScoreProcessor => base.ScoreProcessor;
|
||||||
|
|
||||||
|
protected override bool PauseOnFocusLost => false;
|
||||||
|
|
||||||
public ScoreAccessibleReplayPlayer(Score score)
|
public ScoreAccessibleReplayPlayer(Score score)
|
||||||
: base(score, false, false)
|
: base(score, false, false)
|
||||||
{
|
{
|
||||||
|
@ -31,7 +31,6 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
private int depthIndex;
|
private int depthIndex;
|
||||||
protected readonly List<Mod> Mods = new List<Mod>();
|
|
||||||
|
|
||||||
public TestCaseSpinner()
|
public TestCaseSpinner()
|
||||||
{
|
{
|
||||||
@ -57,7 +56,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
Depth = depthIndex++
|
Depth = depthIndex++
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var mod in Mods.OfType<IApplicableToDrawableHitObjects>())
|
foreach (var mod in Mods.Value.OfType<IApplicableToDrawableHitObjects>())
|
||||||
mod.ApplyToDrawableHitObjects(new[] { drawable });
|
mod.ApplyToDrawableHitObjects(new[] { drawable });
|
||||||
|
|
||||||
Add(drawable);
|
Add(drawable);
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
|
|
||||||
public TestCaseSpinnerHidden()
|
public TestCaseSpinnerHidden()
|
||||||
{
|
{
|
||||||
Mods.Add(new OsuModHidden());
|
Mods.Value = new[] { new OsuModHidden() };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,12 +44,14 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
if (endIndex < 0) throw new ArgumentOutOfRangeException(nameof(endIndex), $"{nameof(endIndex)} cannot be less than 0.");
|
if (endIndex < 0) throw new ArgumentOutOfRangeException(nameof(endIndex), $"{nameof(endIndex)} cannot be less than 0.");
|
||||||
|
|
||||||
int extendedEndIndex = endIndex;
|
int extendedEndIndex = endIndex;
|
||||||
|
|
||||||
if (endIndex < beatmap.HitObjects.Count - 1)
|
if (endIndex < beatmap.HitObjects.Count - 1)
|
||||||
{
|
{
|
||||||
// Extend the end index to include objects they are stacked on
|
// Extend the end index to include objects they are stacked on
|
||||||
for (int i = endIndex; i >= startIndex; i--)
|
for (int i = endIndex; i >= startIndex; i--)
|
||||||
{
|
{
|
||||||
int stackBaseIndex = i;
|
int stackBaseIndex = i;
|
||||||
|
|
||||||
for (int n = stackBaseIndex + 1; n < beatmap.HitObjects.Count; n++)
|
for (int n = stackBaseIndex + 1; n < beatmap.HitObjects.Count; n++)
|
||||||
{
|
{
|
||||||
OsuHitObject stackBaseObject = beatmap.HitObjects[stackBaseIndex];
|
OsuHitObject stackBaseObject = beatmap.HitObjects[stackBaseIndex];
|
||||||
@ -87,6 +89,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
|
|
||||||
//Reverse pass for stack calculation.
|
//Reverse pass for stack calculation.
|
||||||
int extendedStartIndex = startIndex;
|
int extendedStartIndex = startIndex;
|
||||||
|
|
||||||
for (int i = extendedEndIndex; i > startIndex; i--)
|
for (int i = extendedEndIndex; i > startIndex; i--)
|
||||||
{
|
{
|
||||||
int n = i;
|
int n = i;
|
||||||
@ -138,6 +141,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
if (objectN is Slider && Vector2Extensions.Distance(objectN.EndPosition, objectI.Position) < stack_distance)
|
if (objectN is Slider && Vector2Extensions.Distance(objectN.EndPosition, objectI.Position) < stack_distance)
|
||||||
{
|
{
|
||||||
int offset = objectI.StackHeight - objectN.StackHeight + 1;
|
int offset = objectI.StackHeight - objectN.StackHeight + 1;
|
||||||
|
|
||||||
for (int j = n + 1; j <= i; j++)
|
for (int j = n + 1; j <= i; j++)
|
||||||
{
|
{
|
||||||
//For each object which was declared under this slider, we will offset it to appear *below* the slider end (rather than above).
|
//For each object which was declared under this slider, we will offset it to appear *below* the slider end (rather than above).
|
||||||
|
@ -16,15 +16,16 @@ namespace osu.Game.Rulesets.Osu.Configuration
|
|||||||
protected override void InitialiseDefaults()
|
protected override void InitialiseDefaults()
|
||||||
{
|
{
|
||||||
base.InitialiseDefaults();
|
base.InitialiseDefaults();
|
||||||
|
|
||||||
Set(OsuRulesetSetting.SnakingInSliders, true);
|
Set(OsuRulesetSetting.SnakingInSliders, true);
|
||||||
Set(OsuRulesetSetting.SnakingOutSliders, true);
|
Set(OsuRulesetSetting.SnakingOutSliders, true);
|
||||||
|
Set(OsuRulesetSetting.ShowCursorTrail, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum OsuRulesetSetting
|
public enum OsuRulesetSetting
|
||||||
{
|
{
|
||||||
SnakingInSliders,
|
SnakingInSliders,
|
||||||
SnakingOutSliders
|
SnakingOutSliders,
|
||||||
|
ShowCursorTrail
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,6 +109,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
|
|||||||
aimValue *= Math.Min(Math.Pow(scoreMaxCombo, 0.8f) / Math.Pow(beatmapMaxCombo, 0.8f), 1.0f);
|
aimValue *= Math.Min(Math.Pow(scoreMaxCombo, 0.8f) / Math.Pow(beatmapMaxCombo, 0.8f), 1.0f);
|
||||||
|
|
||||||
double approachRateFactor = 1.0f;
|
double approachRateFactor = 1.0f;
|
||||||
|
|
||||||
if (Attributes.ApproachRate > 10.33f)
|
if (Attributes.ApproachRate > 10.33f)
|
||||||
approachRateFactor += 0.3f * (Attributes.ApproachRate - 10.33f);
|
approachRateFactor += 0.3f * (Attributes.ApproachRate - 10.33f);
|
||||||
else if (Attributes.ApproachRate < 8.0f)
|
else if (Attributes.ApproachRate < 8.0f)
|
||||||
|
@ -56,6 +56,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
|
|||||||
{
|
{
|
||||||
// We will scale distances by this factor, so we can assume a uniform CircleSize among beatmaps.
|
// We will scale distances by this factor, so we can assume a uniform CircleSize among beatmaps.
|
||||||
float scalingFactor = normalized_radius / (float)BaseObject.Radius;
|
float scalingFactor = normalized_radius / (float)BaseObject.Radius;
|
||||||
|
|
||||||
if (BaseObject.Radius < 30)
|
if (BaseObject.Radius < 30)
|
||||||
{
|
{
|
||||||
float smallCircleBonus = Math.Min(30 - (float)BaseObject.Radius, 5) / 50;
|
float smallCircleBonus = Math.Min(30 - (float)BaseObject.Radius, 5) / 50;
|
||||||
|
@ -42,9 +42,11 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
|||||||
speedBonus = 1 + Math.Pow((min_speed_bonus - deltaTime) / speed_balancing_factor, 2);
|
speedBonus = 1 + Math.Pow((min_speed_bonus - deltaTime) / speed_balancing_factor, 2);
|
||||||
|
|
||||||
double angleBonus = 1.0;
|
double angleBonus = 1.0;
|
||||||
|
|
||||||
if (osuCurrent.Angle != null && osuCurrent.Angle.Value < angle_bonus_begin)
|
if (osuCurrent.Angle != null && osuCurrent.Angle.Value < angle_bonus_begin)
|
||||||
{
|
{
|
||||||
angleBonus = 1 + Math.Pow(Math.Sin(1.5 * (angle_bonus_begin - osuCurrent.Angle.Value)), 2) / 3.57;
|
angleBonus = 1 + Math.Pow(Math.Sin(1.5 * (angle_bonus_begin - osuCurrent.Angle.Value)), 2) / 3.57;
|
||||||
|
|
||||||
if (osuCurrent.Angle.Value < pi_over_2)
|
if (osuCurrent.Angle.Value < pi_over_2)
|
||||||
{
|
{
|
||||||
angleBonus = 1.28;
|
angleBonus = 1.28;
|
||||||
|
@ -37,6 +37,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
case SliderPosition.Start:
|
case SliderPosition.Start:
|
||||||
Position = slider.StackedPosition + slider.Path.PositionAt(0);
|
Position = slider.StackedPosition + slider.Path.PositionAt(0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SliderPosition.End:
|
case SliderPosition.End:
|
||||||
Position = slider.StackedPosition + slider.Path.PositionAt(1);
|
Position = slider.StackedPosition + slider.Path.PositionAt(1);
|
||||||
break;
|
break;
|
||||||
|
@ -62,6 +62,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
|
|||||||
case PlacementState.Initial:
|
case PlacementState.Initial:
|
||||||
HitObject.Position = e.MousePosition;
|
HitObject.Position = e.MousePosition;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case PlacementState.Body:
|
case PlacementState.Body:
|
||||||
cursor = e.MousePosition - HitObject.Position;
|
cursor = e.MousePosition - HitObject.Position;
|
||||||
return true;
|
return true;
|
||||||
@ -77,6 +78,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
|
|||||||
case PlacementState.Initial:
|
case PlacementState.Initial:
|
||||||
beginCurve();
|
beginCurve();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PlacementState.Body:
|
case PlacementState.Body:
|
||||||
switch (e.Button)
|
switch (e.Button)
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Osu.UI;
|
using osu.Game.Rulesets.Osu.UI;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -10,8 +12,8 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
{
|
{
|
||||||
public class DrawableOsuEditRuleset : DrawableOsuRuleset
|
public class DrawableOsuEditRuleset : DrawableOsuRuleset
|
||||||
{
|
{
|
||||||
public DrawableOsuEditRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
public DrawableOsuEditRuleset(Ruleset ruleset, WorkingBeatmap beatmap, IReadOnlyList<Mod> mods)
|
||||||
: base(ruleset, beatmap)
|
: base(ruleset, beatmap, mods)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ using System.Collections.Generic;
|
|||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Edit.Tools;
|
using osu.Game.Rulesets.Edit.Tools;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles;
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles;
|
||||||
using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders;
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders;
|
||||||
@ -23,8 +24,8 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override DrawableRuleset<OsuHitObject> CreateDrawableRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
protected override DrawableRuleset<OsuHitObject> CreateDrawableRuleset(Ruleset ruleset, WorkingBeatmap beatmap, IReadOnlyList<Mod> mods)
|
||||||
=> new DrawableOsuEditRuleset(ruleset, beatmap);
|
=> new DrawableOsuEditRuleset(ruleset, beatmap, mods);
|
||||||
|
|
||||||
protected override IReadOnlyList<HitObjectCompositionTool> CompositionTools => new HitObjectCompositionTool[]
|
protected override IReadOnlyList<HitObjectCompositionTool> CompositionTools => new HitObjectCompositionTool[]
|
||||||
{
|
{
|
||||||
@ -41,8 +42,10 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
{
|
{
|
||||||
case DrawableHitCircle circle:
|
case DrawableHitCircle circle:
|
||||||
return new HitCircleSelectionBlueprint(circle);
|
return new HitCircleSelectionBlueprint(circle);
|
||||||
|
|
||||||
case DrawableSlider slider:
|
case DrawableSlider slider:
|
||||||
return new SliderSelectionBlueprint(slider);
|
return new SliderSelectionBlueprint(slider);
|
||||||
|
|
||||||
case DrawableSpinner spinner:
|
case DrawableSpinner spinner:
|
||||||
return new SpinnerSelectionBlueprint(spinner);
|
return new SpinnerSelectionBlueprint(spinner);
|
||||||
}
|
}
|
||||||
|
@ -16,13 +16,33 @@ namespace osu.Game.Rulesets.Osu.Judgements
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case HitResult.Meh:
|
case HitResult.Meh:
|
||||||
return 50;
|
return 50;
|
||||||
|
|
||||||
case HitResult.Good:
|
case HitResult.Good:
|
||||||
return 100;
|
return 100;
|
||||||
|
|
||||||
case HitResult.Great:
|
case HitResult.Great:
|
||||||
return 300;
|
return 300;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override double HealthIncreaseFor(HitResult result)
|
||||||
|
{
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
case HitResult.Miss:
|
||||||
|
return -0.02;
|
||||||
|
|
||||||
|
case HitResult.Meh:
|
||||||
|
case HitResult.Good:
|
||||||
|
case HitResult.Great:
|
||||||
|
return 0.01;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ using osu.Game.Rulesets.Mods;
|
|||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
|
using osu.Game.Scoring;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -41,6 +42,8 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
scoreProcessor.Health.ValueChanged += health => { blinds.AnimateClosedness((float)health.NewValue); };
|
scoreProcessor.Health.ValueChanged += health => { blinds.AnimateClosedness((float)health.NewValue); };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ScoreRank AdjustRank(ScoreRank rank, double accuracy) => rank;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Element for the Blinds mod drawing 2 black boxes covering the whole screen which resize inside a restricted area with some leniency.
|
/// Element for the Blinds mod drawing 2 black boxes covering the whole screen which resize inside a restricted area with some leniency.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1,23 +1,38 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Mods
|
namespace osu.Game.Rulesets.Osu.Mods
|
||||||
{
|
{
|
||||||
public class OsuModFlashlight : ModFlashlight<OsuHitObject>
|
public class OsuModFlashlight : ModFlashlight<OsuHitObject>, IApplicableToDrawableHitObjects
|
||||||
{
|
{
|
||||||
public override double ScoreMultiplier => 1.12;
|
public override double ScoreMultiplier => 1.12;
|
||||||
|
|
||||||
private const float default_flashlight_size = 180;
|
private const float default_flashlight_size = 180;
|
||||||
|
|
||||||
public override Flashlight CreateFlashlight() => new OsuFlashlight();
|
private OsuFlashlight flashlight;
|
||||||
|
|
||||||
|
public override Flashlight CreateFlashlight() => flashlight = new OsuFlashlight();
|
||||||
|
|
||||||
|
public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
|
||||||
|
{
|
||||||
|
foreach (var s in drawables.OfType<DrawableSlider>())
|
||||||
|
{
|
||||||
|
s.Tracking.ValueChanged += flashlight.OnSliderTrackingChange;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class OsuFlashlight : Flashlight, IRequireHighFrequencyMousePosition
|
private class OsuFlashlight : Flashlight, IRequireHighFrequencyMousePosition
|
||||||
{
|
{
|
||||||
@ -26,9 +41,22 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
FlashlightSize = new Vector2(0, getSizeFor(0));
|
FlashlightSize = new Vector2(0, getSizeFor(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnSliderTrackingChange(ValueChangedEvent<bool> e)
|
||||||
|
{
|
||||||
|
// If a slider is in a tracking state, a further dim should be applied to the (remaining) visible portion of the playfield over a brief duration.
|
||||||
|
this.TransformTo(nameof(FlashlightDim), e.NewValue ? 0.8f : 0.0f, 50);
|
||||||
|
}
|
||||||
|
|
||||||
protected override bool OnMouseMove(MouseMoveEvent e)
|
protected override bool OnMouseMove(MouseMoveEvent e)
|
||||||
{
|
{
|
||||||
FlashlightPosition = e.MousePosition;
|
const double follow_delay = 120;
|
||||||
|
|
||||||
|
var position = FlashlightPosition;
|
||||||
|
var destination = e.MousePosition;
|
||||||
|
|
||||||
|
FlashlightPosition = Interpolation.ValueAt(
|
||||||
|
MathHelper.Clamp(Clock.ElapsedFrameTime, 0, follow_delay), position, destination, 0, follow_delay, Easing.Out);
|
||||||
|
|
||||||
return base.OnMouseMove(e);
|
return base.OnMouseMove(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
{
|
{
|
||||||
case DrawableSpinner _:
|
case DrawableSpinner _:
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
drawable.ApplyCustomUpdateState += ApplyCustomState;
|
drawable.ApplyCustomUpdateState += ApplyCustomState;
|
||||||
break;
|
break;
|
||||||
@ -51,6 +52,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
case DrawableSliderTail _:
|
case DrawableSliderTail _:
|
||||||
// special cases we should *not* be scaling.
|
// special cases we should *not* be scaling.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DrawableSlider _:
|
case DrawableSlider _:
|
||||||
case DrawableHitCircle _:
|
case DrawableHitCircle _:
|
||||||
{
|
{
|
||||||
|
@ -59,11 +59,13 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
circle.FadeOut(fadeOutDuration);
|
circle.FadeOut(fadeOutDuration);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DrawableSlider slider:
|
case DrawableSlider slider:
|
||||||
using (slider.BeginAbsoluteSequence(fadeOutStartTime, true))
|
using (slider.BeginAbsoluteSequence(fadeOutStartTime, true))
|
||||||
slider.Body.FadeOut(longFadeDuration, Easing.Out);
|
slider.Body.FadeOut(longFadeDuration, Easing.Out);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DrawableSliderTick sliderTick:
|
case DrawableSliderTick sliderTick:
|
||||||
// slider ticks fade out over up to one second
|
// slider ticks fade out over up to one second
|
||||||
var tickFadeOutDuration = Math.Min(sliderTick.HitObject.TimePreempt - DrawableSliderTick.ANIM_DURATION, 1000);
|
var tickFadeOutDuration = Math.Min(sliderTick.HitObject.TimePreempt - DrawableSliderTick.ANIM_DURATION, 1000);
|
||||||
@ -72,6 +74,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
sliderTick.FadeOut(tickFadeOutDuration);
|
sliderTick.FadeOut(tickFadeOutDuration);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DrawableSpinner spinner:
|
case DrawableSpinner spinner:
|
||||||
// hide elements we don't care about.
|
// hide elements we don't care about.
|
||||||
spinner.Disc.Hide();
|
spinner.Disc.Hide();
|
||||||
|
@ -6,6 +6,7 @@ using osuTK.Graphics;
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
|
@ -67,6 +67,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
OsuHitObject prevHitObject = null;
|
OsuHitObject prevHitObject = null;
|
||||||
|
|
||||||
foreach (var currHitObject in hitObjects)
|
foreach (var currHitObject in hitObjects)
|
||||||
{
|
{
|
||||||
if (prevHitObject != null && !currHitObject.NewCombo && !(prevHitObject is Spinner) && !(currHitObject is Spinner))
|
if (prevHitObject != null && !currHitObject.NewCombo && !(prevHitObject is Spinner) && !(currHitObject is Spinner))
|
||||||
|
@ -124,6 +124,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
}
|
}
|
||||||
|
|
||||||
var result = HitObject.HitWindows.ResultFor(timeOffset);
|
var result = HitObject.HitWindows.ResultFor(timeOffset);
|
||||||
|
|
||||||
if (result == HitResult.None)
|
if (result == HitResult.None)
|
||||||
{
|
{
|
||||||
Shake(Math.Abs(timeOffset) - HitObject.HitWindows.HalfWindowFor(HitResult.Miss));
|
Shake(Math.Abs(timeOffset) - HitObject.HitWindows.HalfWindowFor(HitResult.Miss));
|
||||||
@ -158,11 +159,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
// override lifetime end as FadeIn may have been changed externally, causing out expiration to be too early.
|
// override lifetime end as FadeIn may have been changed externally, causing out expiration to be too early.
|
||||||
LifetimeEnd = HitObject.StartTime + HitObject.HitWindows.HalfWindowFor(HitResult.Miss);
|
LifetimeEnd = HitObject.StartTime + HitObject.HitWindows.HalfWindowFor(HitResult.Miss);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ArmedState.Miss:
|
case ArmedState.Miss:
|
||||||
ApproachCircle.FadeOut(50);
|
ApproachCircle.FadeOut(50);
|
||||||
this.FadeOut(100);
|
this.FadeOut(100);
|
||||||
Expire();
|
Expire();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ArmedState.Hit:
|
case ArmedState.Hit:
|
||||||
ApproachCircle.FadeOut(50);
|
ApproachCircle.FadeOut(50);
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
{
|
{
|
||||||
if (repeatPoint.StartTime <= Time.Current)
|
if (repeatPoint.StartTime <= Time.Current)
|
||||||
ApplyResult(r => r.Type = drawableSlider.Tracking ? HitResult.Great : HitResult.Miss);
|
ApplyResult(r => r.Type = drawableSlider.Tracking.Value ? HitResult.Great : HitResult.Miss);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdatePreemptState()
|
protected override void UpdatePreemptState()
|
||||||
@ -64,9 +64,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
case ArmedState.Idle:
|
case ArmedState.Idle:
|
||||||
this.Delay(HitObject.TimePreempt).FadeOut();
|
this.Delay(HitObject.TimePreempt).FadeOut();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ArmedState.Miss:
|
case ArmedState.Miss:
|
||||||
this.FadeOut(animDuration);
|
this.FadeOut(animDuration);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ArmedState.Hit:
|
case ArmedState.Hit:
|
||||||
this.FadeOut(animDuration, Easing.OutQuint)
|
this.FadeOut(animDuration, Easing.OutQuint)
|
||||||
.ScaleTo(Scale * 1.5f, animDuration, Easing.Out);
|
.ScaleTo(Scale * 1.5f, animDuration, Easing.Out);
|
||||||
|
@ -130,13 +130,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Tracking;
|
public readonly Bindable<bool> Tracking = new Bindable<bool>();
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
Tracking = Ball.Tracking;
|
Tracking.Value = Ball.Tracking;
|
||||||
|
|
||||||
double completionProgress = MathHelper.Clamp((Time.Current - slider.StartTime) / slider.Duration, 0, 1);
|
double completionProgress = MathHelper.Clamp((Time.Current - slider.StartTime) / slider.Duration, 0, 1);
|
||||||
|
|
||||||
@ -160,9 +160,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
base.SkinChanged(skin, allowFallback);
|
base.SkinChanged(skin, allowFallback);
|
||||||
|
|
||||||
Body.AccentColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderTrackOverride") ? s.CustomColours["SliderTrackOverride"] : (Color4?)null) ?? Body.AccentColour;
|
Body.BorderSize = skin.GetValue<SkinConfiguration, float?>(s => s.SliderBorderSize) ?? SliderBody.DEFAULT_BORDER_SIZE;
|
||||||
Body.BorderColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBorder") ? s.CustomColours["SliderBorder"] : (Color4?)null) ?? Body.BorderColour;
|
Body.AccentColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderTrackOverride") ? s.CustomColours["SliderTrackOverride"] : (Color4?)null) ?? AccentColour;
|
||||||
Ball.AccentColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : (Color4?)null) ?? Ball.AccentColour;
|
Body.BorderColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBorder") ? s.CustomColours["SliderBorder"] : (Color4?)null) ?? Color4.White;
|
||||||
|
Ball.AccentColour = skin.GetValue<SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : (Color4?)null) ?? AccentColour;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
protected override void CheckForResult(bool userTriggered, double timeOffset)
|
||||||
|
@ -67,10 +67,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
case ArmedState.Idle:
|
case ArmedState.Idle:
|
||||||
this.Delay(HitObject.TimePreempt).FadeOut();
|
this.Delay(HitObject.TimePreempt).FadeOut();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ArmedState.Miss:
|
case ArmedState.Miss:
|
||||||
this.FadeOut(ANIM_DURATION);
|
this.FadeOut(ANIM_DURATION);
|
||||||
this.FadeColour(Color4.Red, ANIM_DURATION / 2);
|
this.FadeColour(Color4.Red, ANIM_DURATION / 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ArmedState.Hit:
|
case ArmedState.Hit:
|
||||||
this.FadeOut(ANIM_DURATION, Easing.OutQuint);
|
this.FadeOut(ANIM_DURATION, Easing.OutQuint);
|
||||||
this.ScaleTo(Scale * 1.5f, ANIM_DURATION, Easing.Out);
|
this.ScaleTo(Scale * 1.5f, ANIM_DURATION, Easing.Out);
|
||||||
|
@ -222,9 +222,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
case ArmedState.Idle:
|
case ArmedState.Idle:
|
||||||
Expire(true);
|
Expire(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ArmedState.Hit:
|
case ArmedState.Hit:
|
||||||
sequence.ScaleTo(Scale * 1.2f, 320, Easing.Out);
|
sequence.ScaleTo(Scale * 1.2f, 320, Easing.Out);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ArmedState.Miss:
|
case ArmedState.Miss:
|
||||||
sequence.ScaleTo(Scale * 0.8f, 320, Easing.In);
|
sequence.ScaleTo(Scale * 0.8f, 320, Easing.In);
|
||||||
break;
|
break;
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
@ -14,6 +14,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
public abstract class SliderBody : CompositeDrawable
|
public abstract class SliderBody : CompositeDrawable
|
||||||
{
|
{
|
||||||
|
public const float DEFAULT_BORDER_SIZE = 1;
|
||||||
|
|
||||||
private readonly SliderPath path;
|
private readonly SliderPath path;
|
||||||
protected Path Path => path;
|
protected Path Path => path;
|
||||||
|
|
||||||
@ -64,6 +66,23 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used to size the path border.
|
||||||
|
/// </summary>
|
||||||
|
public float BorderSize
|
||||||
|
{
|
||||||
|
get => path.BorderSize;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (path.BorderSize == value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
path.BorderSize = value;
|
||||||
|
|
||||||
|
container.ForceRedraw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Quad PathDrawQuad => container.ScreenSpaceDrawQuad;
|
public Quad PathDrawQuad => container.ScreenSpaceDrawQuad;
|
||||||
|
|
||||||
protected SliderBody()
|
protected SliderBody()
|
||||||
@ -92,6 +111,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
|
|
||||||
private class SliderPath : SmoothPath
|
private class SliderPath : SmoothPath
|
||||||
{
|
{
|
||||||
|
private const float border_max_size = 8f;
|
||||||
|
private const float border_min_size = 0f;
|
||||||
|
|
||||||
private const float border_portion = 0.128f;
|
private const float border_portion = 0.128f;
|
||||||
private const float gradient_portion = 1 - border_portion;
|
private const float gradient_portion = 1 - border_portion;
|
||||||
|
|
||||||
@ -130,12 +152,33 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private float borderSize = DEFAULT_BORDER_SIZE;
|
||||||
|
|
||||||
|
public float BorderSize
|
||||||
|
{
|
||||||
|
get => borderSize;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (borderSize == value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (value < border_min_size || value > border_max_size)
|
||||||
|
return;
|
||||||
|
|
||||||
|
borderSize = value;
|
||||||
|
|
||||||
|
InvalidateTexture();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private float calculatedBorderPortion => BorderSize * border_portion;
|
||||||
|
|
||||||
protected override Color4 ColourAt(float position)
|
protected override Color4 ColourAt(float position)
|
||||||
{
|
{
|
||||||
if (position <= border_portion)
|
if (calculatedBorderPortion != 0f && position <= calculatedBorderPortion)
|
||||||
return BorderColour;
|
return BorderColour;
|
||||||
|
|
||||||
position -= border_portion;
|
position -= calculatedBorderPortion;
|
||||||
return new Color4(AccentColour.R, AccentColour.G, AccentColour.B, (opacity_at_edge - (opacity_at_edge - opacity_at_centre) * position / gradient_portion) * AccentColour.A);
|
return new Color4(AccentColour.R, AccentColour.G, AccentColour.B, (opacity_at_edge - (opacity_at_edge - opacity_at_centre) * position / gradient_portion) * AccentColour.A);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ using System;
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Effects;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
@ -183,6 +183,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
Samples = sampleList
|
Samples = sampleList
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SliderEventType.Head:
|
case SliderEventType.Head:
|
||||||
AddNested(HeadCircle = new SliderCircle
|
AddNested(HeadCircle = new SliderCircle
|
||||||
{
|
{
|
||||||
@ -194,6 +195,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
ComboIndex = ComboIndex,
|
ComboIndex = ComboIndex,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SliderEventType.LegacyLastTick:
|
case SliderEventType.LegacyLastTick:
|
||||||
// we need to use the LegacyLastTick here for compatibility reasons (difficulty).
|
// we need to use the LegacyLastTick here for compatibility reasons (difficulty).
|
||||||
// it is *okay* to use this because the TailCircle is not used for any meaningful purpose in gameplay.
|
// it is *okay* to use this because the TailCircle is not used for any meaningful purpose in gameplay.
|
||||||
@ -206,6 +208,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
ComboIndex = ComboIndex,
|
ComboIndex = ComboIndex,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SliderEventType.Repeat:
|
case SliderEventType.Repeat:
|
||||||
AddNested(new RepeatPoint
|
AddNested(new RepeatPoint
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
{
|
{
|
||||||
public class OsuRuleset : Ruleset
|
public class OsuRuleset : Ruleset
|
||||||
{
|
{
|
||||||
public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap) => new DrawableOsuRuleset(this, beatmap);
|
public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap, IReadOnlyList<Mod> mods) => new DrawableOsuRuleset(this, beatmap, mods);
|
||||||
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new OsuBeatmapConverter(beatmap);
|
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new OsuBeatmapConverter(beatmap);
|
||||||
public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new OsuBeatmapProcessor(beatmap);
|
public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new OsuBeatmapProcessor(beatmap);
|
||||||
|
|
||||||
@ -104,6 +104,7 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
new MultiMod(new OsuModHalfTime(), new OsuModDaycore()),
|
new MultiMod(new OsuModHalfTime(), new OsuModDaycore()),
|
||||||
new OsuModSpunOut(),
|
new OsuModSpunOut(),
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.DifficultyIncrease:
|
case ModType.DifficultyIncrease:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
@ -113,11 +114,13 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
new OsuModHidden(),
|
new OsuModHidden(),
|
||||||
new MultiMod(new OsuModFlashlight(), new OsuModBlinds()),
|
new MultiMod(new OsuModFlashlight(), new OsuModBlinds()),
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.Conversion:
|
case ModType.Conversion:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
new OsuModTarget(),
|
new OsuModTarget(),
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.Automation:
|
case ModType.Automation:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
@ -125,6 +128,7 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
new OsuModRelax(),
|
new OsuModRelax(),
|
||||||
new OsuModAutopilot(),
|
new OsuModAutopilot(),
|
||||||
};
|
};
|
||||||
|
|
||||||
case ModType.Fun:
|
case ModType.Fun:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
@ -133,6 +137,7 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
new OsuModGrow(),
|
new OsuModGrow(),
|
||||||
new MultiMod(new ModWindUp<OsuHitObject>(), new ModWindDown<OsuHitObject>()),
|
new MultiMod(new ModWindUp<OsuHitObject>(), new ModWindDown<OsuHitObject>()),
|
||||||
};
|
};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return new Mod[] { };
|
return new Mod[] { };
|
||||||
}
|
}
|
||||||
|
@ -199,6 +199,7 @@ namespace osu.Game.Rulesets.Osu.Replays
|
|||||||
|
|
||||||
// Wait until Auto could "see and react" to the next note.
|
// Wait until Auto could "see and react" to the next note.
|
||||||
double waitTime = h.StartTime - Math.Max(0.0, h.TimePreempt - reactionTime);
|
double waitTime = h.StartTime - Math.Max(0.0, h.TimePreempt - reactionTime);
|
||||||
|
|
||||||
if (waitTime > lastFrame.Time)
|
if (waitTime > lastFrame.Time)
|
||||||
{
|
{
|
||||||
lastFrame = new OsuReplayFrame(waitTime, lastFrame.Position) { Actions = lastFrame.Actions };
|
lastFrame = new OsuReplayFrame(waitTime, lastFrame.Position) { Actions = lastFrame.Actions };
|
||||||
@ -314,6 +315,7 @@ namespace osu.Game.Rulesets.Osu.Replays
|
|||||||
|
|
||||||
endFrame.Position = endPosition;
|
endFrame.Position = endPosition;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Slider slider:
|
case Slider slider:
|
||||||
for (double j = FrameDelay; j < slider.Duration; j += FrameDelay)
|
for (double j = FrameDelay; j < slider.Duration; j += FrameDelay)
|
||||||
{
|
{
|
||||||
|
@ -37,8 +37,6 @@ namespace osu.Game.Rulesets.Osu.Scoring
|
|||||||
comboResultCounts.Clear();
|
comboResultCounts.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private const double harshness = 0.01;
|
|
||||||
|
|
||||||
protected override void ApplyResult(JudgementResult result)
|
protected override void ApplyResult(JudgementResult result)
|
||||||
{
|
{
|
||||||
base.ApplyResult(result);
|
base.ApplyResult(result);
|
||||||
@ -47,28 +45,29 @@ namespace osu.Game.Rulesets.Osu.Scoring
|
|||||||
|
|
||||||
if (result.Type != HitResult.None)
|
if (result.Type != HitResult.None)
|
||||||
comboResultCounts[osuResult.ComboType] = comboResultCounts.GetOrDefault(osuResult.ComboType) + 1;
|
comboResultCounts[osuResult.ComboType] = comboResultCounts.GetOrDefault(osuResult.ComboType) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override double HealthAdjustmentFactorFor(JudgementResult result)
|
||||||
|
{
|
||||||
switch (result.Type)
|
switch (result.Type)
|
||||||
{
|
{
|
||||||
case HitResult.Great:
|
case HitResult.Great:
|
||||||
Health.Value += (10.2 - hpDrainRate) * harshness;
|
return 10.2 - hpDrainRate;
|
||||||
break;
|
|
||||||
|
|
||||||
case HitResult.Good:
|
case HitResult.Good:
|
||||||
Health.Value += (8 - hpDrainRate) * harshness;
|
return 8 - hpDrainRate;
|
||||||
break;
|
|
||||||
|
|
||||||
case HitResult.Meh:
|
case HitResult.Meh:
|
||||||
Health.Value += (4 - hpDrainRate) * harshness;
|
return 4 - hpDrainRate;
|
||||||
break;
|
|
||||||
|
|
||||||
/*case HitResult.SliderTick:
|
// case HitResult.SliderTick:
|
||||||
Health.Value += Math.Max(7 - hpDrainRate, 0) * 0.01;
|
// return Math.Max(7 - hpDrainRate, 0) * 0.01;
|
||||||
break;*/
|
|
||||||
|
|
||||||
case HitResult.Miss:
|
case HitResult.Miss:
|
||||||
Health.Value -= hpDrainRate * (harshness * 2);
|
return hpDrainRate;
|
||||||
break;
|
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,22 +43,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
|
|
||||||
private readonly InputResampler resampler = new InputResampler();
|
private readonly InputResampler resampler = new InputResampler();
|
||||||
|
|
||||||
protected override DrawNode CreateDrawNode() => new TrailDrawNode();
|
protected override DrawNode CreateDrawNode() => new TrailDrawNode(this);
|
||||||
|
|
||||||
protected override void ApplyDrawNode(DrawNode node)
|
|
||||||
{
|
|
||||||
base.ApplyDrawNode(node);
|
|
||||||
|
|
||||||
TrailDrawNode tNode = (TrailDrawNode)node;
|
|
||||||
tNode.Shader = shader;
|
|
||||||
tNode.Texture = texture;
|
|
||||||
tNode.Size = size;
|
|
||||||
tNode.Time = time;
|
|
||||||
|
|
||||||
for (int i = 0; i < parts.Length; ++i)
|
|
||||||
if (parts[i].InvalidationID > tNode.Parts[i].InvalidationID)
|
|
||||||
tNode.Parts[i] = parts[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
public CursorTrail()
|
public CursorTrail()
|
||||||
{
|
{
|
||||||
@ -167,33 +152,53 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
|
|
||||||
private class TrailDrawNode : DrawNode
|
private class TrailDrawNode : DrawNode
|
||||||
{
|
{
|
||||||
public IShader Shader;
|
protected new CursorTrail Source => (CursorTrail)base.Source;
|
||||||
public Texture Texture;
|
|
||||||
|
|
||||||
public float Time;
|
private IShader shader;
|
||||||
|
private Texture texture;
|
||||||
|
|
||||||
public readonly TrailPart[] Parts = new TrailPart[max_sprites];
|
private float time;
|
||||||
public Vector2 Size;
|
|
||||||
|
private readonly TrailPart[] parts = new TrailPart[max_sprites];
|
||||||
|
private Vector2 size;
|
||||||
|
|
||||||
private readonly VertexBuffer<TexturedTrailVertex> vertexBuffer = new QuadVertexBuffer<TexturedTrailVertex>(max_sprites, BufferUsageHint.DynamicDraw);
|
private readonly VertexBuffer<TexturedTrailVertex> vertexBuffer = new QuadVertexBuffer<TexturedTrailVertex>(max_sprites, BufferUsageHint.DynamicDraw);
|
||||||
|
|
||||||
public TrailDrawNode()
|
public TrailDrawNode(CursorTrail source)
|
||||||
|
: base(source)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < max_sprites; i++)
|
for (int i = 0; i < max_sprites; i++)
|
||||||
{
|
{
|
||||||
Parts[i].InvalidationID = 0;
|
parts[i].InvalidationID = 0;
|
||||||
Parts[i].WasUpdated = false;
|
parts[i].WasUpdated = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ApplyState()
|
||||||
|
{
|
||||||
|
base.ApplyState();
|
||||||
|
|
||||||
|
shader = Source.shader;
|
||||||
|
texture = Source.texture;
|
||||||
|
size = Source.size;
|
||||||
|
time = Source.time;
|
||||||
|
|
||||||
|
for (int i = 0; i < Source.parts.Length; ++i)
|
||||||
|
{
|
||||||
|
if (Source.parts[i].InvalidationID > parts[i].InvalidationID)
|
||||||
|
parts[i] = Source.parts[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Draw(Action<TexturedVertex2D> vertexAction)
|
public override void Draw(Action<TexturedVertex2D> vertexAction)
|
||||||
{
|
{
|
||||||
Shader.GetUniform<float>("g_FadeClock").UpdateValue(ref Time);
|
shader.GetUniform<float>("g_FadeClock").UpdateValue(ref time);
|
||||||
|
|
||||||
int updateStart = -1, updateEnd = 0;
|
int updateStart = -1, updateEnd = 0;
|
||||||
for (int i = 0; i < Parts.Length; ++i)
|
|
||||||
|
for (int i = 0; i < parts.Length; ++i)
|
||||||
{
|
{
|
||||||
if (Parts[i].WasUpdated)
|
if (parts[i].WasUpdated)
|
||||||
{
|
{
|
||||||
if (updateStart == -1)
|
if (updateStart == -1)
|
||||||
updateStart = i;
|
updateStart = i;
|
||||||
@ -202,22 +207,22 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
int start = i * 4;
|
int start = i * 4;
|
||||||
int end = start;
|
int end = start;
|
||||||
|
|
||||||
Vector2 pos = Parts[i].Position;
|
Vector2 pos = parts[i].Position;
|
||||||
float time = Parts[i].Time;
|
float localTime = parts[i].Time;
|
||||||
|
|
||||||
Texture.DrawQuad(
|
texture.DrawQuad(
|
||||||
new Quad(pos.X - Size.X / 2, pos.Y - Size.Y / 2, Size.X, Size.Y),
|
new Quad(pos.X - size.X / 2, pos.Y - size.Y / 2, size.X, size.Y),
|
||||||
DrawColourInfo.Colour,
|
DrawColourInfo.Colour,
|
||||||
null,
|
null,
|
||||||
v => vertexBuffer.Vertices[end++] = new TexturedTrailVertex
|
v => vertexBuffer.Vertices[end++] = new TexturedTrailVertex
|
||||||
{
|
{
|
||||||
Position = v.Position,
|
Position = v.Position,
|
||||||
TexturePosition = v.TexturePosition,
|
TexturePosition = v.TexturePosition,
|
||||||
Time = time + 1,
|
Time = localTime + 1,
|
||||||
Colour = v.Colour,
|
Colour = v.Colour,
|
||||||
});
|
});
|
||||||
|
|
||||||
Parts[i].WasUpdated = false;
|
parts[i].WasUpdated = false;
|
||||||
}
|
}
|
||||||
else if (updateStart != -1)
|
else if (updateStart != -1)
|
||||||
{
|
{
|
||||||
@ -232,12 +237,12 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
|
|
||||||
base.Draw(vertexAction);
|
base.Draw(vertexAction);
|
||||||
|
|
||||||
Shader.Bind();
|
shader.Bind();
|
||||||
|
|
||||||
Texture.TextureGL.Bind();
|
texture.TextureGL.Bind();
|
||||||
vertexBuffer.Draw();
|
vertexBuffer.Draw();
|
||||||
|
|
||||||
Shader.Unbind();
|
shader.Unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
|
using osu.Game.Rulesets.Osu.Configuration;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.UI.Cursor
|
namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||||
@ -16,6 +19,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
|
|
||||||
private readonly Container<Drawable> fadeContainer;
|
private readonly Container<Drawable> fadeContainer;
|
||||||
|
|
||||||
|
private readonly Bindable<bool> showTrail = new Bindable<bool>(true);
|
||||||
|
|
||||||
|
private readonly CursorTrail cursorTrail;
|
||||||
|
|
||||||
public OsuCursorContainer()
|
public OsuCursorContainer()
|
||||||
{
|
{
|
||||||
InternalChild = fadeContainer = new Container
|
InternalChild = fadeContainer = new Container
|
||||||
@ -23,11 +30,19 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new CursorTrail { Depth = 1 }
|
cursorTrail = new CursorTrail { Depth = 1 }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader(true)]
|
||||||
|
private void load(OsuRulesetConfigManager config)
|
||||||
|
{
|
||||||
|
config?.BindWith(OsuRulesetSetting.ShowCursorTrail, showTrail);
|
||||||
|
|
||||||
|
showTrail.BindValueChanged(v => cursorTrail.FadeTo(v.NewValue ? 1 : 0, 200), true);
|
||||||
|
}
|
||||||
|
|
||||||
private int downCount;
|
private int downCount;
|
||||||
|
|
||||||
private void updateExpandedState()
|
private void updateExpandedState()
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Input.Handlers;
|
using osu.Game.Input.Handlers;
|
||||||
using osu.Game.Replays;
|
using osu.Game.Replays;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.Configuration;
|
using osu.Game.Rulesets.Osu.Configuration;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
@ -22,8 +25,8 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
{
|
{
|
||||||
protected new OsuRulesetConfigManager Config => (OsuRulesetConfigManager)base.Config;
|
protected new OsuRulesetConfigManager Config => (OsuRulesetConfigManager)base.Config;
|
||||||
|
|
||||||
public DrawableOsuRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
public DrawableOsuRuleset(Ruleset ruleset, WorkingBeatmap beatmap, IReadOnlyList<Mod> mods)
|
||||||
: base(ruleset, beatmap)
|
: base(ruleset, beatmap, mods)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,8 +46,10 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
{
|
{
|
||||||
case HitCircle circle:
|
case HitCircle circle:
|
||||||
return new DrawableHitCircle(circle);
|
return new DrawableHitCircle(circle);
|
||||||
|
|
||||||
case Slider slider:
|
case Slider slider:
|
||||||
return new DrawableSlider(slider);
|
return new DrawableSlider(slider);
|
||||||
|
|
||||||
case Spinner spinner:
|
case Spinner spinner:
|
||||||
return new DrawableSpinner(spinner);
|
return new DrawableSpinner(spinner);
|
||||||
}
|
}
|
||||||
@ -58,8 +63,10 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var first = (OsuHitObject)Objects.First();
|
if (Objects.FirstOrDefault() is OsuHitObject first)
|
||||||
return first.StartTime - first.TimePreempt;
|
return first.StartTime - Math.Max(2000, first.TimePreempt);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,11 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
LabelText = "Snaking out sliders",
|
LabelText = "Snaking out sliders",
|
||||||
Bindable = config.GetBindable<bool>(OsuRulesetSetting.SnakingOutSliders)
|
Bindable = config.GetBindable<bool>(OsuRulesetSetting.SnakingOutSliders)
|
||||||
},
|
},
|
||||||
|
new SettingsCheckbox
|
||||||
|
{
|
||||||
|
LabelText = "Cursor trail",
|
||||||
|
Bindable = config.GetBindable<bool>(OsuRulesetSetting.ShowCursorTrail)
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.MathUtils;
|
|||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Taiko.Judgements;
|
using osu.Game.Rulesets.Taiko.Judgements;
|
||||||
@ -86,7 +87,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Height = 768,
|
Height = 768,
|
||||||
Children = new[] { drawableRuleset = new DrawableTaikoRuleset(new TaikoRuleset(), beatmap) }
|
Children = new[] { drawableRuleset = new DrawableTaikoRuleset(new TaikoRuleset(), beatmap, Array.Empty<Mod>()) }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,15 +101,19 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
case 1:
|
case 1:
|
||||||
addCentreHit(false);
|
addCentreHit(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
addCentreHit(true);
|
addCentreHit(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
addDrumRoll(false);
|
addDrumRoll(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
addDrumRoll(true);
|
addDrumRoll(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
addSwell();
|
addSwell();
|
||||||
delay = scroll_time - 100;
|
delay = scroll_time - 100;
|
||||||
@ -121,6 +126,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
default:
|
default:
|
||||||
playfieldContainer.Delay(delay).ResizeTo(new Vector2(1, rng.Next(25, 400)), 500);
|
playfieldContainer.Delay(delay).ResizeTo(new Vector2(1, rng.Next(25, 400)), 500);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
playfieldContainer.Delay(delay).ResizeTo(new Vector2(1, TaikoPlayfield.DEFAULT_HEIGHT), 500);
|
playfieldContainer.Delay(delay).ResizeTo(new Vector2(1, TaikoPlayfield.DEFAULT_HEIGHT), 500);
|
||||||
break;
|
break;
|
||||||
|
@ -120,6 +120,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
|||||||
List<List<SampleInfo>> allSamples = curveData != null ? curveData.NodeSamples : new List<List<SampleInfo>>(new[] { samples });
|
List<List<SampleInfo>> allSamples = curveData != null ? curveData.NodeSamples : new List<List<SampleInfo>>(new[] { samples });
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for (double j = obj.StartTime; j <= obj.StartTime + taikoDuration + tickSpacing / 8; j += tickSpacing)
|
for (double j = obj.StartTime; j <= obj.StartTime + taikoDuration + tickSpacing / 8; j += tickSpacing)
|
||||||
{
|
{
|
||||||
List<SampleInfo> currentSamples = allSamples[i];
|
List<SampleInfo> currentSamples = allSamples[i];
|
||||||
|
@ -16,6 +16,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements
|
|||||||
{
|
{
|
||||||
case HitResult.Miss:
|
case HitResult.Miss:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return base.HealthIncreaseFor(result);
|
return base.HealthIncreaseFor(result);
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements
|
|||||||
{
|
{
|
||||||
case HitResult.Great:
|
case HitResult.Great:
|
||||||
return 200;
|
return 200;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -26,6 +27,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements
|
|||||||
{
|
{
|
||||||
case HitResult.Great:
|
case HitResult.Great:
|
||||||
return 0.15;
|
return 0.15;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,10 @@ namespace osu.Game.Rulesets.Taiko.Judgements
|
|||||||
{
|
{
|
||||||
case HitResult.Good:
|
case HitResult.Good:
|
||||||
return 100;
|
return 100;
|
||||||
|
|
||||||
case HitResult.Great:
|
case HitResult.Great:
|
||||||
return 300;
|
return 300;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -29,10 +31,13 @@ namespace osu.Game.Rulesets.Taiko.Judgements
|
|||||||
{
|
{
|
||||||
case HitResult.Miss:
|
case HitResult.Miss:
|
||||||
return -1.0;
|
return -1.0;
|
||||||
|
|
||||||
case HitResult.Good:
|
case HitResult.Good:
|
||||||
return 1.1;
|
return 1.1;
|
||||||
|
|
||||||
case HitResult.Great:
|
case HitResult.Great:
|
||||||
return 3.0;
|
return 3.0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user