示例#1
0
文件: Person.cs 项目: tompall/phoenix
 public void Initialize()
 {
     this.Mood      = eMood.allright;
     this.Health    = eHealth.ok;
     this.Social    = eSocial.loner;
     this.Political = ePolitical.central;
 }
示例#2
0
    public void SetSegment(eMood selectedMood)
    {
        Texture2D segColour;

        switch (selectedMood)
        {
        case eMood.Optimisism:
            segColour = OptimismColour;
            break;

        case eMood.Pessismism:
            segColour = PessimismColour;
            break;

        case eMood.Anger:
            segColour = AngerColour;
            break;

        case eMood.Chilled:
            segColour = ChilledColour;
            break;

        case eMood.eMoodCount:
            throw new UnityException("Invalid card selected");

        default:
            throw new UnityException("Invalid card selected");
        }
        segments[currentLifeSeg].blockRender = segColour;

        ++currentLifeSeg;
    }
示例#3
0
    public void DealCard(eMood card)
    {
        if (CurrentHandSize >= HandSize)
        {
            throw new UnityException("Too many cards in the hand");
        }

        ++currentHandSize;

        GameObject    flipCard = (GameObject)Instantiate(FlipCardPrefab);
        FlippableCard flipper  = flipCard.GetComponent <FlippableCard>();

        flipper.startPosition  = deckPosition.position;
        flipper.finishPosition = NextCardSpawnPoint;
        flipper.mood           = card;

        GameObject newCard;

        switch (card)
        {
        case eMood.Optimisism:
            newCard = (GameObject)Instantiate(optimismCard, NextCardSpawnPoint, Quaternion.AngleAxis(90.0f, Vector3.left) * Quaternion.AngleAxis(180.0f, Vector3.up));
            break;

        case eMood.Pessismism:
            newCard = (GameObject)Instantiate(pesimismCard, NextCardSpawnPoint, Quaternion.AngleAxis(90.0f, Vector3.left) * Quaternion.AngleAxis(180.0f, Vector3.up));
            break;

        case eMood.Anger:
            newCard = (GameObject)Instantiate(angerCard, NextCardSpawnPoint, Quaternion.AngleAxis(90.0f, Vector3.left) * Quaternion.AngleAxis(180.0f, Vector3.up));
            break;

        case eMood.Chilled:
            newCard = (GameObject)Instantiate(chillCard, NextCardSpawnPoint, Quaternion.AngleAxis(90.0f, Vector3.left) * Quaternion.AngleAxis(180.0f, Vector3.up));
            break;

        case eMood.eMoodCount:
            throw new UnityException("Unknown mood type");

        default:
            throw new UnityException("Unknown mood type");
        }

        hand[NextHandSlot] = newCard;

        newCard.GetComponent <MoodCard>().mood = card;

        newCard.GetComponent <Draggable>().OnSpent += new System.EventHandler(Hand_OnSpent);

        newCard.transform.parent = transform;

        newCard.SetActive(false);

        flipper.OnArrive += (pos) =>
        {
            newCard.SetActive(true);
        };
    }
示例#4
0
    void ResetValues()
    {
        lastMood = (eMood)Random.Range(0, (int)eMood.eMoodCount);

        moodValues = new int[(int)eMood.eMoodCount];

        for (int i = 0; i < moodValues.Length; ++i)
        {
            moodValues[i] = 0;
        }

        background.material.color = DefaultColour;
    }
    public void SetOutcome(eMood mood)
    {
        switch (mood)
        {
        case eMood.Optimisism: ApplyOutcome(currentEvent.optimismOutcome); break;

        case eMood.Pessismism: ApplyOutcome(currentEvent.pessimismOutcome); break;

        case eMood.Anger: ApplyOutcome(currentEvent.angerOutcome); break;

        case eMood.Chilled: ApplyOutcome(currentEvent.chilledOutcome); break;
        }
    }
示例#6
0
    public eMood DrawCard()
    {
        eMood topCard = CurrentDeck[0];

        CurrentDeck.RemoveAt(0);

        //transform.localScale.y -= cardHeight;

        newCardDrawn.Play();


        return(topCard);
    }
示例#7
0
    public void PlayCard(eMood card)
    {
        if (gameState != GameState.WaitingOnCardChoose)
        {
            throw new UnityException("Invalid state to be playing a card");
        }

        lastMood = card;

        shower.SetOutcome(card);

        lifeSegmentBar.SetSegment(card);

        switch (card)
        {
        case eMood.Optimisism:

            background.material.color = OptimismColour;
            break;

        case eMood.Pessismism:

            background.material.color = PessimismColour;
            break;

        case eMood.Anger:

            background.material.color = AngerColour;
            break;

        case eMood.Chilled:

            background.material.color = ChilledColour;
            break;

        case eMood.eMoodCount:
            throw new UnityException("Invalid card");

        default:
            throw new UnityException("Invalid card");
        }

        ++moodValues[(int)card];

        button.Avaliable = true;

        gameState = GameState.WaitingOnConfirmation;
    }
示例#8
0
    void ComputeSounds(eMood mood, int level)
    {
        if (level >= 1)
        {
            level1Players[(int)mood].fader.FadeIn();

            if (level >= 2)
            {
                level2Players[(int)mood].fader.FadeIn();
            }
            else
            {
                level2Players[(int)mood].fader.FadeOut();
            }
        }
        else
        {
            level1Players[(int)mood].fader.FadeOut();
        }
    }
示例#9
0
    // Update is called once per frame
    void Update()
    {
        for (int i = 0; i < (int)eMood.eMoodCount; ++i)
        {
            eMood mood = (eMood)i;
            ComputeSounds(mood, manager.moodValues[i]);
        }

        eMood mostUsedMood = manager.MostUsedMood;
        int   value        = manager.moodValues[(int)mostUsedMood];

        if (value >= 3)
        {
            bassPlayers[(int)mostUsedMood].player.clip = bassTracks[(int)mostUsedMood];
            bassPlayers[(int)mostUsedMood].fader.FadeIn();
        }

        if (oldBass != value && oldBass != -1)
        {
            bassPlayers[oldBass].fader.FadeOut();
        }
    }
 public void SetOutcome(eMood mood)
 {
     currentEventShower.SetOutcome(mood);
     outcomeArrivalSound.Play();
 }