Exemplo n.º 1
0
 //called once each tick
 protected virtual void ForEachTarget(CircleCollider2D coll)
 {
     if (coll.gameObject.tag == "Enemy")
     {
         Enemy e = coll.GetComponent <Enemy>();
         if (e != null)
         {
             if (vampIsOn)
             {
                 if (e.GetHP() < damagePerTick)
                 {
                     dial.ChangeHealth(e.GetHP());
                 }
                 else
                 {
                     dial.ChangeHealth(damagePerTick);
                 }
             }
             e.TakeDamage(damagePerTick);
         }
     }
     else if (coll.gameObject.tag == "EnemyShield")
     {
         EnemyShield es = coll.GetComponent <EnemyShield>();
         if (es != null)
         {
             es.TakeDamage(damagePerTick);
         }
     }
 }
Exemplo n.º 2
0
    public void SetTarget(GameObject t)
    {
        //also starts the tractor beam moving
        target = t;
        targetRT = (RectTransform)t.transform;
        targetShield = t.GetComponent<Enemy>().GetShield();
        initialHP = targetShield.GetCurrentHP();

        radians = Mathf.Atan2(targetRT.anchoredPosition.y-bossRT.anchoredPosition.y,targetRT.anchoredPosition.x-bossRT.anchoredPosition.x); //what angle's it at?
        transform.eulerAngles = new Vector3(transform.eulerAngles.x,transform.eulerAngles.y,
                                            Rotations.RadiansCounterclockwiseFromXAxisToEulerAngles(radians)-bulk.transform.eulerAngles.z); //match angle
        distance = Mathf.Sqrt((targetRT.anchoredPosition.x-bossRT.anchoredPosition.x)*(targetRT.anchoredPosition.x-bossRT.anchoredPosition.x) +
                              (targetRT.anchoredPosition.y-bossRT.anchoredPosition.y)*(targetRT.anchoredPosition.y-bossRT.anchoredPosition.y));

        float zoneDist = distance - headMinimum; //how far is it from the hidden head of the beam, not the center of the dial?
        fastLegDist = FAST_LEG*zoneDist;
        mediLegDist = MEDI_LEG*zoneDist;
        slowLegDist = SLOW_LEG*zoneDist;

        float bonusTimeMultiplier = 0; //replace with actual calculation later, between 0 and 1 based on distance
        reachTime = MIN_REACH_TIME + (bonusTimeMultiplier*MAX_BONUS_TIME); //set how long it's going to take to reach the drop

        state = states.REACHING;
        grabTimer = new Timer();
    }
Exemplo n.º 3
0
    public void SetTarget(GameObject t)      //also starts the tractor beam moving
    {
        target       = t;
        targetRT     = (RectTransform)t.transform;
        targetShield = t.GetComponent <Enemy>().GetShield();
        initialHP    = targetShield.GetCurrentHP();

        radians = Mathf.Atan2(targetRT.anchoredPosition.y - bossRT.anchoredPosition.y, targetRT.anchoredPosition.x - bossRT.anchoredPosition.x);    //what angle's it at?
        transform.eulerAngles = new Vector3(transform.eulerAngles.x, transform.eulerAngles.y,
                                            Rotations.RadiansCounterclockwiseFromXAxisToEulerAngles(radians) - bulk.transform.eulerAngles.z);       //match angle
        distance = Mathf.Sqrt((targetRT.anchoredPosition.x - bossRT.anchoredPosition.x) * (targetRT.anchoredPosition.x - bossRT.anchoredPosition.x) +
                              (targetRT.anchoredPosition.y - bossRT.anchoredPosition.y) * (targetRT.anchoredPosition.y - bossRT.anchoredPosition.y));

        float zoneDist = distance - headMinimum;         //how far is it from the hidden head of the beam, not the center of the dial?

        fastLegDist = FAST_LEG * zoneDist;
        mediLegDist = MEDI_LEG * zoneDist;
        slowLegDist = SLOW_LEG * zoneDist;

        float bonusTimeMultiplier = 0;                                       //replace with actual calculation later, between 0 and 1 based on distance

        reachTime = MIN_REACH_TIME + (bonusTimeMultiplier * MAX_BONUS_TIME); //set how long it's going to take to reach the drop

        state     = states.REACHING;
        grabTimer = new Timer();
    }
