Skip to content

Commit

Permalink
Merge pull request #14 from Flutterish/Update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
Flutterish authored Nov 14, 2020
2 parents 532380b + ebd1d13 commit 5248c84
Show file tree
Hide file tree
Showing 120 changed files with 769 additions and 953 deletions.
54 changes: 4 additions & 50 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,50 +1,4 @@
osu.Game.Rulesets.Hitokori.csproj.user
bin\
obj\
bin/Release/netstandard2.1/osu.Game.xml
bin/Release/netstandard2.1/osu.Game.Rulesets.Hitokori.pdb
bin/Release/netstandard2.1/osu.Game.Rulesets.Hitokori.dll
bin/Release/netstandard2.1/osu.Game.Rulesets.Hitokori.deps.json
bin/Release/netstandard2.1/osu.Game.pdb
bin/Release/netstandard2.1/osu.Game.dll
.vs/osu.Game.Rulesets.Hitokori/v16/.suo
.vs/osu.Game.Rulesets.Hitokori/DesignTimeBuild/.dtbcache.v2
obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.cs
obj/Debug/netstandard2.1/osu.Game.Rulesets.Hitokori.AssemblyInfo.cs
obj/Debug/netstandard2.1/osu.Game.Rulesets.Hitokori.AssemblyInfoInputs.cache
obj/Debug/netstandard2.1/osu.Game.Rulesets.Hitokori.assets.cache
obj/Debug/netstandard2.1/osu.Game.Rulesets.Hitokori.csprojAssemblyReference.cache
obj/osu.Game.Rulesets.Hitokori.csproj.nuget.dgspec.json
obj/osu.Game.Rulesets.Hitokori.csproj.nuget.g.props
obj/osu.Game.Rulesets.Hitokori.csproj.nuget.g.targets
obj/project.assets.json
obj/project.nuget.cache
obj/Release/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.cs
obj/Release/netstandard2.1/osu.Game.Rulesets.Hitokori.AssemblyInfo.cs
obj/Release/netstandard2.1/osu.Game.Rulesets.Hitokori.AssemblyInfoInputs.cache
obj/Release/netstandard2.1/osu.Game.Rulesets.Hitokori.assets.cache
obj/Release/netstandard2.1/osu.Game.Rulesets.Hitokori.csproj.CopyComplete
obj/Release/netstandard2.1/osu.Game.Rulesets.Hitokori.csproj.CoreCompileInputs.cache
obj/Release/netstandard2.1/osu.Game.Rulesets.Hitokori.csproj.FileListAbsolute.txt
obj/Release/netstandard2.1/osu.Game.Rulesets.Hitokori.csprojAssemblyReference.cache
obj/Release/netstandard2.1/osu.Game.Rulesets.Hitokori.dll
obj/Release/netstandard2.1/osu.Game.Rulesets.Hitokori.pdb
bin/Release/netstandard2.1/Resources/hitokori-BotRight.png
bin/Release/netstandard2.1/Resources/hitokori-BotNeutral.png
bin/Release/netstandard2.1/Resources/hitokori-BotLeft.png
bin/Release/netstandard2.1/Resources/hitokori-BotHold.png
obj/Debug/netstandard2.1/osu.Game.Rulesets.Hitokori.pdb
obj/Debug/netstandard2.1/osu.Game.Rulesets.Hitokori.dll
obj/Debug/netstandard2.1/osu.Game.Rulesets.Hitokori.csproj.FileListAbsolute.txt
obj/Debug/netstandard2.1/osu.Game.Rulesets.Hitokori.csproj.CoreCompileInputs.cache
obj/Debug/netstandard2.1/osu.Game.Rulesets.Hitokori.csproj.CopyComplete
bin/Debug/netstandard2.1/Resources/hitokori-BotRight.png
bin/Debug/netstandard2.1/Resources/hitokori-BotNeutral.png
bin/Debug/netstandard2.1/Resources/hitokori-BotLeft.png
bin/Debug/netstandard2.1/Resources/hitokori-BotHold.png
bin/Debug/netstandard2.1/osu.Game.xml
bin/Debug/netstandard2.1/osu.Game.Rulesets.Hitokori.pdb
bin/Debug/netstandard2.1/osu.Game.Rulesets.Hitokori.dll
bin/Debug/netstandard2.1/osu.Game.Rulesets.Hitokori.deps.json
bin/Debug/netstandard2.1/osu.Game.pdb
bin/Debug/netstandard2.1/osu.Game.dll
.vs/
*/bin/
*/obj/
*.user
31 changes: 0 additions & 31 deletions Beatmaps/HitokoriBeatmap.cs

This file was deleted.

45 changes: 0 additions & 45 deletions Beatmaps/HitokoriBeatmapProcessor.cs

This file was deleted.

7 changes: 0 additions & 7 deletions Difficulty/HitokoriDifficultyAttributes.cs

This file was deleted.

17 changes: 0 additions & 17 deletions Difficulty/HitokoriPerformanceCalculator.cs

This file was deleted.

28 changes: 28 additions & 0 deletions Hitokori/Beatmaps/HitokoriBeatmap.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Hitokori.Objects;
using osu.Game.Rulesets.Hitokori.Objects.Base;
using System.Collections.Generic;
using System.Linq;

