Exemple #1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "SniperBullet")
     {
         bulletScript = other.GetComponent <LineSniperShot>();
         DamageJunk(bulletScript.lineSniperShotDamage);
     }
     else if (other.tag == "Missile")
     {
         homingMissileScript = other.GetComponent <EnemySeekerShot>();
         DamageJunk(homingMissileScript.seekerDamage);
     }
     else if (other.tag == "Shot")
     {
         shotScript = other.GetComponent <ProtoShotPrefab>();
         DamageJunk(shotScript.shotDamage);
     }
     else if (other.tag == "PhaseBlast")
     {
         phaseBlastScript = other.GetComponent <PhaseBlast>();
         DamageJunk(phaseBlastScript.phaseBlastDamage);
     }
     else if (other.tag == "Plasma")
     {
         //damage this
         plasmaScript = other.GetComponent <Plasma>();
         DamageJunk(plasmaScript.plasmaDamage);
     }
     else if (other.tag == "ShieldMine")
     {
         shieldMineScript = other.GetComponent <ShieldMine>();
         DamageJunk(hitPoints);
     }
 }
Exemple #2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Boundary" || other.tag == "MineralPickup" || other.tag == "Capsule" || other.tag == "Edge" || other.tag == "BoostHit")
     {
         return;
     }
     else if (other.tag == "SniperBullet")
     {
         bulletScript = other.GetComponent <LineSniperShot>();
         if (bulletScript.teamCount != teamCount)
         {
             //Damage the bug
             DamageThis(bulletScript.lineSniperShotDamage);
         }
     }
     else if (other.tag == "Shot")
     {
         shotScript = other.GetComponent <ProtoShotPrefab>();
         if (shotScript.teamCount != teamCount)
         {
             //Damage this bug
             DamageThis(shotScript.shotDamage);
         }
     }
     else if (other.tag == "ShieldMine")
     {
         mineScript = other.GetComponent <ShieldMine>();
         if (mineScript.teamCount != teamCount)
         {
             DestroyThis();
         }
     }
     else if (other.tag == "Missile")
     {
         seekerShotScript = other.GetComponent <EnemySeekerShot>();
         if (seekerShotScript.teamCount != teamCount)
         {
             //Damage
             DamageThis(seekerShotScript.seekerDamage);
         }
     }
     else if (other.tag == "PhaseBlast")
     {
         phaseBlastScript = other.GetComponent <PhaseBlast>();
         if (phaseBlastScript.teamCount != teamCount)
         {
             DamageThis(phaseBlastScript.phaseBlastDamage);
         }
     }
     else if (other.tag == "Plasma")
     {
         plasmaScript = other.GetComponent <Plasma>();
         if (plasmaScript.teamCount != teamCount)
         {
             DamageThis(plasmaScript.plasmaDamage);
         }
     }
 }
Exemple #3
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "SniperBullet")
     {
         bulletScript = other.GetComponent <LineSniperShot>();
         if (bulletScript.teamCount != teamCount)
         {
             //Damage
             BlowUp();
         }
     }
     else if (other.tag == "Shot")
     {
         shotScript = other.GetComponent <ProtoShotPrefab>();
         if (shotScript.teamCount != teamCount)
         {
             //Damage
             BlowUp();
         }
     }
     else if (other.tag == "ShieldMine")
     {
         mineScript = other.GetComponent <ShieldMine>();
         if (mineScript.teamCount != teamCount)
         {
             BlowUp();
         }
     }
     else if (other.tag == "Missile")
     {
         seekerShotScript = other.GetComponent <EnemySeekerShot>();
         if (seekerShotScript.teamCount != teamCount)
         {
             //Damage
             BlowUp();
         }
     }
     else if (other.tag == "PhaseBlast")
     {
         phaseBlastScript = other.GetComponent <PhaseBlast>();
         if (phaseBlastScript.teamCount != teamCount)
         {
             //Damage
             BlowUp();
         }
     }
     else if (other.tag == "Plasma")
     {
         plasmaScript = other.GetComponent <Plasma>();
         if (plasmaScript.teamCount != teamCount)
         {
             //Damage
             BlowUp();
         }
     }
 }