Exemplo n.º 4
0
    void Start()
    {
        _enemyShield = GetComponent <EnemyShield>();
        _enemyHealth = GetComponent <EnemyHealth>();

        // Setting up the references.
        _ren = transform.GetComponent <SpriteRenderer>();
        //score = GameObject.Find("Score").GetComponent<Score>();
    }
Exemplo n.º 5
0
    public void GiveShield(float power, float sSpeed, float sRegen, List <System.Object> fragDicts)
    {
        GameObject shieldObj = Instantiate(Resources.Load("Prefabs/MainCanvas/EnemyShield")) as GameObject;

        shieldObj.transform.SetParent(transform, false);
        shield = shieldObj.GetComponent <EnemyShield>();
        shield.ConfigureShield(power, power, sRegen, sSpeed, fragDicts);
        shield.MakeStuffRealTinyInPreparationForGrowing();
        shield.GrowShields();
    }
Exemplo n.º 6
0
    public void CreateShield()
    {
        if (m_ShieldInfo.ShieldType != DebuffPanel.DebuffTypes.None)
        {
            var shieldGO          = Resources.Load("Effects/Shields/" + m_ShieldInfo.ShieldType) as GameObject;
            var shieldInstantiate = GameMaster.Instantiate(shieldGO, m_GameObject.transform);

            shieldInstantiate.GetComponent <EnemyShield>().OnShieldDestroy += SetInvincible;

            CreatedShield = shieldInstantiate.GetComponent <EnemyShield>();
        }
    }
Exemplo n.º 7
0
    }//Finds the angle between two objects

    public static void DamageEnemy(Collision2D hit, int damage)
    {
        if (hit.gameObject.CompareTag("Enemy"))
        {
            CommonEnemy c = hit.gameObject.GetComponent <CommonEnemy>();
            c.EnemyDamage(damage);
        }
        if (hit.gameObject.CompareTag("EnemyShield"))
        {
            EnemyShield s = hit.gameObject.GetComponent <EnemyShield>();
            s.EnemyDamage(damage);
        }
    }//Damages an enemy or enemyshield
Exemplo n.º 8
0
    public void ConfigureEnemy()
    {
        FileLoader fl   = new FileLoader("JSONData" + Path.DirectorySeparatorChar + "Bestiary", srcFileName);
        string     json = fl.Read();
        //Debug.Log (json.Length);
        Dictionary <string, System.Object> data = (Dictionary <string, System.Object>)Json.Deserialize(json);

        maxhp            = (float)(double)data ["maxHP"];
        hp               = (float)(double)data ["HP"];
        impactDamage     = (float)(double)data ["damage"];
        baseImpactDamage = impactDamage;
        impactTime       = (float)(double)data ["impactTime"];
        radius           = (float)(double)data ["size"];
        maxShields       = (float)(double)data ["maxShields"];
        shields          = (float)(double)data ["shields"];
        tripsTraps       = (bool)data ["tripsTraps"];
        shieldPen        = (bool)data ["shieldPen"];

        rarityUpWithHits  = (bool)data ["rarityUpWithHits"];
        rareDropThreshold = (int)(long)data ["rareDropThreshold"];
        rareChance        = (float)(double)data ["rareChance"];
        normalChance      = (float)(double)data ["normalChance"];
        omnitechChance    = (float)(double)data["omnitechChance"];

        //apply Risk bonuses to drop/rarity rates
        ApplyRiskBonuses();

        //shield stuff
        if (data.ContainsKey("shielded"))
        {
            bool shielded = (bool)data["shielded"];
            if (shielded)             //from here we assume all the shield properties are defined
            {
                float shieldMax   = (float)(double)data ["shieldMax"];
                float shieldHP    = (float)(double)data ["shieldHP"];
                float shieldRegen = (float)(double)data ["shieldRegen"];
                float shieldSpeed = (float)(double)data["shieldSpeed"];
                List <System.Object> fragments = (List <System.Object>)data["fragments"];

                GameObject shieldObj = Instantiate(Resources.Load("Prefabs/MainCanvas/EnemyShield")) as GameObject;
                shieldObj.transform.SetParent(transform, false);
                shield = shieldObj.GetComponent <EnemyShield>();
                shield.ConfigureShield(shieldMax, shieldHP, shieldRegen, shieldSpeed, fragments);
            }
        }

        //movement types
        moverType = (string)data["movementType"];
    }
