Skip to content

Commit

Permalink
Fixes related to bump
Browse files Browse the repository at this point in the history
  • Loading branch information
LumpBloom7 committed Jul 18, 2024
1 parent 698e56c commit 47f523b
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 51 deletions.
14 changes: 7 additions & 7 deletions osu.Game.Rulesets.Rush/Beatmaps/RushGeneratedBeatmapConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,23 @@ void updatePrevious(LanedHitLane? newLane)
var kiaiMultiplier = original.Kiai ? kiai_multiplier : 1;

// try to get a lane from the force flags
if (flags.HasFlagFast(HitObjectFlags.ForceSameLane) || flags.HasFlagFast(HitObjectFlags.SuggestSameLane) && random.NextDouble() < suggest_probability)
if (flags.HasFlag(HitObjectFlags.ForceSameLane) || flags.HasFlag(HitObjectFlags.SuggestSameLane) && random.NextDouble() < suggest_probability)
lane = previousLane;
else if (flags.HasFlagFast(HitObjectFlags.ForceNotSameLane) || flags.HasFlagFast(HitObjectFlags.SuggestNotSameLane) && random.NextDouble() < suggest_probability)
else if (flags.HasFlag(HitObjectFlags.ForceNotSameLane) || flags.HasFlag(HitObjectFlags.SuggestNotSameLane) && random.NextDouble() < suggest_probability)
lane = previousLane?.Opposite();

// get the lane from the object
lane ??= laneForHitObject(original);

// if we should end a sheet, try to
if (currentStarSheets.Count > 0 && (flags.HasFlagFast(HitObjectFlags.ForceEndStarSheet) || flags.HasFlagFast(HitObjectFlags.SuggestEndStarSheet) && random.NextDouble() < starsheet_end_probability))
if (currentStarSheets.Count > 0 && (flags.HasFlag(HitObjectFlags.ForceEndStarSheet) || flags.HasFlag(HitObjectFlags.SuggestEndStarSheet) && random.NextDouble() < starsheet_end_probability))
{
// TODO: for now we'll end both sheets where they are and ignore snapping logic
currentStarSheets.Clear();
}

