Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into tgi74-rightclicks…
Browse files Browse the repository at this point in the history
…crolling
  • Loading branch information
peppy committed Apr 18, 2018
2 parents 81f0649 + 69a91c6 commit bd834dd
Show file tree
Hide file tree
Showing 49 changed files with 1,149 additions and 333 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ App.config text eol=crlf
*.bat text eol=crlf
*.cmd text eol=crlf
*.snippet text eol=crlf
*.manifest text eol=crlf

# Check out with lf (UNIX) line endings
*.sh text eol=lf
Expand Down
46 changes: 46 additions & 0 deletions app.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity version="1.0.0.0" name="osu!" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</asmv1:assembly>
2 changes: 1 addition & 1 deletion osu-framework
Submodule osu-framework updated 459 files
2 changes: 1 addition & 1 deletion osu.Desktop.Deploy/osu.Desktop.Deploy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup Label="Package References">
<PackageReference Include="NuGet.CommandLine" Version="4.5.1" />
<PackageReference Include="NUnit" Version="3.8.1" />
<PackageReference Include="NUnit" Version="3.10.1" />
<PackageReference Include="squirrel.windows" Version="1.7.8" Condition="'$(TargetFramework)' == 'net461'" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.4.0" />
</ItemGroup>
Expand Down
39 changes: 39 additions & 0 deletions osu.Game.Rulesets.Catch/CatchRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using osu.Framework.Input.Bindings;
using osu.Game.Rulesets.Catch.Replays;
using osu.Game.Rulesets.Replays.Types;
using osu.Game.Beatmaps.Legacy;

namespace osu.Game.Rulesets.Catch
{
Expand All @@ -29,6 +30,44 @@ public override IEnumerable<KeyBinding> GetDefaultKeyBindings(int variant = 0) =
new KeyBinding(InputKey.Shift, CatchAction.Dash),
};

public override IEnumerable<Mod> ConvertLegacyMods(LegacyMods mods)
{
if (mods.HasFlag(LegacyMods.Nightcore))
yield return new CatchModNightcore();
else if (mods.HasFlag(LegacyMods.DoubleTime))
yield return new CatchModDoubleTime();

if (mods.HasFlag(LegacyMods.Autoplay))
yield return new CatchModAutoplay();

if (mods.HasFlag(LegacyMods.Easy))
yield return new CatchModEasy();

if (mods.HasFlag(LegacyMods.Flashlight))
yield return new CatchModFlashlight();

if (mods.HasFlag(LegacyMods.HalfTime))
yield return new CatchModHalfTime();

if (mods.HasFlag(LegacyMods.HardRock))
yield return new CatchModHardRock();

if (mods.HasFlag(LegacyMods.Hidden))
yield return new CatchModHidden();

if (mods.HasFlag(LegacyMods.NoFail))
yield return new CatchModNoFail();

if (mods.HasFlag(LegacyMods.Perfect))
yield return new CatchModPerfect();

if (mods.HasFlag(LegacyMods.Relax))
yield return new CatchModRelax();

if (mods.HasFlag(LegacyMods.SuddenDeath))
yield return new CatchModSuddenDeath();
}

public override IEnumerable<Mod> GetModsFor(ModType type)
{
switch (type)
Expand Down
77 changes: 76 additions & 1 deletion osu.Game.Rulesets.Catch/Mods/CatchModHardRock.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,88 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <[email protected]>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using osu.Framework.MathUtils;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.UI;
using osu.Game.Rulesets.Mods;
using System;

namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModHardRock : ModHardRock
public class CatchModHardRock : ModHardRock, IApplicableToHitObject<CatchHitObject>
{
public override double ScoreMultiplier => 1.12;
public override bool Ranked => true;

private float lastStartX;
private int lastStartTime;

public void ApplyToHitObject(CatchHitObject hitObject)
{
float position = hitObject.X;
int startTime = (int)hitObject.StartTime;

if (lastStartX == 0)
{
lastStartX = position;
lastStartTime = startTime;
return;
}

float diff = lastStartX - position;
int timeDiff = startTime - lastStartTime;

if (timeDiff > 1000)
{
lastStartX = position;
lastStartTime = startTime;
return;
}

if (diff == 0)
{
bool right = RNG.NextBool();

float rand = Math.Min(20, (float)RNG.NextDouble(0, timeDiff / 4d)) / CatchPlayfield.BASE_WIDTH;

if (right)
{
if (position + rand <= 1)
position += rand;
else
position -= rand;
}
else
{
if (position - rand >= 0)
position -= rand;
else
position += rand;
}

hitObject.X = position;

return;
}

if (Math.Abs(diff) < timeDiff / 3d)
{
if (diff > 0)
{
if (position - diff > 0)
position -= diff;
}
else
{
if (position - diff < 1)
position -= diff;
}
}

hitObject.X = position;

lastStartX = position;
lastStartTime = startTime;
}
}
}
69 changes: 69 additions & 0 deletions osu.Game.Rulesets.Mania/ManiaRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,82 @@
using osu.Game.Graphics;
using osu.Game.Rulesets.Mania.Replays;
using osu.Game.Rulesets.Replays.Types;
using osu.Game.Beatmaps.Legacy;

