1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:07:23 +08:00

Implement combo offsets

This commit is contained in:
smoogipoo 2018-08-15 11:47:31 +09:00
parent da3e2cfee2
commit 31f324945e
13 changed files with 38 additions and 7 deletions

View File

@ -20,6 +20,8 @@ namespace osu.Game.Rulesets.Catch.Objects
public virtual bool NewCombo { get; set; }
public int ComboOffset { get; set; }
public int IndexInCurrentCombo { get; set; }
public int ComboIndex { get; set; }

View File

@ -42,6 +42,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
RepeatCount = curveData.RepeatCount,
Position = positionData?.Position ?? Vector2.Zero,
NewCombo = comboData?.NewCombo ?? false,
ComboOffset = comboData?.ComboOffset ?? 0,
LegacyLastTickOffset = legacyOffset?.LegacyLastTickOffset
};
}
@ -54,6 +55,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
EndTime = endTimeData.EndTime,
Position = positionData?.Position ?? OsuPlayfield.BASE_SIZE / 2,
NewCombo = comboData?.NewCombo ?? false,
ComboOffset = comboData?.ComboOffset ?? 0,
};
}
else
@ -64,6 +66,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
Samples = original.Samples,
Position = positionData?.Position ?? Vector2.Zero,
NewCombo = comboData?.NewCombo ?? false,
ComboOffset = comboData?.ComboOffset ?? 0,
};
}
}

View File

@ -54,6 +54,8 @@ namespace osu.Game.Rulesets.Osu.Objects
public virtual bool NewCombo { get; set; }
public int ComboOffset { get; set; }
public virtual int IndexInCurrentCombo { get; set; }
public virtual int ComboIndex { get; set; }

View File

@ -13,5 +13,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
public float X { get; set; }
public bool NewCombo { get; set; }
public int ComboOffset { get; set; }
}
}

View File

@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
{
X = position.X,
NewCombo = newCombo,
ComboOffset = comboOffset
};
}
@ -33,6 +34,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
{
X = position.X,
NewCombo = newCombo,
ComboOffset = comboOffset,
ControlPoints = controlPoints,
Distance = length,
CurveType = curveType,
@ -45,7 +47,8 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
{
return new ConvertSpinner
{
EndTime = endTime
EndTime = endTime,
ComboOffset = comboOffset
};
}

View File

@ -13,5 +13,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
public float X { get; set; }
public bool NewCombo { get; set; }
public int ComboOffset { get; set; }
}
}

View File

@ -15,5 +15,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
public double Duration => EndTime - StartTime;
public bool NewCombo { get; set; }
public int ComboOffset { get; set; }
}
}

View File

@ -22,12 +22,12 @@ namespace osu.Game.Rulesets.Objects.Legacy
/// <summary>
/// The offset to apply to all time values.
/// </summary>
public double Offset;
protected readonly double Offset;
/// <summary>
/// The beatmap version.
/// </summary>
public int FormatVersion;
protected readonly int FormatVersion;
protected ConvertHitObjectParser(double offset, int formatVersion)
{
@ -43,11 +43,12 @@ namespace osu.Game.Rulesets.Objects.Legacy
Vector2 pos = new Vector2((int)Convert.ToSingle(split[0], CultureInfo.InvariantCulture), (int)Convert.ToSingle(split[1], CultureInfo.InvariantCulture));
ConvertHitObjectType type = (ConvertHitObjectType)int.Parse(split[3]) & ~ConvertHitObjectType.ComboOffset;
ConvertHitObjectType type = (ConvertHitObjectType)int.Parse(split[3]);
int comboOffset = (int)(type & ConvertHitObjectType.ComboOffset) >> 4;
type &= ~ConvertHitObjectType.ComboOffset;
bool combo = type.HasFlag(ConvertHitObjectType.NewCombo);
int comboOffset = (int)(type & ConvertHitObjectType.ComboOffset) >> 4;
type &= ~ConvertHitObjectType.NewCombo;
var soundType = (LegacySoundType)int.Parse(split[4]);

View File

@ -19,6 +19,8 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
public bool NewCombo { get; set; }
public int ComboOffset { get; set; }
protected override HitWindows CreateHitWindows() => null;
}
}

View File

@ -25,6 +25,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
{
Position = position,
NewCombo = newCombo,
ComboOffset = comboOffset
};
}
@ -34,6 +35,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
{
Position = position,
NewCombo = newCombo,
ComboOffset = comboOffset,
ControlPoints = controlPoints,
Distance = Math.Max(0, length),
CurveType = curveType,
@ -47,7 +49,8 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
return new ConvertSpinner
{
Position = position,
EndTime = endTime
EndTime = endTime,
ComboOffset = comboOffset
};
}

View File

@ -19,6 +19,8 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
public bool NewCombo { get; set; }
public int ComboOffset { get; set; }
protected override HitWindows CreateHitWindows() => null;
}
}

View File

@ -24,5 +24,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
protected override HitWindows CreateHitWindows() => null;
public bool NewCombo { get; set; }
public int ComboOffset { get; set; }
}
}

View File

@ -12,5 +12,10 @@ namespace osu.Game.Rulesets.Objects.Types
/// Whether the HitObject starts a new combo.
/// </summary>
bool NewCombo { get; }
/// <summary>
/// When starting a new combo, the offset of the new combo relative to the current one.
/// </summary>
int ComboOffset { get; }
}
}