using System;
using System.Collections.Generic;
using DxLibDLL;
using System.Collections;

namespace HH
{
    class AttackMethods
    {

        //public CBasic attacker;
        //public CBasic target;

        public enum Method
        { threeWayAim, threeWayDown, threeWayDownMissile, fourWayAim, aim, spiralBar, endLoop }

        public static void threeWayAim(CBasic attacker, CBasic target)
        {
                EnemyBulletA eb1 = new EnemyBulletA(attacker);
                EnemyBulletA eb2 = new EnemyBulletA(attacker);
                EnemyBulletA eb3 = new EnemyBulletA(attacker);

                eb1.velocity = 5.2 * Vector.unitvector(attacker.position, target.position);
                eb2.velocity = 5.2 * Vector.unitvector(attacker.position, target.position).rot(30);
                eb3.velocity = 5.2 * Vector.unitvector(attacker.position, target.position).rot(-30);


                Program.game.newEnemyList.Add(eb1);
                Program.game.newEnemyList.Add(eb2);
                Program.game.newEnemyList.Add(eb3);
        }

        public static void threeWayDown(CBasic attacker, CBasic target)
        {
            target = CBasic.virtualCharacter(attacker);

            EnemyBulletA eb1 = new EnemyBulletA(attacker);
            EnemyBulletA eb2 = new EnemyBulletA(attacker);
            EnemyBulletA eb3 = new EnemyBulletA(attacker);

            eb1.velocity = 5.2 * Vector.unitvector(attacker.position, target.position);
            eb2.velocity = 5.2 * Vector.unitvector(attacker.position, target.position).rot(30);
            eb3.velocity = 5.2 * Vector.unitvector(attacker.position, target.position).rot(-30);


            Program.game.newEnemyList.Add(eb1);
            Program.game.newEnemyList.Add(eb2);
            Program.game.newEnemyList.Add(eb3);
        }

        public static void threeWayDownMissile(CBasic attacker, CBasic target)
        {
            target = CBasic.virtualCharacter(attacker);

            EnemyMissile eb1 = new EnemyMissile(attacker);
            EnemyMissile eb2 = new EnemyMissile(attacker);
            EnemyMissile eb3 = new EnemyMissile(attacker);

            eb1.velocity = 5.2 * Vector.unitvector(attacker.position, target.position);
            eb2.velocity = 5.2 * Vector.unitvector(attacker.position, target.position).rot(30);
            eb3.velocity = 5.2 * Vector.unitvector(attacker.position, target.position).rot(-30);


            Program.game.newEnemyList.Add(eb1);
            Program.game.newEnemyList.Add(eb2);
            Program.game.newEnemyList.Add(eb3);
        }

        public static void fourWayAim(CBasic attacker, CBasic target)
        {
            EnemyBulletA eb1 = new EnemyBulletA(attacker);
            EnemyBulletA eb2 = new EnemyBulletA(attacker);
            EnemyBulletA eb3 = new EnemyBulletA(attacker);
            EnemyBulletA eb4 = new EnemyBulletA(attacker);

            eb1.velocity = 5.2 * Vector.unitvector(attacker.position, target.position).rot(8);
            eb2.velocity = 5.2 * Vector.unitvector(attacker.position, target.position).rot(24);
            eb3.velocity = 5.2 * Vector.unitvector(attacker.position, target.position).rot(-8);
            eb4.velocity = 5.2 * Vector.unitvector(attacker.position, target.position).rot(-24);


            Program.game.newEnemyList.Add(eb1);
            Program.game.newEnemyList.Add(eb2);
            Program.game.newEnemyList.Add(eb3);
            Program.game.newEnemyList.Add(eb4);
        }

        public static void spiralBar(CBasic attacker, CBasic target)
        {
            EnemyBar eb1 = new EnemyBar(attacker);
            EnemyBar eb2 = new EnemyBar(attacker);
            EnemyBar eb3 = new EnemyBar(attacker);
            EnemyBar eb4 = new EnemyBar(attacker);
            EnemyBar eb5 = new EnemyBar(attacker);
            EnemyBar eb6 = new EnemyBar(attacker);

            eb1.velocity = 10 * attacker.atk.targetAimVector.unitvector().rot(0);
            eb2.velocity = 10 * attacker.atk.targetAimVector.unitvector().rot(60);
            eb3.velocity = 10 * attacker.atk.targetAimVector.unitvector().rot(120);
            eb4.velocity = 10 * attacker.atk.targetAimVector.unitvector().rot(180);
            eb5.velocity = 10 * attacker.atk.targetAimVector.unitvector().rot(240);
            eb6.velocity = 10 * attacker.atk.targetAimVector.unitvector().rot(300);

            //for the next fireing
            attacker.atk.targetAimVector.x = attacker.atk.targetAimVector.rot(25).x;
            attacker.atk.targetAimVector.y = attacker.atk.targetAimVector.rot(25).y;

            Program.game.newEnemyList.Add(eb1);
            Program.game.newEnemyList.Add(eb2);
            Program.game.newEnemyList.Add(eb3);
            Program.game.newEnemyList.Add(eb4);
            Program.game.newEnemyList.Add(eb5);
            Program.game.newEnemyList.Add(eb6);

        }

        public static void aim(CBasic attacker, CBasic target)
        {
            EnemyBulletA eb1 = new EnemyBulletA(attacker);
            
            eb1.velocity = 5.2 * Vector.unitvector(attacker.position, target.position);
            
            Program.game.newEnemyList.Add(eb1);
            
        }
    
    }
}
