예제 #1
0
        public void Tick(SceneGame scene)
        {
            var sword    = Curio.GetBehavior <BehaviorSword>();
            var enflamed = Enflamed;

            if (sword != null /*&& sword.HasBlood*/)
            {
                FrameCharge += scene.TimeModCurrent;
            }
            else
            {
                Extinguish();
            }

            if (Enflamed)
            {
                if (FrameVisual.Done)
                {
                    if (sword != null)
                    {
                        var particle = new ExplosionParticle(scene, SpriteLoader.Instance.AddSprite("content/effect_explosion"), sword.GetBlade(8), Random.Next(10, 20))
                        {
                            Angle    = Curio.GetVisualAngle() + sword.VisualAngle() + Random.NextFloat(-0.3f, +0.3f),
                            Color    = Color.White,
                            DrawPass = DrawPass.EffectAdditive,
                        };
                        particle.Size.Set(Random.NextFloat(0.5f, 1.0f));
                    }
                    FrameVisual.Reset();
                }
                FrameVisual += scene.TimeModCurrent;
            }
        }