// if we should start a starsheet...
if (flags.HasFlagFast(HitObjectFlags.ForceStartStarSheet) || flags.HasFlagFast(HitObjectFlags.SuggestStartStarSheet) && random.NextDouble() < starsheet_start_probability)
if (flags.HasFlag(HitObjectFlags.ForceStartStarSheet) || flags.HasFlag(HitObjectFlags.SuggestStartStarSheet) && random.NextDouble() < starsheet_start_probability)
{
// TODO: for now, end all existing sheets
currentStarSheets.Clear();
Expand Down Expand Up @@ -202,15 +202,15 @@ void updatePrevious(LanedHitLane? newLane)
currentStarSheets.Remove(LanedHitLane.Ground);

// if it's low probability, potentially skip this object
if (flags.HasFlagFast(HitObjectFlags.LowProbability) && random.NextDouble() < skip_probability)
if (flags.HasFlag(HitObjectFlags.LowProbability) && random.NextDouble() < skip_probability)
{
updatePrevious(lane ?? previousLane);
yield break;
}

// if not too close to a sawblade, allow adding a double hit
if (original.StartTime - lastSawbladeTime >= sawblade_same_lane_safety_time
&& flags.HasFlagFast(HitObjectFlags.AllowDoubleHit)
&& flags.HasFlag(HitObjectFlags.AllowDoubleHit)
&& original.StartTime >= nextDualHitTime
&& random.NextDouble() < dualhit_probability)
{
Expand Down Expand Up @@ -281,7 +281,7 @@ void updatePrevious(LanedHitLane? newLane)
// we didn't add a sawblade, or
// we added a sawblade and are allowed to replace the hit entirely, or
// we added a sawblade that was in the opposite lane
if (finalLane != blockedLane && !tooCloseToLastSawblade && (!sawbladeAdded || !flags.HasFlagFast(HitObjectFlags.AllowSawbladeReplace)))
if (finalLane != blockedLane && !tooCloseToLastSawblade && (!sawbladeAdded || !flags.HasFlag(HitObjectFlags.AllowSawbladeReplace)))
yield return createNormalHit(original, finalLane);

updatePrevious(finalLane);
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Rush/Replays/RushReplayFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public LegacyReplayFrame ToLegacy(IBeatmap beatmap)
return new LegacyReplayFrame(Time, flags, 0f, getFeverActivationButtonState(FeverActivationMode));
}

private static FeverActivationMode getFeverActivationMode(ReplayButtonState buttonState) => buttonState.HasFlagFast(ReplayButtonState.Smoke) switch
private static FeverActivationMode getFeverActivationMode(ReplayButtonState buttonState) => buttonState.HasFlag(ReplayButtonState.Smoke) switch
{
true => FeverActivationMode.Automatic,
false => FeverActivationMode.Manual
Expand Down
3 changes: 0 additions & 3 deletions osu.Game.Rulesets.Rush/RushSkinComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@ public RushSkinComponent(RushSkinComponents component)
: base(component)
{
}

protected override string RulesetPrefix => RushRuleset.SHORT_NAME;
protected override string ComponentName => Component.ToString().ToLower();
}
}
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Rush/UI/DefaultHitExplosion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public void Animate()
{
var scale = 0.8f + random.NextDouble() * 0.2f;
var duration = average_duration * (0.8f + random.NextDouble() * 0.4f);
var radians = MathUtils.DegreesToRadians(triangle.Rotation + 90);
var radians = float.DegreesToRadians(triangle.Rotation + 90);
var distance = DrawWidth * (0.8f + random.NextDouble() * 0.2f);
var target = new Vector2(MathF.Cos(radians), MathF.Sin(radians)) * (float)distance;
triangle.Scale = new Vector2((float)scale);
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Rush/UI/Ground/DefaultGround.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected override void UpdateAfterChildren()

protected override bool OnInvalidate(Invalidation invalidation, InvalidationSource source)
{
if (invalidation.HasFlagFast(Invalidation.DrawSize))
if (invalidation.HasFlag(Invalidation.DrawSize))
{
slats.Clear(false);

Expand Down
76 changes: 38 additions & 38 deletions osu.Game.Rulesets.Rush/osu.Game.Rulesets.Rush.csproj
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Project">
<Configurations>Debug;Release;Development</Configurations>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget>
<RootNamespace>osu.Game.Rulesets.Rush</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Development' ">
<Optimize Condition=" '$(Optimize)' == '' ">true</Optimize>
</PropertyGroup>
<Choose>
<When Condition=" '$(Configuration)' == 'Release' ">
<PropertyGroup>
<AssemblyName>osu.Game.Rulesets.Rush</AssemblyName>
<AssemblyTitle>rush for osu!</AssemblyTitle>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<AssemblyName>osu.Game.Rulesets.Rush-dev</AssemblyName>
<AssemblyTitle>rush for osu! (development build)</AssemblyTitle>
</PropertyGroup>
</Otherwise>
</Choose>
<ItemGroup>
<!-- The automated version of this (<EmbeddedResource Include="xyz\**" />) would prepend the RootNamespace to name,
that will not work well with DllResourceStore as it can only determine the root namespace via AssemblyName,
and we change that based on the build configuration for separation purposes.
Therefore prepend the AssemblyName to embedded resources names instead. -->
<EmbeddedResource Include="Resources\**">
<LogicalName>$(AssemblyName).$([System.String]::Copy(%(Identity)).Replace($([System.IO.Path]::DirectorySeparatorChar.ToString()), '.'))</LogicalName>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game" Version="2024.718.0" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Project">
<Configurations>Debug;Release;Development</Configurations>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget>
<RootNamespace>osu.Game.Rulesets.Rush</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Development' ">
<Optimize Condition=" '$(Optimize)' == '' ">true</Optimize>
</PropertyGroup>
<Choose>
<When Condition=" '$(Configuration)' == 'Release' ">
<PropertyGroup>
<AssemblyName>osu.Game.Rulesets.Rush</AssemblyName>
<AssemblyTitle>rush for osu!</AssemblyTitle>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<AssemblyName>osu.Game.Rulesets.Rush-dev</AssemblyName>
<AssemblyTitle>rush for osu! (development build)</AssemblyTitle>
</PropertyGroup>
</Otherwise>
</Choose>
<ItemGroup>
<!-- The automated version of this (<EmbeddedResource Include="xyz\**" />) would prepend the RootNamespace to name,
that will not work well with DllResourceStore as it can only determine the root namespace via AssemblyName,
and we change that based on the build configuration for separation purposes.
Therefore prepend the AssemblyName to embedded resources names instead. -->
<EmbeddedResource Include="Resources\**">
<LogicalName>$(AssemblyName).$([System.String]::Copy(%(Identity)).Replace($([System.IO.Path]::DirectorySeparatorChar.ToString()), '.'))</LogicalName>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game" Version="2024.718.0" />
</ItemGroup>
</Project>

0 comments on commit 47f523b

Please sign in to comment.