Exemplo n.º 9
0
 protected override void ForEachTarget(CircleCollider2D coll)
 {
     if (coll.gameObject.tag == "Enemy")
     {
         //Debug.Log("Here's an enemy in ShieldTrapField");
         Enemy e = coll.GetComponent <Enemy>();
         if (e != null)
         {
             //Drain
             if (drainPerTick > 0f)
             {
                 //Debug.Log("doing drain in ShieldTrapField");
                 if (e.GetHP() < drainPerTick)
                 {
                     dial.ChangeHealth(e.GetHP()); //multiplier applied in SetUp()
                 }
                 else
                 {
                     dial.ChangeHealth(drainPerTick); //multiplier applied in SetUp()
                 }
                 e.TakeDamage(drainPerTick);
             }
             if (coolPerTick > 0f)
             {
                 ReduceCooldown(coolPerTick); //multiplier applied in SetUp()
             }
         }
     }
     else if (coll.gameObject.tag == "EnemyShield")
     {
         EnemyShield es = coll.GetComponent <EnemyShield>();
         if (es != null)
         {
             //es.TakeDamage(damagePerTick);
             //Drain
             if (drainPerTick > 0f)
             {
             }
         }
     }
 }
Exemplo n.º 10
0
    void OnTriggerEnter(Collider _other)
    {
        Vector3 i_impactVector            = _other.transform.position - transform.position;
        Vector3 i_flattedDownImpactVector = new Vector3(i_impactVector.x, 0, i_impactVector.z);

        if (_other.tag == "Player")
        {
            if (_other.GetComponent <PawnController>() != null)
            {
                _other.GetComponent <PawnController>().Damage(transform.parent.GetComponent <EnemyBehaviour>().damage);
            }

            EnemyShield i_enemyShield = GetComponentInParent <EnemyShield>();
            if (i_enemyShield != null)
            {
                i_enemyShield.StopAttack();

                if (_other.GetComponent <PawnController>() != null && _other.GetComponent <DunkController>() != null && _other.GetComponent <DunkController>().IsDunking() == false)
                {
                    _other.GetComponent <PawnController>().Push(PushType.Light, i_flattedDownImpactVector.normalized, PushForce.Force2);
                }
            }
        }
    }
