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

namespace HumanLikeBattleRobots.Logic
{
    class MyTower: Tower
    {
        private float bonusTimer = 0;

        public MyTower(Vec2f position, float angle, List<List<Sprite>> sprites) : 
            base(position, angle, sprites) 
        { }

        public override void Proceed(double delta)
        {
            base.Proceed(delta);
            if (bonusTimer > 0)
                bonusTimer += (float)delta;
            if (bonusTimer > 10)
            {
                bonusTimer = 0;
                w1.SetSpeed(0.05f);
                w2.SetSpeed(1f);
            }
        }

        protected override void SetParams()
        {
            w1Radius = 25;
            w2Radius = 40;
            towerSprite = new MyTowerSprite(3);

            w1 = new MachineGun(this.position + normal.Rotate(Math.PI / 2) * 1, normal, true, false);
            w2 = new MySmallCannon(this.position + normal.Rotate(Math.PI / 2) * 1, normal, false, false);

            health = 20;
        }

        public void SetSpeedBonus()
        {
            bonusTimer = 0.0001f;
            w1.SetSpeed(0.03f);
            w2.SetSpeed(0.5f);
        }
    }
}
