mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 18:42:56 +08:00
Let fruits know what index they are in the beatmap to draw a visual representation
This commit is contained in:
parent
31865b4d96
commit
02131d75d4
@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
|||||||
if (beatmap.ComboColors.Count == 0)
|
if (beatmap.ComboColors.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int comboIndex = 0;
|
int index = 0;
|
||||||
int colourIndex = 0;
|
int colourIndex = 0;
|
||||||
|
|
||||||
CatchHitObject lastObj = null;
|
CatchHitObject lastObj = null;
|
||||||
@ -31,12 +31,10 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
|||||||
if (obj.NewCombo)
|
if (obj.NewCombo)
|
||||||
{
|
{
|
||||||
if (lastObj != null) lastObj.LastInCombo = true;
|
if (lastObj != null) lastObj.LastInCombo = true;
|
||||||
|
|
||||||
comboIndex = 0;
|
|
||||||
colourIndex = (colourIndex + 1) % beatmap.ComboColors.Count;
|
colourIndex = (colourIndex + 1) % beatmap.ComboColors.Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
obj.ComboIndex = comboIndex++;
|
obj.IndexInBeatmap = index++;
|
||||||
obj.ComboColour = beatmap.ComboColors[colourIndex];
|
obj.ComboColour = beatmap.ComboColors[colourIndex];
|
||||||
|
|
||||||
lastObj = obj;
|
lastObj = obj;
|
||||||
|
@ -16,7 +16,10 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
public float X { get; set; }
|
public float X { get; set; }
|
||||||
|
|
||||||
public Color4 ComboColour { get; set; } = Color4.Gray;
|
public Color4 ComboColour { get; set; } = Color4.Gray;
|
||||||
public int ComboIndex { get; set; }
|
|
||||||
|
public int IndexInBeatmap { get; set; }
|
||||||
|
|
||||||
|
public virtual FruitVisualRepresentation VisualRepresentation => (FruitVisualRepresentation)(IndexInBeatmap % 4);
|
||||||
|
|
||||||
public virtual bool NewCombo { get; set; }
|
public virtual bool NewCombo { get; set; }
|
||||||
|
|
||||||
@ -44,4 +47,13 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
Scale = 1.0f - 0.7f * (difficulty.CircleSize - 5) / 5;
|
Scale = 1.0f - 0.7f * (difficulty.CircleSize - 5) / 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum FruitVisualRepresentation
|
||||||
|
{
|
||||||
|
Pear,
|
||||||
|
Grape,
|
||||||
|
Apple,
|
||||||
|
Orange,
|
||||||
|
Banana // banananananannaanana
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user