namespace osu.Game.Rulesets.Mania
{
public class ManiaRuleset : Ruleset
{
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new ManiaRulesetContainer(this, beatmap, isForCurrentRuleset);

public override IEnumerable<Mod> ConvertLegacyMods(LegacyMods mods)
{
if (mods.HasFlag(LegacyMods.Nightcore))
yield return new ManiaModNightcore();
else if (mods.HasFlag(LegacyMods.DoubleTime))
yield return new ManiaModDoubleTime();

if (mods.HasFlag(LegacyMods.Autoplay))
yield return new ManiaModAutoplay();

if (mods.HasFlag(LegacyMods.Easy))
yield return new ManiaModEasy();

if (mods.HasFlag(LegacyMods.FadeIn))
yield return new ManiaModFadeIn();

if (mods.HasFlag(LegacyMods.Flashlight))
yield return new ManiaModFlashlight();

if (mods.HasFlag(LegacyMods.HalfTime))
yield return new ManiaModHalfTime();

if (mods.HasFlag(LegacyMods.HardRock))
yield return new ManiaModHardRock();

if (mods.HasFlag(LegacyMods.Hidden))
yield return new ManiaModHidden();

if (mods.HasFlag(LegacyMods.Key1))
yield return new ManiaModKey1();

if (mods.HasFlag(LegacyMods.Key2))
yield return new ManiaModKey2();

if (mods.HasFlag(LegacyMods.Key3))
yield return new ManiaModKey3();

if (mods.HasFlag(LegacyMods.Key4))
yield return new ManiaModKey4();

if (mods.HasFlag(LegacyMods.Key5))
yield return new ManiaModKey5();

if (mods.HasFlag(LegacyMods.Key6))
yield return new ManiaModKey6();

if (mods.HasFlag(LegacyMods.Key7))
yield return new ManiaModKey7();

if (mods.HasFlag(LegacyMods.Key8))
yield return new ManiaModKey8();

if (mods.HasFlag(LegacyMods.Key9))
yield return new ManiaModKey9();

if (mods.HasFlag(LegacyMods.NoFail))
yield return new ManiaModNoFail();

if (mods.HasFlag(LegacyMods.Perfect))
yield return new ManiaModPerfect();

if (mods.HasFlag(LegacyMods.Random))
yield return new ManiaModRandom();

if (mods.HasFlag(LegacyMods.SuddenDeath))
yield return new ManiaModSuddenDeath();
}

public override IEnumerable<Mod> GetModsFor(ModType type)
{
switch (type)
Expand Down
48 changes: 48 additions & 0 deletions osu.Game.Rulesets.Osu/OsuRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Replays;
using osu.Game.Rulesets.Replays.Types;
using osu.Game.Beatmaps.Legacy;

namespace osu.Game.Rulesets.Osu
{
Expand Down Expand Up @@ -66,6 +67,53 @@ public override IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatma
};
}

public override IEnumerable<Mod> ConvertLegacyMods(LegacyMods mods)
{
if (mods.HasFlag(LegacyMods.Nightcore))
yield return new OsuModNightcore();
else if (mods.HasFlag(LegacyMods.DoubleTime))
yield return new OsuModDoubleTime();

if (mods.HasFlag(LegacyMods.Autopilot))
yield return new OsuModAutopilot();

if (mods.HasFlag(LegacyMods.Autoplay))
yield return new OsuModAutoplay();

if (mods.HasFlag(LegacyMods.Easy))
yield return new OsuModEasy();

if (mods.HasFlag(LegacyMods.Flashlight))
yield return new OsuModFlashlight();

if (mods.HasFlag(LegacyMods.HalfTime))
yield return new OsuModHalfTime();

if (mods.HasFlag(LegacyMods.HardRock))
yield return new OsuModHardRock();

if (mods.HasFlag(LegacyMods.Hidden))
yield return new OsuModHidden();

if (mods.HasFlag(LegacyMods.NoFail))
yield return new OsuModNoFail();

if (mods.HasFlag(LegacyMods.Perfect))
yield return new OsuModPerfect();

if (mods.HasFlag(LegacyMods.Relax))
yield return new OsuModRelax();

if (mods.HasFlag(LegacyMods.SpunOut))
yield return new OsuModSpunOut();

if (mods.HasFlag(LegacyMods.SuddenDeath))
yield return new OsuModSuddenDeath();

if (mods.HasFlag(LegacyMods.Target))
yield return new OsuModTarget();
}

public override IEnumerable<Mod> GetModsFor(ModType type)
{
switch (type)
Expand Down
Loading

0 comments on commit bd834dd

Please sign in to comment.