mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 13:32:54 +08:00
Implement combo offsets
This commit is contained in:
parent
da3e2cfee2
commit
31f324945e
@ -20,6 +20,8 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
|
|
||||||
public virtual bool NewCombo { get; set; }
|
public virtual bool NewCombo { get; set; }
|
||||||
|
|
||||||
|
public int ComboOffset { get; set; }
|
||||||
|
|
||||||
public int IndexInCurrentCombo { get; set; }
|
public int IndexInCurrentCombo { get; set; }
|
||||||
|
|
||||||
public int ComboIndex { get; set; }
|
public int ComboIndex { get; set; }
|
||||||
|
@ -42,6 +42,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
RepeatCount = curveData.RepeatCount,
|
RepeatCount = curveData.RepeatCount,
|
||||||
Position = positionData?.Position ?? Vector2.Zero,
|
Position = positionData?.Position ?? Vector2.Zero,
|
||||||
NewCombo = comboData?.NewCombo ?? false,
|
NewCombo = comboData?.NewCombo ?? false,
|
||||||
|
ComboOffset = comboData?.ComboOffset ?? 0,
|
||||||
LegacyLastTickOffset = legacyOffset?.LegacyLastTickOffset
|
LegacyLastTickOffset = legacyOffset?.LegacyLastTickOffset
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -54,6 +55,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
EndTime = endTimeData.EndTime,
|
EndTime = endTimeData.EndTime,
|
||||||
Position = positionData?.Position ?? OsuPlayfield.BASE_SIZE / 2,
|
Position = positionData?.Position ?? OsuPlayfield.BASE_SIZE / 2,
|
||||||
NewCombo = comboData?.NewCombo ?? false,
|
NewCombo = comboData?.NewCombo ?? false,
|
||||||
|
ComboOffset = comboData?.ComboOffset ?? 0,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -64,6 +66,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
Samples = original.Samples,
|
Samples = original.Samples,
|
||||||
Position = positionData?.Position ?? Vector2.Zero,
|
Position = positionData?.Position ?? Vector2.Zero,
|
||||||
NewCombo = comboData?.NewCombo ?? false,
|
NewCombo = comboData?.NewCombo ?? false,
|
||||||
|
ComboOffset = comboData?.ComboOffset ?? 0,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,8 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
|
|
||||||
public virtual bool NewCombo { get; set; }
|
public virtual bool NewCombo { get; set; }
|
||||||
|
|
||||||
|
public int ComboOffset { get; set; }
|
||||||
|
|
||||||
public virtual int IndexInCurrentCombo { get; set; }
|
public virtual int IndexInCurrentCombo { get; set; }
|
||||||
|
|
||||||
public virtual int ComboIndex { get; set; }
|
public virtual int ComboIndex { get; set; }
|
||||||
|
@ -13,5 +13,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
|||||||
public float X { get; set; }
|
public float X { get; set; }
|
||||||
|
|
||||||
public bool NewCombo { get; set; }
|
public bool NewCombo { get; set; }
|
||||||
|
|
||||||
|
public int ComboOffset { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
|||||||
{
|
{
|
||||||
X = position.X,
|
X = position.X,
|
||||||
NewCombo = newCombo,
|
NewCombo = newCombo,
|
||||||
|
ComboOffset = comboOffset
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,6 +34,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
|||||||
{
|
{
|
||||||
X = position.X,
|
X = position.X,
|
||||||
NewCombo = newCombo,
|
NewCombo = newCombo,
|
||||||
|
ComboOffset = comboOffset,
|
||||||
ControlPoints = controlPoints,
|
ControlPoints = controlPoints,
|
||||||
Distance = length,
|
Distance = length,
|
||||||
CurveType = curveType,
|
CurveType = curveType,
|
||||||
@ -45,7 +47,8 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
|||||||
{
|
{
|
||||||
return new ConvertSpinner
|
return new ConvertSpinner
|
||||||
{
|
{
|
||||||
EndTime = endTime
|
EndTime = endTime,
|
||||||
|
ComboOffset = comboOffset
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,5 +13,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
|||||||
public float X { get; set; }
|
public float X { get; set; }
|
||||||
|
|
||||||
public bool NewCombo { get; set; }
|
public bool NewCombo { get; set; }
|
||||||
|
|
||||||
|
public int ComboOffset { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,5 +15,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
|||||||
public double Duration => EndTime - StartTime;
|
public double Duration => EndTime - StartTime;
|
||||||
|
|
||||||
public bool NewCombo { get; set; }
|
public bool NewCombo { get; set; }
|
||||||
|
|
||||||
|
public int ComboOffset { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,12 +22,12 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The offset to apply to all time values.
|
/// The offset to apply to all time values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Offset;
|
protected readonly double Offset;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The beatmap version.
|
/// The beatmap version.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int FormatVersion;
|
protected readonly int FormatVersion;
|
||||||
|
|
||||||
protected ConvertHitObjectParser(double offset, 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));
|
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);
|
bool combo = type.HasFlag(ConvertHitObjectType.NewCombo);
|
||||||
int comboOffset = (int)(type & ConvertHitObjectType.ComboOffset) >> 4;
|
|
||||||
|
|
||||||
type &= ~ConvertHitObjectType.NewCombo;
|
type &= ~ConvertHitObjectType.NewCombo;
|
||||||
|
|
||||||
var soundType = (LegacySoundType)int.Parse(split[4]);
|
var soundType = (LegacySoundType)int.Parse(split[4]);
|
||||||
|
@ -19,6 +19,8 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
|||||||
|
|
||||||
public bool NewCombo { get; set; }
|
public bool NewCombo { get; set; }
|
||||||
|
|
||||||
|
public int ComboOffset { get; set; }
|
||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => null;
|
protected override HitWindows CreateHitWindows() => null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
|||||||
{
|
{
|
||||||
Position = position,
|
Position = position,
|
||||||
NewCombo = newCombo,
|
NewCombo = newCombo,
|
||||||
|
ComboOffset = comboOffset
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,6 +35,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
|||||||
{
|
{
|
||||||
Position = position,
|
Position = position,
|
||||||
NewCombo = newCombo,
|
NewCombo = newCombo,
|
||||||
|
ComboOffset = comboOffset,
|
||||||
ControlPoints = controlPoints,
|
ControlPoints = controlPoints,
|
||||||
Distance = Math.Max(0, length),
|
Distance = Math.Max(0, length),
|
||||||
CurveType = curveType,
|
CurveType = curveType,
|
||||||
@ -47,7 +49,8 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
|||||||
return new ConvertSpinner
|
return new ConvertSpinner
|
||||||
{
|
{
|
||||||
Position = position,
|
Position = position,
|
||||||
EndTime = endTime
|
EndTime = endTime,
|
||||||
|
ComboOffset = comboOffset
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,8 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
|||||||
|
|
||||||
public bool NewCombo { get; set; }
|
public bool NewCombo { get; set; }
|
||||||
|
|
||||||
|
public int ComboOffset { get; set; }
|
||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => null;
|
protected override HitWindows CreateHitWindows() => null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,5 +24,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
|||||||
protected override HitWindows CreateHitWindows() => null;
|
protected override HitWindows CreateHitWindows() => null;
|
||||||
|
|
||||||
public bool NewCombo { get; set; }
|
public bool NewCombo { get; set; }
|
||||||
|
|
||||||
|
public int ComboOffset { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,5 +12,10 @@ namespace osu.Game.Rulesets.Objects.Types
|
|||||||
/// Whether the HitObject starts a new combo.
|
/// Whether the HitObject starts a new combo.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool NewCombo { get; }
|
bool NewCombo { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// When starting a new combo, the offset of the new combo relative to the current one.
|
||||||
|
/// </summary>
|
||||||
|
int ComboOffset { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user