Inheritance: Player
Beispiel #1
0
 private void Act2()
 {
     Narrator.Instance.GetComponent <AudioSource>().pitch = 1;
     Narrator.Instance.narrate("BobWhatAreYouDoing");
     Murderer.SetActive(true);
     CameraFlash();
 }
Beispiel #2
0
    private void Act14()
    {
        CameraFlash();
        SpriteRenderer murderenderer = Murderer.GetComponent <SpriteRenderer>();

        murderenderer.flipX = true;
        Murderer.transform.Translate(new Vector3(-0.05f, 0f, 0f));
        pacingTime = 1f;
    }
Beispiel #3
0
    private void Act4()
    {
        oldFieldOfView2    = camera.fieldOfView;
        camera.fieldOfView = fieldOfView2;

        SpriteRenderer murderenderer = Murderer.GetComponent <SpriteRenderer>();

        murderenderer.sprite = BloodyRogerSprite;
        murderenderer.flipX  = true;
        CameraFlash();
    }
Beispiel #4
0
    void Start()
    {
        controller        = GetComponent <CharacterController>();
        jumping           = false;
        fallen            = false;
        previousGroundedY = transform.position.y;

        thief    = GetComponent <Thief>();
        murderer = GetComponent <Murderer>();
        cheater  = GetComponent <Cheater>();
        addict   = GetComponent <Addict>();
        liar     = GetComponent <Liar>();

        thief.enabled    = false;
        murderer.enabled = false;
        cheater.enabled  = false;
        addict.enabled   = false;
        liar.enabled     = false;

        numPowerUps = 0;
    }
Beispiel #5
0
    /// <summary>
    /// Ends in-game day
    /// </summary>
    public void EndDay()
    {
        // determines whether game has met room-related end-day conditions
        if (roomManager.CanEndDay() == false)
        {
            // break from end-day process
            return;
        }

        // decrement number of days left and lose game if final day ends
        --daysRemaining;
        if (daysRemaining < 0 && murdererAtLarge)
        {
            // TODO: refactor notif pop-up to work with separate managers
            //if (notifPopUp.text == "")
            //{
            //    // prints murderer escaped fail state message
            //    notifPopUp.text = "Murderer escaped. Game Over.";
            //    continueButton.gameObject.SetActive(true);
            //}
            // Note: placeholder for first iteration
            Debug.Log("Murderer escaped. Game Over.");
        }

        // if execution chamber is occupied
        if (roomManager.ExecutionRoom.IsOccupied)
        {
            // destroy occupant
            characterExecuted = roomManager.ExecutionRoom.ExecuteOccupant();

            // Remove killer from list of murderers if applicable
            // and return appropriate feedback to player
            // Note: debug logs are placeholders for first iteration
            if (!characterExecuted.CompareTag("murderer"))
            {
                // TODO: refactor notif pop-up to work with separate managers
                //if (notifPopUp.text == "")
                //{
                //    // prints innocent killed fail state message
                //    notifPopUp.text = "Innocent killed. Game Over.";
                //    continueButton.gameObject.SetActive(true);
                //}
                Debug.Log("Innocent killed. Game Over.");
            }
            else
            {
                // remove killer from list of murderers
                murderers.Remove(characterExecuted);

                // if player has found all killers, tell them they've won
                if (murderers.Count < 1)
                {
                    // TODO: refactor notif pop-up to work with separate managers
                    //if (notifPopUp.text == "")
                    //{
                    //    // prints killers found victory condition message
                    //    notifPopUp.text = "All killers found. You win!";
                    //    continueButton.gameObject.SetActive(true);
                    //}
                    Debug.Log("All killers found. You win!");
                    murdererAtLarge = false;

                    // break from end day process
                    return;
                }
                // otherwise (i.e., killers remain to be found)
                else
                {
                    // TODO: refactor notif pop-up to work with separate managers
                    //if (notifPopUp.text == "")
                    //{
                    //    // displays number of murderers left
                    //    if (murderers.Count > 1)
                    //    {
                    //        notifPopUp.text = "Murderer caught. " + murderers.Count + " killers remain.";
                    //        continueButton.gameObject.SetActive(true);
                    //    }
                    //    else if (murderers.Count == 1)
                    //    {
                    //        notifPopUp.text = "Murderer caught. " + murderers.Count + " killer remains.";
                    //        continueButton.gameObject.SetActive(true);
                    //    }
                    //}
                    Debug.Log("Murderer caught. " + murderers.Count + " killers remain.");
                }
            }
        }

        // Note: win / lose conditions haven't been met

        // finally, arm any unarmed killers in game
        foreach (GameObject killer in murderers)
        {
            Murderer killerComp = killer.GetComponent <Murderer>();

            // if killer isn't armed
            if (!killerComp.IsArmed)
            {
                // arm killer and set them to be inactive for night
                killerComp.Arm();
                killerComp.IsActive = false;
            }
            // otherwise (killer currently holds weapon)
            else
            {
                // set killer to be active tonight (i.e., can determine to strike tonight)
                killerComp.IsActive = true;
            }
        }

        // pass killer-to-strike on to next killer in list
        killerToStrike++;
        if (killerToStrike >= murderers.Count)
        {
            killerToStrike = 0;
        }

        // finally, if killer to strike tonight is active
        // they determine to kill a roommate
        if (murderers[killerToStrike].GetComponent <Murderer>().IsActive)
        {
            murderers[killerToStrike].GetComponent <Murderer>().DetermineToKill();
        }
    }
Beispiel #6
0
    private void Act8()
    {
        SpriteRenderer murderenderer = Murderer.GetComponent <SpriteRenderer>();

        murderenderer.flipX = false;
    }
    void Start()
    {
        controller = GetComponent<CharacterController>();
        jumping = false;
        fallen = false;
        previousGroundedY = transform.position.y;

        thief = GetComponent<Thief>();
        murderer = GetComponent<Murderer>();
        cheater = GetComponent<Cheater>();
        addict = GetComponent<Addict>();
        liar = GetComponent<Liar>();

        thief.enabled = false;
        murderer.enabled = false;
        cheater.enabled = false;
        addict.enabled = false;
        liar.enabled = false;

        numPowerUps = 0;
    }