public virtual void PlayerUpdate(Color lastColor, Player player) { if (player != null) { player.OverrideHairColor = Hyperline.GetCurrentColor(Hyperline.Instance.lastColor, player.Dashes, 0, player.Hair); Hyperline.Instance.maddyCrownSprite = null; } }
/// <summary> /// Updates the hair, allowing for custom physics. /// </summary> /// <param name="orig">The default function for hair updating.</param> /// <param name="self">The player's hair.</param> /// <remarks> /// It is reccomended to look at the default hair after update before writing this. /// </remarks> public virtual void AfterUpdate(On.Celeste.PlayerHair.orig_AfterUpdate orig, PlayerHair self) { Player player = self.EntityAs <Player>(); if (!(!Hyperline.Settings.DoFeatherColor && player.StateMachine.State == 19)) { player.Hair.Color = Hyperline.GetCurrentColor(Hyperline.Instance.lastColor, player.Dashes, 0, player.Hair); } orig(self); }
public Hyperline() { UI = new HyperlineUI(); triggerManager = new TriggerManager(); presetManager = new PresetManager(); lastColor = new Color(); Instance = this; lastHairLength = 4; //add the default hair types hairTypes = new HairTypeManager(); AddHairType(new GradientHair()); AddHairType(new PatternHair()); AddHairType(new SolidHair()); AddHairType(new RainbowHair()); AddHairType(new DefaultHair()); DefaultPDashA = new ParticleType { Color = Calc.HexToColor("44B7FF"), Color2 = Calc.HexToColor("75c9ff"), ColorMode = ParticleType.ColorModes.Blink, FadeMode = ParticleType.FadeModes.Late, LifeMin = 1f, LifeMax = 1.8f, Size = 1f, SpeedMin = 10f, SpeedMax = 20f, Acceleration = new Vector2(0f, 8f), DirectionRange = 1.0471976f }; DefaultPDashB = new ParticleType(DefaultPDashA) { Color = Calc.HexToColor("AC3232"), Color2 = Calc.HexToColor("e05959") }; DefaultPDashBadB = new ParticleType(DefaultPDashA) { Color = Calc.HexToColor("9B3FB5"), Color2 = Calc.HexToColor("CC8EE2") }; PlayerParticle = new ParticleType(DefaultPDashA) { }; }