コード例 #1
0
 public void NPC_ResponseToBad()
 {
     PlayerNotoriety.DecreasePlayerNotoriety();
     npcText.text = DialogueTable.PickRandomResponse();
     isTalking    = false;
     UnFreezeScene();
 }
コード例 #2
0
 /// <summary>
 /// Toggles the mute.
 /// </summary>
 public void ToggleMute()
 {
     //_audio.volume = ( _audio.volume > 0 ) ? 0 : 1.0f;
     if (_audio.isPlaying == true)
     {
         _audio.Stop();
         PlayerNotoriety.DecreasePlayerNotoriety();
     }
     else
     {
         int i = Random.Range(0, 9);
         i = (i > 4) ? 1 : 0;
         //Debug.Log("Random Index of Clips is: " + i);
         _audio.clip = backgroundPartyMusicClips[i];
         _audio.Play();
         PlayerNotoriety.IncreasePlayerNotoriety();
     }
     //if (_audio.volume > 0)
     //{
     //    int i = Random.Range(0, 1);
     //    _audio.clip = backgroundMusicClips[i];
     //    _audio.Play();
     //    PlayerNotoriety.IncreasePlayerNotoriety();
     //}
     //else
     //{
     //    PlayerNotoriety.DecreasePlayerNotoriety();
     //}
 }
コード例 #3
0
    // Update is called once per frame
    void Update()
    {
        float n = PlayerNotoriety.GetPlayerNotoriety(); //Mathf.Lerp(PlayerNotoriety.GetPlayerNotoriety(), 0f, frequencyOfNotorietyIncrease);

        if (n != 0f && Time.timeScale != 0f)            //timer > frequencyOfNotorietyIncrease && Time.timeScale != 0f)
        {
            timer -= Time.deltaTime;
            if (n < 0f && timer <= 0f)
            {
                PlayerNotoriety.IncreasePlayerNotoriety();
                timer = frequencyOfNotorietyIncrease;
                //Debug.Log("Notoriety is going up." + n.ToString());
            }
            else if (n > 0f && timer <= 0f)
            {
                PlayerNotoriety.DecreasePlayerNotoriety();
                timer = frequencyOfNotorietyIncrease;
                //Debug.Log("Notoriety is going down." + n.ToString());
            }
            else
            {
                //Debug.Log("Notoriety is 0");
            }
        }
        //else
        //{
        //}
        //Debug.Log("Notoriety:\t" + n.ToString());
    }
コード例 #4
0
    public static string PickRandomResponse()
    {
        float  playerNotoriety = PlayerNotoriety.GetPlayerNotoriety();
        string temp;

        if (playerNotoriety >= 5f)
        {
            int randomIndex = Random.Range(0, responsesGood.Count);
            temp = responsesGood[randomIndex];
            return(temp);
        }
        else if (playerNotoriety <= -5f)
        {
            int randomIndex = Random.Range(0, responsesBad.Count);
            temp = responsesBad[randomIndex];
            return(temp);
        }
        else if (playerNotoriety > -5f && playerNotoriety < 5f)
        {
            int randomIndex = Random.Range(0, responsesNeutral.Count);
            temp = responsesNeutral[randomIndex];
            return(temp);
        }
        else
        {
            temp = "*DEBUG ME!!*";
            return(temp);
        }
    }
コード例 #5
0
 private void Update()
 {
     localNoteriety = PlayerNotoriety.GetPlayerNotoriety();
     if (localNoteriety <= noterietyValueToTrigger && isBodyParts == false)
     {
         foreach (GameObject body_part in bodyParts)
         {
             if (body_part.activeInHierarchy == false)
             {
                 body_part.SetActive(true);
             }
         }
         isBodyParts = true;
     }
     if (localNoteriety > noterietyValueToTrigger && isBodyParts == true)
     {
         foreach (GameObject body_part in bodyParts)
         {
             if (body_part.activeInHierarchy == true)
             {
                 body_part.SetActive(false);
             }
         }
         isBodyParts = false;
     }
 }
