Exemple #1
0
    public void setState(QuestState state)
    {
        this.state = state;
        switch (this.state)
        {
        case QuestState.hidden: {     // Quest is invisible.
            setVisibility(false, false, false, false);
            _ballColor = Expedition.questColorUniscovered;
            break;
        }

        case QuestState.undiscovered: {     // Quest can be found by exploring on foot.
            setVisibility(true, false, false, false);
            _ballColor = Expedition.questColorUniscovered;
            break;
        }

        case QuestState.discovered: {     // Quest goal is visible on the minimap.
            setVisibility(true, true, true, false);
            _ballColor = Expedition.questColorUncompleted;
            break;
        }

        case QuestState.completeable: {     // Quest is ready to be red-lined.
            setVisibility(true, true, true, true);
            _ballColor = Expedition.questColorCompleteable;
            break;
        }

        case QuestState.complete: {     // Quest is done.
            setVisibility(true, true, true, true);
            _ballColor = Expedition.questColorCompleted;
            QuestCompletedSound.Play();
            foreach (GameObject g in _ObjectsToToggleOnCompletion)
            {
                g.SetActive(!g.activeSelf);
            }
            //--------------------
            foreach (GameObject g in _ObjectsToTurnOffWhenCompleted)
            {
                g.SetActive(false);
            }
            //-----------------
            foreach (Quest q in _QuestsToUnlockOnCompletion)
            {
                q.setState(QuestState.undiscovered);
            }
            Expedition.CheckGameCompletion();
            break;
        }
        }
        EndPoint.SetBallColor(_ballColor);
        StartPoint.SetBallColor(_ballColor);
        //Debug.Log("Questpoint set to "+_state);
    }