private static void Prefix(ref MissileProjectile __instance)
 {
     if (MissileSmokePrefab.ContainsKey(__instance))
     {
         m_SmokeTrailPrefab.SetValue(__instance, MissileSmokePrefab[__instance]);
         MissileSmokePrefab.Remove(__instance);
     }
 }
 public void SetStartSpeed(float x, float y)
 {
     mp           = new MissileProjectile();
     mp.StartingX = x;
     mp.StartingY = y;
     mp.CurrentX  = x;
     mp.CurrentY  = y;
 }
Beispiel #3
0
        public override void InitSkillsOnMonster(SkillSet set, ActiveSkill meleeSkill, int level)
        {
            MissileProjectile sk = set.GetSkill(SkillId.MissileProjectile) as MissileProjectile;

            if (sk != null)
            {
                sk.range = AggressionRange * 2;
            }
        }
    void OnTriggerEnter2D(Collider2D collider)
    {
        Projectile laser = collider.gameObject.GetComponent <Projectile>();

        projectile = Projectile.FindObjectOfType <Projectile>();

        MissileProjectile missile = collider.gameObject.GetComponent <MissileProjectile>();

        missile = MissileProjectile.FindObjectOfType <MissileProjectile>();

        LaserDouble laserx2 = collider.gameObject.GetComponent <LaserDouble>();

        doublelaser = LaserDouble.FindObjectOfType <LaserDouble>();

        if (laser)
        {
            Debug.Log("hit by a laser");

            Destroy(collider.gameObject);
            scoreKeeper.Score(scoreValue);
            EnemyHealth = EnemyHealth - projectile.basicLaserDamage;
            Debug.Log(EnemyHealth);
            if (EnemyHealth <= 0)
            {
                Die();
            }
        }
        if (missile)
        {
            Debug.Log("Hit by a missile");
            Destroy(collider.gameObject);
            scoreKeeper.Score(MissileScoreValue);
            EnemyHealth = EnemyHealth - missile.missileDamage;
            hitbymissile.Play();
            Debug.Log(EnemyHealth);
            if (EnemyHealth <= 0)
            {
                Die();
            }
        }
        if (laserx2)
        {
            Debug.Log("Hit by double laser");
            Destroy(collider.gameObject);
            scoreKeeper.Score(LaserScoreValue);
            EnemyHealth = EnemyHealth - doublelaser.DoubleLaserDamage;
            Debug.Log(EnemyHealth);
            if (EnemyHealth <= 0)
            {
                Die();
            }
        }
    }
Beispiel #5
0
    private void ToAttack(KeyCode attackKey)
    {
        if (CanAttack && Input.GetKey(attackKey) && _player.QuantityMissile > 0)
        {
            _shootCooldown = _shotingRate;

            MissileProjectile newMissileProjectile = Instantiate(_missileProjectile, _playerShip.transform.position, transform.rotation);

            newMissileProjectile.Parent    = _playerShip.gameObject;
            newMissileProjectile.Direction = transform.up;

            _player.QuantityMissile--;
        }
    }
                    private static void Prefix(ref MissileProjectile __instance)
                    {
                        var prefab = (Transform)m_SmokeTrailPrefab.GetValue(__instance);

                        if (prefab != null && !MissileSmokePrefab.ContainsKey(__instance))
                        {
                            MissileSmokePrefab.Add(__instance, prefab);
                        }

                        if (displayMissileSmokeBool)
                        {
                            if (MissileSmokePrefab[__instance] != prefab)
                            {
                                m_SmokeTrailPrefab.SetValue(__instance, MissileSmokePrefab[__instance]);
                            }
                        }
                        else if (prefab != null)
                        {
                            m_SmokeTrailPrefab.SetValue(__instance, null);
                        }
                    }