namespace osu.Game.Rulesets.Hitokori.Beatmaps {
public class HitokoriBeatmap : Beatmap<HitokoriHitObject> {
public override IEnumerable<BeatmapStatistic> GetStatistics () {
yield return new BeatmapStatistic {
Name = "Press Tiles",
Content = HitObjects.OfType<TapTile>().Count().ToString(),
CreateIcon = () => new SpriteIcon { Icon = FontAwesome.Solid.Circle }
};
yield return new BeatmapStatistic {
Name = "Hold Tiles",
Content = HitObjects.OfType<HoldTile>().Count().ToString(),
CreateIcon = () => new SpriteIcon { Icon = FontAwesome.Solid.HandHolding }
};
yield return new BeatmapStatistic {
Name = "Spin Tiles",
Content = HitObjects.OfType<SpinTile>().Count().ToString(),
CreateIcon = () => new SpriteIcon { Icon = FontAwesome.Solid.RedoAlt }
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using osu.Game.Rulesets.Objects.Types;
using System.Collections.Generic;
using System.Linq;
using System.Threading;

namespace osu.Game.Rulesets.Hitokori.Beatmaps {
public class HitokoriBeatmapConverter : BeatmapConverter<HitokoriHitObject> {
Expand All @@ -35,32 +36,31 @@ public HitokoriBeatmapConverter ( IBeatmap beatmap, Ruleset ruleset ) : base( be
public override bool CanConvert ()
=> true; // can always convert because it only uses timing. For some reason some modes still dont convert though ( taiko? )

protected override IEnumerable<HitokoriHitObject> ConvertHitObject ( HitObject original, IBeatmap beatmap ) { // TODO do the async version
switch ( original ) {
case IHasDuration duration:
return new HoldTile {
Samples = new List<IList<Audio.HitSampleInfo>> { original.Samples, original.Samples },
StartTime = original.StartTime,
EndTime = duration.EndTime
}.Yield();

default:
return new TapTile {
Samples = original.Samples.Yield().ToList(),
PressTime = original.StartTime
}.Yield();
protected override IEnumerable<HitokoriHitObject> ConvertHitObject ( HitObject original, IBeatmap beatmap, CancellationToken cancellationToken ) {
if ( original is IHasDuration duration ) {
yield return new HoldTile {
Samples = new List<IList<Audio.HitSampleInfo>> { original.Samples, original.Samples },
StartTime = original.StartTime,
EndTime = duration.EndTime
};
}
else {
yield return new TapTile {
Samples = original.Samples.Yield().ToList(),
PressTime = original.StartTime
};
}
}

protected override Beatmap<HitokoriHitObject> ConvertBeatmap ( IBeatmap original ) {
protected override Beatmap<HitokoriHitObject> ConvertBeatmap ( IBeatmap original, CancellationToken cancellationToken ) {
var beatmap = CreateBeatmap() as HitokoriBeatmap;

Windows.SetDifficulty( Beatmap.BeatmapInfo.StarDifficulty );
AngleWindows.SetDifficulty( Beatmap.BeatmapInfo.StarDifficulty );

beatmap.BeatmapInfo = original.BeatmapInfo;
beatmap.ControlPointInfo = original.ControlPointInfo;
beatmap.HitObjects = ConvertHitObjects( original.HitObjects, original );
beatmap.HitObjects = ConvertHitObjects( original.HitObjects, original, cancellationToken );
PostProcess( beatmap );
GenerateBreaks( beatmap );

Expand Down Expand Up @@ -219,11 +219,12 @@ void GenerateBreaks ( HitokoriBeatmap Beatmap ) { // BUG doubleTile mod breaks b
Beatmap.Breaks = breaks;
}

private List<HitokoriHitObject> ConvertHitObjects ( IReadOnlyList<HitObject> originalHitObjects, IBeatmap original ) {
private List<HitokoriHitObject> ConvertHitObjects ( IReadOnlyList<HitObject> originalHitObjects, IBeatmap original, CancellationToken cancellationToken ) {
List<HitokoriHitObject> hitObjects = new List<HitokoriHitObject>();

foreach ( var hitObject in originalHitObjects ) {
hitObjects.AddRange( ConvertHitObject( hitObject, original ) );
cancellationToken.ThrowIfCancellationRequested();
hitObjects.AddRange( ConvertHitObject( hitObject, original, cancellationToken ) );
}

return hitObjects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using osu.Game.Rulesets.Hitokori.Utils;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using System;
using System.Collections.Generic;
using System.Linq;

Expand All @@ -20,7 +19,7 @@ public HitokoriDifficultyCalculator ( Ruleset ruleset, WorkingBeatmap beatmap )
protected override DifficultyAttributes CreateDifficultyAttributes ( IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate ) {
double readingDifficulty = skills.First<Reading>().DifficultyValue() * STAR_SCALING_FACTOR;
double speedDifficulty = skills.First<Speed>().DifficultyValue() * STAR_SCALING_FACTOR;
double starRating = (readingDifficulty + speedDifficulty) / 2;
double starRating = ( readingDifficulty + speedDifficulty ) / 2;

return new DifficultyAttributes {
StarRating = starRating,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public HitokoriDifficultyHitObject ( HitObject hitObject, HitObject lastObject,
BPM = bpm;
ChangedDirection = hitokoriObject.FirstPoint.ChangedDirection;
HitAngle = lastHitokoriObject.LastPoint.AngleOffset;
if (hitokoriObject is HoldTile) {
HoldAngle = ((HoldTile)hitokoriObject).FirstPoint.AngleOffset;
if ( hitokoriObject is HoldTile ) {
HoldAngle = ( (HoldTile)hitokoriObject ).FirstPoint.AngleOffset;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ public class Reading : Skill {

private const double DIRECTION_CHANGE_BONUS = 1.05;

protected override double StrainValueOf(DifficultyHitObject current) {
protected override double StrainValueOf ( DifficultyHitObject current ) {
HitokoriDifficultyHitObject hitokoriCurrent = (HitokoriDifficultyHitObject)current;

double strain = CalculateAngleStrain(hitokoriCurrent.HitAngle);
double strain = CalculateAngleStrain( hitokoriCurrent.HitAngle );

if (hitokoriCurrent.ChangedDirection) strain *= DIRECTION_CHANGE_BONUS;
if ( hitokoriCurrent.ChangedDirection ) strain *= DIRECTION_CHANGE_BONUS;

if (hitokoriCurrent.HoldAngle != null) {
strain += CalculateAngleStrain(hitokoriCurrent.HoldAngle.Value);
if ( hitokoriCurrent.HoldAngle != null ) {
strain += CalculateAngleStrain( hitokoriCurrent.HoldAngle.Value );
}

return 1 + strain;
}

//Strain linearly grows from 0.0 to 2/3 the farther the angle is from 180 degrees
private double CalculateAngleStrain(double angle) {
return Math.Abs((Math.Abs(angle) - Math.PI) / (Math.PI * 3 / 2));
private double CalculateAngleStrain ( double angle ) {
return Math.Abs( ( Math.Abs( angle ) - Math.PI ) / ( Math.PI * 3 / 2 ) );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ public class Speed : Skill {
/// </summary>
private const double BASE_BPM = 120;

protected override double StrainValueOf(DifficultyHitObject current) {
protected override double StrainValueOf ( DifficultyHitObject current ) {
HitokoriDifficultyHitObject hitokoriCurrent = (HitokoriDifficultyHitObject)current;
double bpm = Math.Min(hitokoriCurrent.BPM, MAX_BPM);
double bpm = Math.Min( hitokoriCurrent.BPM, MAX_BPM );

return Math.Pow(bpm / BASE_BPM, 0.6);
return Math.Pow( bpm / BASE_BPM, 0.6 );
}
}
}
File renamed without changes.
26 changes: 22 additions & 4 deletions HitokoriRuleset.cs → Hitokori/HitokoriRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public override Drawable CreateIcon ()

public override IBeatmapConverter CreateBeatmapConverter ( IBeatmap beatmap )
=> new HitokoriBeatmapConverter( beatmap, this );
public override IBeatmapProcessor CreateBeatmapProcessor ( IBeatmap beatmap )
=> new HitokoriBeatmapProcessor( beatmap );

public override IRulesetConfigManager CreateConfig ( SettingsStore settings )
=> new HitokoriSettingsManager( settings, RulesetInfo );
Expand All @@ -45,8 +43,9 @@ public override DifficultyCalculator CreateDifficultyCalculator ( WorkingBeatmap
=> new HitokoriDifficultyCalculator( this, beatmap );
public override HealthProcessor CreateHealthProcessor ( double drainStartTime )
=> new HitokoriHealthProcessor();
public override ScoreProcessor CreateScoreProcessor ()
=> new HitokoriScoreProcessor();
public override ScoreProcessor CreateScoreProcessor () {
return base.CreateScoreProcessor();
}
public override StatisticRow[] CreateStatisticsForScore ( ScoreInfo score, IBeatmap playableBeatmap )
=> base.CreateStatisticsForScore( score, playableBeatmap );

Expand Down Expand Up @@ -128,5 +127,24 @@ public override IEnumerable<KeyBinding> GetDefaultKeyBindings ( int variant = 0
new KeyBinding( InputKey.MouseRight, HitokoriAction.Action2 )
};
}

public override string GetDisplayNameForHitResult ( HitResult result ) {
return result switch
{
HitResult.Miss => "Miss",
HitResult.Great => "Late",
HitResult.Ok => "Early",
_ => "Perfect"
};
}

protected override IEnumerable<HitResult> GetValidHitResults () {
return new HitResult[] {
HitResult.Miss,
HitResult.Ok,
HitResult.Great,
HitResult.Perfect
};
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mods;
using System;
using System.Collections.Generic;
using System.Text;

namespace osu.Game.Rulesets.Hitokori.Mods {
public abstract class AutoImplementedMod : Mod, IApplicableToBeatmapConverter {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Hitokori.Beatmaps;
using osu.Game.Rulesets.Mods;

Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5248c84

Please sign in to comment.