using System;
using Microsoft.Xna.Framework;
using MonoGame.Extended.Timers;
using XmasHell.BulletML;

namespace XmasHell.Entities.Bosses.XmasTree
{
    class XmasTreeBehaviour1 : AbstractBossBehaviour
    {
        public XmasTreeBehaviour1(Boss boss) : base(boss)
        {
            InitialBehaviourLife = GameConfig.BossDefaultBehaviourLife * 1.5f;
        }

        public override void Start()
        {
            base.Start();

            Boss.Speed = GameConfig.BossDefaultSpeed * 2.5f;

            Boss.StartShootTimer = true;
            Boss.ShootTimerTime = 0.01f;
            Boss.ShootTimerFinished += ShootTimerFinished;

            Boss.CurrentAnimator.Play("Idle");
        }

        private void ShootTimerFinished(object sender, float e)
        {
            if (CurrentBehaviourLife <= InitialBehaviourLife / 1.5f)
                Boss.Game.GameManager.MoverManager.TriggerPattern("XmasTree/pattern1.2", BulletType.Type2, false, Boss.Position());
            else
                Boss.Game.GameManager.MoverManager.TriggerPattern("XmasTree/pattern1.1", BulletType.Type2, false, Boss.Position());
        }

        public override void Stop()
        {
            base.Stop();

            Boss.StartShootTimer = false;
            Boss.ShootTimerFinished -= ShootTimerFinished;
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }
    }
}
using System;
using Microsoft.Xna.Framework;
using MonoGame.Extended.Timers;
using XmasHell.BulletML;

namespace XmasHell.Entities.Bosses.XmasTree
{
    class XmasTreeBehaviour1 : AbstractBossBehaviour
    {
        public XmasTreeBehaviour1(Boss boss) : base(boss)
        {
            InitialBehaviourLife = GameConfig.BossDefaultBehaviourLife * 1.5f;
        }

        public override void Start()
        {
            base.Start();

            Boss.Speed = GameConfig.BossDefaultSpeed * 2.5f;

            Boss.StartShootTimer = true;
            Boss.ShootTimerTime = 0.01f;
            Boss.ShootTimerFinished += ShootTimerFinished;

            Boss.CurrentAnimator.Play("Idle");

            Boss.EnableRandomPosition(true);
        }

        private void ShootTimerFinished(object sender, float e)
        {
            if (CurrentBehaviourLife <= InitialBehaviourLife / 1.5f)
                Boss.Game.GameManager.MoverManager.TriggerPattern("XmasTree/pattern1.2", BulletType.Type2, false, Boss.Position());
            else
                Boss.Game.GameManager.MoverManager.TriggerPattern("XmasTree/pattern1.1", BulletType.Type2, false, Boss.Position());
        }

        public override void Stop()
        {
            base.Stop();

            Boss.StartShootTimer = false;
            Boss.ShootTimerFinished -= ShootTimerFinished;
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }
    }
}
Make the Xmas Tree move randomly on its first pattern.
Make the Xmas Tree move randomly on its first pattern.
