Exemple #1
0
 public void Attacking(int num)
 {
     if (Fire)
     {
         GolemEnemy = ScriptObject.GetComponent <FireGolem>();
         if (num == 1)
         {
             GolemEnemy.Attacked(true);
         }
         else
         {
             GolemEnemy.Attacked(false);
         }
     }
     else if (Ice)
     {
         GolemEnemy2 = ScriptObject.GetComponent <IceGolem>();
         if (num == 1)
         {
             GolemEnemy2.Attacked(true);
         }
         else
         {
             GolemEnemy2.Attacked(false);
         }
     }
 }
Exemple #2
0
 public void StartWalking(int num)
 {
     if (Fire)
     {
         if (num > 0)
         {
             shake      = false;
             GolemEnemy = ScriptObject.GetComponent <FireGolem>();
             GolemEnemy.SwitchState(FireGolem.EnemyState.isWalking);
         }
         else
         {
             shake      = false;
             GolemEnemy = ScriptObject.GetComponent <FireGolem>();
             GolemEnemy.SwitchState(FireGolem.EnemyState.notWalking);
         }
     }
     else if (Ice)
     {
         if (num > 0)
         {
             shake       = false;
             GolemEnemy2 = ScriptObject.GetComponent <IceGolem>();
             GolemEnemy2.SwitchState(IceGolem.EnemyState.isWalking);
         }
         else
         {
             shake       = false;
             GolemEnemy2 = ScriptObject.GetComponent <IceGolem>();
             GolemEnemy2.SwitchState(IceGolem.EnemyState.notWalking);
         }
     }
 }
 private void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.CompareTag("FireGolem"))
     {
         fireGolem = other.gameObject.GetComponent <FireGolem>();
         if (fireGolem != null)
         {
             fireGolem.DoDamage(1);
         }
     }
     else if (other.gameObject.CompareTag("IceGolem"))
     {
         iceGolem = other.gameObject.GetComponent <IceGolem>();
         if (iceGolem != null)
         {
             iceGolem.DoDamage(6);
         }
     }
     else if (other.gameObject.CompareTag("Eye"))
     {
         EyeEnemy = other.gameObject.GetComponent <EyeEnemy>();
         if (EyeEnemy != null)
         {
             EyeEnemy.DoDamage(3);
         }
     }
     else if (other.gameObject.CompareTag("GhostBoss"))
     {
         GhostBoss = other.gameObject.GetComponent <GhostBoss>();
         if (GhostBoss != null)
         {
             GhostBoss.DoDamage(3);
         }
     }
     else if (other.gameObject.CompareTag("EnemyPhantom"))
     {
         PhantomEnemy = other.gameObject.GetComponent <PhantomEnemy>();
         if (PhantomEnemy != null)
         {
             PhantomEnemy.DoDamage(3);
         }
     }
     else if (other.gameObject.CompareTag("FinalBoss"))
     {
         rb.velocity   = Vector3.zero;
         rb.useGravity = true;
     }
     else if (other.gameObject.CompareTag("BossIceField"))
     {
         Destroy(gameObject);
     }
     else
     {
         rb.constraints = RigidbodyConstraints.FreezeAll;
         Destroy(gameObject, 3);
     }
 }
    private void OnCollisionEnter(Collision other)
    {
        if (other.gameObject.CompareTag("FireGolem"))
        {
            rb.velocity   = Vector3.zero;
            rb.useGravity = true;

            fireGolem = other.gameObject.GetComponent <FireGolem>();
            if (fireGolem != null)
            {
                fireGolem.DoDamage(4);
                Destroy(gameObject, 2);
            }
        }
        else if (other.gameObject.CompareTag("IceGolem"))
        {
            rb.velocity   = Vector3.zero;
            rb.useGravity = true;

            iceGolem = other.gameObject.GetComponent <IceGolem>();
            if (iceGolem != null)
            {
                iceGolem.DoDamage(4);
                Destroy(gameObject, 2);
            }
        }
        else if (other.gameObject.CompareTag("Eye"))
        {
            rb.velocity   = Vector3.zero;
            rb.useGravity = true;
            enemy         = other.gameObject.GetComponent <EyeEnemy>();
            if (enemy != null)
            {
                enemy.DoDamage(4);
                Destroy(gameObject, 2);
            }
        }
        else if (other.gameObject.CompareTag("GhostBoss"))
        {
            rb.velocity   = Vector3.zero;
            rb.useGravity = true;

            GhostBoss = other.gameObject.GetComponent <GhostBoss>();
            if (GhostBoss != null)
            {
                GhostBoss.DoDamage(4);
                Destroy(gameObject, 2);
            }
        }
        else if (other.gameObject.CompareTag("EnemyPhantom"))
        {
            rb.velocity   = Vector3.zero;
            rb.useGravity = true;

            PhantomEnemy = other.gameObject.GetComponent <PhantomEnemy>();
            if (PhantomEnemy != null)
            {
                PhantomEnemy.DoDamage(4);
                Destroy(gameObject, 2);
            }
        }
        else if (other.gameObject.CompareTag("FinalBoss"))
        {
            rb.useGravity = true;
        }
        else if (other.gameObject.CompareTag("BossIceField"))
        {
            Destroy(gameObject);
        }
    }