예제 #1
0
        public override bool Update(Dust dust)
        {
            if (dust.customData is Player)
            {
                Player player = dust.customData as Player;
                Abilities.AbilityHandler mp = player.GetModPlayer <Abilities.AbilityHandler>();

                dust.position  = player.Center + dust.velocity;
                dust.rotation += 6.28f / Abilities.Smash.ChargeTime;

                if (mp.smash.Active && mp.smash.Timer <= Abilities.Smash.ChargeTime)
                {
                    dust.alpha = (int)(mp.smash.Timer / (float)Abilities.Smash.ChargeTime * 255f);
                }

                if (mp.smash.Timer > Abilities.Smash.ChargeTime || !mp.smash.Active)
                {
                    dust.alpha -= 10;
                }
                if (dust.alpha <= 0)
                {
                    dust.active = false;
                }
            }
            else
            {
                dust.active = false;
            }

            return(false);
        }
예제 #2
0
        public override bool Update(Dust dust)
        {
            if (dust.customData is Player player)
            {
                Abilities.AbilityHandler mp = player.GetModPlayer <Abilities.AbilityHandler>();

                dust.position = player.Center + dust.velocity;

                if (mp.GetAbility <Smash>(out var smash))
                {
                    dust.rotation += 6.28f / Smash.ChargeTime;

                    if (smash.Active && smash.Timer <= Smash.ChargeTime)
                    {
                        dust.alpha = (int)(smash.Timer / (float)Smash.ChargeTime * 255f);
                    }

                    if (smash.Timer > Smash.ChargeTime || !smash.Active)
                    {
                        dust.alpha -= 10;
                    }
                    if (dust.alpha <= 0)
                    {
                        dust.active = false;
                    }
                }
            }
            else
            {
                dust.active = false;
            }

            return(false);
        }