Change strong hit sample handling to be user input based, not hit object based

This commit is contained in:
Dean Herbert 2023-06-30 17:50:32 +09:00
parent a9587fd1aa
commit 010262c764
3 changed files with 6 additions and 7 deletions

View File

@ -27,7 +27,7 @@ public ArgonDrumSampleTriggerSource(HitObjectContainer hitObjectContainer, Sampl
// TODO: pool flourish sample
}
public override void Play(HitType hitType)
public override void Play(HitType hitType, bool strong)
{
TaikoHitObject? hitObject = GetMostValidObject() as TaikoHitObject;
@ -39,14 +39,13 @@ public override void Play(HitType hitType)
// If the sample is provided by a legacy skin, we should not try and do anything special.
if (skinSource.FindProvider(s => s.GetSample(baseSample) != null) is LegacySkin)
{
base.Play(hitType);
base.Play(hitType, strong);
return;
}
// let the magic begin...
// TODO: should we only play strong samples if the user correctly hits them? arguable.
if ((hitObject as TaikoStrongableHitObject)?.IsStrong == true || hitObject is StrongNestedHitObject)
if (strong)
{
PlaySamples(new ISampleInfo[]
{

View File

@ -82,7 +82,7 @@ public bool OnPressed(KeyBindingPressEvent<TaikoAction> e)
if (strong && hitType == HitType.Rim)
flushRimTriggerSources();
triggerSource.Play(hitType);
triggerSource.Play(hitType, strong);
lastHitTime = Time.Current;
lastAction = e.Action;

View File

@ -33,7 +33,7 @@ public DrumSampleTriggerSource(HitObjectContainer hitObjectContainer, SampleBala
}
}
public virtual void Play(HitType hitType)
public virtual void Play(HitType hitType, bool strong)
{
TaikoHitObject? hitObject = GetMostValidObject() as TaikoHitObject;
@ -43,7 +43,7 @@ public virtual void Play(HitType hitType)
var baseSample = hitObject.CreateHitSampleInfo(hitType == HitType.Rim ? HitSampleInfo.HIT_CLAP : HitSampleInfo.HIT_NORMAL);
// TODO: should we only play strong samples if the user correctly hits them? arguable.
if ((hitObject as TaikoStrongableHitObject)?.IsStrong == true || hitObject is StrongNestedHitObject)
if (strong)
{
PlaySamples(new ISampleInfo[]
{