<commit_before>﻿// Copyright (c) 2007-2017 ppy Pty Ltd <<EMAIL>>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using System;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.MathUtils;
using osu.Game.Graphics;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Drawables;
using OpenTK;
using OpenTK.Graphics;

namespace osu.Game.Rulesets.Catch.Objects.Drawable
{
    public class DrawableFruit : DrawableScrollingHitObject<CatchBaseHit>
    {
        private const float pulp_size = 30;

        private class Pulp : Circle, IHasAccentColour
        {
            public Pulp()
            {
                Size = new Vector2(pulp_size);

                EdgeEffect = new EdgeEffectParameters
                {
                    Type = EdgeEffectType.Glow,
                    Radius = 5,
                    Colour = AccentColour.Opacity(0.5f),
                };
            }

            public Color4 AccentColour { get; set; } = Color4.White;
        }


        public DrawableFruit(CatchBaseHit h)
            : base(h)
        {
            Origin = Anchor.Centre;
            Size = new Vector2(pulp_size * 2, pulp_size * 2.6f);

            RelativePositionAxes = Axes.Both;
            X = h.Position;

            Colour = new Color4(RNG.NextSingle(), RNG.NextSingle(), RNG.NextSingle(), 1);

            Rotation = (float)(RNG.NextDouble() - 0.5f) * 40;
        }

        public Func<CatchBaseHit, bool> CheckPosition;

        [BackgroundDependencyLoader]
        private void load()
        {
            Children = new Framework.Graphics.Drawable[]
            {
                //todo: share this more
                new BufferedContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    CacheDrawnFrameBuffer = true,
                    Children = new Framework.Graphics.Drawable[]
                    {
                        new Pulp
                        {
                            RelativePositionAxes = Axes.Both,
                            Anchor = Anchor.TopCentre,
                            Origin = Anchor.TopCentre,
                            Scale = new Vector2(0.6f),
                        },
                        new Pulp
                        {
                            RelativePositionAxes = Axes.Both,
                            Anchor = Anchor.CentreLeft,
                            Origin = Anchor.CentreLeft,
                            Y = -0.08f
                        },
                        new Pulp
                        {
                            RelativePositionAxes = Axes.Both,
                            Anchor = Anchor.CentreRight,
                            Origin = Anchor.CentreRight,
                            Y = -0.08f
                        },
                        new Pulp
                        {
                            RelativePositionAxes = Axes.Both,
                            Anchor = Anchor.BottomCentre,
                            Origin = Anchor.BottomCentre,
                        },
                    }
                }
            };
        }

        private const float preempt = 1000;
<commit_msg>Make fruits look a bit closer to the final design<commit_after>﻿// Copyright (c) 2007-2017 ppy Pty Ltd <<EMAIL>>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using System;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.MathUtils;
using osu.Game.Graphics;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Drawables;
using OpenTK;
using OpenTK.Graphics;

namespace osu.Game.Rulesets.Catch.Objects.Drawable
{
    public class DrawableFruit : DrawableScrollingHitObject<CatchBaseHit>
    {
        private const float pulp_size = 20;

        private class Pulp : Circle, IHasAccentColour
        {
            public Pulp()
            {
                Size = new Vector2(pulp_size);

                Blending = BlendingMode.Additive;
                Colour = Color4.White.Opacity(0.9f);
            }

            private Color4 accentColour;
            public Color4 AccentColour
            {
                get { return accentColour; }
                set
                {
                    accentColour = value;

                    EdgeEffect = new EdgeEffectParameters
                    {
                        Type = EdgeEffectType.Glow,
                        Radius = 5,
                        Colour = accentColour.Lighten(100),
                    };
                }
            }
        }


        public DrawableFruit(CatchBaseHit h)
            : base(h)
        {
            Origin = Anchor.Centre;
            Size = new Vector2(pulp_size * 2.2f, pulp_size * 2.8f);

            RelativePositionAxes = Axes.Both;
            X = h.Position;

            AccentColour = HitObject.ComboColour;

            Masking = false;

            Rotation = (float)(RNG.NextDouble() - 0.5f) * 40;
        }

        public Func<CatchBaseHit, bool> CheckPosition;

        [BackgroundDependencyLoader]
        private void load()
        {
            Children = new Framework.Graphics.Drawable[]
            {
                //todo: share this more
                new BufferedContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    CacheDrawnFrameBuffer = true,
                    Children = new Framework.Graphics.Drawable[]
                    {
                        new Pulp
                        {
                            RelativePositionAxes = Axes.Both,
                            Anchor = Anchor.TopCentre,
                            Origin = Anchor.TopCentre,
                            AccentColour = AccentColour,
                            Scale = new Vector2(0.6f),
                        },
                        new Pulp
                        {
                            RelativePositionAxes = Axes.Both,
                            Anchor = Anchor.CentreLeft,
                            Origin = Anchor.CentreLeft,
                            AccentColour = AccentColour,
                            Y = -0.08f
                        },
                        new Pulp
                        {
                            RelativePositionAxes = Axes.Both,
                            Anchor = Anchor.CentreRight,
                            Origin = Anchor.CentreRight,
                            AccentColour = AccentColour,
                            Y = -0.08f
                        },
                        new Pulp
                        {
                            RelativePositionAxes = Axes.Both,
                            Anchor = Anchor.BottomCentre,
                            Origin = Anchor.BottomCentre,
                            AccentColour = AccentColour,
                        },
                    }
                }
            };
        }

        private const float preempt = 1000;

{'fraction_non_alphanumeric': 0.07129251700680272, 'fraction_numerical': 0.011292517006802722, 'mean_word_length': 1.0648876404494383, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2366327', 'n_tokens_mistral': 1967, 'n_tokens_neox': 1776, 'n_words': 361}