1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-04 02:53:38 +08:00
This commit is contained in:
Shawdooow
2018-03-22 10:07:57 -04:00
Unverified
parent f3febf5010
commit 41692740f6
14 changed files with 49 additions and 57 deletions
@@ -14,6 +14,10 @@ namespace Symcol.Rulesets.Core.HitObjects
public abstract class DrawableSymcolHitObject<TObject> : DrawableHitObject<TObject>
where TObject : HitObject
{
//Future prep?
public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null) { }
public override void ApplyTransformsAt(double time, bool propagateChildren = false) { }
protected virtual Container<Drawable> Content => new Container();
public IReadOnlyList<Drawable> Children
@@ -7,23 +7,7 @@ namespace osu.Game.Rulesets.Shape.Beatmaps
{
public override void PostProcess(Beatmap<ShapeHitObject> beatmap)
{
if (beatmap.ComboColours.Count == 0)
return;
int comboIndex = 0;
int colourIndex = 0;
foreach (var obj in beatmap.HitObjects)
{
if (obj.NewCombo)
{
comboIndex = 0;
colourIndex = (colourIndex + 1) % beatmap.ComboColours.Count;
}
obj.ComboIndex = comboIndex++;
obj.ComboColour = beatmap.ComboColours[colourIndex];
}
base.PostProcess(beatmap);
}
}
}
@@ -7,23 +7,7 @@ namespace osu.Game.Rulesets.Vitaru.Beatmaps
{
public override void PostProcess(Beatmap<VitaruHitObject> beatmap)
{
if (beatmap.ComboColours.Count == 0)
return;
int comboIndex = 0;
int colourIndex = 0;
foreach (var obj in beatmap.HitObjects)
{
if (obj.NewCombo)
{
comboIndex = 0;
colourIndex = (colourIndex + 1) % beatmap.ComboColours.Count;
}
obj.ComboIndex = comboIndex++;
obj.ComboColour = beatmap.ComboColours[colourIndex];
}
base.PostProcess(beatmap);
}
}
}
@@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Characters
AlwaysPresent = true;
CharacterName = "enemy";
Team = 1;
CharacterColor = pattern.ComboColour;
CharacterColor = drawablePattern.AccentColour;
HitboxWidth = 27;
}
@@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Characters.Pieces
Team = ParentCharacter.Team,
BulletSpeed = 0.8f,
BulletDamage = 5,
ComboColour = ParentCharacter.CharacterColor,
ColorOverride = ParentCharacter.CharacterColor,
StartAngle = StartAngle,
}));
s.MoveTo(ToSpaceOfOtherDrawable(new Vector2(0, 0), s));
@@ -688,7 +688,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Characters
{
LaserSize = new Vector2(80, 400),
Team = Team,
ComboColour = CharacterColor,
StartTime = Time.Current,
EndTime = Time.Current + 2000
}));
@@ -1148,11 +1147,11 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Characters
StartTime = Time.Current,
Cs = 1.2f,
DummyMode = true,
ComboColour = color,
BulletAngleRadian = angle,
BulletSpeed = speed,
BulletDiameter = 16,
BulletDamage = 20 * damageMultiplier,
ColorOverride = color,
Team = Team,
Ghost = currentCharacter == Characters.YuyukoSaigyouji | currentCharacter == Characters.AliceMuyart
}));
@@ -81,7 +81,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables
Size = new Vector2(30),
CornerRadius = 30f / 2,
BorderThickness = 10,
BorderColour = pattern.ComboColour,
BorderColour = AccentColour,
Children = new Drawable[]
{
new Box
@@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
Colour = pattern.ComboColour.Opacity(0.5f),
Colour = AccentColour.Opacity(0.5f),
Radius = Width / 2,
}
};
@@ -109,7 +109,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables
Origin = Anchor.Centre,
Size = new Vector2(20),
BorderThickness = 6,
BorderColour = pattern.ComboColour,
BorderColour = AccentColour,
Children = new Drawable[]
{
new Box
@@ -120,7 +120,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
Colour = pattern.ComboColour.Opacity(0.5f),
Colour = AccentColour.Opacity(0.5f),
Radius = Width / 2,
}
};
@@ -141,7 +141,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables
foreach (var o in pattern.NestedHitObjects)
{
var b = (Bullet)o;
b.ComboColour = pattern.ComboColour;
DrawableBullet drawableBullet = new DrawableBullet(ParentContainer, b, this);
ParentContainer.Add(drawableBullet);
AddNested(drawableBullet);
@@ -1,6 +1,9 @@
using osu.Game.Rulesets.Objects.Drawables;
using Symcol.Rulesets.Core.HitObjects;
using System.ComponentModel;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Skinning;
using OpenTK.Graphics;
namespace osu.Game.Rulesets.Vitaru.Objects.Drawables
{
@@ -12,6 +15,16 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables
public readonly Framework.Graphics.Containers.Container ParentContainer;
protected override void SkinChanged(ISkinSource skin, bool allowFallback)
{
base.SkinChanged(skin, allowFallback);
if (HitObject is IHasComboInformation combo && HitObject.ColorOverride == Color4.White)
AccentColour = skin.GetValue<SkinConfiguration, Color4>(s => s.ComboColours.Count > 0 ? s.ComboColours[combo.ComboIndex % s.ComboColours.Count] : (Color4?)null) ?? Color4.White;
else
AccentColour = HitObject.ColorOverride;
}
public DrawableVitaruHitObject(VitaruHitObject hitObject, Framework.Graphics.Containers.Container parent) : base(hitObject)
{
ParentContainer = parent;
@@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables.Pieces
Alpha = 0,
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Colour = drawableBullet.Bullet.ComboColour,
Colour = drawableBullet.AccentColour,
Texture = VitaruRuleset.VitaruTextures.Get("bulletKiai"),
};
@@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables.Pieces
Origin = Anchor.Centre,
Alpha = 1,
RelativeSizeAxes = Axes.Both,
BorderColour = drawableBullet.Bullet.ComboColour,
BorderColour = drawableBullet.AccentColour,
BorderThickness = 6,
Masking = true,
@@ -103,7 +103,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables.Pieces
{
Radius = drawableBullet.Bullet.BulletDiameter,
Type = EdgeEffectType.Shadow,
Colour = drawableBullet.Bullet.ComboColour.Opacity(0.2f)
Colour = drawableBullet.AccentColour.Opacity(0.2f)
};
if (drawableBullet.Bullet.Ghost && currentCharacter == Characters.Characters.YuyukoSaigyouji | currentCharacter == Characters.Characters.AliceMuyart)
@@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables.Pieces
CornerRadius = 16;
BorderThickness = 8;
BorderColour = drawableLaser.Laser.ComboColour;
BorderColour = drawableLaser.AccentColour;
Child = new Box
{
@@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables.Pieces
Anchor = Anchor.Centre;
BorderThickness = 4;
AlwaysPresent = true;
BorderColour = seekingBullet.SeekingBullet.ComboColour;
BorderColour = seekingBullet.AccentColour;
CornerRadius = 4;
Child = new Box
@@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables.Pieces
{
Type = EdgeEffectType.Shadow,
Radius = 8,
Colour = seekingBullet.SeekingBullet.ComboColour.Opacity(0.25f),
Colour = seekingBullet.AccentColour.Opacity(0.25f),
};
}
+5 -6
View File
@@ -182,6 +182,11 @@ namespace osu.Game.Rulesets.Vitaru.Objects
b.Cs = Cs;
b.StackHeight = StackHeight;
b.NewCombo = NewCombo;
b.IndexInCurrentCombo = IndexInCurrentCombo;
b.ComboIndex = ComboIndex;
b.LastInCombo = LastInCombo;
b.ShootPlayer = shootPlayer;
AddNested(b);
@@ -238,7 +243,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects
{
StartTime = StartTime,
Position = Position,
ComboColour = ComboColour,
BulletSpeed = PatternSpeed,
BulletAngleRadian = angle,
BulletDiameter = diameter,
@@ -262,7 +266,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects
{
StartTime = StartTime,
Position = Position,
ComboColour = ComboColour,
BulletSpeed = speed,
BulletAngleRadian = patternAngleRadian,
BulletDiameter = diameter,
@@ -288,7 +291,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects
{
StartTime = StartTime,
Position = Position,
ComboColour = ComboColour,
BulletSpeed = PatternSpeed,
BulletAngleRadian = angle,
BulletDiameter = diameter,
@@ -320,7 +322,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects
{
StartTime = StartTime,
Position = Position,
ComboColour = ComboColour,
BulletSpeed = speed,
BulletAngleRadian = angle,
BulletDiameter = diameter,
@@ -351,7 +352,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects
{
StartTime = StartTime,
Position = Position,
ComboColour = ComboColour,
BulletSpeed = speed,
BulletAngleRadian = patternAngleRadian,
BulletDiameter = diameter,
@@ -375,7 +375,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects
{
StartTime = StartTime,
Position = Position,
ComboColour = ComboColour,
BulletSpeed = PatternSpeed,
BulletAngleRadian = patternAngleRadian,
BulletDiameter = diameter,
@@ -3,10 +3,12 @@ using OpenTK;
using OpenTK.Graphics;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects.Types;
using System;
namespace osu.Game.Rulesets.Vitaru.Objects
{
public abstract class VitaruHitObject : HitObject
public abstract class VitaruHitObject : HitObject, IHasComboInformation
{
public float BPM;
@@ -30,10 +32,17 @@ namespace osu.Game.Rulesets.Vitaru.Objects
public abstract HitObjectType Type { get; }
public Color4 ComboColour { get; set; }
//TODO: make null != White
public Color4 ColorOverride { get; set; } = Color4.White;
public virtual bool NewCombo { get; set; }
public int IndexInCurrentCombo { get; set; }
public int ComboIndex { get; set; }
public bool LastInCombo { get; set; }
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
{
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
@@ -40,6 +40,7 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
</ItemGroup>
<ItemGroup>
<Compile Include="Multi\VitaruPlayerInformation.cs" />