예제 #1
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (photonView && !photonView.isMine && player && damage == true)
     {
         player.Damage(1.2f);
     }
     if (Ai && damage == true && Ai.TypeFire == false)
     {
         Ai.Damage(4f);
     }
 }
예제 #2
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (player && damage == true)
     {
         if (player.photonView.isMine)
         {
             player.Damage2(10f * damagemultiplyer);
         }
         //else
         //player.Damage(10f * damagemultiplyer);
     }
     if (Ai && damage == true && Ai.isBoss == false)
     {
         if (Ai.photonView.isMine)
         {
             Ai.Damage(10f);
         }
     }
 }
예제 #3
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (speed >= 10)
        {
            if (Input.GetKey(mousebutton) && collision.gameObject.tag != "LowerArm" || collision.gameObject.tag != "LowerArm(1)")
            {
                speed -= 10;
                speed *= multiplyer;
                if (speed >= 30 && (collision.gameObject.GetComponentInParent <PlayerController>() || collision.gameObject.GetComponentInParent <TheBraaiiinnn>()))
                {
                    if (MenuController.selectedgamemode != 3 && MenuController.selectedgamemode != 4)
                    {
                        photonView.RPC("knockback", PhotonTargets.Others, speed);
                    }
                    ;                   StartCoroutine("CameraShake");
                    speed += 10;
                }
                PlayerController playerHit = collision.gameObject.GetComponentInParent <PlayerController>();
                if (playerHit != null && playerHit.photonView && !(KI == false && MenuController.selectedgamemode == 3 && MenuController.selectedgamemode == 4))
                {
                    if (MenuController.selectedgamemode != 3 && MenuController.selectedgamemode != 4)
                    {
                        photonView.RPC("knockback", PhotonTargets.Others, speed);
                    }
                    damagetoapply = speed * 0.4f;
                    if (damagetoapply >= maxdamage)
                    {
                        damagetoapply = maxdamage;
                    }
                    if (playerHit != null && !playerHit.photonView.isMine)
                    {
                        playerHit.Damage(damagetoapply);
                    }
                    else if (playerHit != null)
                    {
                        playerHit.Damage2(damagetoapply);
                    }
                }
                TheBraaiiinnn aKI = collision.gameObject.GetComponentInParent <TheBraaiiinnn>();
                if (aKI != null)// && KI.photonView)
                {
                    if (MenuController.selectedgamemode != 3 && MenuController.selectedgamemode != 4)
                    {
                        photonView.RPC("knockback", PhotonTargets.Others, speed);
                    }
                }
                if (MenuController.selectedgamemode == 4)
                {
                    damagetoapply = speed * 0.8f;
                }
                else
                {
                    damagetoapply = speed * 0.4f;
                }
                if (damagetoapply >= maxdamage)
                {
                    damagetoapply = maxdamage;
                }
                if (aKI != null)
                {
                    aKI.Damage(damagetoapply);
                }

                ps.Play();
            }
        }
    }