示例#1
0
 private void Kill()
 {
     if (kraken != null)
     {
         kraken.SignalHurt(2f);
         kraken.ApplyDamage(kraken.TentacleDeathDamage);
         deathTimer = kraken.RegularTentacleTime;
     }
     else
     {
         if (throwEngaged && instantiatedIceberg != null)
         {
             Iceberg iceberg = instantiatedIceberg.GetComponent <Iceberg>() as Iceberg;
             iceberg.ApplyDamage(iceberg.HealthPoints);
         }
         deathTimer = 0f;
     }
     initialPosition     = transform.position;
     destinationPosition = initialPosition - Vector3.up * 80f;
     Dead = true;
     deathCounter++;
     animationTimer      = 0f;
     tentaculeAnim.speed = animationSpeedMod;
     StartHurtAnimation();
     StopHolding();
     deathAnimPlaying = true;
 }
示例#2
0
    public void OnTriggerEnter(Collider col)
    {
        if (!Network.isClient)
        {
            if (col.tag == "ThrowingIceberg" && col.rigidbody != null)
            {
                icebergHitSource.Play();
                this.rigidbody.AddForce(col.rigidbody.velocity / 4.0f);

                Iceberg iceberg = col.GetComponent <Iceberg>();
                if (iceberg != null)
                {
                    iceberg.ApplyDamage(1);
                    col.tag = "Untagged";
                }
                ApplyDamage(this.Health);
            }
            else if (col.tag == "EndOfLevel")
            {
                ScreenFader.Instance.SceneEnding = true;
                Network.RemoveRPCsInGroup(0);
                Network.RemoveRPCsInGroup(1);
                Utils.NetworkCommand(GlobalScript.Instance, "LoadKrakenLevel");
            }
            else if (col.tag == "Checkpoint1")
            {
                GlobalScript.CheckpointToLoad = 2;
            }
            else if (col.tag == "Checkpoint2")
            {
                GlobalScript.CheckpointToLoad = 3;
            }
            else if (col.tag == "Checkpoint3")
            {
                GlobalScript.CheckpointToLoad = 4;
            }
        }
    }