Exemplo n.º 1
0
 public override void CaptureObject(PlayerKatamari katamari)
 {
     base.CaptureObject(katamari);
     StartCoroutine(Blink());
     StartCoroutine(Countdown(timer));
     Debug.Log("Counting down mine");
 }
Exemplo n.º 2
0
    public virtual void DetachObject(Vector3 explosionPos, float explosionSize)
    {
        if (ParentKatamari == null)
        {
            return;
        }

        Attached = false;
        transform.SetParent(null);

        Rigidbody.isKinematic = false;
        Rigidbody.AddExplosionForce(10.0f, explosionPos, explosionSize * ExplosionMultiplier);

        CaptureCollider.isTrigger = false;
        PhysicsCollider.enabled   = false;

        Weapon[] weapons = GetComponentsInChildren <Weapon>();
        foreach (Weapon weapon in weapons)
        {
            weapon.UpdateShip();
        }


        ParentKatamari = null;
    }
Exemplo n.º 3
0
    private new void OnTriggerEnter(Collider other)
    {
        if (Active)
        {
            base.OnTriggerEnter(other);
            return;
        }

        PlayerKatamari player = other.GetComponentInParent <PlayerKatamari>();

        if (player == null)
        {
            return;
        }


        if (player.MasterRigidbody.mass < MassThreshold)
        {
            GameController.Instance.ShowText("What a wonderful planet!  We must absorb it, we must have it, but we must first grow larger...", 7);
        }
        else
        {
            GameController.Instance.ShowText("What a wonderful planet!  We must absorb it, we must have it!", 7);
            Active = true;
        }

        try
        {
            MusicManager.Instance.PlayIntenseMusic();
        }
        catch
        {
            Debug.LogError("No Music Manager foudn!");
        }
    }
Exemplo n.º 4
0
    public override void CaptureObject(PlayerKatamari katamari)
    {
        base.CaptureObject(katamari);

        DetectionCollider.enabled = false;
        DetectionCollider.gameObject.SetActive(false);

        GameController.Instance.ShowText("What opulence!  The cataclysmic terror really brings out the flavor of halted civilization.\n\nRUN LITTLE SHIPS, WE HAVE YOUR HOME.\n\n(press esc to restart when finished)", 3.0f);
    }
Exemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        if (myShip != null && myShip.Active)
        {
            acquisitionTimer += Time.deltaTime;
            if (acquisitionTimer >= acquisitionInterval)
            {
                acquisitionTimer = 0f;
                player           = null;
                PlayerKatamari[] katamaris = FindObjectsOfType <PlayerKatamari>();
                if (katamaris.Length > 0)
                {
                    PlayerKatamari katamari = katamaris[0];
                    if (katamari.CurrentState == PlayerState.Existing && Vector3.Distance(transform.position, katamari.transform.position) <= acquisitionRange)
                    {
                        player = katamari.gameObject;
                    }
                }
            }

            if (player != null)
            {
                Behave();
                if (thrusters.Length > 0)
                {
                    if (rigidBody.velocity.magnitude > 0)
                    {
                        Quaternion thrusterRotation = Quaternion.LookRotation(rigidBody.velocity.normalized, Vector3.up);
                        foreach (Thruster thruster in thrusters)
                        {
                            thruster.SetExaustSpeed(rigidBody.velocity.magnitude);
                            thruster.SetNozzleRotation(thrusterRotation);
                        }
                    }
                    else
                    {
                        foreach (Thruster thruster in thrusters)
                        {
                            thruster.TurnParticlesOff();
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 6
0
    public virtual void CaptureObject(PlayerKatamari katamari)
    {
        Attached       = true;
        ParentKatamari = katamari;
        transform.SetParent(katamari.CaptureAnchor, true);
        Rigidbody.isKinematic = true;
        Rigidbody.velocity    = Vector3.zero;

        Ship ship = GetComponent <Ship>();

        if (ship != null)
        {
            ship.Active = false;
        }

        Weapon[] weapons = GetComponentsInChildren <Weapon>();
        foreach (Weapon weapon in weapons)
        {
            weapon.UpdateShip();
        }

        CaptureCollider.isTrigger = true;
        PhysicsCollider.enabled   = true;
    }
Exemplo n.º 7
0
 // Start is called before the first frame update
 void Start()
 {
     Map    = MapBounds.Instance;
     Player = PlayerKatamari.GetPlayer();
 }