public void Shoot()
 {
     if (playerHealth != null)
     {
         if (HUDHealthScript.timer > 5)
         {
             HUDHealthScript.timer = 0;
         }
         if (playerHealth.currentHealth > 0 && playerHealth.currentHealth <= playerHealth.startingHealth)
         {
             playerHealth.TakeDamage(damage);
             if (GameMasterObject.dannyActive)
             {
                 DannyCameraShake.InstanceD1.ShakeD1(amplitude, duration);
             }
             else if (GameMasterObject.strongmanActive)
             {
                 CameraShake.InstanceSM1.ShakeSM1(amplitude, duration);
             }
         }
         else if (playerHealth.currentHealth > 0 && playerHealth.currentHealth >= playerHealth.startingHealth + 1)
         {
             playerHealth.TakeArmorDamage(damage);
             if (GameMasterObject.dannyActive)
             {
                 DannyCameraShake.InstanceD1.ShakeD1(amplitude, duration);
             }
             else if (GameMasterObject.strongmanActive)
             {
                 CameraShake.InstanceSM1.ShakeSM1(amplitude, duration);
             }
         }
     }
 }
    public void Attack()
    {
        if (takeDamage)
        {
            if (playerHealth != null)
            {
                if (HUDHealthScript.timer > 5)
                {
                    HUDHealthScript.timer = 0;
                }
                if (playerHealth.currentHealth > 0 && playerHealth.currentHealth <= playerHealth.startingHealth)
                {
                    playerHealth.TakeDamage(damage);

                    if (GameMasterObject.dannyActive)
                    {
                        DannyCameraShake.InstanceD1.ShakeD1(amplitude, duration);
                    }
                    else if (GameMasterObject.strongmanActive)
                    {
                        playerHealth.poisoned = true;
                        playerHealth.poisonEffects++;
                        playerHealth.poisonLeakageTime++;
                        CameraShake.InstanceSM1.ShakeSM1(amplitude, duration);
                    }
                }
                else if (playerHealth.currentHealth > 0 && playerHealth.currentHealth >= playerHealth.startingHealth + 1)
                {
                    playerHealth.TakeArmorDamage(damage);

                    if (GameMasterObject.dannyActive)
                    {
                        DannyCameraShake.InstanceD1.ShakeD1(amplitude, duration);
                    }
                    else if (GameMasterObject.strongmanActive)
                    {
                        playerHealth.poisoned = true;
                        playerHealth.poisonEffects++;
                        playerHealth.poisonLeakageTime++;
                        CameraShake.InstanceSM1.ShakeSM1(amplitude, duration);
                    }
                }
            }
            if (decoyLife != null)
            {
                if (decoyLife != null)
                {
                    decoyLife.shots++;
                }
            }
            if (causeDD != null)
            {
                causeDD.shots += 15;
            }
        }
    }
Example #3
0
 void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.tag == "Player")
     {
         PlayerHealth1 playerHealth = other.gameObject.GetComponent <PlayerHealth1> ();
         if (playerHealth != null)
         {
             HUDHealthScript.timer = 0;
             if (playerHealth.currentHealth > 0 && playerHealth.currentHealth <= playerHealth.startingHealth)
             {
                 playerHealth.TakeDamage(attackDamage * enemyAttackBoost, 100f);
                 if (GameMasterObject.dannyActive)
                 {
                     DannyCameraShake.InstanceD1.ShakeD1(amplitude, duration);
                 }
                 else if (GameMasterObject.strongmanActive)
                 {
                     CameraShake.InstanceSM1.ShakeSM1(amplitude, duration);
                 }
             }
             else if (playerHealth.currentHealth > 0 && playerHealth.currentHealth >= playerHealth.startingHealth + 1)
             {
                 playerHealth.TakeArmorDamage(attackDamage * enemyAttackBoost, 100f);
                 if (GameMasterObject.dannyActive)
                 {
                     DannyCameraShake.InstanceD1.ShakeD1(amplitude, duration);
                 }
                 else if (GameMasterObject.strongmanActive)
                 {
                     CameraShake.InstanceSM1.ShakeSM1(amplitude, duration);
                 }
             }
         }
     }
     if (other.gameObject.tag == "Ally")
     {
         DannyDecoyLifeScript decoyLife = other.gameObject.GetComponent <DannyDecoyLifeScript> ();
         if (decoyLife != null)
         {
             decoyLife.shots++;
         }
     }
     if (other.gameObject.tag == "Cover")
     {
         Destroy(this.gameObject);
     }
     else
     {
         Destroy(this.gameObject);
     }
     Destroy(this.gameObject);
 }
 public void Attack()
 {
     if (takeDamage)
     {
         if (playerHealth != null)
         {
             if (HUDHealthScript.timer > 5)
             {
                 HUDHealthScript.timer = 0;
             }
             if (playerHealth.currentHealth > 0 && playerHealth.currentHealth <= playerHealth.startingHealth)
             {
                 playerHealth.TakeDamage(damage);
                 if (GameMasterObject.dannyActive)
                 {
                     DannyCameraShake.InstanceD1.ShakeD1(amplitude, duration);
                 }
                 else if (GameMasterObject.strongmanActive)
                 {
                     CameraShake.InstanceSM1.ShakeSM1(amplitude, duration);
                 }
             }
             else if (playerHealth.currentHealth > 0 && playerHealth.currentHealth >= playerHealth.startingHealth + 1)
             {
                 playerHealth.TakeArmorDamage(damage);
                 if (GameMasterObject.dannyActive)
                 {
                     DannyCameraShake.InstanceD1.ShakeD1(amplitude, duration);
                 }
                 else if (GameMasterObject.strongmanActive)
                 {
                     CameraShake.InstanceSM1.ShakeSM1(amplitude, duration);
                 }
             }
         }
         if (decoyLife != null)
         {
             //Debug.Log ("gotlife");
             decoyLife.shots++;
         }
         if (timerCheckHealth != null)
         {
             timerCheckHealth.TakeDamage(15);
         }
     }
 }
Example #5
0
 public void Attack()
 {
     if (takeDamage)
     {
         if (playerHealth != null)
         {
             if (HUDHealthScript.timer > 5)
             {
                 HUDHealthScript.timer = 0;
             }
             if (playerHealth.currentHealth > 0 && playerHealth.currentHealth <= playerHealth.startingHealth)
             {
                 playerHealth.TakeDamage(damage);
             }
             else if (playerHealth.currentHealth > 0 && playerHealth.currentHealth >= playerHealth.startingHealth + 1)
             {
                 playerHealth.TakeArmorDamage(damage);
             }
         }
     }
 }