コード例 #1
0
    // Use this for initialization
    void Start()
    {
        _countdownTimer = 22;
        quoteCategory   = PlayerHolderBehavior.singleton.LastHit;
        played          = false;
        //TODO: Load up a quote
        //audioSource = GetComponent<AudioSource>();

        //PlayerHolderBehavior.singleton.Players
    }
コード例 #2
0
 public static int IndexInPieOrder(BookBehavior.KnowledgeType kt)
 {
     for (int i = 0; i < pieOrder.Length; i++)
     {
         if (kt == pieOrder[i])
         {
             return(i);
         }
     }
     throw new System.Exception();
 }
コード例 #3
0
    private void AddEffect(BookBehavior.KnowledgeType kt)
    {
        PlayerHolderBehavior.singleton.RegisterHit(kt);
        singleSource.PlayOneShot(hitSound);


        //TO DO: change players properties
        switch (kt)
        {
        case BookBehavior.KnowledgeType.Art:
            GetComponent <InvisibilityAbility>().enabled = true;
            break;

        case BookBehavior.KnowledgeType.History:
            GetComponent <RecallAbility>().enabled = true;
            break;

        case BookBehavior.KnowledgeType.Language:
            GetComponent <ChangeBookAbility>().enabled = true;
            break;

        case BookBehavior.KnowledgeType.Physics:
            GetComponent <DashAbility>().enabled = true;
            break;

        case BookBehavior.KnowledgeType.Literature:
            repeatShot = true;
            break;

        case BookBehavior.KnowledgeType.Math:
            splitShotOff = false;
            break;
        }
        //adds it to the affected array
        player.SetEffect(kt);
        activeEffects [(int)kt] = true;
        lifes--;
        //checks if player gets "killed"
        if (lifes == 0)
        {
            singleSource.PlayOneShot(deadSound);
            //TO DO kills player
            Destroy(gameObject);
            if (GraduationPrefab != null)
            {
                Instantiate(GraduationPrefab, transform.position, Quaternion.identity);
            }
        }
        else
        {
            StartCoroutine(HitRumble());
        }
    }
コード例 #4
0
 // Deals with player being hit by the book
 public void HitByBook(BookBehavior bookBehavior)
 {
     //get which book hit the player
     BookBehavior.KnowledgeType adding = bookBehavior.Kind;
     //check if player was already hit by book
     if (!activeEffects[(int)adding])
     {
         AddEffect(adding);
     }
     else
     {
         singleSource.PlayOneShot(nullSound);
     }
 }
コード例 #5
0
    private string GetText(BookBehavior.KnowledgeType knowledgeType, int track)
    {
        switch (knowledgeType)
        {
        case BookBehavior.KnowledgeType.Art:
            switch (track)
            {
            case 0:
                return("The artist belongs to his work, not the work to the artist.  -Novalis");

            case 1:
                return("Creativity is allowing yourself to make mistakes.  Art is knowing which ones to keep.  -Scott Adams");

            case 2:
                return("You use a glass mirror to see your face; you use works of art to see your soul.  -George Bernard Shaw");

            case 3:
                return("The purpose of art is washing the dust of daily life off our souls.  -Pablo Picasso");

            case 4:
                return("Love of beauty is taste.  The creation of beauty is art.  -Ralph Waldo Emerson");
            }
            break;

        case BookBehavior.KnowledgeType.Language:
            switch (track)
            {
            case 0:
                return("Language is wine upon the lips.  -Virginia Woolf");

            case 1:
                return("The limits of my language means the limits of my world.  -Ludwig Wittgenstein");

            case 2:
                return("Every language is a world.  Without translation, we would inhabit parishes bordering on silence.  -George Steiner");

            case 3:
                return("A different language is a different vision of life.  -Federico Fellini");

            case 4:
                return("Language exerts hidden power, like the moon on the tides.  -Rita Mae Brown");
            }
            break;

        case BookBehavior.KnowledgeType.History:
            switch (track)
            {
            case 0:
                return("We are not makers of history.  We are made by history.  -Martin Luther King, Jr.");

            case 1:
                return("History never really says goodbye.  History says, ‘See you later.’ -Eduardo Galeano");

            case 2:
                return("There is nothing new in the world except the history you do not know.  -Harry S Truman");

            case 3:
                return("History is a cyclic poem written by time upon the memories of man.  -Percy Bysshe Shelley");

            case 4:
                return("History is not a burden on the memory but an illumination of the soul.  -Lord Acton");
            }
            break;

        case BookBehavior.KnowledgeType.Literature:
            switch (track)
            {
            case 0:
                return("Great literature is simply language charged with meaning to the utmost possible degree.  -Ezra Pound");

            case 1:
                return("Literature… is the union of suffering with the instinct for form.  -Thomas Mann");

            case 2:
                return("It’s in literature that true life can be found.  It’s under the mask of fiction that you can tell the truth.  -Gao Xingjian");

            case 3:
                return("Literature is the art of discovering something extraordinary about ordinary people, and saying with ordinary words something extraordinary.  -Boris Pasternak");

            case 4:
                return("Literature becomes the living memory of a nation.  -Aleksandr Solzhenitsyn");
            }
            break;

        case BookBehavior.KnowledgeType.Physics:
            switch (track)
            {
            case 0:
                return("Physics is the only profession in which prophecy is not only accurate but routine.  -Neil deGrasse Tyson");

            case 1:
                return("Physics has a history of synthesizing many phenomena into a few theories.  -Richard P. Feynman");

            case 2:
                return("Physics is experience, arranged in economical order.  -Ernst Mach");

            case 3:
                return("In science there is only physics; all the rest is stamp collecting.  -Lord Kelvin");

            case 4:
                return("Physics is about questioning, studying, probing nature.  You probe, and, if you’re lucky, you get strange clues.  -Lene Hau");
            }
            break;

        case BookBehavior.KnowledgeType.Math:
            switch (track)
            {
            case 0:
                return("Mathematics is the music of reason.  -James Joseph Sylvester");

            case 1:
                return("Mathematics is the most beautiful and most powerful creation of the human spirit.  -Stefan Banach");

            case 2:
                return("Mathematics is the art of giving the same name to different things.  -Henri Poincare");

            case 3:
                return("The essence of mathematics lies in its freedom.  -Georg Cantor");

            case 4:
                return("Pure mathematics is, in its way, the poetry of logical ideas.  -Albert Einstein");
            }
            break;

        default:
            throw new ArgumentOutOfRangeException("knowledgeType", knowledgeType, null);
        }
        return("Game Over");
    }
コード例 #6
0
 private void SetText(BookBehavior.KnowledgeType knowledgeType, int track)
 {
     Text.text = GetText(knowledgeType, track);
 }
コード例 #7
0
 public void RegisterHit(BookBehavior.KnowledgeType kt)
 {
     LastHit = kt;
 }
コード例 #8
0
 public bool HasBeenHitBy(BookBehavior.KnowledgeType kind)
 {
     return(activeEffects[(int)kind]);
 }
コード例 #9
0
 public void SetEffect(BookBehavior.KnowledgeType kt)
 {
     activeEffects [(int)kt] = true;
 }
コード例 #10
0
 //TODO:  Add current book, add hitpoint books, add head size, add powerups, etc.
 public bool isAffected(BookBehavior.KnowledgeType kt)
 {
     return(activeEffects [(int)kt]);
 }