コード例 #6
0
    /// <summary>
    /// Interaction with a balloon.
    /// </summary>
    /// <returns>The interaction.</returns>
    private IEnumerator Balloon_Interaction()
    {
        //	Wait a random time to stagger clustered baloons
        yield return(new WaitForSeconds(Random.Range(0.01f, 0.25f)));

        //	Play popping audio
        _audioSource.pitch += Random.Range(-0.05f, 0.05f);
        _audioSource.Play();

        //	Hide the balloon
        _meshRenderer.enabled = false;

        //	Disable further interaction
        OnTriggerExit();

        //	Wait for audio clip to complete
        yield return(new WaitWhile(() => _audioSource.isPlaying));

        //	Set being interacted with to false
        _isBeingInteractedWith = false;

        //	De-activate the game object
        gameObject.SetActive(false);

        //Modify notoriety field
        PlayerNotoriety.DecreasePlayerNotoriety();

        //	Flush the point of interest and retarget all audience NPCs
        _cellEntity.Flush_Point_Of_Interest();
    }
コード例 #7
0
 private void Update()
 {
     _blackScreen.color = (_blackScreen.color.a > 0 && _fps.enabled)? new Color(0, 0, 0, (_blackScreen.color.a - (Time.deltaTime / 3.0f))) : _blackScreen.color;
     if (PlayerNotoriety.GetPlayerNotoriety() <= -5f && _fps.enabled)
     {
         _fps.enabled = false;
         StopAllCoroutines();
         StartCoroutine(Wake_Up());
     }
 }
コード例 #8
0
 private void Start()
 {
     localNoteriety = PlayerNotoriety.GetPlayerNotoriety();
     foreach (GameObject body_part in bodyParts)
     {
         if (body_part.activeInHierarchy == true)
         {
             body_part.SetActive(false);
         }
     }
     isBodyParts = false;
 }
コード例 #9
0
    /// <summary>
    /// Interaction with the food.
    /// </summary>
    /// <returns>The interaction.</returns>
    private IEnumerator Food_Interaction()
    {
        //	Perform the interaction

        //	**************************
        //	Animate!
        //	**************************

        //Modify notoriety field
        PlayerNotoriety.IncreasePlayerNotoriety();
        yield return(new WaitForSeconds(2));

        _isBeingInteractedWith = false;
    }
コード例 #10
0
    /// <summary>
    /// Interaction with the door to lose the game
    /// </summary>
    /// <returns>The interaction.</returns>
    private IEnumerator Door_Interaction()
    {
        //	Perform the interaction
        //ChangeInState.SetRoomState(END_PARTY_STATE.LOSE);
        GameManager.instance.data.endPartyState = END_PARTY_STATE.LOSE;

        PlayerNotoriety.ResetPlayerNoteriety();
        UnityEngine.SceneManagement.SceneManager.LoadScene(1);

        //	**************************
        //	Animate!
        //	**************************

        yield return(null);

        _isBeingInteractedWith = false;
    }
コード例 #11
0
    /// <summary>
    /// Called at the end of the execution order.
    /// </summary>
    private void Update()
    {
        //	On the first update, generate each cell
        if (_firstUpdate)
        {
            Generate();
            _firstUpdate = false;
        }

        //	If the difference between the cell distance and player position is large enough, translate and regenerate the cell
        if (!_hasStartedTranslation)
        {
            if (playerPosition != Vector3.zero)
            {
                _hasCompletedTranslation = false;
                StartCoroutine(Translate());
                _cellUpdates++;
                _hasStartedTranslation = true;
                if (_cellUpdates == 9)
                {
                    _player.parent.position -= playerPosition * 100.0f;
                    _cellUpdates             = 0;
                }
            }
        }
        else
        {
            if (_cellUpdates == 0)
            {
                _hasStartedTranslation = false;
            }
        }

        if (PlayerNotoriety.GetPlayerNotoriety() <= -3.0f)
        {
            exitDoor.SetActive(true);
        }
        else
        {
            exitDoor.SetActive(false);
        }
    }
コード例 #12
0
    private IEnumerator Wake_Up()
    {
        _innerThoughts.text = "No... they hate me... I can't... no more please...";
        while (_thoughtBubble.alpha < 1f)
        {
            _blackScreen.color    = new Color(0, 0, 0, _blackScreen.color.a + Time.deltaTime);
            _thoughtBubble.alpha += Time.deltaTime;
            yield return(new WaitForSeconds(Time.deltaTime));
        }
        yield return(new WaitForSeconds(2f));

        while (_thoughtBubble.alpha > 0f)
        {
            _stereo.volume       -= Time.deltaTime * 3.0f;
            _crowd.volume        -= Time.deltaTime * 3.0f;
            _thoughtBubble.alpha -= Time.deltaTime;
            yield return(new WaitForSeconds(Time.deltaTime));
        }
        PlayerNotoriety.ResetPlayerNoteriety();
        _audio.PlayOneShot(_fallingSound, 4.0f);
        SceneManager.LoadScene(1);
    }
