// Use this for initialization
    void Start()
    {
        this.mood = GameObject.FindGameObjectWithTag("PlayerHealth").GetComponent<PlayerStatBar>();
        this.sobriety = GameObject.FindGameObjectWithTag("PlayerSobriety").GetComponent<PlayerStatBar>();

        mood_index = Random.Range(0, defaultSad.Length - 1);
        sobriety_index = Random.Range(0, defaultDrunk.Length - 1);
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        mood = moodObject.GetComponent<PlayerStatBar>();
        sobriety = sobrietyObject.GetComponent<PlayerStatBar>();

        lastSobriety = sobriety.getStatValue();

        this.reverbZone = boombox.GetComponent<AudioReverbZone>();
        this.audioSource = boombox.GetComponent<AudioSource>();
    }
Esempio n. 3
0
 public void RemoveListenOnPlayerStats(PlayerStatBar statBar)
 {
     statBar.MyPlayer = PlayerManager.pm.GetPartyMemberLocations()[statBar.slot];
     RemoveHpValueChangeListener(statBar.MyPlayer, statBar.UpdateHpBar);
     RemoveMpValueChangeListener(statBar.MyPlayer, statBar.UpdateMpBar);
     RemoveHpModListener(statBar.MyPlayer, statBar.UpdateHpStatSprite);
     RemoveAtkModListener(statBar.MyPlayer, statBar.UpdateAtkStatSprite);
     RemoveDefModListener(statBar.MyPlayer, statBar.UpdateDefStatSprite);
     RemoveSpdModListener(statBar.MyPlayer, statBar.UpdateSpdStatSprite);
 }
    // Use this for initialization
    void Start()
    {
        this.player = GameObject.FindWithTag("PlayerObject");
        this.playerConversationStatus = player.GetComponent<ConversationStatus>();

        this.moodObject = GameObject.FindWithTag("PlayerHealth");

        if (moodObject) {
            this.mood = moodObject.GetComponent<PlayerStatBar>();
        }
    }
    // Use this for initialization
    void Start()
    {
        this.player = GameObject.FindWithTag("PlayerObject");
        this.playerConversationStatus = player.GetComponent<ConversationStatus>();
        this.playerMovementScripts = player.GetComponents<MonoBehaviour>();

        if (this.barToImpact == null) {
            this.barToImpact = GameObject.FindWithTag("PlayerHealth");
        }

        if (barToImpact) {
            this.impactedStatBar = barToImpact.GetComponent<PlayerStatBar>();
        }

        if (GameObject.FindWithTag("DefaultDialogue")) {
            defaultDialogue =  GameObject.FindWithTag("DefaultDialogue").GetComponent<DefaultDialogue>();
        }

        if (GameObject.FindGameObjectWithTag("InnerMonologue")) {
            innerMonologue = GameObject.FindGameObjectWithTag("InnerMonologue");
        }
    }
 void Start()
 {
     this.statBar = this.gameObject.GetComponent<PlayerStatBar>();
 }
Esempio n. 7
0
    public void InitBattleUI()
    {
        if (!BattleManager.bm.InBattle())
        {
            return;                                       // If not in battle, should not bring up battle UI
        }
        Vector3 cameraPos = Camera.main.transform.position;

        battleUI.transform.position = new Vector3(cameraPos.x, cameraPos.y, transform.position.z);
        battleUI.SetActive(true);
        int partyCount = PlayerManager.pm.GetPartyCount();

        Debug.LogFormat("Party count={0}", partyCount);
        if (_playerOneStatusBars == null)
        {
            _playerOneStatusBars = Instantiate(playerOneStatusBarsPrefab, battleUI.transform, false);
            _playerOneStatusBars.transform.localPosition = pOneLocation;
            PlayerStatBar statBar = _playerOneStatusBars.GetComponent <PlayerStatBar>();
            BattleEventManager.bem.ListenOnPlayerStats(statBar);                // Listen in on the player's stats whos slot matches the bars.
            playerStatBars.Add(CharacterSlot.One, statBar);
        }
        switch (partyCount)
        {
        case 1:
            break;

        case 2:
            if (_playerTwoStatusBars == null)
            {
                _playerTwoStatusBars = Instantiate(playerTwoStatusBarsPrefab, battleUI.transform, false);
                _playerTwoStatusBars.transform.localPosition = pTwoLocation;
                PlayerStatBar statBar = _playerTwoStatusBars.GetComponent <PlayerStatBar>();
                BattleEventManager.bem.ListenOnPlayerStats(statBar);                         // Listen in on the player's stats whos slot matches the bars.
                playerStatBars.Add(CharacterSlot.Two, statBar);
            }
            break;

        case 3:
            if (_playerTwoStatusBars == null)
            {
                _playerTwoStatusBars = Instantiate(playerTwoStatusBarsPrefab, battleUI.transform, false);
                _playerTwoStatusBars.transform.localPosition = pTwoLocation;
                PlayerStatBar statBar = _playerTwoStatusBars.GetComponent <PlayerStatBar>();
                BattleEventManager.bem.ListenOnPlayerStats(statBar);                         // Listen in on the player's stats whos slot matches the bars.
                playerStatBars.Add(CharacterSlot.Two, statBar);
            }
            if (_playerThreeStatusBars == null)
            {
                _playerThreeStatusBars = Instantiate(playerThreeStatusBarsPrefab, battleUI.transform, false);
                _playerThreeStatusBars.transform.localPosition = pThreeLocation;
                PlayerStatBar statBar = _playerThreeStatusBars.GetComponent <PlayerStatBar>();
                BattleEventManager.bem.ListenOnPlayerStats(statBar);                         // Listen in on the player's stats whos slot matches the bars.
                playerStatBars.Add(CharacterSlot.Three, statBar);
            }
            break;

        default:
            Debug.LogFormat("Invalid amount of party members, must be 1 <= count <= 3");
            break;
        }
        if (_mainActionMenu == null)
        {
            _mainActionMenu = Instantiate(mainActionMenuPrefab, BattleManager.battleCanvas.transform, false);
        }
        else
        {
            _mainActionMenu.SetActive(true);
        }
    }