Exemplo n.º 11
0
 public void SetManager(EnemyShield es)
 {
     manager = es;
     transform.SetParent(es.transform,false);
     es.AddFragment(this);
 }
    public void PlayerShootButton()
    {
        ray = Camera.main.ViewportPointToRay(new Vector3(.5f, .5f, 0));

        if (Physics.Raycast(ray, out hit, Mathf.Infinity))
        {
            if (hit.collider.gameObject.tag == "enemy")
            {
                Npc enemy = hit.collider.gameObject.GetComponent <Npc>();
                enemy.TakeDamage();
            }
            if (hit.collider.gameObject.tag == "GoldPrize")
            {
                GoldCounter gem = hit.collider.gameObject.GetComponent <GoldCounter>();
                gem.Money();
            }
            if (hit.collider.gameObject.tag == "ManaPrize")
            {
                ManaPrize mana = hit.collider.gameObject.GetComponent <ManaPrize>();
                mana.Mana();
            }
            if (hit.collider.gameObject.tag == "HealthPrize")
            {
                HealthPrize heal = hit.collider.gameObject.GetComponent <HealthPrize>();
                heal.Heal();
            }
            if (hit.collider.gameObject.tag == "EnemyShield")
            {
                EnemyShield shield = hit.collider.gameObject.GetComponent <EnemyShield>();
                shield.HitShield();
            }
        }


        if (uzi.activeSelf)
        {
            camerashake.Camerashake.duration  = 0.1f;
            camerashake.Camerashake.magnitude = 0.2f;
        }
        if (ak47.activeSelf)
        {
            camerashake.Camerashake.duration  = 0.1f;
            camerashake.Camerashake.magnitude = 0.2f;
        }
        if (m4a1.activeSelf)
        {
            camerashake.Camerashake.duration  = 0.1f;
            camerashake.Camerashake.magnitude = 0.2f;
        }
        if (shotgun.activeSelf)
        {
            camerashake.Camerashake.duration  = 0.2f;
            camerashake.Camerashake.magnitude = 0.3f;
        }
        if (shotgun2.activeSelf)
        {
            camerashake.Camerashake.duration  = 0.2f;
            camerashake.Camerashake.magnitude = 0.3f;
        }
        if (pistol.activeSelf)
        {
            camerashake.Camerashake.duration  = 0.08f;
            camerashake.Camerashake.magnitude = 0.18f;
        }
        if (pistol2.activeSelf)
        {
            camerashake.Camerashake.duration  = 0.08f;
            camerashake.Camerashake.magnitude = 0.18f;
        }
        if (deagle.activeSelf)
        {
            camerashake.Camerashake.duration  = 0.08f;
            camerashake.Camerashake.magnitude = 0.18f;
        }

        camerashake.Camerashake.StartCoroutine(camerashake.Camerashake.shake());
        if (!shot)
        {
            kovan.Play();
            muzzle.Play();
            gunSound.Play();
            shot = true;
            //ammo--;
            GameObject bulletObject = Instantiate(bulletPrefab);

            /* bulletObject.transform.position = Main.transform.position + Main.transform.forward;
             * bulletObject.transform.forward = Main.transform.forward;*/
            bulletObject.transform.position = gunFront.transform.position + gunFront.transform.forward;
            bulletObject.transform.forward  = gunFront.transform.forward;
            if (pistol.activeInHierarchy)
            {
                StartCoroutine(Shoot(0.5f));
                pistolanim.Play("pistol_sekme");
            }
            if (pistol2.activeInHierarchy)
            {
                StartCoroutine(Shoot(0.5f));
                pistol2anim.Play("pistol2_sekme");
            }
            if (deagle.activeInHierarchy)
            {
                StartCoroutine(Shoot(0.5f));
                deagleanim.Play("deagle_sekme");
            }

            if (uzi.activeInHierarchy)
            {
                StartCoroutine(Shoot(0.2f));
                uzianim.Play("uzi_sekme");
            }
            if (ak47.activeInHierarchy)
            {
                StartCoroutine(Shoot(0.2f));
                ak47anim.Play("ak47_sekme");
            }
            if (m4a1.activeInHierarchy)
            {
                StartCoroutine(Shoot(0.2f));
                m4a1anim.Play("m4a1_sekme");
            }

            if (shotgun.activeInHierarchy)
            {
                StartCoroutine(Shoot(1f));
                shotgunanim.Play("shotgun_sekme");
            }
            if (shotgun2.activeInHierarchy)
            {
                StartCoroutine(Shoot(1f));
                shotgun2anim.Blend("shotgun2_sekme");
                shotgun2anim.Play("shotgun_pull");
            }
            IEnumerator Shoot(float time)
            {
                if (!shot)
                {
                }

                yield return(new WaitForSeconds(time));

                shot = false;

                // Code to execute after the delay
            }
        }
    }
Exemplo n.º 13
0
 public void NullShield()
 {
     shield = null;
 }
Exemplo n.º 14
0
 public void GiveShield(float power,float sSpeed, float sRegen, List<System.Object> fragDicts)
 {
     GameObject shieldObj = Instantiate (Resources.Load ("Prefabs/MainCanvas/EnemyShield")) as GameObject;
     shieldObj.transform.SetParent(transform,false);
     shield = shieldObj.GetComponent<EnemyShield>();
     shield.ConfigureShield(power,power,sRegen,sSpeed,fragDicts);
     shield.MakeStuffRealTinyInPreparationForGrowing();
     shield.GrowShields();
 }