Exemple #4
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Boundary" || other.tag == "MineralPickup" || other.tag == "Capsule" || other.tag == "Edge" || other.tag == "Map" || other.tag == "Ibeam")
     {
         return;
     }
     else if (other.tag == "RocketAmmo")
     {
         rocketScript = other.GetComponent <RemoteLauncherShot>();
         if (rocketScript.teamCount != teamCount)
         {
             //Debug.Log(teamCount + " |other: " + rocketScript.teamCount);
             if (hitCount > 1)
             {
                 Destroy(this.gameObject);
             }
             else
             {
                 hitCount++;
             }
         }
     }
     else if (other.tag == "SniperBullet")
     {
         bulletScript = other.GetComponent <LineSniperShot>();
         if (bulletScript.teamCount != teamCount)
         {
             //Debug.Log(teamCount + " |other: " + bulletScript.teamCount);
             if (hitCount > 1)
             {
                 Destroy(this.gameObject);
             }
             else
             {
                 hitCount++;
             }
         }
     }
     else if (other.tag == "Missile")
     {
         homingMissileScript = other.GetComponent <EnemySeekerShot>();
         if (homingMissileScript.teamCount != teamCount)
         {
             if (hitCount > 1)
             {
                 Destroy(this.gameObject);
             }
             else
             {
                 hitCount++;
             }
         }
     }
     else if (other.tag == "Shot")
     {
         shotScript = other.GetComponent <ProtoShotPrefab>();
         if (shotScript.teamCount != teamCount)
         {
             //Debug.Log(teamCount + " |other: " + shotScript.teamCount);
             if (hitCount > 1)
             {
                 Destroy(this.gameObject);
             }
             else
             {
                 hitCount++;
             }
         }
     }
     else if (other.tag == "Player1(Black)" || other.tag == "Player2(White)" || other.tag == "Player3" || other.tag == "Player4")
     {
         enemyHealthScript = other.GetComponent <PlayerHealth>();
         if (enemyHealthScript.teamCount != teamCount)
         {
             enemyHealthScript.Damage(mineDamage, false);
             Destroy(this.gameObject);
         }
     }
     else if (other.tag == "PlayerPhysicsCollider")
     {
         enemyHealthScript = other.GetComponentInParent <PlayerHealth>();
         if (enemyHealthScript.teamCount != teamCount)
         {
             enemyHealthScript.Damage(mineDamage, false);
             Destroy(this.gameObject);
         }
     }
     else if (other.tag == "Asteroid")
     {
         asteroidScript = other.GetComponent <Asteroid>();
         asteroidScript.DamageAsteroid(mineDamage);
         Destroy(this.gameObject);
     }
     else if (other.tag == "Plasma")
     {
         plasmaScript = other.GetComponent <Plasma>();
         if (plasmaScript.teamCount != teamCount)
         {
             if (hitCount > 1)
             {
                 Destroy(this.gameObject);
             }
             else
             {
                 hitCount++;
             }
         }
     }
 }
Exemple #5
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player1(Black)" || other.tag == "Player2(White)" || other.tag == "Player3" || other.tag == "Player4")
     {
         //if we hit a player not our team Explode
         playerHealthScript = other.GetComponent <PlayerHealth>();
         if (playerHealthScript.teamCount != teamCount)
         {
             BlowUp();
         }
     }
     else if (other.tag == "Asteroid")
     {
         BlowUp();
     }
     else if (other.tag == "RocketAmmo")
     {
         rocketScript = other.GetComponent <RemoteLauncherShot>();
         if (rocketScript.teamCount != teamCount)
         {
             BlowUp();
         }
     }
     else if (other.tag == "SniperBullet")
     {
         bulletScript = other.GetComponent <LineSniperShot>();
         if (bulletScript.teamCount != teamCount)
         {
             BlowUp();
         }
     }
     else if (other.tag == "Shot")
     {
         shotScript = other.GetComponent <ProtoShotPrefab>();
         if (shotScript.teamCount != teamCount)
         {
             BlowUp();
         }
     }
     else if (other.tag == "ShieldMine")
     {
         mineScript = other.GetComponent <ShieldMine>();
         if (mineScript.teamCount != teamCount)
         {
             BlowUp();
         }
     }/*
       * else if (other.tag == "Plasma")
       * {
       * plasmaScript = other.GetComponent<Plasma>();
       * if (plasmaScript.teamCount != teamCount)
       * {
       *     BlowUp();
       * }
       * }*/
     else if (other.tag == "DamageBug")
     {
         damageBugScript = other.GetComponent <DamageBug>();
         if (damageBugScript.teamCount != teamCount)
         {
             BlowUp();
         }
     }
     else if (other.tag == "Missile")
     {
         seekerShotScript = other.GetComponent <EnemySeekerShot>();
         if (seekerShotScript.teamCount != teamCount)
         {
             BlowUp();
         }
     }
     else if (other.tag == "TripMine")
     {
         tripMineScript = other.GetComponent <TripMine>();
         if (tripMineScript.teamCount != teamCount)
         {
             BlowUp();
         }
     }
     else if (other.tag == "AutoTurretHitBox")
     {
         autoTurretScript = other.GetComponentInParent <AutoTurret>();
         if (autoTurretScript.teamCount != teamCount)
         {
             BlowUp();
         }
     }
     else if (other.tag == "Junk")
     {
         BlowUp();
     }
 }