コード例 #13
0
 public static List <TableItem> Build(Editor editor)
 {
     return(new List <TableItem>()
     {
         new TableItem()
         {
             Name = Properties.Localization.Editor_BasicTable_Character_Name,
             Control = new TextBox()
             {
                 Dock = DockStyle.Fill,
             },
             Binding =
                 new Binding("Text",
                             editor._RootSaveFileBindingSource,
                             "Player.FirstName",
                             true,
                             DataSourceUpdateMode.OnPropertyChanged)
         },
         new TableItem()
         {
             Name = Properties.Localization.Editor_BasicTable_Character_Level,
             Control = new NumericUpDown()
             {
                 Minimum = 1,
                 Maximum = 60,
                 Increment = 1,
                 Dock = DockStyle.Fill,
             },
             Binding =
                 new Binding("Value",
                             editor._RootSaveFileBindingSource,
                             "Player.Level",
                             true,
                             DataSourceUpdateMode.OnPropertyChanged)
         },
         new TableItem()
         {
             Name = Properties.Localization.Editor_BasicTable_Character_Class,
             Control = new ComboBox()
             {
                 DropDownStyle = ComboBoxStyle.DropDownList,
                 DisplayMember = "Name",
                 ValueMember = "Type",
                 DataSource = PlayerClass.GetClasses(),
                 Dock = DockStyle.Fill,
             },
             Binding =
                 new Binding("SelectedValue",
                             editor._RootSaveFileBindingSource,
                             "Player.ClassName",
                             true,
                             DataSourceUpdateMode.OnPropertyChanged)
         },
         new TableItem()
         {
             Name = Properties.Localization.Editor_BasicTable_Character_Gender,
             Control = new ComboBox()
             {
                 DropDownStyle = ComboBoxStyle.DropDownList,
                 DisplayMember = "Name",
                 ValueMember = "Type",
                 DataSource = PlayerGender.GetGenders(),
                 Dock = DockStyle.Fill,
             },
             Binding =
                 new Binding("SelectedValue",
                             editor._RootSaveFileBindingSource,
                             "Player.IsFemale",
                             true,
                             DataSourceUpdateMode.OnPropertyChanged)
         },
         new TableItem()
         {
             Name = Properties.Localization.Editor_BasicTable_Character_Origin,
             Control = new ComboBox()
             {
                 DropDownStyle = ComboBoxStyle.DropDownList,
                 DisplayMember = "Name",
                 ValueMember = "Type",
                 DataSource = PlayerOrigin.GetOrigins(),
                 Dock = DockStyle.Fill,
             },
             Binding =
                 new Binding("SelectedValue",
                             editor._RootSaveFileBindingSource,
                             "Player.Origin",
                             true,
                             DataSourceUpdateMode.OnPropertyChanged)
         },
         new TableItem()
         {
             Name = Properties.Localization.Editor_BasicTable_Character_Notoriety,
             Control = new ComboBox()
             {
                 DropDownStyle = ComboBoxStyle.DropDownList,
                 DisplayMember = "Name",
                 ValueMember = "Type",
                 DataSource = PlayerNotoriety.GetNotorieties(),
                 Dock = DockStyle.Fill,
             },
             Binding =
                 new Binding("SelectedValue",
                             editor._RootSaveFileBindingSource,
                             "Player.Notoriety",
                             true,
                             DataSourceUpdateMode.OnPropertyChanged)
         },
         new TableItem()
         {
             Name = Properties.Localization.Editor_BasicTable_Character_TalentPoints,
             Control = new NumericUpDown()
             {
                 Minimum = int.MinValue,
                 Maximum = int.MaxValue,
                 Increment = 1,
                 Dock = DockStyle.Fill,
             },
             Binding =
                 new Binding("Value",
                             editor._RootSaveFileBindingSource,
                             "Player.TalentPoints",
                             true,
                             DataSourceUpdateMode.OnPropertyChanged)
         },
     });
 }
