using System;
using System.Collections.Generic;
using System.Text;
using HumanLikeBattleRobots.Graphic;
using HumanLikeBattleRobots.Data;

namespace HumanLikeBattleRobots.Logic
{
    class SmallCannon : Weapon
    {
        private bool isLeft;

        public SmallCannon(Vec2f position, Vec2f normal, bool isLeft, bool isEnemy)
            : base(position, normal, isEnemy)
        {
            cooldownPeriod = 1.1f;
            health = 20;
            weaponSprite = new SmallCannonSprite(3, isLeft);
        }

        protected sealed override void OnFire(Vec2f aimPosition)
        {
            //new Cannonball(this.position + this.normal * 43, this.normal * 260);
            if (!GameManager.Mute)
                Bass.Bass.BASS_SamplePlayEx(SoundResources.Cannon[GameManager.MainRandom.Next(2)],
                    0, 0, 40, 0, false);
            new Cannonball(this.position + this.normal * 43, this.normal * 260, isEnemy, 0.5f);
        }
    }
}