Exemple #6
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Boundary" || other.tag == "MineralPickup" || other.tag == "Capsule" || other.tag == "Edge" || other.tag == "AutoTurret")
     {
         //Debug.Log("hit boundary/mineralpickup/capsule/edge");
         return;
     }
     else if (other.tag == "BoostHit")
     {
         enemyHealthScript = other.GetComponentInParent <PlayerHealth>();
         if (enemyHealthScript.teamCount != teamCount)
         {
             enemyHealthScript.Damage(seekerDamage, false);
             DestroyThis();
         }
     }
     else if (other.tag == "Missile")
     {
         missileShotScript = other.GetComponent <EnemySeekerShot>();
         if (missileShotScript.teamCount != teamCount)
         {
             missileShotScript.DestroyThis();
             DestroyThis();
         }
     }
     else if (other.tag == "Player1(Black)" || other.tag == "Player2(White)" || other.tag == "Player3" || other.tag == "Player4")
     {
         //Debug.Log("ShotHit " + other.tag);
         enemyHealthScript = other.GetComponent <PlayerHealth>();
         if (enemyHealthScript.teamCount != teamCount)
         {
             enemyHealthScript.Damage(seekerDamage, false);
             DestroyThis();
         }
     }
     else if (other.tag == "Enemy")
     {
         aiHealthScript = other.GetComponent <EnemyHealth>();
         if (aiHealthScript.teamCount != teamCount)
         {
             aiHealthScript.DamageEnemy(seekerDamage);
             DestroyThis();
         }
     }
     else if (other.tag == "PlayerPhysicsCollider")
     {
         //Debug.Log("ShotHit " + other.tag);
         enemyHealthScript = other.GetComponentInParent <PlayerHealth>();
         if (enemyHealthScript.teamCount != teamCount)
         {
             enemyHealthScript.Damage(seekerDamage, false);
             DestroyThis();
         }
     }
     else if (other.tag == "RocketAmmo")
     {
         rocketScript = other.GetComponent <RemoteLauncherShot>();
         if (rocketScript.teamCount != teamCount)
         {
             DestroyThis();
         }
     }
     else if (other.tag == "SniperBullet")
     {
         bulletScript = other.GetComponent <LineSniperShot>();
         if (bulletScript.teamCount != teamCount)
         {
             DestroyThis();
         }
     }
     else if (other.tag == "Shot")
     {
         shotScript = other.GetComponent <ProtoShotPrefab>();
         if (shotScript.teamCount != teamCount)
         {
             DestroyThis();
         }
     }
     else if (other.tag == "ShieldMine")
     {
         mineScript = other.GetComponent <ShieldMine>();
         if (mineScript.teamCount != teamCount)
         {
             DestroyThis();
         }
     }
     else if (other.tag == "Asteroid")
     {
         //Debug.Log("hit asteroid");
         asteroidScript = other.GetComponent <Asteroid>();
         asteroidScript.DamageAsteroid(seekerDamage);
         DestroyThis();
     }
     else if (other.tag == "Plasma")
     {
     }
     else if (other.tag == "PhaseBlast")
     {
     }
     else
     {
         //Debug.Log("hit " + other.tag);
         DestroyThis();
     }
 }