Skip to content

Commit

Permalink
Use whistle sample for EX state
Browse files Browse the repository at this point in the history
  • Loading branch information
LumpBloom7 committed Nov 3, 2024
1 parent 320aa7a commit 842a858
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ public partial class SentakkiBeatmapConverter
private Tap convertHitCircle(HitObject original, int lane, double startTime)
{
bool isBreak = original.Samples.Any(s => s.Name == HitSampleInfo.HIT_FINISH);
bool isSoft = original.Samples.Any(s => s.Name == HitSampleInfo.HIT_WHISTLE);

Tap result = new Tap
{
Lane = lane,
Samples = original.Samples,
StartTime = startTime,
Break = isBreak
Break = isBreak,
Ex = isSoft
};

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ private SentakkiHitObject convertSlider(HitObject original, int lane, bool force

bool isSuitableSlider = !isLazySlider(original);

bool isBreak = slider.NodeSamples[0].Any(s => s.Name == HitSampleInfo.HIT_FINISH);

if (isSuitableSlider && !forceHoldNote)
{
var slide = tryConvertToSlide(original, lane, allowFans);
Expand All @@ -33,13 +31,17 @@ private SentakkiHitObject convertSlider(HitObject original, int lane, bool force
return slide.Value.Item1;
}

bool isBreak = slider.NodeSamples[0].Any(s => s.Name == HitSampleInfo.HIT_FINISH);
bool isSoft = slider.NodeSamples[0].Any(s => s.Name == HitSampleInfo.HIT_WHISTLE);

var hold = new Hold
{
Lane = lane,
Break = isBreak,
StartTime = original.StartTime,
Duration = duration,
NodeSamples = slider.NodeSamples,
Ex = isSoft,
};
return hold;
}
Expand All @@ -55,6 +57,7 @@ private SentakkiHitObject convertSlider(HitObject original, int lane, bool force

bool tailBreak = nodeSamples.Last().Any(s => s.Name == HitSampleInfo.HIT_FINISH);
bool headBreak = nodeSamples.First().Any(s => s.Name == HitSampleInfo.HIT_FINISH);
bool isSoft = original.Samples.Any(s => s.Name == HitSampleInfo.HIT_WHISTLE);

int endOffset = selectedPath.Sum(p => p.EndOffset);

Expand All @@ -75,7 +78,8 @@ private SentakkiHitObject convertSlider(HitObject original, int lane, bool force
Lane = lane.NormalizePath(),
StartTime = original.StartTime,
Samples = nodeSamples.FirstOrDefault(),
Break = headBreak
Break = headBreak,
Ex = isSoft
};

return (slide, end);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,17 @@ protected override IEnumerable<SentakkiHitObject> ConvertHitObject(HitObject ori
if (targetTime >= fanStartTime)
break;

if (tryGetLaneForTwinNote(original.StartTime, out int twinLane))
bool isBreak = samples.Any(h => h.Name == HitSampleInfo.HIT_FINISH);
bool isSoft = samples.Any(h => h.Name == HitSampleInfo.HIT_WHISTLE);

if (tryGetLaneForTwinNote(targetTime, out int twinLane))
{
var sho = (SentakkiLanedHitObject)convertHitCircle(original, twinLane, targetTime);
sho.Break = isBreak;
sho.Samples = samples;
sho.Ex = isSoft;

yield return sho;
};
}

Expand Down

0 comments on commit 842a858

Please sign in to comment.