Exemplo n.º 15
0
    public void ConfigureEnemy()
    {
        FileLoader fl = new FileLoader ("JSONData" + Path.DirectorySeparatorChar + "Bestiary",srcFileName);
        string json = fl.Read ();
        //Debug.Log (json.Length);
        Dictionary<string,System.Object> data = (Dictionary<string,System.Object>)Json.Deserialize (json);
        maxhp = (float)(double)data ["maxHP"];
        hp = (float)(double)data ["HP"];
        impactDamage = (float)(double)data ["damage"];
        impactTime = (float)(double)data ["impactTime"];
        radius = (float)(double)data ["size"];
        maxShields = (float)(double)data ["maxShields"];
        shields = (float)(double)data ["shields"];
        tripsTraps = (bool)data ["tripsTraps"];
        shieldPen = (bool)data ["shieldPen"];

        rarityUpWithHits = (bool)data ["rarityUpWithHits"];
        rareDropThreshold = (int)(long)data ["rareDropThreshold"];
        rareChance = (float)(double)data ["rareChance"];
        normalChance = (float)(double)data ["normalChance"];

        //shield stuff
        if(data.ContainsKey("shielded")){
            bool shielded = (bool)data["shielded"];
            if(shielded){ //from here we assume all the shield properties are defined
                float shieldMax = (float)(double)data ["shieldMax"];
                float shieldHP = (float)(double)data ["shieldHP"];
                float shieldRegen = (float)(double)data ["shieldRegen"];
                float shieldSpeed = (float)(double)data["shieldSpeed"];
                List<System.Object> fragments = (List<System.Object>)data["fragments"];

                GameObject shieldObj = Instantiate (Resources.Load ("Prefabs/MainCanvas/EnemyShield")) as GameObject;
                shieldObj.transform.SetParent(transform,false);
                shield = shieldObj.GetComponent<EnemyShield>();
                shield.ConfigureShield(shieldMax,shieldHP,shieldRegen,shieldSpeed,fragments);
            }
        }

        //movement types
        moverType = (string)data["movementType"];
    }
Exemplo n.º 16
0
 public void SetManager(EnemyShield es)
 {
     manager = es;
     transform.SetParent(es.transform, false);
     es.AddFragment(this);
 }
Exemplo n.º 17
0
 public void NullShield()
 {
     shield = null;
 }
Exemplo n.º 18
0
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player> ();
     enemy  = FindObjectOfType <EnemyShield> ();
 }
Exemplo n.º 19
0
 // Use this for initialization
 void Start()
 {
     enemyAI = gameObject.GetComponentInParent <EnemyShield>();
 }