コード例 #14
0
 // Update is called once per frame
 private void Update()
 {
     _footprintMaterial.color = Color.Lerp(_footprintMaterial.color, new Color(1f - Mathf.Clamp(PlayerNotoriety.GetPlayerNotoriety() / ((1.001f - _noterietyImpact) * 5f), 0, 1f),
                                                                               Mathf.Clamp(1.0f - Mathf.Abs(PlayerNotoriety.GetPlayerNotoriety() / ((1.001f - _noterietyImpact) * 5f)), 0, 1f),
                                                                               1f - Mathf.Clamp(PlayerNotoriety.GetPlayerNotoriety() / ((1.001f - _noterietyImpact) * -5f), 0, 1f)), Time.deltaTime);
 }
コード例 #15
0
    public static string PickRandomPassive()
    {
        float  playerNotoriety = PlayerNotoriety.GetPlayerNotoriety();
        string temp            = "*REALLY BUGGED*";

        if (playerNotoriety >= good)      //good
        {
            int randomIndex;
            if (DistanceToTarget.distanceToTarget <= near)        //near
            {
                randomIndex = Random.Range(0, goodNearPassive.Count);
                temp        = goodNearPassive[randomIndex];
                //Debug.Log("A Good Near thing was said");
                return(temp);
            }
            else if (DistanceToTarget.distanceToTarget <= mid)   //mid
            {
                randomIndex = Random.Range(0, goodMidPassive.Count);
                temp        = goodMidPassive[randomIndex];
                //Debug.Log("A Good Mid thing was said");
                return(temp);
            }
            else if (DistanceToTarget.distanceToTarget > mid)    //far
            {
                randomIndex = Random.Range(0, goodFarPassive.Count);
                temp        = goodFarPassive[randomIndex];
                //Debug.Log("A Good Far thing was said");
                return(temp);
            }
            else
            {
                //Debug.Log("Why is this happening?");
                temp = "*DEBUG ME!!*";
                return(temp);
            }
        }
        else if (playerNotoriety <= bad)    //bad
        {
            int randomIndex;
            if (DistanceToTarget.distanceToTarget <= near)        //near
            {
                randomIndex = Random.Range(0, badNearPassive.Count);
                temp        = badNearPassive[randomIndex];
                //Debug.Log("A Bad Near thing was said");
                return(temp);
            }
            else if (DistanceToTarget.distanceToTarget <= mid)   //mid
            {
                randomIndex = Random.Range(0, badMidPassive.Count);
                temp        = badMidPassive[randomIndex];
                //Debug.Log("A Bad Mid thing was said");
                return(temp);
            }
            else if (DistanceToTarget.distanceToTarget > mid)    //far
            {
                randomIndex = Random.Range(0, badFarPassive.Count);
                temp        = badFarPassive[randomIndex];
                //Debug.Log("A Bad Far thing was said");
                return(temp);
            }
            else
            {
                //Debug.Log("Why is this happening?");
                temp = "*DEBUG ME!!*";
                return(temp);
            }
        }
        else if (playerNotoriety > bad && playerNotoriety < good)  //neutral
        {
            int randomIndex;
            if (DistanceToTarget.distanceToTarget <= near)        //near
            {
                randomIndex = Random.Range(0, goodNearPassive.Count);
                temp        = goodNearPassive[randomIndex];
                //Debug.Log("A Neutral Near thing was said");
                return(temp);
            }
            else if (DistanceToTarget.distanceToTarget <= mid)   //mid
            {
                randomIndex = Random.Range(0, goodMidPassive.Count);
                temp        = goodMidPassive[randomIndex];
                //Debug.Log("A Neutral Mid thing was said");
                return(temp);
            }
            else if (DistanceToTarget.distanceToTarget > mid)    //far
            {
                randomIndex = Random.Range(0, goodFarPassive.Count);
                temp        = goodFarPassive[randomIndex];
                //Debug.Log("A Neutral Far thing was said");
                return(temp);
            }
            else
            {
                //Debug.Log("Why is this happening?");
                temp = "*DEBUG ME!!*";
                return(temp);
            }
        }
        else
        {
            temp = "*DEBUG ME!!*";
            return(temp);
        }
    }