Beispiel #1
0
 private void OnCollisionExit(Collision collision)
 {
     if (collision.collider.CompareTag("Potion") && potionsOnBoiler.Contains(collision.collider.GetComponent <PotionStack>()))
     {
         potionToMove = collision.collider.GetComponent <PotionStack>();
         potionsOnBoiler.Remove(potionToMove);
         potionToMove.revealBoilDiplsay(false);
     }
 }
Beispiel #2
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.collider.CompareTag("Potion"))
     {
         potionToMove = collision.collider.GetComponent <PotionStack>();
         potionsOnBoiler.Add(potionToMove);
         if (potionToMove.corked)
         {
             potionToMove.revealBoilDiplsay(true);
         }
     }
 }
    //0 = nothing
    //1 = uncorked potion
    //2 = unboiled potion
    //3 = boiled but incorrect potion
    //4 = fireball
    //5 = tornado
    //6 = blizzard
    //7 = lightning
    //8 = arcane
    //9 = poison
    //10 = yellow essence
    //11 = magenta essence
    //12 = cyan essence
    //13 = cork
    public int DetermineHolding()
    {
        if (objectHovering && IPL.GetRightTriggerInteracting())
        {
            itemOfInterest = objectHovering.gameObject;
        }
        else if (IPL.rightHand.CurrentlyInteracting)
        {
            itemOfInterest = IPL.rightHand.CurrentlyInteracting.gameObject;
        }
        else
        {
            return(0);
        }
        if (itemOfInterest.GetComponent <PotionStack>())
        {
            PotionStack potionInHand = itemOfInterest.GetComponent <PotionStack>();
            if (!potionInHand.corked)
            {
                return(1);
            }
            else
            {
                if (!potionInHand.dinged)
                {
                    return(2);
                }
                else
                {
                    return(potionInHand.DeterminePotionType() + 3);
                }
            }
        }
        else if (itemOfInterest.GetComponent <Ingredient>())
        {
            return(itemOfInterest.GetComponent <Ingredient>().type + 9);
        }
        else
        {
            return(13);
        }

        return(0);
    }
Beispiel #4
0
    IEnumerator CheckTutorialProgress()
    {
        while (true)
        {
            yield return(new WaitForSeconds(.25f));

            if (stage == 0)
            {
                if (IPL.leftHand && IPL.rightHand)
                {
                    if (IPL.leftHand.GetComponent <Left_VR_Cont>().pullPotion || IPL.rightHand.GetComponent <Right_VR_Cont>().pullPotion)
                    {
                        ProgressTutorial();
                    }
                }
            }
            else if (stage == 1)
            {
                foreach (GameObject pot in GameObject.FindGameObjectsWithTag("Potion"))
                {
                    if (pot.GetComponent <PotionStack>())
                    {
                        PotionStack p = pot.GetComponent <PotionStack>();
                        if (p.contents.Count == 2)
                        {
                            if (p.contents[0].type * 10 + p.contents[1].type == 12 || p.contents[0].type * 10 + p.contents[1].type == 21) //yellow + magenta
                            {
                                ProgressTutorial();
                                break;
                            }
                        }
                    }
                }
            }
            else if (stage == 2)
            {
                foreach (PotionStack p in boiler.potionsOnBoiler)
                {
                    if (p.DeterminePotionType() == 1)
                    {
                        ProgressTutorial();
                        break;
                    }
                }
            }
            else if (stage == 3)
            {
                if ((IPL.GetRightButtonInteracting() && (IPL.rightHand.CurrentlyInteracting || (IPL.rightHand.GetComponent <Right_VR_Cont>().objectHovering&& IPL.GetRightTriggerInteracting()))) || (IPL.GetLeftButtonInteracting() && (IPL.leftHand.CurrentlyInteracting || (IPL.leftHand.GetComponent <Left_VR_Cont>().objectHovering&& IPL.GetLeftTriggerInteracting()))))
                {
                    ProgressTutorial();
                }
            }
            else if (stage == 4)
            {
                if (GameObject.FindGameObjectWithTag("Enemy").GetComponent <Goblin_ro_ctrl>().dead)
                {
                    ProgressTutorial();
                }
            }
            else if (stage == 5)
            {
                if (allEnemiesDead())
                {
                    ProgressTutorial();
                }
            }
        }
    }
 public void PotionHit(PotionStack potion)
 {
     potion.enhancedRadius = true;
 }