Exemplo n.º 20
0
    public void ConfigureEnemy()
    {
        FileLoader fl = new FileLoader ("JSONData" + Path.DirectorySeparatorChar + "Bestiary",srcFileName);
        string json = fl.Read ();
        //Debug.Log (json.Length);
        Dictionary<string,System.Object> data = (Dictionary<string,System.Object>)Json.Deserialize (json);
        maxhp = (float)(double)data ["maxHP"];
        hp = (float)(double)data ["HP"];
        impactDamage = (float)(double)data ["damage"];
        impactTime = (float)(double)data ["impactTime"];
        radius = (float)(double)data ["size"];
        maxShields = (float)(double)data ["maxShields"];
        shields = (float)(double)data ["shields"];
        tripsTraps = (bool)data ["tripsTraps"];
        shieldPen = (bool)data ["shieldPen"];

        rarityUpWithHits = (bool)data ["rarityUpWithHits"];
        rareDropThreshold = (int)(long)data ["rareDropThreshold"];
        rareChance = (float)(double)data ["rareChance"];
        normalChance = (float)(double)data ["normalChance"];

        //shield stuff
        if(data.ContainsKey("shielded")){
            bool shielded = (bool)data["shielded"];
            if(shielded){ //from here we assume all the shield properties are defined
                float shieldMax = (float)(double)data ["shieldMax"];
                float shieldHP = (float)(double)data ["shieldHP"];
                float shieldRegen = (float)(double)data ["shieldRegen"];
                float shieldSpeed = (float)(double)data["shieldSpeed"];
                List<System.Object> fragments = (List<System.Object>)data["fragments"];

                GameObject shieldObj = Instantiate (Resources.Load ("Prefabs/MainCanvas/EnemyShield")) as GameObject;
                shieldObj.transform.SetParent(transform,false);
                shield = shieldObj.GetComponent<EnemyShield>();
                shield.ConfigureShield(shieldMax,shieldHP,shieldRegen,shieldSpeed,fragments);
            }
        }

        //movement types
        string moveString = (string)data["movementType"];
        /*if(moveString.Equals("Linear")){
            mover = new LinearMover(this);
        }else if(moveString.Equals("Linear_Right")){
            mover = new LinearMover(this);
            mover.PutInRightLane();
        }else if(moveString.Equals("Linear_Left")){
            mover = new LinearMover(this);
            mover.PutInLeftLane();
        }else if(moveString.Equals("Slowing_Linear")){
            mover = new SlowingLinearMover(this);
        }else if(moveString.Equals("Slowing_Linear_Right")){
            mover = new SlowingLinearMover(this);
            mover.PutInRightLane();
        }else if(moveString.Equals("Slowing_Linear_Left")){
            mover = new SlowingLinearMover(this);
            mover.PutInLeftLane();
        }else if(moveString.Equals ("Zigzag")){
            mover = new ZigzagMover(this);
        }else if(moveString.Equals ("Zigzag_Mirror")){
            ZigzagMover zm = new ZigzagMover(this);
            zm.Mirror();
            mover = zm;
        }else if(moveString.Equals ("Strafing")){
            mover = new StrafingMover(this);
        }else if(moveString.Equals ("Strafing_Mirror")){
            StrafingMover sm = new StrafingMover(this);
            sm.Mirror();
            mover = sm;
        }else if(moveString.Equals ("Sine")){
            mover = new SineMover(this);
        }else if(moveString.Equals ("Sine_Mirror")){
            SineMover sm = new SineMover(this);
            sm.Mirror();
            mover = sm;
        }else if(moveString.Equals ("Swerve_Left")){
            mover = new SwerveMover(this);
        }else if(moveString.Equals ("Swerve_Right")){
            SwerveMover sm = new SwerveMover(this);
            sm.Mirror();
            mover = sm;
        }else if(moveString.Equals ("Swerve_In_Left")){
            SwerveMover sm = new SwerveMover(this);
            sm.PutInRightLane();
            mover = sm;
        }else if(moveString.Equals ("Swerve_In_Right")){
            SwerveMover sm = new SwerveMover(this);
            sm.PutInLeftLane();
            sm.Mirror();
            mover = sm;
        }else if(moveString.Equals ("Semicircle")){
            mover = new SemicircleMover(this);
        }else if(moveString.Equals ("Semicircle_Mirror")){
            SemicircleMover sm = new SemicircleMover(this);
            sm.Mirror();
            mover = sm;
        }else if(moveString.Equals ("Blink")){
            mover = new BlinkMover(this);
        }else if(moveString.Equals ("Blink_Mirror")){
            BlinkMover bm = new BlinkMover(this);
            bm.Mirror();
            mover = bm;
        }else if(moveString.Equals ("Wink")){
            mover = new WinkMover(this);
        }else if(moveString.Equals ("Wink_Mirror")){
            WinkMover wm = new WinkMover(this);
            wm.Mirror();
            mover = wm;
        }else if(moveString.Equals ("Sidestep")){
            mover = new SidestepMover(this);
        }else if(moveString.Equals ("Sidestep_Mirror")){
            SidestepMover sm = new SidestepMover(this);
            sm.Mirror();
            mover = sm;
        }
        //do any lane overriding
        mover.RightOffset(moverLaneOverride);*/
    }
Exemplo n.º 21
0
    public void ConfigureEnemy()
    {
        FileLoader fl   = new FileLoader("JSONData" + Path.DirectorySeparatorChar + "Bestiary", srcFileName);
        string     json = fl.Read();
        //Debug.Log (json.Length);
        Dictionary <string, System.Object> data = (Dictionary <string, System.Object>)Json.Deserialize(json);

        maxhp        = (float)(double)data ["maxHP"];
        hp           = (float)(double)data ["HP"];
        impactDamage = (float)(double)data ["damage"];
        impactTime   = (float)(double)data ["impactTime"];
        radius       = (float)(double)data ["size"];
        maxShields   = (float)(double)data ["maxShields"];
        shields      = (float)(double)data ["shields"];
        tripsTraps   = (bool)data ["tripsTraps"];
        shieldPen    = (bool)data ["shieldPen"];

        rarityUpWithHits  = (bool)data ["rarityUpWithHits"];
        rareDropThreshold = (int)(long)data ["rareDropThreshold"];
        rareChance        = (float)(double)data ["rareChance"];
        normalChance      = (float)(double)data ["normalChance"];

        //shield stuff
        if (data.ContainsKey("shielded"))
        {
            bool shielded = (bool)data["shielded"];
            if (shielded)             //from here we assume all the shield properties are defined
            {
                float shieldMax   = (float)(double)data ["shieldMax"];
                float shieldHP    = (float)(double)data ["shieldHP"];
                float shieldRegen = (float)(double)data ["shieldRegen"];
                float shieldSpeed = (float)(double)data["shieldSpeed"];
                List <System.Object> fragments = (List <System.Object>)data["fragments"];

                GameObject shieldObj = Instantiate(Resources.Load("Prefabs/MainCanvas/EnemyShield")) as GameObject;
                shieldObj.transform.SetParent(transform, false);
                shield = shieldObj.GetComponent <EnemyShield>();
                shield.ConfigureShield(shieldMax, shieldHP, shieldRegen, shieldSpeed, fragments);
            }
        }

        //movement types
        string moveString = (string)data["movementType"];

        /*if(moveString.Equals("Linear")){
         *      mover = new LinearMover(this);
         * }else if(moveString.Equals("Linear_Right")){
         *      mover = new LinearMover(this);
         *      mover.PutInRightLane();
         * }else if(moveString.Equals("Linear_Left")){
         *      mover = new LinearMover(this);
         *      mover.PutInLeftLane();
         * }else if(moveString.Equals("Slowing_Linear")){
         *      mover = new SlowingLinearMover(this);
         * }else if(moveString.Equals("Slowing_Linear_Right")){
         *      mover = new SlowingLinearMover(this);
         *      mover.PutInRightLane();
         * }else if(moveString.Equals("Slowing_Linear_Left")){
         *      mover = new SlowingLinearMover(this);
         *      mover.PutInLeftLane();
         * }else if(moveString.Equals ("Zigzag")){
         *      mover = new ZigzagMover(this);
         * }else if(moveString.Equals ("Zigzag_Mirror")){
         *      ZigzagMover zm = new ZigzagMover(this);
         *      zm.Mirror();
         *      mover = zm;
         * }else if(moveString.Equals ("Strafing")){
         *      mover = new StrafingMover(this);
         * }else if(moveString.Equals ("Strafing_Mirror")){
         *      StrafingMover sm = new StrafingMover(this);
         *      sm.Mirror();
         *      mover = sm;
         * }else if(moveString.Equals ("Sine")){
         *      mover = new SineMover(this);
         * }else if(moveString.Equals ("Sine_Mirror")){
         *      SineMover sm = new SineMover(this);
         *      sm.Mirror();
         *      mover = sm;
         * }else if(moveString.Equals ("Swerve_Left")){
         *      mover = new SwerveMover(this);
         * }else if(moveString.Equals ("Swerve_Right")){
         *      SwerveMover sm = new SwerveMover(this);
         *      sm.Mirror();
         *      mover = sm;
         * }else if(moveString.Equals ("Swerve_In_Left")){
         *      SwerveMover sm = new SwerveMover(this);
         *      sm.PutInRightLane();
         *      mover = sm;
         * }else if(moveString.Equals ("Swerve_In_Right")){
         *      SwerveMover sm = new SwerveMover(this);
         *      sm.PutInLeftLane();
         *      sm.Mirror();
         *      mover = sm;
         * }else if(moveString.Equals ("Semicircle")){
         *      mover = new SemicircleMover(this);
         * }else if(moveString.Equals ("Semicircle_Mirror")){
         *      SemicircleMover sm = new SemicircleMover(this);
         *      sm.Mirror();
         *      mover = sm;
         * }else if(moveString.Equals ("Blink")){
         *      mover = new BlinkMover(this);
         * }else if(moveString.Equals ("Blink_Mirror")){
         *      BlinkMover bm = new BlinkMover(this);
         *      bm.Mirror();
         *      mover = bm;
         * }else if(moveString.Equals ("Wink")){
         *      mover = new WinkMover(this);
         * }else if(moveString.Equals ("Wink_Mirror")){
         *      WinkMover wm = new WinkMover(this);
         *      wm.Mirror();
         *      mover = wm;
         * }else if(moveString.Equals ("Sidestep")){
         *      mover = new SidestepMover(this);
         * }else if(moveString.Equals ("Sidestep_Mirror")){
         *      SidestepMover sm = new SidestepMover(this);
         *      sm.Mirror();
         *      mover = sm;
         * }
         * //do any lane overriding
         * mover.RightOffset(moverLaneOverride);*/
    }